Skip to content

fix(tooling): generate:check no longer leaves the spec snapshot dirty#15

Merged
ph33nx merged 2 commits into
mainfrom
fix/generate-check-clean-tree
Jun 15, 2026
Merged

fix(tooling): generate:check no longer leaves the spec snapshot dirty#15
ph33nx merged 2 commits into
mainfrom
fix/generate-check-clean-tree

Conversation

@ph33nx

@ph33nx ph33nx commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem

bin/generate.mjs always rewrites specs/openapi.json from the live spec (the drift baseline). generate:check (run by the lefthook pre-push openapi-drift-check hook) only git diff --exit-codes src/Generated/blocks/generated, never the snapshot. So when the live spec drifts (e.g. a description update) without a release since, every generate leaves specs/openapi.json modified silently. A dirty tree then blocks git checkout, which aborted a post-merge branch switch.

Fix

generate:check restores specs/openapi.json after regenerating, before gating on the generated code. The snapshot is still updated intentionally by npm run generate and reconciled at release; the generated-code drift gate is unchanged. The working tree stays clean after a check/push.

Verified: dirtied the snapshot, ran generate:check, snapshot restored clean while the generated-code gate still ran (exit 0).

@ph33nx ph33nx merged commit 3bd9aea into main Jun 15, 2026
13 checks passed
@ph33nx ph33nx deleted the fix/generate-check-clean-tree branch June 15, 2026 09:57
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