diff --git a/docs/mvp-workplans-index.md b/docs/mvp-workplans-index.md index c0e8489..9f04f26 100644 --- a/docs/mvp-workplans-index.md +++ b/docs/mvp-workplans-index.md @@ -16,6 +16,17 @@ CE-WP-0008 fixes capture field value persistence and viewport scroll reliability | `CE-WP-0007` | Capture view polish — scroll, linking, layout, rename, field UX | done | | `CE-WP-0008` | Capture content editing & viewport scroll reliability | done | +## Post-MVP — extraction and distribution + +| Workplan | Repo | Title | Status | +|----------|------|-------|--------| +| `CENG-WP-0001` | citation-engine | Extract engine from umbrella | done | +| `CE-WP-0009` | citation-evidence | Wire umbrella to `@citation-evidence/engine` | active | +| `CENG-WP-0002` | citation-engine | Package distribution (ADR-0002, publish prep) | active | + +`CE-WP-0009` depends on `CENG-WP-0001`. `CENG-WP-0002` can run in parallel; +publish tasks wait on ADR-0002 resolution. + ## Order CE-WP-0001..0004 are strictly sequential. CE-WP-0005 depends on 0004. diff --git a/workplans/CE-WP-0009-engine-workspace-wireup.md b/workplans/CE-WP-0009-engine-workspace-wireup.md new file mode 100644 index 0000000..e9b451d --- /dev/null +++ b/workplans/CE-WP-0009-engine-workspace-wireup.md @@ -0,0 +1,147 @@ +--- +id: CE-WP-0009 +type: workplan +title: "Wire umbrella to @citation-evidence/engine package" +domain: citation_evidence +repo: citation-evidence +repo_id: a677c189-b4e2-4f2a-9e48-faa482c277e6 +topic_slug: citation_evidence_mvp +topic_id: 96fa8e80-9f74-40f2-84cd-644e9747b9ec +status: active +owner: codex +created: "2026-06-22" +updated: "2026-06-22" +depends_on_workplan: CE-WP-0008 +planning_order: 9 +planning_priority: high +spec_refs: + - wiki/DependencyMap.md + - ../citation-engine/workplans/CENG-WP-0001-intent-placeholder.md +--- + +# CE-WP-0009 — Wire Umbrella to `@citation-evidence/engine` + +Replace the in-repo `src/shared/` and `src/engine/` copies with a dependency on +the extracted `citation-engine` package (`@citation-evidence/engine`). + +Prerequisite: `CENG-WP-0001` complete (engine extracted and tests green). + +This workplan does **not** publish the package — it uses a local `link:` (or +equivalent) dependency on the sibling checkout. Publishing is `CENG-WP-0002`. + +## Goals + +1. Single canonical source for shared types and engine services (`citation-engine`). +2. Umbrella tests and app behavior unchanged after wireup. +3. ESLint boundary rules still enforce the dependency map (subsystems may not + import each other's behavior; engine/shared come from the package). + +## Dependency order + +``` +T01 (add package dependency + resolve aliases) + └─ T02 (point tsconfig / vite / eslint at package) + └─ T03 (delete src/shared + src/engine) + └─ T04 (verification: test + lint + typecheck + manual smoke) +``` + +--- + +## T01 — Add `@citation-evidence/engine` dependency + +```task +id: CE-WP-0009-T01 +status: wait +priority: critical +depends_on: [] +``` + +Add a workspace-style local dependency on the sibling repo: + +```json +"dependencies": { + "@citation-evidence/engine": "link:../citation-engine" +} +``` + +Run `pnpm install` and confirm `node_modules/@citation-evidence/engine` resolves. + +Document the sibling-checkout requirement in `README.md` (engine repo must sit +next to umbrella, same layout as today). + +**Acceptance:** `pnpm why @citation-evidence/engine` shows the link target. + +--- + +## T02 — Retarget `@shared/*` and `@engine/*` aliases + +```task +id: CE-WP-0009-T02 +status: wait +priority: critical +depends_on: [T01] +``` + +Update tooling so existing `@shared/*` and `@engine/*` imports keep working +without rewriting every consumer file: + +- `tsconfig.json` paths → `node_modules/@citation-evidence/engine/src/shared/*` + and `.../src/engine/*` (or equivalent stable path through the link). +- `vite.config.ts` resolve aliases — same targets. +- `eslint.config.js` — remove `shared` and `engine` element patterns under + `src/`; treat the package as external for boundary lint (subsystems still + may only import `@shared` / `@engine`, not each other's folders). + +Do **not** change import statements in `anchor/`, `source/`, `binder/`, +`work/`, or `app/` unless an alias path breaks. + +**Acceptance:** `pnpm typecheck` passes before folder deletion. + +--- + +## T03 — Delete in-repo engine copies + +```task +id: CE-WP-0009-T03 +status: wait +priority: critical +depends_on: [T02] +``` + +Remove: + +- `src/shared/` (entire tree) +- `src/engine/` (entire tree) + +Update partition README pointers in remaining `src/*/` folders to reference +`@citation-evidence/engine` instead of "future home: citation-engine". + +**Acceptance:** `src/` contains only `anchor/`, `source/`, `binder/`, `work/`, +`app/` (plus any top-level app entry). No duplicate engine code in git. + +--- + +## T04 — Verification + +```task +id: CE-WP-0009-T04 +status: wait +priority: critical +depends_on: [T03] +``` + +- `pnpm test` — full suite green (integration + unit). +- `pnpm typecheck` — clean. +- `pnpm lint` — clean; boundary rules still catch illegal cross-partition imports. +- Manual smoke: dev server loads, PDF review → evidence → form link → export + citation card (PRD §20 path). + +**Acceptance:** CI-equivalent commands pass; no runtime import errors. + +--- + +## Out of scope + +- Publishing `@citation-evidence/engine` to a registry (`CENG-WP-0002`). +- Extracting `anchor/`, `source/`, `binder/`, or `work/` to sister repos. +- Resolving `ADR-0002` (recommended before publish, not required for `link:`). \ No newline at end of file