PR: #656: feat(documents): add findings lifecycle and SIDE review [Story-2511] by @pramaan-board-bot[bot]
View PR →

Story 2511: Findings lifecycle + SIDE CHECK

Manifest T5c · Wave W5 · RFD-DOC-006. Covers ER-06, ER-23, ER-24, ER-28 and ER-38.

Findings have an explicit, reversible verdict

Every Deep Read finding offers three complete actions: Keep finding, Dismiss finding as not accurate, and Dismiss finding as not relevant. The verdict appears immediately and is stored in the browser fixture store. A rejected write restores the previous state instead of leaving a false success.

A superseded finding re-enters only when a prior not relevant record has the same stable finding identity but changed source content. It shows the prior author/date and a side-by-side quote diff. “Not accurate” remains terminal in the fixture.

ER-38 — one warning on every document lens

record/doc/[documentId]/layout
  → DocumentPermalinkShell
    → DocumentStrip
    → SIDE CHECK ribbon       // Original, Text and Insights
    → routed lens body

The ribbon is one slim, single-line semantic-danger band. It names both sides, never blames counsel, and expands the exact quote, page and confidence with a page-and-anchor evidence link. Every resolution names its full target: Change to Client's, Change to Opponent's, Change to Other, or Keep as Opponent's.

Record SIDE column and routed queue

The Record adapter now preserves DocumentListItem.declaredSide. A distinct SIDE column shows the declaration; a disagreement renders a text-and-icon warning, never colour alone. The warning links to the routed queue, and a shared segmented filter narrows the register to Needs review.

The declared-side control remains available in every SIDE cell, so counsel can make an explicit-target manual correction after a toast expires. It updates immediately, rolls back on refusal, and offers a destination-named undo.

/record/side-review is a real App Router route with layout-owned Record/SIDE review navigation. It can be deep-linked, opened in a new tab, and addressed by agentSurface.

Queue rule Behaviour
Confidence floor Only suggestions at or above 85% enter bulk actions. Lower-confidence rows require an individual decision.
Explicit bulk target Bulk actions are grouped by destination: for example, Change all 3 to Client's.
Optimism + rollback Rows leave immediately. Refused writes return only the failed rows.
Undo The toast names the destination and writes each prior declared side back. A refused undo restores server-consistent queue state.

Cutover truth

The generated contract has a real, audited declared-side mutation, and every Change/Undo uses it. It does not yet expose side suggestions, confidence/evidence, finding dismissal reasons, or superseded identity history.

Those read models are therefore fixture-only and hard-gated to the established matter-16 UAT corpus. “Keep current side” and finding verdicts persist in a browser fixture store, including undo, rollback, declarer/resolver identity, timestamp, and the machine suggestion, until their generated audit contracts land. At wave cutover the fixture read/write helpers are deleted; they are never dual-served beside live suggestions.

Files changed

60 file(s), +3205 / -314 lines

Path Role + -
messages/en.jsonConfig+71-2
messages/hi.jsonConfig+71-2
src/app/[locale]/(workspace)/matters/[matterId]/record/doc/[documentId]/insights/page.tsxApp route+1-0
src/app/[locale]/(workspace)/matters/[matterId]/record/doc/[documentId]/layout.tsxApp route+6-0
src/app/[locale]/(workspace)/matters/[matterId]/record/layout.tsxApp route+21-0
src/app/[locale]/(workspace)/matters/[matterId]/record/side-review/page.tsxApp route+57-0
src/app/api/internal/matters/[matterId]/documents/route.tsApp route+56-0
src/components/documents/register/register-cell.tsxComponent+60-9
src/components/documents/register/register-document-row.stories.tsxComponent+19-1
src/components/documents/register/register-document-row.tsxComponent+38-8
src/components/documents/register/register-side-cell.stories.tsxComponent+65-0
src/components/documents/register/register-side-cell.tsxComponent+117-0
src/components/documents/register/register-table.tsxComponent+133-103
src/components/documents/register/register-view.stories.tsxComponent+45-10
src/components/documents/register/register-view.tsxComponent+130-36
src/components/documents/register/saved-views-register.tsxComponent+25-6
src/components/documents/register/view-popover/icons.tsComponent+2-0
src/components/documents/side-check/record-mode-layout.stories.tsxComponent+34-0
src/components/documents/side-check/record-mode-layout.tsxComponent+26-0
src/components/documents/side-check/record-subnav.stories.tsxComponent+24-0
src/components/documents/side-check/record-subnav.tsxComponent+41-0
src/components/documents/side-check/side-check-review-context.tsComponent+8-0
src/components/documents/side-check/side-check-ribbon.stories.tsxComponent+45-0
src/components/documents/side-check/side-check-ribbon.tsxComponent+174-0
src/components/documents/side-check/side-check-story-fixtures.tsComponent+37-0
src/components/documents/side-check/side-review-queue.stories.tsxComponent+39-0
src/components/documents/side-check/side-review-queue.tsxComponent+237-0
src/components/documents/side-check/use-side-check-ribbon.tsComponent+115-0
src/components/documents/side-check/use-side-review-queue.tsComponent+156-0
src/components/documents/viewer/deep-read-finding-item.stories.tsxComponent+38-0
src/components/documents/viewer/deep-read-finding-item.tsxComponent+77-0
src/components/documents/viewer/deep-read-findings.tsxComponent+68-46
src/components/documents/viewer/deep-read-section.tsxComponent+3-0
src/components/documents/viewer/document-insights-dossier.tsxComponent+43-36
src/components/documents/viewer/document-insights-live.tsxComponent+6-3
src/components/documents/viewer/document-permalink-shell.tsxComponent+24-3
src/components/documents/viewer/finding-lifecycle-controls.stories.tsxComponent+53-0
src/components/documents/viewer/finding-lifecycle-controls.test.tsxComponent+44-0
src/components/documents/viewer/finding-lifecycle-controls.tsxComponent+144-0
src/components/documents/viewer/finding-lifecycle-story-fixtures.tsComponent+17-0
src/components/documents/viewer/section-finding-card.stories.tsxComponent+9-4
src/components/documents/viewer/section-finding-card.tsxComponent+12-10
src/components/documents/viewer/use-finding-lifecycle.tsComponent+78-0
src/components/matters/live-matter-documents-page.tsxComponent+8-2
src/lib/documents/finding-lifecycle-fixture.test.tsLibrary+95-0
src/lib/documents/finding-lifecycle-fixture.tsLibrary+187-0
src/lib/documents/register/adapter.tsLibrary+8-2
src/lib/documents/register/columns.tsLibrary+27-4
src/lib/documents/register/filters.test.tsLibrary+2-0
src/lib/documents/register/fixtures.tsLibrary+2-0
src/lib/documents/register/saved-view.test.tsLibrary+39-10
src/lib/documents/register/saved-view.tsLibrary+25-5
src/lib/documents/register/types.tsLibrary+11-1
src/lib/documents/side-check-decisions.test.tsLibrary+51-0
src/lib/documents/side-check-decisions.tsLibrary+98-0
src/lib/documents/side-check.test.tsLibrary+57-0
src/lib/documents/side-check.tsLibrary+78-0
src/lib/kubb-client.tsLibrary+15-9
src/lib/surface-registry/route-registry.tsLibrary+12-2
tests/unit/lib/kubb-client.test.tsTest+21-0

Storybook proof

Locale contract

All product copy is present in messages/en.json and messages/hi.json. SIDE names reuse the existing reviewed DocumentViewer.side vocabulary; the feature does not mint a parallel party taxonomy.