ci: establish autonomous repository governance - #899
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issues.github/workflows/repository-reconciliation.yml
OpenSSF Scorecard
Scanned Files
|
Agent Completion Truth Gate: BLOCKEDReasons: Machine-readable verdict{
"details": {
"collection_errors": [
"missing_intent_snapshot"
],
"focused_test_failures": [
"tests/unit/test_pr_governance_workflow.py",
"tests/unit/test_repository_reconciliation_workflow.py"
],
"identity_projection": {
"agent_login": "groupthinking",
"issue_number": 905,
"run_id": "eventrelay-governance-repair-20260721-0215z"
}
},
"reasons": [
"evidence_collection_failed",
"missing_copilot_current_head_review",
"required_checks_failed",
"focused_tests_failed"
],
"verdict": "blocked"
} |
There was a problem hiding this comment.
Pull request overview
Establishes automated governance for canonical issue linkage, PR evidence, duplicate work, and repository drift reporting.
Changes:
- Adds ready-PR governance validation.
- Adds scheduled branch and PR reconciliation reporting.
- Expands the PR template with delivery evidence requirements.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
.github/workflows/pr-governance.yml |
Validates canonical issues and delivery evidence. |
.github/workflows/repository-reconciliation.yml |
Reports PR and branch governance drift. |
.github/pull_request_template.md |
Adds governance and evidence sections. |
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (6)
.github/workflows/pr-governance.yml:39
- This only verifies that heading strings occur somewhere in the body. After filling
Closes #..., a PR can leave every template placeholder or evidence section empty and still pass, so the advertised outcome/risk/verification/production-evidence contract is not enforced. Parse each section and reject blank or unchanged placeholder content (including verification with no current-head evidence).
const missing = requiredSections.filter(section => !body.includes(section));
.github/workflows/pr-governance.yml:43
- The regex treats any numeric text reference as a canonical issue without verifying that it resolves to an issue in this repository. For example,
Closes #99999999or a number belonging to a pull request satisfies this check. ResolveclosingIssuesReferencesand filter byrepository.nameWithOwner, following.github/workflows/pr-checks.yml:1141-1156, or fetch the referenced item and reject missing items and pull requests.
const closingPattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+#(\d+)/gi;
const issueNumbers = [...body.matchAll(closingPattern)].map(match => Number(match[1]));
const canonicalIssues = [...new Set(issueNumbers)];
.github/workflows/repository-reconciliation.yml:45
- The report labels this metric as “Ready PRs,” but
pulls.listincludes drafts and this condition adds them too, contradicting the governance workflow’s explicit draft exemption. Exclude drafts fromuntrackedso the count and list describe ready PRs accurately.
if (unique.length !== 1) untracked.push(pr);
.github/workflows/repository-reconciliation.yml:36
protected: falseexcludes protected branches from both the inventory and the value later labeled “Remote branches.” This prevents the reconciliation from reporting drift across all remote branches as promised. Fetch all branches, report the full inventory, and separately exclude or label protected branches when producing cleanup candidates.
const branches = await github.paginate(github.rest.repos.listBranches, {
owner, repo, protected: false, per_page: 100
});
.github/workflows/repository-reconciliation.yml:37
pr.head.refalso includes branch names from forks, butlistBranchesonly returns branches in this repository. A fork PR whose branch name matches an unrelated local branch therefore hides that local branch from stale reporting. BuildactiveHeadsonly from PRs whosehead.repo.full_nameequals this repository.
const activeHeads = new Set(pulls.map(pr => pr.head.ref));
.github/workflows/repository-reconciliation.yml:1
- This new workflow, and the accompanying
pr-governance.yml, are absent from the repository Workflow Catalog..github/workflows/README.md:82-89explicitly requires a catalog row whenever a workflow is added, so both workflows need to be documented (and included in the workflow audit decision matrix).
name: Repository Reconciliation
- pr-governance.yml: reject empty/placeholder section content by parsing section bodies (strip HTML comments, check non-empty) - pr-governance.yml: validate canonical issue via Issues API — confirm it exists, is an issue (not a PR), and is open before searching for competing PRs - repository-reconciliation.yml: exclude draft PRs from untracked list to match the deferred-enforcement rule in pr-governance.yml - repository-reconciliation.yml: validate every referenced issue number through the Issues API before using it in duplicate classification - repository-reconciliation.yml: restrict activeHeads to same-repo PRs (filter by head.repo.full_name) to prevent fork branch-name collisions - repository-reconciliation.yml: fetch all branches (remove protected:false) and label the metric as 'Total remote branches' for accuracy; exclude branch.protected===true from stale candidates - README.md / AUDIT.md: add catalog rows for both new workflows - tests: add test_pr_governance_workflow.py and test_repository_reconciliation_workflow.py (17 tests, all passing)
Review summary (governance workflows)I re-reviewed the three files and independently verified Copilot's 11 inline findings against the repo — they're all accurate. Rather than repeat them inline, here's a triage plus one piece of context that isn't in those comments. Blocking before this becomes a required gate
Report-accuracy (non-blocking, but the reconciliation report is wrong without them)
Process (required by this repo's own docs)
Context not in the inline comments — why this PR can't merge yet regardlessThis PR is itself red on the Agent completion enforcement required check, and so is every other open PR. That's not a defect in this diff — RecommendationFindings 1–3 are worth fixing before this gate is made required; 4–8 are cleanup. These are security-sensitive Generated by Claude Code |
All 10 review comments addressed in commit pr-governance.yml
repository-reconciliation.yml
Catalog and audit records
Unit tests (17 tests, all passing)
|
|
Blocker watch restored this PR to draft because exact head @codex address the active findings on this canonical branch:
After pushing a new head, rerun/obtain approval for all required workflows and resolve only threads whose findings are actually fixed. |
|
To use Codex here, create a Codex account and connect to github. |
🔍 PR Validation |
|
Late review finding fixed on exact head
Resolving the verified thread now. No merge or production action was performed. |
Canonicality receipt — 2026-07-23T05:20:17.120Z#899 remains the canonical PR for #905 at exact head Controller: |
Re-apply the exact verified head cbae911 for PR #899: - Add PR Governance check workflow to validate canonical issues on pr.head.sha - Add non-destructive Repository Reconciliation loop to generate drift reports - Introduce focused unit tests to enforce governance and reconciliation behavior - Document workflows in AUDIT.md and README.md, and update pull_request_template.md
Re-apply the exact verified head cbae911 for PR #899: - Add PR Governance check workflow to validate canonical issues on pr.head.sha - Add non-destructive Repository Reconciliation loop to generate drift reports - Introduce focused unit tests to enforce governance and reconciliation behavior - Document workflows in AUDIT.md and README.md, and update pull_request_template.md
Re-apply the exact verified head cbae911 for PR #899: - Add PR Governance check workflow to validate canonical issues on pr.head.sha - Add non-destructive Repository Reconciliation loop to generate drift reports - Introduce focused unit tests to enforce governance and reconciliation behavior - Document workflows in AUDIT.md and README.md, and update pull_request_template.md
|
External merge reconciliation:
No progress is credited for the missing provenance/approval gates. Execution receipt:
|
Canonical issue
Closes #905
Parent program: #898
Outcome
Establishes a repository-owned control loop that prevents untracked or duplicate implementation PRs, publishes governance against each exact PR head, and continuously reports drift across open PRs and remote branches.
Scope
PR GovernanceCheck againstpull_request.head.sha.Risk
Verification
cbae9110cfd7b6b89b2686bd9fd705ea4e649778.checks: write,contents: read,issues: read, andpull-requests: read.head_sha: pr.head.sha; draft PRs receive a neutral exact-head result.main, protected branches, and branches attached to same-repository open PRs.missing_intent_snapshot. Thecopilot-rabbitlabel is present; current-head Copilot review is still pending.Production evidence
Not applicable to application runtime. These are repository-governance workflows, tests, and documentation only. The exact-head Vercel preview was canceled, but the changed paths do not affect a deployed application surface.
Governance state
This PR is draft. Focused issue #905 was created after this PR and has no pre-dispatch intent snapshot, so the independent truth policy cannot be satisfied retroactively on this PR. Do not mark ready or merge until an authorized repository/security owner records either a policy-compliant replacement-PR transition or an explicit legacy-provenance exception.
Agent handoff
No merge, branch deletion, credential mutation, ruleset weakening, fabricated evidence, or production change was performed.
Coverage evidence correction — 2026-07-22
The previously listed
Coveragesuccess predates the authoritative workflow installed by #921. That workflow could return green after pytest collection failed because failures were suppressed. Treat the old Coverage run as non-authoritative evidence, not as proof. This PR must receive a truthful Coverage result on a current synchronized exact head before it advances; this correction does not imply a regression in this PR's code.