Files
citation-engine/workplans/CENG-WP-0002-package-distribution.md
tegwick ed64f0c57d Normalize agent instructions and workplan frontmatter (STATE-WP-0067)
- Align agent files with on-disk workplan prefixes (infer from workplan ids)
- Set workplan domain to registered domain_slug; add topic_slug where applicable
- Repair frontmatter delimiter formatting; migrate legacy task status literals
- Regenerate AGENTS.md, CLAUDE.md, and .claude/rules from State Hub templates
2026-06-22 23:16:24 +02:00

161 lines
4.9 KiB
Markdown

---
id: CENG-WP-0002
type: workplan
title: "Package distribution — ADR-0002, publish readiness, contract sync"
domain: infotech
repo: citation-engine
status: done
owner: codex
topic_slug: citation_evidence_mvp
created: "2026-06-22"
updated: "2026-06-22"
planning_order: 2
planning_priority: high
depends_on_workplan: CENG-WP-0001
topic_id: 96fa8e80-9f74-40f2-84cd-644e9747b9ec
spec_refs:
- ../citation-evidence/docs/decisions/ADR-0002-monorepo-vs-polyrepo.md
- ../citation-evidence/wiki/SharedContracts.md
- ../citation-evidence/wiki/DependencyMap.md
state_hub_workstream_id: "c1141068-d969-4367-bd6f-d159efb8332d"
---
# CENG-WP-0002 — Package Distribution
Make `@citation-evidence/engine` consumable beyond a sibling `link:` checkout:
resolve the monorepo-vs-polyrepo decision, document the install story for sister
repos, and prepare optional registry publish.
Prerequisite: `CENG-WP-0001` complete. `CE-WP-0009` (umbrella wireup) can
proceed in parallel using `link:`; publish tasks here depend on T01.
## Dependency order
```
T01 (resolve ADR-0002)
└─ T02 (consumer install docs + export surface)
└─ T03 (SharedContracts sync runbook)
└─ T04 (publish readiness — optional until registry chosen)
```
---
## T01 — Resolve ADR-0002
```task
id: CENG-WP-0002-T01
status: done
priority: critical
depends_on: []
state_hub_task_id: "ed44ca36-d834-4fe7-8a02-82e5a921b95d"
```
Fill in `citation-evidence/docs/decisions/ADR-0002-monorepo-vs-polyrepo.md`:
- **Decision** — pick A, B, or C for the citation-evidence ecosystem.
- **Recommended default** (if no strong preference): **B — six independent repos
with published packages**, using `link:../citation-engine` during local dev
until a registry is configured.
- **Consequences** — how sister repos install engine, how versions bump, how
`SharedContracts.md` stays authoritative.
Stop and ask the repo owner if the choice is genuinely ambiguous.
**Acceptance:** ADR status moves from `proposed` to `accepted`; decision and
consequences sections are filled.
---
## T02 — Consumer install docs and export surface
```task
id: CENG-WP-0002-T02
status: done
priority: high
depends_on: [T01]
state_hub_task_id: "5726bfff-e3ff-4942-a5d8-3a69107695e7"
```
Document in `citation-engine/README.md`:
- **Local dev** — `link:../citation-engine` (sibling checkout layout).
- **Post-publish** — `pnpm add @citation-evidence/engine` (registry TBD).
Review and stabilize `package.json` `exports`:
```json
{
".": "./src/engine/index.ts",
"./shared": "./src/shared/index.ts"
}
```
Confirm TypeScript consumers can resolve both entry points without deep imports
into `src/`. Add `types` conditions or subpath exports only if a consumer
repo hits resolution errors during `CE-WP-0009`.
**Acceptance:** README has copy-paste install snippets for umbrella and one
sister repo placeholder (`evidence-anchor`).
---
## T03 — SharedContracts sync runbook
```task
id: CENG-WP-0002-T03
status: done
priority: high
depends_on: [T01]
state_hub_task_id: "deb05231-751a-4b3b-812a-62ad3016724a"
```
`citation-evidence/wiki/SharedContracts.md` remains the **authoritative**
contract. `citation-engine/wiki/SharedContracts.md` is a conformance copy for
enum tests (`evidence-link.test.ts`).
Write a short runbook (in `citation-engine/README.md` or `wiki/README.md`):
1. Contract change lands in umbrella `wiki/SharedContracts.md`.
2. Copy/sync to `citation-engine/wiki/SharedContracts.md`.
3. Update runtime enums/types in `src/shared/` if needed.
4. Run `pnpm test` in both repos.
**Acceptance:** runbook exists; `evidence-link.test.ts` path to local
`wiki/SharedContracts.md` is documented.
---
## T04 — Publish readiness (deferred until registry exists)
```task
id: CENG-WP-0002-T04
status: done
priority: low
depends_on: [T01, T02]
state_hub_task_id: "9087896a-7779-42e0-8844-aaa8de1016e9"
```
Prepare for first registry publish when a host is chosen (npm, GitHub Packages,
private Verdaccio, etc.):
- Decide `private: false` vs scoped private package.
- Add `files` whitelist (`src/`, `wiki/`, `README.md`, `LICENSE`).
- Optional: `tsc` emit to `dist/` if consumers cannot consume TypeScript
sources directly (decide based on ADR-0002 choice and first consumer).
- Versioning policy: semver from `0.1.0`; breaking contract changes bump minor
or major per `SharedContracts.md` § change process.
- CI publish step stub (document only — no registry credentials in repo).
**Acceptance:** a "Publishing checklist" section in README; package is
structurally publishable even if no publish has occurred yet.
---
## Relationship to other workplans
| Workplan | Role |
|----------|------|
| `CENG-WP-0001` | Extraction — **done** |
| `CE-WP-0009` | Umbrella consumes engine via `link:`**done** |
| `CENG-WP-0002` | Distribution strategy and publish prep — this file |
| Future `EANCH-WP-0002`, etc. | Sister-repo extractions depend on engine install story from T02 |