2026-07-08 20:55:28 +02:00
|
|
|
---
|
|
|
|
|
id: ESRC-WP-0002
|
|
|
|
|
type: workplan
|
|
|
|
|
title: "HTML and Markdown source representations"
|
|
|
|
|
domain: infotech
|
|
|
|
|
repo: evidence-source
|
2026-07-09 01:48:28 +02:00
|
|
|
status: finished
|
2026-07-08 20:55:28 +02:00
|
|
|
owner: codex
|
|
|
|
|
topic_slug: citation_evidence_mvp
|
|
|
|
|
created: "2026-07-08"
|
2026-07-09 01:48:28 +02:00
|
|
|
updated: "2026-07-09"
|
2026-07-08 20:55:28 +02:00
|
|
|
spec_refs:
|
|
|
|
|
- README.md
|
|
|
|
|
- docs/ADR-0001-extraction-boundary.md
|
2026-07-09 01:48:28 +02:00
|
|
|
- docs/ADR-0003-html-markdown-representation.md
|
2026-07-08 20:55:28 +02:00
|
|
|
- ../citation-engine/src/shared/document.ts
|
2026-08-25 20:10:10 +02:00
|
|
|
state_hub_workstream_id: "12f0b386-0df1-50d9-8cf7-4829d5257382"
|
2026-07-08 20:55:28 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
2026-07-09 01:48:28 +02:00
|
|
|
## Decisions (ADR-0003)
|
2026-07-08 20:55:28 +02:00
|
|
|
|
2026-07-09 01:48:28 +02:00
|
|
|
- HTML maps to `representationType: "html-dom"`; Markdown to
|
|
|
|
|
`"markdown-rendered"`.
|
|
|
|
|
- Pageless formats omit `pageMap`; `offsetMap` is a single synthetic page-1
|
|
|
|
|
range covering `[0, canonicalText.length)`.
|
|
|
|
|
- Inline fixtures owned by this repo (no PII); PDF corpus rules unchanged.
|
2026-07-08 20:55:28 +02:00
|
|
|
|
|
|
|
|
## Sketch
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
id: ESRC-WP-0002-T01
|
2026-07-09 01:48:28 +02:00
|
|
|
status: done
|
2026-07-08 20:55:28 +02:00
|
|
|
priority: medium
|
2026-08-25 20:10:10 +02:00
|
|
|
state_hub_task_id: "f875c025-2c08-56d7-bbde-60e0643a7b9c"
|
2026-07-08 20:55:28 +02:00
|
|
|
```
|
|
|
|
|
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
|
2026-07-09 01:48:28 +02:00
|
|
|
status: done
|
2026-07-08 20:55:28 +02:00
|
|
|
priority: medium
|
2026-08-25 20:10:10 +02:00
|
|
|
state_hub_task_id: "e7936d67-188d-50f3-8dc8-684c9f03fb4a"
|
2026-07-08 20:55:28 +02:00
|
|
|
```
|
|
|
|
|
Implement `ingestHtml` / `ingestMarkdown` in `src/html/` and `src/markdown/`,
|
|
|
|
|
reusing `fingerprintBytes` and the canonical-text normalizer.
|
|
|
|
|
|
|
|
|
|
```task
|
|
|
|
|
id: ESRC-WP-0002-T03
|
2026-07-09 01:48:28 +02:00
|
|
|
status: done
|
2026-07-08 20:55:28 +02:00
|
|
|
priority: medium
|
2026-08-25 20:10:10 +02:00
|
|
|
state_hub_task_id: "18fcce8a-92f6-5e52-b613-ffa52f18bc71"
|
2026-07-08 20:55:28 +02:00
|
|
|
```
|
|
|
|
|
Add fixture-driven contract tests mirroring the PDF suite; decide fixture
|
2026-07-09 01:48:28 +02:00
|
|
|
ownership per ADR-0002.
|