- internal/advisor/handler.go: StreamChat (SSE, token-by-token),
GetConversations, GetConversation; body limited to 64KB, message
truncated to 8000 chars (T-06-02-03); API key never echoed (T-06-02-02)
- internal/api/router.go: /api/advisor/{chat,conversations,conversations/{id}}
with nil-guard returning 503 when DB not configured
- internal/config/config.go: Tier3 defaults + HWLAB_AI_TIER3_* env bindings
- cmd/hwlab/main.go: store init from HWLAB_DATABASE_URL, RunMigrations,
InventoryContextBuilder, AdvisorHandler wired into NewRouter
- internal/advisor/context.go: BuildContext assembles compact NetBox
summary (item count, category breakdown, recent 20 items)
- Caches result under sync.Mutex for defaultTTL=60s
- Stale cache returned on NetBox error rather than propagating failure
- internal/ai/types.go: add Tier3 TierConfig field to AIConfig
(required by AdvisorHandler for OpenRouter Claude Opus access)
- Add web/src/api/test.ts with submitCableTest, getRecentTests, streamTestEvents
- Add web/src/pages/CableTestPage.tsx with three-panel layout (readout/label/recent)
- Register /test route in router.tsx
- Add Test nav link (Cable icon) in TopBar
- SSE live readout via EventSource, closed on unmount
- Print & Next mutation with react-hot-toast feedback
- Mobile-responsive: single col on mobile, 3-col on lg+
- ClickHouse design tokens throughout (#000000 bg, #faff69 accent)
- TestHandler: POST /api/test/cable, GET /api/test/events, GET /api/test/recent
- POST /api/test/cable: DisallowUnknownFields (T-05-03), creates NetBox cable,
auto-prints with 1s rate limit (T-05-05), prepends to 20-item ring buffer
- GET /api/test/events: SSE, 30s keepalive, exits on context cancel (T-05-04)
- GET /api/test/recent: thread-safe ring buffer, returns [] when empty
- AttachStream() wires StreamingTesterDriver channel to SSE broadcaster
- Router: three /api/test/* routes added to NewRouter signature
- main.go: constructs TestHandler, wires USB Manager event loop stub
- All handler tests pass race-clean (7 test cases)
- LabelHandler: POST /api/labels/:deviceID/print with 1/s rate limit (T-04-09)
- USBEventsHandler: GET /api/usb/events SSE stream, exits on context cancel (T-04-11)
- router.go: two new parameters + routes wired
- main.go: USB Manager started with ctx, MockDriver connected, handlers passed to router
- Add CableLabelData struct and RenderCable() producing 384x180 bitmap
- Cable template: HW ID, name, USB version/speed, wattage/test date
- IsCableDevice() detects cable records by name or AINotes heuristic
- T-04-07 mitigation applied: HWID format validated in RenderCable too
- All 5 cable tests pass (10 total in package)
- Manager with injectable enumerateFunc and serialOpener for test isolation
- goroutine-per-device model: deviceLoop owns one serial port per device
- context+done-channel teardown: inner read goroutine exits on ctx.Done()
- Read buffer capped at 4096 bytes (T-04-01 threat mitigation)
- Poll loop reconciles prev/current snapshots for connect/disconnect events
- ErrDeviceNotConnected returned by Send() when device absent
- All 5 manager tests pass with -race flag; goroutine count stable across 5 replug cycles
- mockPort test helper blocks Read until Close() unblocks it (realistic behavior)
- Add internal/labels package with LabelData struct and RenderStandard()
- QR encodes http://mac-mini.mg:8080/hw/HW-XXXXX (LBL-01)
- Label is 384x120px NRGBA, white background, basicfont text
- T-04-07 mitigation: validate HWID format before qrcode.New()
- Install github.com/skip2/go-qrcode and golang.org/x/image
- All 5 renderer tests pass
5 plans across 3 waves covering USB-01 through USB-04 and LBL-01 through LBL-05.
Mock drivers and goroutine-leak harness tests enable full TDD before hardware arrives.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- web/src/pages/ScanPage.tsx: camera QR scanner with volt reticle overlay
- extractHWID() parses both URL format and bare HW-XXXXX patterns
- rear camera preference (back/rear/environment label matching)
- debounce via lastScanned state prevents duplicate navigation
- graceful camera permission denied error state
- web/src/router.tsx: lazy-loads ScanPage with Suspense fallback spinner
- web/src/lib/api.ts: typed fetch wrappers (fetchInventory, fetchInventoryItem)
- web/src/components/layout/AppShell.tsx: minimal page wrapper (stub for plan 03-03)