You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reserve exact Git mutations until receive completion - #9
PR #9 carries forward the strongest Codex_Kernel enforcement idea without copying its implementation: bind governance to the exact incoming Git ref mutation, reserve that mutation while Git is in flight, and finalize authorization only after Git reports the ref update succeeded.
Protocol
pre-receive now:
validates registered pusher, repository binding, claims/handoffs, and any exact protected-operation approval;
creates/renews a durable reservation for (repository, refname, oldrev, newrev, agent, approval instance);
does not consume the approval;
commits the reservation before allowing Git to continue.
post-receive now:
verifies the resulting Git ref actually equals the reserved newrev (or is absent for deletion);
finds the exact reservation for the same registered pusher;
consumes any bound approval instance;
marks the mutation completed and audits completion in the same libSQL transaction.
Aborted receives leave the approval approved. An identical retry by the same agent/approval renews the reservation. Reservations are bounded leases so a receive that exits before completion cannot freeze governance permanently.
Governance freeze
Migration 003_git_mutations.sql adds engine-level triggers that block claim acquisition, claim release/renewal, and handoff creation/resolution on a branch while a non-expired Git mutation reservation is active. This closes the reviewed window where ownership could change after pre-receive validation but before Git committed the ref.
Hook installation
quorumgit hook install now installs both the existing hardened pre-receive gate and a post-receive completion hook. Existing unrelated post-receive hooks are preserved and installation fails closed rather than overwriting or silently chaining them.
retry of the exact rejected mutation -> same reservation reused and completed;
in-flight branch reservation -> claim release blocked until completion;
unrelated existing post-receive hook -> preserved and installation refused before touching pre-receive.
Scope boundary
PR #10 will enrich the exact mutation with changed paths/digests derived from incoming Git objects and enforce active claim scopes against those paths. PR #9 intentionally establishes the mutation lifecycle first.
Merge only after the full five-leg CI matrix passes.
Closing this in favour of #10, which fixes the same timing gap differently.
This PR uses up the approval in post-receive. By the time that hook runs, Git has already moved the ref. If recording the outcome fails at that point, the protected change has landed and nothing can undo it.
#10 checks the push again and uses up the approval in Git's reference-transaction hook, at the prepared stage. Git has locked the refs by then but can still cancel the update, so any failure stops the push. If Git cancels after that point, the approval becomes usable again. #10 also covers the enforcement of claim scopes on pushed files that this PR had planned as a follow-up.
The branch is left in place in case anything here is worth salvaging.
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
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
PR #9 carries forward the strongest Codex_Kernel enforcement idea without copying its implementation: bind governance to the exact incoming Git ref mutation, reserve that mutation while Git is in flight, and finalize authorization only after Git reports the ref update succeeded.
Protocol
pre-receivenow:(repository, refname, oldrev, newrev, agent, approval instance);post-receivenow:newrev(or is absent for deletion);Aborted receives leave the approval approved. An identical retry by the same agent/approval renews the reservation. Reservations are bounded leases so a receive that exits before completion cannot freeze governance permanently.
Governance freeze
Migration
003_git_mutations.sqladds engine-level triggers that block claim acquisition, claim release/renewal, and handoff creation/resolution on a branch while a non-expired Git mutation reservation is active. This closes the reviewed window where ownership could change after pre-receive validation but before Git committed the ref.Hook installation
quorumgit hook installnow installs both the existing hardened pre-receive gate and a post-receive completion hook. Existing unrelated post-receive hooks are preserved and installation fails closed rather than overwriting or silently chaining them.Regression coverage
New real-Git tests cover:
updatehook rejection -> ref unchanged + approval remains approved;Scope boundary
PR #10 will enrich the exact mutation with changed paths/digests derived from incoming Git objects and enforce active claim scopes against those paths. PR #9 intentionally establishes the mutation lifecycle first.
Merge only after the full five-leg CI matrix passes.