Repository navigation
Add a 2/3+1 quorum mode to repository approval policy - #21
Merged
Merged
Conversation
This was referenced Sep 29, 2026
The predecessor Codex_Kernel gate derived its threshold from membership: a proposal needed floor(2N/3) + 1 votes from the N authorized nodes, so the bar grew with the approver set. Repository policy (#12) uses a fixed approval_threshold, which stays at 1 no matter how many operators exist. `quorumgit repo policy <repo> --quorum` makes an operation require 2/3 + 1 of the agents eligible to approve it: agents holding an approving role, minus the requester (unless the policy lets it vote) and a takeover's beneficiary, and at use time minus the consumer. The fixed threshold remains a floor. Counting only eligible agents keeps those exclusions from making approval impossible. Because eligibility is re-derived when an approval is used, adding approvers raises the bar for unused approvals the same way raising --threshold does. Migration 005 adds the flag; policy changes remain operator-only and audited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mc44WsAZx9hzZdWEihDk5a
Deep-Sixed
force-pushed
the
claude/eloquent-galileo-xu0ah7-approvers
branch
from
September 29, 2026 22:29
cd1b083 to
5a1146f
Compare
Deep-Sixed
changed the base branch from
claude/eloquent-galileo-xu0ah7
to
main
September 29, 2026 22:29
Deep-Sixed
marked this pull request as ready for review
September 29, 2026 22:36
…eo-xu0ah7-approvers
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a1146fe15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Excluding the consuming agent from the eligible set at use time could only lower the requirement, but a still-pending approval is refused before that check runs, so an approval's status and whether it could be used disagreed (review feedback). The quorum is now always 2/3 + 1 of the agents eligible to vote on the approval; whether a given agent may carry it out remains the separate rule that an approver never uses its own approval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mc44WsAZx9hzZdWEihDk5a
#23 added 005_content_governance.sql, so the quorum migration moves to 006_approval_quorum.sql. Conflicts were only in the migration lists (tests and README) and the repo policy command reference, resolved by keeping both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mc44WsAZx9hzZdWEihDk5a
Renumber the quorum migration to 009 and let a per-operation override set quorum mode as well as threshold, roles and requester voting: a NULL approval_quorum on an override inherits the repository default. The repo policy CLI accepts --quorum with --operation and shows quorum on overrides. Reopening a stale approval (#27) uses the same requirement as voting and consumption, so a quorum raised by new approvers reopens it for the missing votes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8BpCkArA34hB1aSyVcnZp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8BpCkArA34hB1aSyVcnZp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8BpCkArA34hB1aSyVcnZp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8BpCkArA34hB1aSyVcnZp
This was referenced Sep 30, 2026
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.
Restores Codex_Kernel's quorum that grows with the number of approvers, built on the repository approval policy from #12 and the per-operation overrides from #27.
Problem
In Codex_Kernel, a proposal needed ⌊2N/3⌋+1 votes from its N authorized nodes, so the bar rose as the approver set grew. #12's
approval_thresholdis a fixed number and defaults to 1. With ten operators, a single vote still approves a push tomain.Change
quorumgit repo policy <repo> --quorum | --no-quorum(operator-only and audited, like the rest of the policy). With quorum on, an operation needs 2/3+1 of the agents eligible to vote on it. "Eligible" means:--requester-may-voteis set;--thresholdstays as a floor.Per-operation overrides can set quorum mode (Add per-operation approval policy overrides #27):
repo policy <repo> --operation force_update --quorumturns it on for one operation type,--no-quorumturns it off for one type while the default has it on, and an override that doesn't mention it follows the default.--inheritcan't be combined with--quorum. Therepo policylisting shows the quorum rule on each override.Counting only eligible agents means these exclusions never make approval impossible while other approvers exist. For example, with three operators, one operator's own request needs the other two, not three of three.
gate.required_approvals()is the single requirement, used when votes are tallied, when an approval is used, and when Add per-operation approval policy overrides #27 decides whether an approved instance is stale and should reopen for votes. As a result:--thresholdalready does; the next eligible vote reopens such an approval so it can collect the missing votes.The approval instance records the requirement that applied when it was requested, for display.
repo policyshows the quorum rule and how many agents currently hold an approving role.Migration
009_approval_quorum.sqladdsrepositories.approval_quorum(default off) and a nullableoperation_approval_policies.approval_quorum(NULL inherits). Renumbered from006after Bind push authorization to Git's reference transaction #30, Measure claim scopes against the mainline, not every ref #29 and Add per-operation approval policy overrides #27 took006–008.With quorum mode off, behaviour is unchanged. Approvals created by #23's content governance (protected paths, ref namespaces) go through the same
required_approvals(), so quorum mode applies to them too.Tests
tests/test_approval_quorum.pyadds 21 tests, run against an isolated store because roles are global:--thresholdacts as a floor;--inherit --quorumis refused;The existing migration-list and policy-dict assertions include
009andquorum.After merging
main(through #27):pytest262 passed,ruff(pinned 0.16.9) clean,pyright0 errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mc44WsAZx9hzZdWEihDk5a
https://claude.ai/code/session_01Q8BpCkArA34hB1aSyVcnZp