Commit a6d8358
feat(schema): bump schemars to 1.x; round-trip + Draft-2020-12 tests (#5)
Chunk M1-W1-C of M1 plan — closes Plan §6.1.
Workspace dep:
- schemars 0.8 → 1 (latest 1.2.1; MSRV 1.74 stays well below our 1.85
pin). 1.x emits Draft 2020-12 by default; the existing JsonSchema
derives compile unchanged.
pearlite-schema dev-dep:
- serde_json (workspace dep, used only in tests).
Two acceptance tests in lib.rs::cross_cutting_tests:
- schemars_output_is_draft_2020_12 — generates the JSON Schema for
DeclaredState and asserts the $schema field claims Draft 2020-12.
This is the Plan §6.1 "schema: schemars_output_is_2020_12" gate.
- declared_state_round_trips_through_toml — parses host_full.toml,
serializes it back, re-parses, and asserts equality. This is the
"round-trip: declared_state_serde — every field round-trips through
TOML" gate.
Plan §6.1 "Done when" status now:
- Public types derive Serialize, Deserialize, JsonSchema, Debug,
Clone (+Eq/PartialEq/Hash/Default where applicable). ✓
- cargo doc --no-deps emits zero "missing docs" warnings. ✓
- A representative resolved.toml fixture round-trips without loss. ✓
- schemars output validates as Draft 2020-12. ✓
- Zero unwrap()/expect()/panic! in production code paths. ✓ (lints
enforce workspace-wide).
- pearlite-audit reports no §13 violations. ✓
What's NOT in this chunk (deferred per Plan §6.1):
- Property tests with proptest — Plan §6.1 doesn't list any property
test for pearlite-schema (proptest gates apply to pearlite-state §6.2
and pearlite-diff §6.3).
Verification:
- cargo test -p pearlite-schema (14 passed; 0 failed)
- cargo doc -p pearlite-schema --no-deps (zero warnings)
- cargo clippy --workspace --all-targets -- -D warnings (zero warnings)
- cargo fmt --all --check
- scripts/ci/check-spdx.sh
- pearlite-audit check . (1 check, 0 violations)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9b9c8e0 commit a6d8358
4 files changed
Lines changed: 68 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments