forked from bai/curriculum-project-hub
752a5c661d
Declarative JSON Schema per kind (segment/example/lemma/sop), embedded as real .json artifacts (ADR-0006) and validated by a small hand-rolled interpreter (properties/required/type/enum/additionalProperties + the `x-cph-content` marker) — no jsonschema-crate churn for a one-optional-string scalar surface. `x-cph-content: true` marks content fields (not in element.toml; require sibling <field>.typ); everything else is an element.toml scalar. `validate(desc)` is self-contained: UnknownKind for unknown kinds, MissingContentFile (path named in message) for absent required .typ, SchemaViolation for bad scalars; lemma proof optional ⇒ no diagnostic when absent. 8 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 lines
279 B
TOML
15 lines
279 B
TOML
[package]
|
|
name = "cph-schema"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[dependencies]
|
|
cph-diag = { workspace = true }
|
|
cph-model = { workspace = true }
|
|
serde_json = "1"
|
|
toml = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
toml = { workspace = true }
|