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>
55 lines
1.5 KiB
Markdown
55 lines
1.5 KiB
Markdown
---
|
|
id: ESRC-WP-0002
|
|
type: workplan
|
|
title: "HTML and Markdown source representations"
|
|
domain: infotech
|
|
repo: evidence-source
|
|
status: proposed
|
|
owner: codex
|
|
topic_slug: citation_evidence_mvp
|
|
created: "2026-07-08"
|
|
updated: "2026-07-08"
|
|
spec_refs:
|
|
- README.md
|
|
- docs/ADR-0001-extraction-boundary.md
|
|
- ../citation-engine/src/shared/document.ts
|
|
---
|
|
|
|
# ESRC-WP-0002 — HTML and Markdown source representations
|
|
|
|
The PDF slice (ESRC-WP-0001) established the ingest boundary and contract shape.
|
|
This workplan extends ingest to HTML and Markdown sources, producing the same
|
|
`{ document, representation }` pair over engine-owned contracts.
|
|
|
|
## Open questions
|
|
|
|
- Which `representationType` values do HTML/MD map to, and do they need new
|
|
`DocumentRepresentation` fields in `citation-engine`?
|
|
- How is canonical text + offset map derived for reflowable formats that have
|
|
no fixed pages? (Page map may be empty or synthetic.)
|
|
|
|
## Sketch
|
|
|
|
```task
|
|
id: ESRC-WP-0002-T01
|
|
status: todo
|
|
priority: medium
|
|
```
|
|
Define the HTML/MD representation contract with `citation-engine`; agree
|
|
`representationType` and any offset/page semantics for pageless formats.
|
|
|
|
```task
|
|
id: ESRC-WP-0002-T02
|
|
status: todo
|
|
priority: medium
|
|
```
|
|
Implement `ingestHtml` / `ingestMarkdown` in `src/html/` and `src/markdown/`,
|
|
reusing `fingerprintBytes` and the canonical-text normalizer.
|
|
|
|
```task
|
|
id: ESRC-WP-0002-T03
|
|
status: todo
|
|
priority: medium
|
|
```
|
|
Add fixture-driven contract tests mirroring the PDF suite; decide fixture
|
|
ownership per ADR-0002.
|