evidence-source/docs/ADR-0002-fixture-ownership.md
tegwick cb93c322c0
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
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>
2026-07-08 20:55:28 +02:00

43 lines
1.8 KiB
Markdown

# 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.