Skip to content

Compose ref policies and preserve quorum executor separation - #35

Merged
Deep-Sixed merged 10 commits into
mainfrom
chatgpt/governance-composition-fixes
Sep 30, 2026
Merged

Deep-Sixed merged 10 commits into
mainfrom
chatgpt/governance-composition-fixes

Conversation

@Deep-Sixed

Copy link
Copy Markdown
Owner

Fixes the two remaining governance findings from the review of main after #21/#32.

1. Protected ref rules now compose with force/delete rules

A protected ref previously took precedence over force_update and ref_delete, so stricter per-operation policies for force pushes and deletions were skipped on protected refs.

Now ref-level operations are additive:

  • protected ordinary update -> protected_ref_update
  • protected force update -> protected_ref_update + force_update
  • protected deletion -> protected_ref_update + ref_delete

The existing all-or-nothing multi-approval path handles the composed operations.

2. Quorum execution never counts the executor's own vote

Fixed-threshold behavior is unchanged: an approver cannot consume its own approval.

Under quorum policy, if the consumer also voted yes, that consumer is removed from both:

  • the eligible yes-vote count, and
  • the quorum denominator.

Consumption succeeds only if the other currently eligible approvers still satisfy 2/3 + 1 (and the fixed threshold floor). This prevents small quorums from becoming impossible to execute without allowing self-authorization.

Migration 011_quorum_consumer_separation.sql:

  • adds the effective quorum bit to approval_effective_policy
  • adds approval_eligible_agents
  • recreates the database consumption trigger with the same rule as the Python gate

Regression coverage

  • protected force update requires both protected-ref and force-update operations
  • protected deletion requires both protected-ref and ref-delete operations
  • per-operation thresholds remain distinct when the rules compose
  • a 3-of-3 quorum voter can execute only because the other 2 independently form the consumer-specific quorum
  • the SQLite trigger is exercised by that consumption path
  • migration upgrade lists and contract views are updated
  • README and agent guide document the behavior

@Deep-Sixed
Deep-Sixed marked this pull request as ready for review September 30, 2026 08:07
@Deep-Sixed
Deep-Sixed merged commit 07f4843 into main Sep 30, 2026
7 checks passed
Deep-Sixed added a commit that referenced this pull request Sep 30, 2026
# Conflicts:
#	README.md
#	src/quorumgit/gate.py
#	src/quorumgit/git_objects.py
#	tests/test_approval_authority.py
#	tests/test_authorization_binding.py
Deep-Sixed pushed a commit that referenced this pull request Sep 30, 2026
Resolve the README conflict by keeping the consolidated Upgrading
section and folding main's new 010 (protected ref full names) and 011
(quorum consumer separation) notes into it in migration order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHGwY6PLGwr7kQY63qQGq6
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