Repository navigation
build: canonical $id for the .wind schema + drift gate - #210
Merged
Merged
Conversation
- generate_schema.py adds a canonical versioned $id (https://fiberpath.org/schemas/wind/1.0/wind.schema.json) and writes the artifact deterministically (sorted keys, trailing newline). It keeps pydantic's "WindDefinition" title so the generated TS root type name stays stable for the GUI. - Remove the orphaned second generator (scripts/export_schema.py); the committed wind-schema.json was its stale output. generate_schema.py is now the single source. - Regenerate fiberpath_gui/schemas/wind-schema.json and the TS types (normalising the old CRLF .ts to LF). - Add a CI drift gate (split by toolchain like the OpenAPI gate): the backend job regenerates wind-schema.json and the GUI job regenerates the TS types, each failing on git diff. Addresses the generator-cleanup / versioned-$id / drift-gate part of #141 (the normative SPEC + conformance corpus remain).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the generator-cleanup / versioned-
$id/ drift-gate part of #141 (the normative SPEC + conformance corpus remain open under #141). The input-schema analog of the OpenAPI drift gate (#191).What
generate_schema.pyadds the canonical versioned$id(https://fiberpath.org/schemas/wind/1.0/wind.schema.json) and writeswind-schema.jsondeterministically (sorted keys + trailing newline). It keeps pydantic'sWindDefinitiontitle so the generated TS root type name stays stable.scripts/export_schema.py— the committedwind-schema.jsonwas its stale output, and it was the source of the long-standing drift.generate_schema.pyis now the single source.wind-schema.json+src/types/wind-schema.ts(the latter normalised CRLF→LF).wind-schema.jsonand the GUI job regenerateswind-schema.ts, each failing ongit diff.Fixed along the way
Overriding the schema
titleto "FiberPath Wind Definition" (the oldgenerate_schema.pybehaviour) renamed the generated TS root type and broke 4 importers — which is exactly why the artifact was never regenerated with this script. Dropping the override keepsWindDefinition; the$idcarries the format identity.Review
Independent adversarial review: SHIP (no blocking). It proved the gate catches drift both halves (model change → backend gate red; hand-edited
wind-schema.json→ GUI gate red), confirmed type-name preservation, and thatexport_schema.pyhas zero remaining references. Determinism risk rated LOW (same as the OpenAPI gate;uv.lockpins pydantic,package-lockpins json-schema-to-typescript).Verification
ruffclean · backendpytest112 passed · GUItscclean ·vitest625 passed · ajv validation tests pass · drift gate clean on regen, red on injected drift.