feat(review): unified review inbox + confidence gate on extracted children (Phase 2B)#19
Merged
Conversation
…ldren Phase 2, piece B. Backend — confidence gate on extracted children (capture/process): - New pure helper childTriage.childReviewStatus(level): confidence >= 4 → 'promoted', else 'flagged_for_review' (threshold a named constant). - Document + meeting child inserts now use it instead of hardcoding 'llm_reviewed'. Confident children auto-promote (matching the single-capture maturity gate); the rest land in the inbox flagged. Parent source node unchanged. No new llm_reviewed children are created. Frontend — unified inbox (/review): - One "Review" queue merging flagged_for_review (all types) + legacy llm_reviewed knowledge nodes, each with uniform Accept / Edit & promote / Archive. FlaggedItem generalised → ReviewItem (kind: 'flagged' | 'awaiting', reason tag, "from <source>" tag for extracted children). The old Review-link-only "Awaiting" section folds into the queue. - page.tsx builds the queue and fetches source-document titles so children show their origin. Heading → "Review"; nav label "Health" → "Review". Tests: childTriage unit test (boundary at 4); FlaggedItem.test → ReviewItem.test covering both kinds, reason/source tags, and actions; ReviewPage.test updated for the merged queue. tsc 0, lint 0, 557 pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Review was fragmented:
flagged_for_reviewnodes got one-tap Accept/Edit/Archive, but document/meeting-extracted children were all forced tollm_reviewed— bypassing the maturity gate single captures get, reachable only via a separate per-child page, and (for non-knowledge types) invisible to the queue entirely.What
Backend — confidence gate on extracted children (
capture/process)childTriage.childReviewStatus(level):confidence ≥ 4 → promoted, elseflagged_for_review(threshold = named constant).llm_reviewed. Confident children auto-promote (matching the single-capture gate); the rest land in the inbox flagged. Parent source node unchanged. No newllm_reviewedchildren created.Frontend — unified inbox (
/review)flagged_for_review(all types) + legacyllm_reviewedknowledge nodes, each with uniform Accept (→promoted) / Edit & promote (→ per-child page) / Archive (→archived).FlaggedItemgeneralised →ReviewItem(kind: 'flagged' | 'awaiting', reason tag — "Needs more evidence" / "Low extraction confidence" / "Awaiting sign-off" — and a "from <source>" tag for extracted children). The old Review-link-only "Awaiting" section folds into the queue.page.tsxbuilds the queue and fetches source-document titles. Heading → "Review"; nav label "Health" → "Review" (nav consolidation stays piece C).Decisions captured (yours)
Notes
PATCH /api/nodes/[id]already supports promoted/archived — no API change.Test plan
childTriageunit test (boundary at 4)FlaggedItem.test→ReviewItem.test— both kinds, reason + source tags, action callbacksReviewPage.test— merged queue (flagged + awaiting)tsc→ 0 ·eslint .→ 0 ·vitest run→ 557 passSpec:
docs/superpowers/specs/2026-06-12-unified-review-inbox-design.md. Phase 2 piece B. Remaining: C (nav consolidation + mobile + light-mode), D (optional capture titles).