Skip to content

fix(control-plane): green the example validation (validator crash + schema contradiction + broken JSON)#196

Merged
mdheller merged 1 commit into
mainfrom
fix/control-plane-v2-validation-green
Jul 5, 2026
Merged

fix(control-plane): green the example validation (validator crash + schema contradiction + broken JSON)#196
mdheller merged 1 commit into
mainfrom
fix/control-plane-v2-validation-green

Conversation

@mdheller

@mdheller mdheller commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The control-plane contract check — surfaced via the "Validate OpsHistory contracts" CI job, which runs the whole make validate aggregate — has been red on main for ~2 months, independent of the cockpit contract pack (#195). This fixes it with a minimal, 4-file change.

Three distinct defects

  1. Validator crashtools/validate_control_plane_examples.py called Path.with_name("./release-set.schema.json"), which raises ValueError (with_name rejects names containing /). The correct (schema_path.parent / legacy_ref).resolve() already sat on the next line; removed the dead/crashing one.

  2. Contradictory schemas for one example (the core breakage). examples/release_set.json and examples/fingerprint.json are validated by both validators:

    • validate-control-plane-examples → the control-plane wrappers, which allOf-delegated to the legacy snake_case schemas (release_set_id, created_at, …)
    • validate-nlboot-examples → the canonical v2 camelCase schemas (id/type/specVersion, createdAt, …)

    Both are additionalProperties: false with mutually exclusive key sets, so no single document can satisfy both — unfixable at the example level. Repointed the two shared wrappers (schemas/control-plane/ReleaseSet.json, Fingerprint.json) to delegate to the canonical v2 contracts (../ReleaseSet.json, ../Fingerprint.json) — matching the wrappers' stated purpose of "providing a stable srcos namespace." BootReleaseSet/EnrollmentToken keep their legacy snake schemas (only the control-plane validator checks them; no v2 equivalent).

  3. Invalid JSONexamples/boot_release_set.json was a botched merge (from a2b9dc9 into work/boot-provisioning-examples): two object bodies concatenated (missing comma after the first block's notes, duplicate status/artifacts/created_at/notes). Reconstructed as the single valid union its rich schema requires (identity fields + the fuller recovery body).

Result

make validate now passes end-to-end — control-plane, nlboot, and all other families:

OK: validate

Note: this is the control-plane / boot-provisioning lane. The boot JSON repair reconstructs the intended union of that workstream's merge; worth a glance from its owner to confirm the reconstructed boot_release_set.json matches intent.

🤖 Generated with Claude Code

…chema contradiction + broken JSON)

The control-plane contract check (surfaced via the 'OpsHistory contracts' CI job
that runs the whole `make validate`) has been red on main for ~2 months. Three
distinct defects, all fixed here:

1. Validator crash: tools/validate_control_plane_examples.py called
   Path.with_name('./release-set.schema.json'), which raises ValueError because
   with_name rejects names containing '/'. Removed the dead line; the correct
   (schema_path.parent / legacy_ref).resolve() already sat right below it.

2. Contradictory schemas for one example: release_set.json and fingerprint.json
   are validated by BOTH validate-control-plane-examples (via the control-plane
   wrappers, which allOf-delegated to the legacy snake_case schemas) AND
   validate-nlboot-examples (against the canonical v2 camelCase schemas). No single
   document can satisfy both, so it was unfixable at the example level. Repointed the
   two shared control-plane wrappers (ReleaseSet, Fingerprint) to delegate to the
   canonical v2 contracts (../ReleaseSet.json, ../Fingerprint.json) — matching the
   wrappers' stated purpose of providing a stable srcos namespace over the canonical
   schema. BootReleaseSet/EnrollmentToken keep their legacy snake schemas (only the
   control-plane validator checks them; no v2 equivalent).

3. Invalid JSON: examples/boot_release_set.json was a botched merge — two object
   bodies concatenated (missing comma after the first block's notes, duplicate
   status/artifacts/created_at/notes keys). Reconstructed as the single valid union
   its schema requires (identity fields + the richer recovery body).

`make validate` now passes end-to-end (control-plane + nlboot + all families).
@mdheller mdheller merged commit bc44387 into main Jul 5, 2026
3 checks passed
@mdheller mdheller deleted the fix/control-plane-v2-validation-green branch July 5, 2026 00:58
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.

1 participant