Domain model and tooling for citations.
Find a file
tegwick 86d10e7e90
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 9s
Promote DomRange and Structural selector types for non-PDF anchoring
Define real DomRangeSelector, StructuralSelector, StructureMap, and
containerPath fields so evidence-anchor can implement HTML/Markdown
selector creation and resolution. Update SharedContracts.md with field
shapes and DomSelectionCapture payload.
2026-07-09 09:18:42 +02:00
.claude/rules docs: workplan-first agent guidance prose (CUST-WP-0055 T04 batch 5) 2026-07-08 19:51:07 +02:00
.forgejo/workflows Add Forgejo CI smoke workflow (enablement template) 2026-07-08 12:29:35 +02:00
registry Draft capability entry (reuse-surface REUSE-WP-0017-T04, cohort 1) 2026-07-06 19:03:42 +02:00
src Promote DomRange and Structural selector types for non-PDF anchoring 2026-07-09 09:18:42 +02:00
wiki Promote DomRange and Structural selector types for non-PDF anchoring 2026-07-09 09:18:42 +02:00
workplans Normalize agent instructions and workplan frontmatter (STATE-WP-0067) 2026-06-22 23:16:24 +02:00
.custodian-brief.md chore(consistency): sync task status from DB [auto] 2026-06-22 20:27:36 +02:00
.gitignore Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00
.nvmrc Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00
.repo-classification.yaml Add .repo-classification.yaml (CUST-WP-0050 T11 agent first-pass) 2026-06-22 17:47:35 +02:00
AGENTS.md Regenerate agent instructions from state-hub templates (CUST-WP-0055 T01) 2026-07-08 14:50:18 +02:00
CLAUDE.md Normalize agent instructions and workplan frontmatter (STATE-WP-0067) 2026-06-22 23:16:24 +02:00
eslint.config.js Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00
INTENT.md Implement CENG-WP-0002: package distribution and publish readiness 2026-06-22 19:45:11 +02:00
LICENSE Initial commit 2026-05-24 13:33:51 +00:00
package.json Implement CENG-WP-0002: package distribution and publish readiness 2026-06-22 19:45:11 +02:00
pnpm-lock.yaml Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00
README.md Implement CENG-WP-0002: package distribution and publish readiness 2026-06-22 19:45:11 +02:00
SCOPE.md Normalize agent instructions and workplan frontmatter (STATE-WP-0067) 2026-06-22 23:16:24 +02:00
tsconfig.json Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00
vitest.config.ts Extract engine from citation-evidence umbrella (CENG-WP-0001) 2026-06-22 18:02:05 +02:00

citation-engine

Core domain model and engine services for the citation-evidence ecosystem.

This package provides the shared vocabulary (Document, Selector, Annotation, EvidenceItem, EvidenceLink, EvidenceSet, state enums, branded IDs, canonical text normalization) together with in-memory repositories, orchestration services, the event bus, and citation card renderers.

Published as @citation-evidence/engine.

Layout

src/
  shared/   # types, enums, pure helpers
  engine/   # services, repositories, rendering, persistence
wiki/
  SharedContracts.md   # conformance copy (authoritative: citation-evidence)

Installing

Local development (sibling checkout)

Repos are expected as siblings:

~/citation-evidence/
~/citation-engine/
~/evidence-anchor/
...

In the consumer's package.json:

{
  "dependencies": {
    "@citation-evidence/engine": "link:../citation-engine"
  }
}

Then pnpm install. TypeScript path aliases in consumers typically map @shared/* and @engine/* to ../citation-engine/src/shared/* and ../citation-engine/src/engine/* (see CE-WP-0009 in citation-evidence).

Registry install (when published)

pnpm add @citation-evidence/engine

Registry host TBD. See Publishing checklist below.

evidence-anchor (placeholder)

When evidence-anchor extracts, it will depend on engine types only:

{
  "dependencies": {
    "@citation-evidence/engine": "link:../citation-engine"
  }
}

Import shared types via @shared/* path aliases or @citation-evidence/engine/shared.

Development

pnpm install
pnpm test
pnpm typecheck
pnpm lint

Contract sync

See wiki/README.md. Changes to shared contracts land in citation-evidence/wiki/SharedContracts.md first, then sync here.

Extraction status

Code lives in src/shared/ and src/engine/, extracted from the umbrella MVP per workplans/CENG-WP-0001-intent-placeholder.md. The umbrella consumes this package via link: per CE-WP-0009.

Publishing checklist

Use when a package registry is configured (ADR-0002: independent repos + publish).

  • Set private: false (or scoped private per org policy)
  • Confirm files in package.json includes src/, wiki/, README.md, LICENSE
  • Decide: TypeScript sources via exports (current) vs tsc emit to dist/
  • Bump semver: patch for fixes, minor for additive contracts, major for breaks
  • Run pnpm test && pnpm typecheck && pnpm lint before publish
  • Update consumers from link: to registry version
  • Document registry URL and auth in org runbook (not in this repo)

No publish CI step is configured yet — credentials and registry choice are out of scope until an external consumer requires it.