Gate commits behind check.sh + document release pipeline#82
Merged
Conversation
DX improvements mined from recent sessions: - Add a PreToolUse(Bash) hook that blocks `git commit` unless ./scripts/check.sh passed for the current working tree. check.sh now records a tree signature (scripts/gate_marker.py) into .git/aai-gate-pass on success; the hook (.claude/hooks/require-gate-before-commit.sh) re-verifies it. The signature is staging-invariant but edit-sensitive, so any change after the gate re-requires a green run. Escape hatch for deliberate WIP commits: AAI_ALLOW_COMMIT=1. - Document the tag-triggered release/Homebrew-bottle pipeline in AGENTS.md (release.yml, cut_release.sh, bump_minor.sh, update_check.py) — it was committed in #69/#70 but undocumented. gate_marker.py is stdlib-only (runs from the hook and from check.sh without uv); both new shell paths are added to check.sh's shellcheck list. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
DX improvements surfaced by mining recent agent sessions for friction:
.claude/hooks/require-gate-before-commit.sh) blocksgit commitunless./scripts/check.shpassed for the current working tree. On successcheck.shrecords a sha256 tree signature viascripts/gate_marker.py recordinto.git/aai-gate-pass; the hook runsgate_marker.py checkand exits 2 (with guidance) unless it still matches. The signature is staging-invariant (agit addbetween gate and commit is fine) but edit-sensitive (any later edit re-requires the gate). Escape hatch for intentional WIP commits: prefixAAI_ALLOW_COMMIT=1 git commit …. Fails open outside this repo / if the marker tool is missing.release.yml→ arm64 Homebrew bottle flow, why bottling matters (Rust-backed sdists), thebump_minor.sh→cut_release.sh(main-only) helpers, andupdate_check.py. This infra landed in Ship a prebuilt Homebrew bottle on release; drop install.sh #69/Bottle v0.1.0 #70 but was undocumented.scripts/gate_marker.pyis stdlib-only so it runs from the hook and fromcheck.shwithoutuv; directories (git collapses fully-untracked dirs to one entry) are fingerprinted by stat-walk to avoid reading scratch trees.Test plan
./scripts/check.sh→ All checks passed. (ruff, shellcheck, full pytest, build all green; the new files add no covered lines so diff-cover/mutation are no-ops).git add -A &&); edit after marker → re-blocked; staging a file present at record time → still allowed; untracked-dir regression fixed;AAI_ALLOW_COMMIT=1bypasses.🤖 Generated with Claude Code