forked from bai/curriculum-project-hub
3f9b60f692
The spec/ Lean semantic master had no conformance gate, no codegen, and no CI tie to implementations — alignment was carried entirely by human review, the same mechanism that carries the ADRs. In practice the ADRs plus greppable code comments were already the load-bearing artifacts, so spec/ was the most expensive kind of stale documentation. - delete spec/ and the spec-check CI workflow - README: constitution rewritten around ADRs as decision truth - AGENTS.md/CLAUDE.md: discipline re-anchored (new decisions -> new ADR, never rewrite ADR history; supersede instead) - code comments: re-anchor 'Mirrors Spec.X' invariants to ADR numbers (cph-diag, cph-check, cph-model, hub runner/capacity/org, prisma) - leave ADR bodies and .scratch audit snapshots untouched (history); fix live references in open readiness tickets
36 lines
1.6 KiB
Markdown
36 lines
1.6 KiB
Markdown
# crates/
|
|
|
|
These crates implement the rule-based lesson checker whose semantics are
|
|
pinned by the ADRs in `docs/adr/`: it reads an engineering-file (one lesson,
|
|
ADR-0005)
|
|
laid out per ADR-0008 (declarative `manifest.toml` + per-element
|
|
`element.toml`), validates structure and content, and emits diagnostics.
|
|
`cph-diag` (the shared diagnostic vocabulary), `cph-model` (the ADR-0008 loader),
|
|
and `cph-typst` (the typst `World` / compile / span-mapping layer) are
|
|
deliberately reusable by future components such as an `exporter`, which is why
|
|
they live in this repo-wide `crates/` directory rather than under any single
|
|
component; `cph-schema` (kind JSON Schemas + validation), `cph-check`
|
|
(orchestration + render-coverage) and `cph-cli` (the `cph` command-line
|
|
entrypoint) are the checker proper.
|
|
|
|
## Crate map
|
|
|
|
| crate | owner | role |
|
|
|---------------|-------|------|
|
|
| `cph-diag` | WU-1 | shared diagnostic vocabulary (`Severity`, `DiagCode`, `Diagnostic`, `SourceSpan`) — reusable |
|
|
| `cph-model` | WU-1 | parses the ADR-0008 layout into an in-memory ordered `Lesson` — reusable |
|
|
| `cph-schema` | WU-3 | the 4 stdlib kind JSON Schemas + structural validation |
|
|
| `cph-typst` | WU-4 | typst `World`, driver generation, compile, PDF, span mapping — reusable |
|
|
| `cph-check` | WU-5 | orchestration: render-coverage and the full check pipeline |
|
|
| `cph-cli` | WU-5 | the `cph` command-line entrypoint |
|
|
|
|
## Build
|
|
|
|
```sh
|
|
# from the repository root (the cargo workspace root)
|
|
cargo build # all crates
|
|
cargo test # cph-diag + cph-model unit/integration tests
|
|
cargo clippy --all-targets -- -D warnings
|
|
cargo fmt --check
|
|
```
|