Repository navigation
fix(schema): regenerate schema and fail CI when stale - #157
Merged
Merged
Conversation
The committed schema dated from 2026-05-24 and named actions by Rust variant, so no manifest validated against it, and nothing checked it. - jsonschemagen/tests/schema_current.rs fails when schema.json differs from the generated schema; make test and CI run it. make schema regenerates it. - Regenerating exposed host-dependent output: schemars evaluates serde defaults, so command.run's dir embedded the generator's cwd and the user, group and package providers embedded the host OS (Linux, aptitude; homebrew on macOS). Those ten fields now drop the default from the schema via utilities::without_default. - jsonschemagen exits 1 instead of printing nothing on a serialize error. - Releases attach the schema as etch-schema.json. - Remove the 2022 Netlify hosting files under jsonschemagen/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
The published description said every host has a default; only Ubuntu (apt) and macOS (brew) do, and other hosts panic. Backlog the panic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
mutation-pr missed two mutants: cargo-mutants runs only etch-lib's tests for a lib mutation, so jsonschemagen's guards never saw without_default replaced with (); and nothing ran the jsonschemagen binary. Add lib-side tests for without_default and command.run's schema, and a test that the binary prints render()'s output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf
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.
Summary
jsonschemagen/schema.jsondated from 2026-05-24. It named actions by Rust variant (CommandRun), so no manifest validated against it, and nothing checked whether it was current. It is now regenerated: actions appear under their YAML names,zsh.oh-my-zshamong them.jsonschemagen/tests/schema_current.rsfails when the committed file differs from the generated schema. It runs undercargo nextest, somake test, CI and the release job all enforce it.make schemaregenerates the file, writing through a temp file so a failed run cannot truncate it.Regenerating exposed host-dependent output. schemars evaluates serde defaults while it builds the schema, so:
command.run'sdirembedded the generator's cwd (/home/bruce/...).providerfields embedded the host OS:Linuxandaptitudehere,homebrewon macOS.Those 10 fields now drop the default from the schema via
utilities::without_default. Serde behaviour is unchanged, and a doc comment now gives each field's schema description. The output is byte-identical whether it is generated from/, from/tmp, or with a differentHOME.jsonschemagenexits 1 on a serialize error. Before, it printed nothing and exited 0.Releases attach the schema as
etch-schema.json(unsigned; listed in the README).Removed the 2022 comtrya Netlify files (
jsonschemagen/.build/_redirects,jsonschemagen/.gitignore).New P3 backlog row:
PackageProviders::default()panics on hosts other than Ubuntu and macOS, somake testwould panic there too. No fleet host or CI runner is affected.Test Plan
Linux/aptitudedefaults).package/repository.rsturns the host-OS and currency tests red.mutation-prround 1 found two survivors (without_defaultreplaced with(), since onlyetch-libtests run for a lib mutant; andmainreplaced with()). Fixed in 5491583 with lib-side tests and a binary test. Localcargo mutants --in-diff: 4 of 4 caught.make schemafailure path, with cargo not on PATH: rc 2, no temp file left,schema.jsonuntouched.cfg(target_os)gate sits on a schema-visible type, so a macOS run generates the same file. This was checked by reading the code, not by running on macOS.make test: 1161 nextest passed, 167 pytest passed.jsonschemagenis excluded from tarpaulin.Code review
reviewed-sha: 5491583
diff-hash: 0705ba6d01acbef0bdc402979a0c31dd73c1ce6179946cc12269d294f7f41b7f
reviewers: 5/5
Four rounds. Round 1 (bf912ed): one finding, fixed in e087513 (package provider schema description claimed every host has a default; only Ubuntu and macOS do, others panic). Round 2 (e087513): one finding, fixed in 6db9214 (backlog row's suggested fix path was not implementable as written). Round 3 (0338187, README line listing etch-schema.json): no findings. Round 4 (5491583, tests killing the two mutants CI's mutation-pr found surviving): no findings. Steps 2-3 ran inline: root CLAUDE.md is the only one in scope.
RESOLVED: 2 fixed, 0 kept
Spec alignment
SKIP: no open plan has a spec: line (backlog fix, no plan)
🤖 Generated with Claude Code
https://claude.ai/code/session_01RMRWKLc4oBDsXjYryqoNxf