GSoC'26_Week14 : Schema, AJV & the Final Stretch
说明与用途
作者在 CircuitVerse 中实现了两步验证 Canonical v1 项目文件:先使用 AJV 进行结构验证,然后进行交叉引用检查,确保内部一致性。
问题
Ensuring that Canonical v1 project files are structurally valid and internally consistent before importing into CircuitVerse.
结果
The project now validates Canonical v1 files both structurally and semantically, preventing invalid imports and improving user experience.
工作流
- Generate initial JSON Schema from TypeScript types using ts-json-schema-generator
- Refine schema: split reusable definitions, enforce stricter rules for IDs, names, types, ranges, and metadata
- Create PR #1236 to add Canonical v1 schema to the project
- Implement AJV validation to check JSON structure against the schema
- Add cross‑reference validation pass to check references between circuits, components, nets, and routing data
- Include JSON paths in validation errors for precise error localization
- Ensure importCanonical() accepts unknown data and only mutates after successful validation
- Make layout optional to allow auto‑generation by ELK Auto Layout
- Normalize legacy timePeriod values
- Create PR #1242 to add runtime validation to the codebase
证据
I spent the rest of the time reshaping it to match how Canonical v1 actually works.
I added a second cross‑reference validation pass.
- 记录日期: 2026-09-10T07:00:33.367Z