feat(pdf): extract standalone PDF ingest package (ESRC-WP-0001)
Bootstrap evidence-source from the citation-evidence src/source PDF slice. - Headless core (src/pdf): ingest/extract/fingerprint, importing domain contracts from @citation-evidence/engine/shared (no local copies) - Browser upload helpers isolated under src/browser behind a ./browser entry point, with an eslint boundary keeping the core browser-free - pnpm/TS/vitest/eslint scaffold; 52 tests (contract + determinism) - Fixtures resolved from the sibling citation-evidence checkout, not duplicated (real PII) — see docs/ADR-0002; suites skip when absent - Boundary + fixture decisions recorded as docs/ADR-0001 / ADR-0002 - README/SCOPE rewritten; capability.infotech.pdf-evidence-ingest registered, NO_CAPABILITIES removed - Follow-on workplans ESRC-WP-0002..0004 queued; ESRC-WP-0001 finished Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
2fd715ba45
commit
cb93c322c0
31 changed files with 5066 additions and 105 deletions
43
docs/ADR-0002-fixture-ownership.md
Normal file
43
docs/ADR-0002-fixture-ownership.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# ADR-0002 — Fixture corpus ownership
|
||||
|
||||
- **Status:** accepted
|
||||
- **Date:** 2026-07-08
|
||||
- **Workplan:** ESRC-WP-0001 (T05)
|
||||
|
||||
## Context
|
||||
|
||||
The PDF ingest contract tests are driven by a fixture corpus
|
||||
(`fixtures/pdfs/` + `manifest.json`) currently owned by `citation-evidence`.
|
||||
The corpus is made of **real** personal and legal documents — utility-cost
|
||||
statements, a settlement letter, court correspondence, cemetery admission
|
||||
forms — containing names, addresses, and case details.
|
||||
|
||||
The workplan (T05) asks us to either copy the corpus into this repo or define a
|
||||
stable shared-fixture path.
|
||||
|
||||
## Decision
|
||||
|
||||
Do **not** copy the corpus into `evidence-source`. Resolve it from the sibling
|
||||
`citation-evidence` checkout instead:
|
||||
|
||||
- default: `<repo>/../citation-evidence/fixtures/pdfs`
|
||||
- override: `EVIDENCE_SOURCE_FIXTURE_DIR` environment variable
|
||||
|
||||
## Rationale
|
||||
|
||||
- **Privacy.** `evidence-source` advertises reusable ingest capability and is a
|
||||
candidate for wider distribution. Duplicating real PII into it multiplies the
|
||||
places that data lives and can be leaked.
|
||||
- **Single ownership.** The corpus and its `manifest.json` (page counts,
|
||||
known-good quotes) were curated and re-verified upstream. One owner avoids
|
||||
drift between two copies.
|
||||
- **Consistent coupling.** This repo already assumes a sibling checkout for its
|
||||
`@citation-evidence/engine` (`link:../citation-engine`) dependency. Reading
|
||||
fixtures from `../citation-evidence` is the same coupling model, not a new one.
|
||||
|
||||
## Consequences
|
||||
|
||||
- Tests require a sibling `citation-evidence` checkout. In CI or a standalone
|
||||
clone, point `EVIDENCE_SOURCE_FIXTURE_DIR` at wherever the corpus is mounted.
|
||||
- When the corpus is absent, the fixture-driven suites skip with a clear message
|
||||
rather than failing spuriously, so unit tests that need no corpus still run.
|
||||
Loading…
Add table
Add a link
Reference in a new issue