Implement CENG-WP-0002: package distribution and publish readiness

Resolve ADR-0002 in umbrella, add install docs, contract sync runbook,
publishing checklist, and package files whitelist.
This commit is contained in:
2026-06-22 19:45:11 +02:00
parent a9e3b76a38
commit 697bc90780
5 changed files with 110 additions and 14 deletions

View File

@@ -324,8 +324,8 @@ The umbrella-first MVP (CE-WP-0001..0008) stabilized the engine API. Code now
lives in this repository under `src/shared/` and `src/engine/`, extracted from lives in this repository under `src/shared/` and `src/engine/`, extracted from
`citation-evidence` per `workplans/CENG-WP-0001-intent-placeholder.md`. `citation-evidence` per `workplans/CENG-WP-0001-intent-placeholder.md`.
The umbrella repo still carries a copy during the transition to a workspace The umbrella consumes this package via `link:../citation-engine` per `CE-WP-0009`.
dependency. This repository is the canonical home going forward. This repository is the canonical home going forward.
**Shared contracts** (vocabulary, state enums, relation types, selector **Shared contracts** (vocabulary, state enums, relation types, selector
taxonomy, event types, viewer adapter, canonical text normalization, allowed taxonomy, event types, viewer adapter, canonical text normalization, allowed

View File

@@ -7,6 +7,8 @@ This package provides the shared vocabulary (`Document`, `Selector`, `Annotation
canonical text normalization) together with in-memory repositories, orchestration canonical text normalization) together with in-memory repositories, orchestration
services, the event bus, and citation card renderers. services, the event bus, and citation card renderers.
Published as **`@citation-evidence/engine`**.
## Layout ## Layout
``` ```
@@ -14,9 +16,58 @@ src/
shared/ # types, enums, pure helpers shared/ # types, enums, pure helpers
engine/ # services, repositories, rendering, persistence engine/ # services, repositories, rendering, persistence
wiki/ wiki/
SharedContracts.md # conformance reference (enum lists, normalization rules) 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`:
```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)
```bash
pnpm add @citation-evidence/engine
```
Registry host TBD. See [Publishing checklist](#publishing-checklist) below.
### evidence-anchor (placeholder)
When `evidence-anchor` extracts, it will depend on engine types only:
```json
{
"dependencies": {
"@citation-evidence/engine": "link:../citation-engine"
}
}
```
Import shared types via `@shared/*` path aliases or `@citation-evidence/engine/shared`.
## Development ## Development
```bash ```bash
@@ -26,14 +77,31 @@ pnpm typecheck
pnpm lint pnpm lint
``` ```
## Contract sync
See [`wiki/README.md`](wiki/README.md). Changes to shared contracts land in
`citation-evidence/wiki/SharedContracts.md` first, then sync here.
## Extraction status ## Extraction status
Code was extracted from `citation-evidence/src/shared/` and `citation-evidence/src/engine/` Code lives in `src/shared/` and `src/engine/`, extracted from the umbrella
after the umbrella MVP (CE-WP-0001..0008) stabilized. The umbrella repo still carries MVP per `workplans/CENG-WP-0001-intent-placeholder.md`. The umbrella consumes
a copy during the transition; this repository is the canonical home going forward. this package via `link:` per `CE-WP-0009`.
Contract changes belong in `citation-evidence/wiki/SharedContracts.md` first, then ## Publishing checklist
sync to `wiki/SharedContracts.md` here.
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.
## Related repos ## Related repos

View File

@@ -9,6 +9,12 @@
"engines": { "engines": {
"node": ">=20.10.0" "node": ">=20.10.0"
}, },
"files": [
"src",
"wiki",
"README.md",
"LICENSE"
],
"exports": { "exports": {
".": "./src/engine/index.ts", ".": "./src/engine/index.ts",
"./shared": "./src/shared/index.ts" "./shared": "./src/shared/index.ts"

22
wiki/README.md Normal file
View File

@@ -0,0 +1,22 @@
# Wiki — citation-engine
## SharedContracts sync
`SharedContracts.md` in this directory is a **conformance copy** for tests
(e.g. `evidence-link.test.ts` enum parity checks). It is not authoritative.
**Authoritative source:** `citation-evidence/wiki/SharedContracts.md`
### When contracts change
1. Land the change in `citation-evidence/wiki/SharedContracts.md` (and any
runtime types in `citation-engine/src/shared/` if enums or shapes change).
2. Copy/sync to `citation-engine/wiki/SharedContracts.md`.
3. Run `pnpm test` in **both** repos.
4. Bump `@citation-evidence/engine` version if the change is breaking for
consumers.
### Test reference path
`src/shared/evidence-link.test.ts` reads `wiki/SharedContracts.md` relative
to `src/shared/` (`../../wiki/SharedContracts.md`).

View File

@@ -4,7 +4,7 @@ type: workplan
title: "Package distribution — ADR-0002, publish readiness, contract sync" title: "Package distribution — ADR-0002, publish readiness, contract sync"
domain: citation_evidence domain: citation_evidence
repo: citation-engine repo: citation-engine
status: active status: done
owner: codex owner: codex
topic_slug: citation_evidence_mvp topic_slug: citation_evidence_mvp
created: "2026-06-22" created: "2026-06-22"
@@ -41,7 +41,7 @@ T01 (resolve ADR-0002)
```task ```task
id: CENG-WP-0002-T01 id: CENG-WP-0002-T01
status: wait status: done
priority: critical priority: critical
depends_on: [] depends_on: []
``` ```
@@ -66,7 +66,7 @@ consequences sections are filled.
```task ```task
id: CENG-WP-0002-T02 id: CENG-WP-0002-T02
status: wait status: done
priority: high priority: high
depends_on: [T01] depends_on: [T01]
``` ```
@@ -98,7 +98,7 @@ sister repo placeholder (`evidence-anchor`).
```task ```task
id: CENG-WP-0002-T03 id: CENG-WP-0002-T03
status: wait status: done
priority: high priority: high
depends_on: [T01] depends_on: [T01]
``` ```
@@ -123,7 +123,7 @@ Write a short runbook (in `citation-engine/README.md` or `wiki/README.md`):
```task ```task
id: CENG-WP-0002-T04 id: CENG-WP-0002-T04
status: wait status: done
priority: low priority: low
depends_on: [T01, T02] depends_on: [T01, T02]
``` ```
@@ -149,6 +149,6 @@ structurally publishable even if no publish has occurred yet.
| Workplan | Role | | Workplan | Role |
|----------|------| |----------|------|
| `CENG-WP-0001` | Extraction — **done** | | `CENG-WP-0001` | Extraction — **done** |
| `CE-WP-0009` | Umbrella consumes engine via `link:`can start now | | `CE-WP-0009` | Umbrella consumes engine via `link:`**done** |
| `CENG-WP-0002` | Distribution strategy and publish prep — this file | | `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 | | Future `EANCH-WP-0002`, etc. | Sister-repo extractions depend on engine install story from T02 |