Skip to content

feat(recall): review extracted entries from the corpus - #1369

Open
wesm wants to merge 10 commits into
mainfrom
feat/recall-entry-review
Open

feat(recall): review extracted entries from the corpus#1369
wesm wants to merge 10 commits into
mainfrom
feat/recall-entry-review

Conversation

@wesm

@wesm wesm commented Aug 9, 2026

Copy link
Copy Markdown
Member
  • Machine-distilled Recall entries can now be approved or archived from their expanded Corpus row, with local row updates that preserve pagination and scroll position.
  • Approval requires valid provenance and produces an accepted human_reviewed entry; confirmed archive produces an archived human_rejected entry. Both decisions remain outside extraction generation cleanup.
  • Guarded transactional transitions and typed HTTP conflicts prevent stale or repeated decisions. Existing archives shed the SQLite review-state enum while preserving row identities, evidence, supersession links, and FTS behavior.
  • Review-state policy now lives at the shared Go write boundary, so adding a business state no longer requires another table constraint change.
  • Read-only backends remain mutation-free, and this slice intentionally excludes editing, bulk review, and undo.
  • Review focus: the archive migration and transaction in internal/db, error mapping in internal/server/recall.go, and row-local behavior in RecallCorpusPanel.svelte.

wesm added 9 commits August 8, 2026 21:41
Machine-extracted entries need a durable human disposition before they can safely become trusted or stay rejected. The design keeps that decision explicit in the review state so extraction generation changes cannot silently reverse it.\n\nThe existing SQLite CHECK makes review-state evolution an archive concern instead of a Go business rule. The approved design removes that constraint through one narrowly scoped, data-preserving migration and defines the API, UI, freshness, and failure contracts for the implementation.
The approved workflow spans a data-preserving SQLite migration, transactional review semantics, an HTTP boundary, and row-local frontend behavior. A file-specific red-first plan keeps those layers independently verifiable while preserving the clean scope of individual approve and archive decisions.
Recall review needs a terminal rejection state that survives reopen and future state additions. Keeping the allowed review-state enum in SQLite made each new business state require a table change, so policy now lives at the shared Go write boundary.\n\nExisting archives are rebuilt transactionally before schema initialization while preserving row IDs and relationships needed by evidence, supersession, and FTS.
Machine-generated Recall entries need a one-way human disposition that extraction maintenance cannot reverse. The store now enforces that only accepted, unreviewed automatic entries can be approved or archived, with provenance required for approval.\n\nReturning the hydrated entry from the same transaction keeps the API response aligned with the committed decision, while SQLite triggers continue to invalidate only the query and embedding views affected by each transition.
The Corpus UI needs a narrow mutation boundary for approving or dismissing one machine-generated entry without exposing broader entry editing. The endpoint validates a single explicit action, preserves typed storage conflicts, and returns the committed entry so clients can update one row in place.\n\nRead-only and maintenance states follow the server's existing capability and retry semantics, and vector refresh is scheduled only after a successful decision.
Review controls need one typed client operation and stable user-facing language before the Corpus table can expose mutations. The frontend now models the two allowed decisions, preserves server error details, and names every review state so raw storage values do not leak into the interface.\n\nAll supported locales carry the same confirmation, provenance, and failure messages, keeping the interaction accessible regardless of the active language.
A distilled corpus is only useful if people can turn uncertain automatic output into an explicit decision where they inspect it. Expanded rows now expose immediate approval and confirmed archive actions, while revoked provenance blocks only the trust-increasing transition.\n\nSuccessful responses update the current page locally instead of reloading or disturbing pagination and scroll. Pending and conflict states stay scoped to the affected row so unrelated corpus browsing remains available.
The public workflow now lets users make durable trust decisions from the Corpus table, so the documentation must distinguish approval from rejection and make provenance gating explicit. The extraction lifecycle notes also clarify that machine maintenance cannot reverse either human state.\n\nThe migration test uses the repository's current Go loop form so the full linter remains clean.
The design and execution notes were useful while the review workflow was being built, but they are not product documentation and would add maintenance noise to the public change. The durable behavior now lives in the Recall user and extraction lifecycle documentation.
@roborev-ci

roborev-ci Bot commented Aug 9, 2026

Copy link
Copy Markdown

roborev: Combined Review (fd7192a)

The PR has one medium-severity issue: rejected entries disappear from the “Human rejected” view.

Medium

  • frontend/src/lib/components/recall/RecallCorpusPanel.svelte:177 — The “Human rejected” filter does not request archived entries. Because the backend defaults an omitted status filter to accepted while rejected entries are stored with status=archived, rejected decisions never appear in this view.
    • Fix: Add status support to RecallEntryFilters and request status=archived when filtering for human_rejected.

Reviewers: 2 done | Synthesis: codex, 7s | Total: 5m14s

Human-rejected entries are archived, so querying by review state alone silently restricted the result to the API's accepted default. Pairing that review state with the archived lifecycle status makes the named Corpus filter include the decisions it represents without changing other filters.
@roborev-ci

roborev-ci Bot commented Aug 9, 2026

Copy link
Copy Markdown

roborev: Combined Review (9ff0dc5)

Code review verdict: No Medium, High, or Critical findings were reported.


Reviewers: 2 done | Synthesis: codex, 9s | Total: 6m33s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant