Skip to content

ci: fix execution lock — align matrix with branch protection, add protected-file guard and release workflow#37

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/github-triple-lock-enforce-execution-lock
Draft

ci: fix execution lock — align matrix with branch protection, add protected-file guard and release workflow#37
Copilot wants to merge 2 commits intomainfrom
copilot/github-triple-lock-enforce-execution-lock

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

Branch protection required tests (3.10/3.11/3.12) but CI ran a job named ci on only 3.11/3.12, creating a phantom gate. No protected-file enforcement or auditable release path existed.

Changes

ci.yml

  • Renamed job citests; added "3.10" to matrix — branch protection required checks now have real counterparts
  • Added protected-file-guard job (PR-only): diffs origin/<base>..HEAD and fails if any of authority_gate.py, stop_machine.py, commit_gate/, .github/workflows/ are touched
  • Added build-artefact job (main push only, gated on tests): zips governance primitives, uploads with commit SHA as artifact name

release.yml (new)

  • Triggers on v*.*.* tags only
  • verify-protected-branch job gates everything: fails if the tagged commit is not reachable from origin/main via git merge-base --is-ancestor
  • Runs full tests matrix (3.10/3.11/3.12) before building
  • Produces zip + SHA256 checksum; creates GitHub Release with commit SHA in release notes
# Branch protection required checks now have exact CI counterparts:
matrix:
  python-version: [ "3.10", "3.11", "3.12" ]
# Job name matches: tests (3.10), tests (3.11), tests (3.12)

Requires manual action: Enable "Do not allow bypassing branch protections" in repo Settings → Branches. Branch protection rules for the stop-machine repo must also be configured in the GitHub UI — neither can be enforced via workflow files alone.

Original prompt

This section details on the original issue you should resolve

<issue_title>GITHUB_TRIPLE_LOCK: enforce execution lock at protected branch and release boundary</issue_title>
<issue_description>## GITHUB_TRIPLE_LOCK_INVARIANT v0.1 — LOCK 3: EXECUTION

Part of: GITHUB_TRIPLE_LOCK_INVARIANT
Related: #33 (LOCK 1: Authority), #34 (LOCK 2: Integrity)
Source: Security audit by Comet (Perplexity browser agent), 2026-03-08

Question this lock answers

Are the conditions for irreversible state change satisfied right now?

Required checks

  • Required status checks pass before merge
  • CI matrix matches branch protection requirements exactly
  • Tests for governance primitives executed and passing
  • Merge only from protected branch
  • No bypassing branch protections ("Do not allow bypassing" enabled)
  • Release artefact built from reviewed commit SHA
  • Decision log / changelog entry present for governance-sensitive changes

Audit issues addressed

CI matrix mismatch:

  • Branch protection requires tests (3.10), tests (3.11), tests (3.12)
  • CI workflow matrix only runs Python 3.11 and 3.12
  • tests (3.10) may never run, creating a phantom gate or permanent block
  • Fix: Align CI matrix with branch protection required checks

Admin bypass:

  • "Do not allow bypassing the above settings" is currently OFF
  • Admin can bypass all branch protections including required reviews and status checks
  • Fix: Enable "Do not allow bypassing"

Missing primitive tests:

  • No test_stop_machine.py or test_authority_gate.py in constraint-workshop
  • Core governance primitives have zero test coverage
  • Governance primitives can change without test evidence
  • Fix: Add property-based tests proving immutability, monotone-red, fail-closed

stop-machine repo unprotected:

  • Zero branch protection rules configured
  • Force-push to main possible
  • No required reviews or status checks
  • Fix: Add matching branch protection rules

Concrete actions

  1. Enable "Do not allow bypassing the above settings" on constraint-workshop
  2. Fix CI matrix: align Python versions with branch protection required checks
  3. Add test_stop_machine.py with property-based tests (immutability, monotone-red, no-reset-from-red)
  4. Add test_authority_gate.py with property-based tests (frozen, fail-closed, Evidence boundary)
  5. Add branch protection to stop-machine repo (require PR, reviews, status checks)
  6. Add release workflow that only builds from reviewed, protected-branch commit SHAs

Fail-closed rule for governance paths

if path in {
  .github/workflows/**,
  stop_machine/**,
  authority_gate/**,
  decision_record/**,
  rulesets/**,
  policy/**,
  schemas/**
}
then:
  require triple lock (all three issues LalaSkye/constraint-workshop#33, LalaSkye/constraint-workshop#34, LalaSkye/constraint-workshop#35)
else:
  standard review path

GITHUB_TRIPLE_LOCK_INVARIANT — one-line compile

A governance-sensitive change may merge or release only when: (1) actor authority is valid and in-scope, (2) change integrity is exact, signed, schema-valid, and tamper-evident, and (3) all protected-branch execution conditions pass without bypass. If any lock fails, the repository remains in HOLD.</issue_description>

<agent_instructions>look for any issues
</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…guard, artefact build, and release workflow

Co-authored-by: LalaSkye <228581229+LalaSkye@users.noreply.github.com>
Copilot AI changed the title [WIP] Enforce execution lock at protected branch and release boundary ci: fix execution lock — align matrix with branch protection, add protected-file guard and release workflow Mar 8, 2026
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.

GITHUB_TRIPLE_LOCK: enforce execution lock at protected branch and release boundary

2 participants