generated from coulomb/repo-seed
Add link: dependency on citation-engine, retarget @shared/@engine aliases, remove in-repo shared/engine copies. ADR-0002 accepted (option B). 172 tests, typecheck, and lint pass.
147 lines
4.1 KiB
Markdown
147 lines
4.1 KiB
Markdown
---
|
|
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: done
|
|
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: done
|
|
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: done
|
|
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: done
|
|
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: done
|
|
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:`). |