PR: #658: [Story-2583] Disclose complete Insights and Text payloads by @pramaan-board-bot[bot]
View PR →

Story 2583: Maximal disclosure

Founder law: the founder sees the complete machine payload before deciding what to hide, move, or reformat. Curated reading views stay; direct payload disclosure is added below them and is visible by default.

One disclosure path

generated response object
  → AllFieldsDisclosure
  → JSON.stringify(payload, null, 2)
  → every returned key and value, without a field allowlist

The shared disclosure also replaces the older family-specific JSON renderer, so Family, Insights, and Text use one exact serialization path.

Visible behaviour

Lens Curated view retained Complete disclosure added
Insights Judge summary, semantic sections, findings, and attention map. The original DeepReadEnvelope: schema and document ids, extraction version, summary, privilege flag, complete coverage receipt, examined receipts, row privilege and trace data, plus every section, attention, finding, assertion, evidence, confidence, anchor, offset, and typed assertion-object field.
Text Readable machine copy, named sections, table rendering, and outline. All three untouched generated responses: Text view ids, version, page count, and full text; Anchor view ids, version, pages, page numbers, blocks, anchor ids, geometry, offsets, confidence, kind, text, and explicit table cell coordinates, spans, confidence, and text; plus the Sections view document id, extraction run id, complete section nodes, boundaries, layout tags, and nested children.

Default-visible and empty states

The disclosure is not behind a closed accordion. Its scrollable field dump is in the normal page flow. Before a payload exists, the shared component names that state instead of rendering an unexplained blank panel. The integrated Insights “Not yet read” and loading states show that explicit empty disclosure. Text keeps all responses visible during loading, empty, error, and extraction-version mismatch states, including any partial data that did arrive.

Contract boundary

This change uses the committed generated contracts without running codegen. The current DeepReadEnvelope does not define comparator verdicts, model_sessions, or timestamps. Those values therefore cannot be rendered by this app until the upstream OpenAPI contract carries them.

No UI field mapping needs to change when that generated contract expands: the complete admitted envelope object is serialized directly. The same rule applies to future Text, Anchor, and Sections response fields.

Files changed

12 file(s), +548 / -197 lines

Path Role + -
messages/en.jsonConfig+13-1
messages/hi.jsonConfig+13-1
src/components/documents/all-fields-disclosure.stories.tsxComponent+45-0
src/components/documents/all-fields-disclosure.test.tsxComponent+43-0
src/components/documents/all-fields-disclosure.tsxComponent+44-0
src/components/documents/family/family-all-fields.tsxComponent+8-27
src/components/documents/viewer/deep-read-story-fixtures.tsComponent+156-0
src/components/documents/viewer/document-insights-dossier.stories.tsxComponent+7-99
src/components/documents/viewer/document-insights-dossier.tsxComponent+102-45
src/components/documents/viewer/document-machine-copy-view.stories.tsxComponent+28-3
src/components/documents/viewer/document-machine-copy-view.tsxComponent+88-21
src/components/documents/viewer/use-document-sections.tsComponent+1-0

Storybook proof

Locale, token, and route proof

Verification

pnpm lint
pnpm test
pnpm build
pnpm check:routes
pnpm storybook:build
git diff --check