Skip to content

Evidence exhibit indexer and cover-page engine (Task 2) — Anish Kumar - #7

Open
Outsideorbit29 wants to merge 6 commits into
superdocsapp:mainfrom
Outsideorbit29:exhibit-engine-anish-kumar
Open

Evidence exhibit indexer and cover-page engine (Task 2) — Anish Kumar#7
Outsideorbit29 wants to merge 6 commits into
superdocsapp:mainfrom
Outsideorbit29:exhibit-engine-anish-kumar

Conversation

@Outsideorbit29

Copy link
Copy Markdown

Evidence Exhibit Indexer and Cover-Page Engine — by Anish Kumar

A paralegal's tool for an immigration filing. Give it the brief and a pile of mixed-format evidence and it proposes an exhibit order that follows the brief's argument, generates a numbered cover page per exhibit (what it proves), builds an exhibit index whose page ranges exactly match the assembled packet, inserts in-brief citations ([See Exhibit N]) at the sentences that rely on each exhibit, and exports the filing as one paginated file.

The strong requirement: adding an exhibit late renumbers the index, the cover pages, the page ranges, and every in-brief citation — together.

  • Deterministic engine, no API key needed (bundled mock server speaks the same HTTP contract; 37 tests).
  • The SuperDocs flow runs the exact four-call contract: upload → chat with approval gate → approve → export — verified live.
  • Optional CrewAI crew (OrderPlanner + CoverWriter) authors cover text when configured.
  • All sample data is synthetic (fictitious spousal-visa filing); no confidential material.

Located at use-cases/Outsideorbit29/exhibit-engine/. Run python -m exhibit.cli run --brief sample/brief/supporting_brief.md --evidence sample/evidence --format html --mock --out packet-out.

Outsideorbit29 and others added 6 commits August 7, 2026 02:10
Immigration-paralegal build: propose an exhibit order that follows the
brief's argument, generate numbered cover pages (what each exhibit proves),
build an exhibit index whose page ranges exactly match the assembled
packet, insert in-brief citations at the sentences that rely on each
exhibit, and export the filing as one paginated file through the SuperDocs
API (upload -> chat with approval gate -> approve -> export).

Adding an exhibit late renumbers covers, index, page ranges and every
in-brief citation together. Pagination is a single source of truth so the
index and the rendered packet can never disagree.

- exhibit/ engine: order, citations, covers, index, paging, proposals,
  loader, flow, superdocs client, mock server, optional CrewAI crew
- tests/: 37 tests against the bundled mock server (no API key needed)
- sample/: synthetic spousal-visa filing (PDF/DOCX/TXT/MD), all fictitious
- CLI: exhibit-engine run [--mock|--live] [--add-late FILE:AFTER]

Co-Authored-By: Claude <noreply@anthropic.com>
The real SuperDocs API only persists a document (making it editable via
chat) when the upload request carries a session_id; without one it is a
one-off conversion that returns no session, so the approval-gated chat had
no session to target. The client now mints a session id (UUID, matching
^[a-zA-Z0-9_.-]+$) when none is supplied. Verified live: upload -> chat ->
approve 6/6 -> export produced all [See Exhibit N] markers.

Co-Authored-By: Claude <noreply@anthropic.com>
The deterministic cover writer concatenated stemmed keywords into broken
English ("Evidences balan, depos, and trans relevant to this application.").
Structured evidence (passports, tax returns, leases, certificates) is now
summarised by its real field: value pairs, prose by quoting the exhibit's own
most evidential clause, with a clean title-grounded fallback. Adds 5 regression
tests (test_covers.py) asserting grammatical, grounded output across the real
sample pile, a fresh screenshot, and the README credit line.

Co-Authored-By: Claude <noreply@anthropic.com>
…t flow

- tools/superdocs_login.py: self-signup agent account (altcha proof-of-work,
  whoami reuse, key saved to ~/.superdocs/agent_credentials.json, never echoed)
- cli.py: _agent_key() reads the saved agent key so --live works keyless
- flow.py: build_message now scopes the model to citation edits only — cover
  pages, contents and index are assembled deterministically by the engine, so
  the export is a clean brief-with-citations (real names/dates/amounts, no
  'Please fill' redaction, no '[Copy of]' placeholders)
- flow.py: render markdown headings in the uploaded brief (h1/h2/h3)
- README: document the login tool and what a live run produces

Live-verified against the real API: 9-exhibit filing (incl. late insertion,
which renumbered every citation in the export), 7/7 changes approved,
exported brief carries the renumbered markers end to end.
SuperDocs keeps agent accounts on their own free tier and refuses to merge
them into an existing human account (web + API adoption both blocked), so the
agent-account flow is retired. The CLI now reads ~/.superdocs/personal_key.txt
(dashboard API key) as the fallback after SUPERDOCS_API_KEY, and the live run
was verified against the real API with the human account's key (9-exhibit
filing, all citations, no redaction).
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