diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 6dcbe52..84747ff 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -125,9 +125,9 @@ Plans: **Plans**: 3 plans Plans: -- [ ] 06-01-PLAN.md — PostgreSQL store: pgx/v5 dep, conversations + messages tables, RunMigrations, typed CRUD methods -- [ ] 06-02-PLAN.md — Advisor backend: InventoryContextBuilder (60s cache), AdvisorHandler SSE streaming, router wiring, main.go wiring -- [ ] 06-03-PLAN.md — Frontend: AdvisorPage at /advisor, conversation sidebar, streaming chat UI, model dropdown, TopBar link +- [x] 06-01-PLAN.md — PostgreSQL store: pgx/v5 dep, conversations + messages tables, RunMigrations, typed CRUD methods +- [x] 06-02-PLAN.md — Advisor backend: InventoryContextBuilder (60s cache), AdvisorHandler SSE streaming, router wiring, main.go wiring +- [x] 06-03-PLAN.md — Frontend: AdvisorPage at /advisor, conversation sidebar, streaming chat UI, model dropdown, TopBar link ### Phase 7: Research Agent & Search **Goal**: Items flagged needs_research are automatically enriched by a SearXNG research agent, and any inventory question can be answered via natural language search diff --git a/.planning/phases/06-lab-advisor/06-HUMAN-UAT.md b/.planning/phases/06-lab-advisor/06-HUMAN-UAT.md new file mode 100644 index 0000000..4999ff1 --- /dev/null +++ b/.planning/phases/06-lab-advisor/06-HUMAN-UAT.md @@ -0,0 +1,34 @@ +--- +status: partial +phase: 06-lab-advisor +source: [06-VERIFICATION.md] +started: 2026-04-10 +updated: 2026-04-10 +--- + +## Tests + +### 1. OpenRouter API key configuration +expected: Set HWLAB_OPENROUTER_API_KEY in .env or ai_config.local.json +result: [pending — operator action] + +### 2. Live Opus chat +expected: POST /api/advisor/chat returns streaming response from Claude Opus with NetBox inventory context in system prompt +result: [pending] + +### 3. Conversation history +expected: Send multiple messages, refresh page, verify history persists in sidebar +result: [pending] + +### 4. Model switching +expected: Change model dropdown, send message, verify different model used (no server restart) +result: [pending] + +## Summary + +total: 4 +pending: 4 + +## Gaps + +Operator must provide OpenRouter API key for live validation. diff --git a/.planning/phases/06-lab-advisor/06-VERIFICATION.md b/.planning/phases/06-lab-advisor/06-VERIFICATION.md new file mode 100644 index 0000000..cca54d3 --- /dev/null +++ b/.planning/phases/06-lab-advisor/06-VERIFICATION.md @@ -0,0 +1,38 @@ +--- +phase: 06-lab-advisor +verified: 2026-04-10 +status: human_needed +score: 4/4 (code) — live OpenRouter validation pending +overrides_applied: 0 +--- + +# Phase 6 Verification + +## Goal +Users can ask strategic homelab questions and receive streaming answers from Claude Opus with full inventory context, with conversation history persisted across sessions. + +## Code-Level Verification (Complete) + +| # | Success Criterion | Status | Evidence | +|---|------|--------|----------| +| 1 | Streaming response from Claude Opus via OpenRouter | ✓ | `internal/advisor/handler.go` StreamChat using TierClient + go-openai stream | +| 2 | Inventory context pre-loaded into each conversation | ✓ | `internal/advisor/context.go` InventoryContextBuilder with 60s cache | +| 3 | Conversation history persists across sessions | ✓ | `internal/store/` PostgreSQL pgx/v5 + 12 passing integration tests against 10.5.0.109 | +| 4 | Model switchable via dropdown without restart | ✓ | Per-request model field in JSON body | + +## All 5 Requirements Covered +ADV-01 through ADV-05 — implemented and tested with PostgreSQL integration. + +## Test Results +- `go test ./internal/store/... -v` — 12 tests pass against live PostgreSQL +- `go build ./...` — clean +- `cd web && npm run build` — clean + +## Human Verification Required + +1. Real OpenRouter API key needed (currently empty in .env) +2. Live Opus chat with inventory context +3. Conversation history visual review + +## Status +`human_needed` — code complete, requires operator OpenRouter API key for live testing.