Repository navigation
rescue(citadel-20260904): rescue/wip-main-citadel-20260904 from citadels-macbook-pro-local - #4
Merged
Merged
Conversation
Generated files were hand-editable and nothing in the tree said they should
not be. This adds the policy, the local guard, and the check that actually
enforces it.
Each generated/ directory gets a README declaring one of three policies, and
the checker refuses to take that declaration on trust:
frozen committed and machine-owned. Files must be tracked; chmod a-w on
disk. A tree claiming this with nothing tracked is an error.
writable scaffolded once, now maintained by hand. Never chmod-ed.
ignored build output, deliberately absent from VCS. The files must really
be gitignored; still chmod a-w so a stray edit fails locally.
Three layers, in increasing order of authority:
chmod a-w your editor refuses the write. Local ergonomics only. Git
stores just the executable bit, so a clone comes back at mode
644 and the bit is gone; post-checkout and post-merge re-apply
it.
pre-commit refuses a commit touching a frozen file. Bypassable with
REGEN=1, which is the point: regenerating is legal, hand
editing is not.
CI scripts/check-generated-contract.py verifies the README
against what git actually does, that every frozen file is
read-only, and that JSON Schema still accepts the valid
fixtures and rejects the invalid ones. Plus regenerate-and-
diff where the repo declares how. This is the layer that
enforces the policy.
On JSON Schema: it is a cross-check, not the codegen input. The generated
types come from the primary IR (route map, .cli-flags.toml); the schema is an
independently derived description of the same contract, so disagreement means
one of them has drifted.
.gitattributes marks these trees linguist-generated to collapse PR diffs. No
merge driver is set on purpose: merge=ours would resolve conflicts by picking
a side, which is not how conflicts get resolved here.
Enable the hooks once per clone:
git config core.hooksPath .githooks
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AWgrvzGvJHfx7edBfbrgPG
…adels-macbook-pro-local (/sessions/rcw-01uvb83whqsjgbiyuwkbyiid/mnt/codes/zed-pkg-test/awkward-lib)
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.
Automated rescue of local-only work found on citadels-macbook-pro-local (sweep citadel-20260904). Source branch:
rescue/wip-main-citadel-20260904@ 6600788. Review, cherry-pick what is still wanted, then close.