Skip to content

fix(config): accept any 1.x .wind schemaVersion, validate major in code - #203

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/schema-version-minors-140
Jun 26, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/schema-version-minors-140

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #140.

The .wind schemaVersion was pinned to const "1.0", which would reject every future minor — the opposite of additive evolution.

What

  • schemaVersion is now a native field on WindDefinition (fiberpath/config/schemas.py) with default="1.0" and pattern=r"^1\.\d+$". So at load: absent → treated as legacy 1.0, any 1.x minor accepted, incompatible major (2.0+) rejected. The model is the single source of truth — runtime validation lives here and applies wherever a WindDefinition is parsed (CLI load and API bodies alike).
  • scripts/generate_schema.py no longer injects a manual const "1.0" (the model provides schemaVersion natively); its summary line now reports the model-driven default.
  • The GUI's .wind validator (fiberpath_gui/src/lib/schemas.ts) is relaxed from z.literal("1.0") to the same ^1\.\d+$ pattern.

The "required from 1.1+" sub-task is intentionally not implemented: no 1.1 exists yet, and requiring the field now would reject every current (absent-field) file, contradicting the back-compat default.

Deliberately out of scope (handed to #141)

The committed fiberpath_gui/schemas/wind-schema.json is not regenerated here. It is independently stale — it has no schemaVersion property and a hand-set old-org $id, and (as the review surfaced) it is actually the output of an orphaned scripts/export_schema.py, not the generate_schema.py that npm run schema:generate wires up. Reconciling those two generators and choosing the canonical $id belongs to the open-format groundwork in #141. Leaving the artifact untouched is non-regressive: the GUI's ajv loads it with strict:false and no additionalProperties, so it does not currently constrain schemaVersion at all.

Review gate

Reviewed by an independent adversarial review subagent (verdict: SHIP-WITH-NITS, no blocking). Pattern edge-cases probed (1.0/1.10 accept; 1.0.0/10.0/1./1 reject), absent→default confirmed, ajv non-regression confirmed, no pre-commit/CI schema-gen trap. Both nits addressed (stale print fixed; the two-generators finding handed to #141).

Verification

  • ruff clean · mypy clean · full Python suite 132 passed · all 7 example .wind files load.
  • GUI: tsc --noEmit clean · vitest schemas/validation 62 passed.

Make schemaVersion a native field on WindDefinition with a default of
"1.0" and pattern ^1\.\d+$, so:
- an absent value is treated as the legacy 1.0,
- any 1.x minor is accepted (additive evolution),
- an incompatible major (2.0+) is rejected at load.

The model is now the single source of truth: the schema generator no
longer injects a const "1.0", and the GUI's .wind validator is relaxed
from z.literal("1.0") to the same 1.x pattern.

The generated wind-schema.json artifact is intentionally NOT regenerated
here: it is independently stale (no schemaVersion property, a manually
maintained old-org $id, no regen CI gate), so faithfully regenerating it
— including the canonical $id decision — belongs with the open-format
groundwork in #141.

Closes #140.
@CameronBrooks11
CameronBrooks11 force-pushed the fix/schema-version-minors-140 branch from 2cb65d7 to ff61393 Compare June 26, 2026 04:05
@CameronBrooks11
CameronBrooks11 merged commit e40623f into main Jun 26, 2026
18 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/schema-version-minors-140 branch June 26, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix schemaVersion schema constraint (const 1.0 rejects future minors)

1 participant