[truealpha-bt] Decouple Gate candidate validation from merge authorization - #199
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors TrueAlpha’s governance enforcement so Gate 0 candidate structural validity is evaluated independently from merge authorization and Gate acceptance, eliminating draft/ready PR metadata as an input to blocked-candidate validation. It also tightens determinism of GitHub parity checks by serializing issue synchronization/parity and expanding Vision issue export beyond a fixed limit.
Changes:
- Make blocked Gate 0 candidates pass structural validation without using PR draft state as an authorization bypass, while keeping fail-closed live attestation checks for candidates that claim
accepted. - Expand Gate 0 control coverage to include
.github/**andAGENTS.md, and rename the Gate 0 merge policy field topartial_gate_acceptance_allowedacross code + schema + manifest. - Update CI governance workflow to paginate Vision issue export and skip bot-generated intermediate issue events during parity validation; update tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/check_gate0_candidate.py | Expands candidate-controlled paths (includes .github/**, AGENTS.md) and updates merge policy field validation. |
| tools/check_delivery_governance.py | Removes draft-based blocked-candidate bypass; gates live attestation checks on whether the manifest claims acceptance; expands governance control paths. |
| libs/runtime/tests/test_delivery_governance.py | Updates/extends regression tests to assert deterministic blocked-candidate behavior and accepted-candidate fail-closed behavior. |
| governance/schemas/gate0-candidate-manifest.schema.json | Renames merge policy field to partial_gate_acceptance_allowed. |
| governance/gate0/manifest-v4.json | Updates controlled paths to include .github/** + AGENTS.md and renames merge policy field; refreshes base/tree hashes. |
| AGENTS.md | Documents directory-derived work prefix and a project-level definition of “mergeable”. |
| .github/workflows/ci-governance.yml | Removes draft-state flagging, paginates Vision issue export via gh api --paginate, and skips bot-driven intermediate issue events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 15, 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.
Summary
AGENTS.mdinto the Gate 0 candidate treeRoot cause
Delivery Governance mapped pull-request draft state to
--allow-blocked-gate-candidate. The same head SHA therefore passed as a draft and failed when marked ready. The validator also conflated a structurally valid blocked candidate with an accepted Gate candidate. Separately, issue synchronization emitted intermediate issue events that parity validation treated as durable drift.Evidence and ceiling
This PR proves deterministic governance authorization for a structurally valid but externally blocked Gate 0 candidate. It does not accept Gate 0, satisfy any missing external attestation, activate a capability, or make a release-readiness claim.
Passed:
uv run pytest libs/runtime/tests/test_delivery_governance.py libs/runtime/tests/test_gate0_candidate.py -q(99 passed)uv run ruff check tools/check_delivery_governance.py tools/check_gate0_candidate.py libs/runtime/tests/test_delivery_governance.py libs/runtime/tests/test_gate0_candidate.pymake gate0-candidate-checkmake issue-graph-checkactionlint .github/workflows/ci-governance.ymlLocal
make checkreached 705 passed and 6 skipped but failed 28 data-engine tests against an existing non-fresh local Postgres schema. The failures report stale database state such as missingstaging.filing_documents.normalized_record_id, an unclaimedissuer_categorycolumn, and absent append-only enforcement. This PR changes no database or data-engine files; GitHub CI provisions a fresh Postgres service.Manifest:
governance/gate0/manifest-v4.jsonManifest SHA-256:
b8235893c885f6635985c514d9c5dbfc3153bb3de6429d15a236e9b780762fb1Closes #197