Skip to content

feat(console): confirm / reject memory verdicts in the inspector (ADR 0108 D7) - #3249

Merged
mabry1985 merged 2 commits into
mainfrom
feat/3185-console-review-verdicts
Aug 28, 2026
Merged

feat(console): confirm / reject memory verdicts in the inspector (ADR 0108 D7)#3249
mabry1985 merged 2 commits into
mainfrom
feat/3185-console-review-verdicts

Conversation

@mabry1985

Copy link
Copy Markdown
Member

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:

  • Knowledge → Store: every row shows a verdict chip (pending review / confirmed / rejected) when the backend sends review_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 to GET /api/knowledge/search?review_state=pending with its own empty state ("Nothing awaiting review").
  • Memory → Hot memory: the same chip + actions on every always-on row (hot rows are private-tier, so the actions always apply — a rejected hot row leaves the injection window once D6 lands).
  • Commons rows show the chip and no actions (read-only here). Every request carries the row's 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.
  • Optimistic chip flip across every cached knowledge / hot-memory list with rollback; one toast per outcome (Marked confirmed.); a 400 / 404 shows the server detail verbatim; a 501 (ADR 0031 backend without verdicts) hides the actions everywhere and says so once; enabled: false reads as a dropped write.

Console only — no Python. Backend: #3246 (POST /api/memory/chunks/{id}/review, review_state listing filter). Refs #3185, #3184.

Human visual review required (console UI gate) — do not auto-merge.

How to test (on main, after #3246 + #3247 land)

  1. Have the agent store something: memory_ingest("the operator prefers tabs over spaces", domain="preferences") via chat. It lands pending (agent tier).
  2. Knowledge → Store: the row shows a blue pending review chip next to its domain badge. Hover the ✓ / ✕ at the row's right edge — titles explain each. Click ✓ → chip flips to green confirmed immediately, toast Marked confirmed.; reload → still confirmed (GET /api/knowledge/search?q= shows "review_state": "confirmed").
  3. Click ✕ on a confirmed row → orange rejected, only ↺ remains. Click ↺ → back to pending review with ✓ / ✕.
  4. Header clipboard-check button → list narrows to pending rows only, kicker adds · pending review; with none left you get "Nothing awaiting review". Click again to clear.
  5. Memory → Hot memory: pin an always-on row (Knowledge → + with domain hot, or memory_ingest(..., domain="hot") with the gate off). The hot row carries the chip; the operator-written row is confirmed (operator tier), an agent-written one pending. ✓ / ✕ / ↺ behave as above.
  6. Layered store (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).
  7. Failure paths: point the console at a plugin knowledge backend without set_review_state → first click toasts "This knowledge backend doesn't support review verdicts." and the actions disappear on every row. Turn middleware.knowledge off 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) → ✓ built
  • vitest run → 145 files / 1361 tests passed (incl. 9 new in src/knowledge/reviewVerdict.test.ts: request body carries tier, optimistic cache flip, re-open on rejected, commons read-only, null verdict = pending, 501 hides actions, 400 detail verbatim + rollback, enabled:false, review_state query param only when set)
  • Playwright e2e/knowledge.spec.ts + e2e/memory-inspector.spec.ts against the fresh build → 21 passed (existing surfaces unchanged)
  • Node 26 (the fix(console): run the unit suite on Node 25+ again #3230 Web Storage repair keeps the unit suite green off .nvmrc's 20)

Not in this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby

… 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
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 13 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6362276f-f01c-4c27-851a-03de9cfe419f

📥 Commits

Reviewing files that changed from the base of the PR and between 3836966 and 09e08ca.

📒 Files selected for processing (8)
  • apps/web/src/knowledge/KnowledgeStore.tsx
  • apps/web/src/knowledge/ReviewVerdict.tsx
  • apps/web/src/knowledge/reviewVerdict.test.ts
  • apps/web/src/lib/api.ts
  • apps/web/src/lib/queries.ts
  • apps/web/src/lib/types.ts
  • apps/web/src/memory/MemorySurface.tsx
  • changelog.d/3249.added.md

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby
@mabry1985
mabry1985 marked this pull request as ready for review August 28, 2026 19:18

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
[]

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promoting the PASS verdict for head 09e08cae8682: all checks terminal-green, zero unresolved review threads. (approve-on-green)

@mabry1985
mabry1985 merged commit a4b47dc into main Aug 28, 2026
26 checks passed
@mabry1985
mabry1985 deleted the feat/3185-console-review-verdicts branch August 28, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant