feat(console): confirm / reject memory verdicts in the inspector (ADR 0108 D7) - #3249
Conversation
… 0108 D7)
Verdict chip (pending review / confirmed / rejected) on Knowledge → Store rows and
Memory → Hot memory rows, with Confirm / Reject / Re-open actions backed by
POST /api/memory/chunks/{id}/review (#3246), a pending-review filter on the Store
list (GET /api/knowledge/search?review_state=pending), optimistic cache flip with
rollback, verbatim server detail on 400/404, and actions that hide once a backend
answers 501. Commons rows are read-only; every request carries the row's tier.
Refs #3185, #3184.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby
|
Warning Review limit reachedNext included review available in 13 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head 09e08cae8682 · formal
All five finders (correctness, removed-behavior, cross-file, conventions, and the protoPatch structural engine) independently returned zero findings; the verifier confirmed there was nothing to verify. The structural pass was included and clean. No prior requests exist, so no dispositions are owed. Overall risk: low — the panel found no defects at any severity. No coverage gaps to flag: every lane reported, and the structural engine ran.
No findings — the review came back clean.
findings JSON (machine-readable)
[]
What
The console half of the memory write lifecycle (ADR 0108 D7). Agent-written memories now land as
pending; this PR lets the operator confirm / reject / re-open them where they already inspect memory:pending review/confirmed/rejected) when the backend sendsreview_state; pending rows get Confirm (✓) and Reject (✕) actions, confirmed rows get Reject, rejected rows get Re-open (↺ → back to pending). A new pending-review filter (clipboard-check icon in the header) narrows the list toGET /api/knowledge/search?review_state=pendingwith its own empty state ("Nothing awaiting review").tier— the route only refuses a commons id it is told about; ids are per-backend and a bare id would land on the private row sharing the number.Marked confirmed.); a 400 / 404 shows the serverdetailverbatim; a 501 (ADR 0031 backend without verdicts) hides the actions everywhere and says so once;enabled: falsereads as a dropped write.Console only — no Python. Backend: #3246 (
POST /api/memory/chunks/{id}/review,review_statelisting filter). Refs #3185, #3184.Human visual review required (console UI gate) — do not auto-merge.
How to test (on main, after #3246 + #3247 land)
memory_ingest("the operator prefers tabs over spaces", domain="preferences")via chat. It landspending(agent tier).pending reviewchip next to its domain badge. Hover the ✓ / ✕ at the row's right edge — titles explain each. Click ✓ → chip flips to greenconfirmedimmediately, toastMarked confirmed.; reload → still confirmed (GET /api/knowledge/search?q=shows"review_state": "confirmed").rejected, only ↺ remains. Click ↺ → back topending reviewwith ✓ / ✕.· pending review; with none left you get "Nothing awaiting review". Click again to clear.hot, ormemory_ingest(..., domain="hot")with the gate off). The hot row carries the chip; the operator-written row isconfirmed(operator tier), an agent-written onepending. ✓ / ✕ / ↺ behave as above.knowledge.scope: layered): a commons-tier row shows the chip but no ✓ / ✕ — share a row to the commons and check. A verdict on a private row sends{"state": ..., "tier": "private"}(Network tab).set_review_state→ first click toasts "This knowledge backend doesn't support review verdicts." and the actions disappear on every row. Turnmiddleware.knowledgeoff after the list rendered → a click toasts "The knowledge store is off — the verdict was not saved".Gates
tsc -p tsconfig.json --noEmit+tsc -p tsconfig.node.json --noEmit+vite build(npm run build) → ✓ builtvitest run→ 145 files / 1361 tests passed (incl. 9 new insrc/knowledge/reviewVerdict.test.ts: request body carriestier, optimistic cache flip, re-open on rejected, commons read-only, null verdict = pending, 501 hides actions, 400 detail verbatim + rollback, enabled:false,review_statequery param only when set)e2e/knowledge.spec.ts+e2e/memory-inspector.spec.tsagainst the fresh build → 21 passed (existing surfaces unchanged).nvmrc's 20)Not in this PR
docs/guides/knowledge.mdinspector paragraph — feat(knowledge): memory write lifecycle — provenance stamps, confirm/reject, supersession chain, expiry (ADR 0108 D7) #3246 rewrites it; one sentence on the console controls follows once that lands (avoids a docs conflict).🤖 Generated with Claude Code
https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby