T01 Toolchain — vite + pnpm 9.15 + React 18 + strict TS (ADR-0001).
T02 Folder layout — src/{shared,engine,anchor,source,binder,work,app}/
mirroring the future subsystem split, with path aliases.
T03 Boundary lint — eslint-plugin-boundaries enforcing the dependency
edges from wiki/DependencyMap.md §4; verified by a violating fixture.
T04 Canonical normalization v1 — src/shared/text/normalize.ts with
NORMALIZE_VERSION=1; 10/10 vitest covering ligatures, CRLF, soft
hyphens (including line-break reassembly), mixed whitespace.
T05 PDF fixture corpus — 7 user-supplied German PDFs in fixtures/pdfs/
(gitignored binaries) plus a manifest with verbatim known-good
quotes and page counts, ready for CE-WP-0002 selector tests.
T06 README upgrade — umbrella README points at wiki/docs/workplans
and documents the dev workflow.
T07 ADR-0002..0006 stubs in docs/decisions/.
Toolchain end-to-end: pnpm install + lint + typecheck + test all green.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1.8 KiB
ADR-0006 — Selector ownership split (types in engine, algorithms in anchor)
- Status: proposed
- Date: 2026-05-24
- Workplan: CE-WP-0001-T07 (stub); echoes
wiki/SharedContracts.md§8
Context
The original sister-repo INTENT files had overlapping ownership claims for
Selector: citation-engine listed it as an owned domain type, while
evidence-anchor's scope claimed "selector type definitions related to
anchoring". This was resolved on 2026-05-24 in wiki/SharedContracts.md §8:
type interfaces live in engine (src/shared/selector.ts), creation and
resolution algorithms live in anchor.
This ADR makes the split formal so that future code reviews have a written answer when somebody proposes moving the types into anchor or moving the algorithms into shared.
Options
-
A. Status quo: types in
shared/, algorithms inanchor/(default)- Pros: anchor depends on shared (allowed by DependencyMap §4); type consumers (binder, work) never have to import anchor.
- Cons: tiny risk of types drifting out of sync with what anchor can actually produce.
-
B. Co-locate types and algorithms in
anchor/- Pros: one home for everything selector-related.
- Cons: any partition that mentions a
Selectortype (which is most of them) would have to import fromanchor/. Breaks the "shared has no internal imports" invariant of DependencyMap §4.
-
C. Split selector kinds: text-quote in shared, PDF-rect in anchor
- Pros: only adapter-specific selectors leave shared.
- Cons: forces a discriminated union spanning two packages — type narrowing becomes painful for consumers.
Decision
(blank — option A is the working assumption codified in SharedContracts.md; fill this in if a future use case challenges it.)
Consequences
(blank)