Commit 0200969
feat: schema system rewrite — ruamel.yaml, Pydantic validation, CI enforcement
Core improvements:
- generate_schema.py: migrate comment extraction from hand-rolled 200-line
regex scanner to ruamel.yaml (preserves comments natively via CommentToken)
- extract_unit(): add = guard to reject parentheticals like (lower = less CPU)
- config_validator.py (new): thin Pydantic validation for Safety.GlobalLimits
and VideoSource at startup — non-blocking, logs WARNING only
- parameters.py: call validate_safety_config() after config load
- schemaAnalyzer.js: fix minimum/maximum → min/max naming drift bug
(SmartValueEditor now shows bounds for nested object/array fields)
CI & docs:
- .pre-commit-config.yaml (new): schema-sync-check hook regenerates schema
on config_default.yaml changes and blocks commit if out of sync
- scripts/check_schema.sh (new): standalone CI sync-check script
- scripts/SCHEMA_COMMENT_CONVENTIONS.md (new): structured comment patterns doc
Tests:
- test_generate_schema.py: +11 new tests for extract_unit(), parse_config_with_comments(),
and validate_safety_config() — 25 tests total, all pass
Results: 1558 passed, 49 skipped, 0 failed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 905e1a5 commit 0200969
File tree
9 files changed
+1848
-644
lines changed- configs
- dashboard/src/utils
- scripts
- src/classes
- tests/unit
9 files changed
+1848
-644
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments