EANCH-WP-0001 T03: extract pure selector creation + resolution core

Move types.ts, selectors/{index,create,resolve}.ts, and pdf-selector-math.ts
out of citation-evidence/src/anchor/ into src/ (pdf math under src/pdf/).
Rewrite all @shared/* imports to @citation-evidence/engine/shared; wire the
public entrypoint (src/index.ts) and the ./pdf subpath. Port the three unit
suites. Confidence ladder and selector-redundancy rules preserved verbatim.

Verified: pnpm test (29 passed), typecheck, and lint all green.
Also adds Node/TS .gitignore entries and the pnpm lockfile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-08 20:41:54 +02:00
parent 0e93b68982
commit bd7f56c111
13 changed files with 5298 additions and 13 deletions

View file

@ -1,10 +1,16 @@
// Public entrypoint for `evidence-anchor`.
//
// The stable surface consumers depend on is re-exported from here:
// - selector creation/resolution: ./selectors (T03)
// - adapter-side types + contract: ./types (T03)
// - the concrete PDF adapter: ./pdf (T04, also exposed at `evidence-anchor/pdf`)
// The stable surface consumers depend on:
// - adapter-side types + the viewer contract (./types)
// - selector creation / resolution (./selectors)
//
// Populated during the extraction tasks; kept as an explicit placeholder so the
// package resolves and typechecks before the code lands.
export {};
// The concrete PDF adapter lives behind the `evidence-anchor/pdf` subpath
// (./pdf) so pure consumers do not pull PDF.js or React into their bundle.
export * from "./types";
export {
createSelectors,
resolveSelectors,
DEFAULT_CONTEXT_CHARS,
type CreateSelectorsOptions,
} from "./selectors";