Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

GSoC'26_Week14 : Schema, AJV & the Final Stretch

Description and use

The author implemented a two‑step validation for Canonical v1 project files in CircuitVerse: first structural validation with AJV, then cross‑reference checks to ensure internal consistency.

Problem

Ensuring that Canonical v1 project files are structurally valid and internally consistent before importing into CircuitVerse.

Outcome

The project now validates Canonical v1 files both structurally and semantically, preventing invalid imports and improving user experience.

Workflow

  • 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

Evidence

I spent the rest of the time reshaping it to match how Canonical v1 actually works.

Source

I added a second cross‑reference validation pass.

Source

  • Record date: 2026-09-10T07:00:33.367Z