Extract binder package from citation-evidence (EBIND-WP-0001)
Extracts citation-evidence/src/binder/ into this repo as the standalone @citation-evidence/evidence-binder package: headless binding service + in-memory link repo, active-state machine, the SharedContracts §7 rect-registry contract (registry, change pumps, hooks, SVG overlay), and the target-neutral reference FormRenderer. - toolchain mirrors sibling extracted repos (pnpm/tsc/vitest/eslint); imports rewritten from @shared/@engine aliases to the engine's @citation-evidence/engine package specifiers - dependency boundary (engine + anchor only; no source/work/umbrella) enforced via eslint no-restricted-imports - docs: extraction inventory + contract deltas, ADR-0001 (reference UI kept as supported exports), refreshed README/SCOPE/INTENT, populated capabilities index - typecheck + lint green, 37 tests passing Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
87d4eb3006
commit
a10f080f12
36 changed files with 6643 additions and 170 deletions
58
README.md
58
README.md
|
|
@ -1,19 +1,49 @@
|
|||
# evidence-binder
|
||||
|
||||
Connect evidence items to structured targets — form fields, claims,
|
||||
requirements — and render the visual guide that ties a target, its evidence
|
||||
card, and the source highlight together in the workspace UI.
|
||||
`@citation-evidence/evidence-binder` — connect evidence items to structured
|
||||
targets (form fields, claims, requirements, …) and render the visual guide that
|
||||
ties a target, its evidence card, and the source highlight together.
|
||||
|
||||
## MVP status: INTENT only
|
||||
This is the canonical home of the binder implementation, extracted from
|
||||
`citation-evidence/src/binder/` (EBIND-WP-0001).
|
||||
|
||||
During the citation-evidence MVP, code lives upstream in
|
||||
[`citation-evidence`](../citation-evidence/) under `src/binder/`. This repo
|
||||
currently holds `INTENT.md` describing what will move here. Contract
|
||||
changes — including the rect-registry contract that the visual guide
|
||||
depends on — belong in
|
||||
[`citation-evidence/wiki/SharedContracts.md`](../citation-evidence/wiki/SharedContracts.md),
|
||||
not here.
|
||||
## What this package owns
|
||||
|
||||
Per the dependency map, binder depends on `shared/`, `engine/`, and
|
||||
`anchor/`. It must not be imported by `work/` (the UI talks to binder via
|
||||
the active-state context, not by direct import).
|
||||
- **Evidence links** — `EvidenceLink` repository + binding service
|
||||
(`services/bindings.ts`, `repos/in-memory-links.ts`). Two query directions:
|
||||
*all evidence for a target* and *all targets for an evidence item*. Emits the
|
||||
canonical engine bus events (`EvidenceLinkCreated/Updated/Removed`,
|
||||
`EvidenceItemActivated`).
|
||||
- **Active state** — the `(activeTarget, activeEvidenceItemId, activeAnnotationId)`
|
||||
machine and React provider (`state/active.ts`) that the form UI, evidence
|
||||
sidebar, and viewer adapter coordinate through.
|
||||
- **Rect registry contract** (SharedContracts §7) — a single registry into which
|
||||
independent renderers publish `field` / `evidence-card` / `highlight` rects,
|
||||
plus the change pumps, React hooks, and the SVG `Overlay` that draws the guide
|
||||
(`visual-guide/`).
|
||||
- **Reference form UI** — `FormRenderer` and `FieldDefinitionForm`, kept as
|
||||
supported, target-neutral exports (see `docs/adr/ADR-0001-reference-ui-surface.md`).
|
||||
|
||||
`BinderProvider` composes all four concerns behind one mount.
|
||||
|
||||
## Dependency boundary
|
||||
|
||||
Per `citation-evidence/wiki/DependencyMap.md` §2, this package **may** depend on
|
||||
`citation-engine` and `evidence-anchor`, and **must not** depend on
|
||||
`evidence-source`, `citation-work`, or the umbrella `citation-evidence`. The MVP
|
||||
slice imports only `citation-engine` (shared types + event bus). The boundary is
|
||||
enforced by `eslint.config.js`. Shared-contract authority stays in the umbrella
|
||||
wiki.
|
||||
|
||||
## Develop
|
||||
|
||||
```bash
|
||||
pnpm install # links @citation-evidence/engine from ../citation-engine
|
||||
pnpm test # vitest (node + happy-dom suites)
|
||||
pnpm typecheck # tsc -b --noEmit
|
||||
pnpm lint # eslint (enforces the dependency boundary)
|
||||
```
|
||||
|
||||
Requires a sibling checkout of `citation-engine` (see `.nvmrc` for the Node
|
||||
version). See `docs/extraction-inventory.md` for the extraction boundary and
|
||||
resolved contract deltas.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue