Skip to content

GitHub practice: document the --match-head-commit merge guard; re-require sota-sources - #430

Merged
seathatflowsinourveins merged 8 commits into
mainfrom
claude/github-practice-merge-guard-20260927
Sep 29, 2026
Merged

seathatflowsinourveins merged 8 commits into
mainfrom
claude/github-practice-merge-guard-20260927

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

  • What this PR changes: docs/lanes.md now documents the merge guard, gh pr merge <N> --squash --match-head-commit <SHA>. The guard was already practised but not written down. The live ruleset now has its committed sota-sources requirement back: the PUT ran at 2026-09-27T21:00:13Z, and this PR records the dated GETs before and after.
  • Base commit: 55fc8d17 (the parent of this branch's first commit). Corrected 2026-09-29: the earlier text named 0f76651d, which is not the base.
  • Lane: lane:shared. Corrected 2026-09-29: the earlier text said lane:foundation, but this PR edits docs/lanes.md, and docs/lanes.md L30 makes any change to that file shared. Under L149-150 the trading lane's acknowledgement is required, on this PR at the head SHA it acknowledges, before merge. The PR label is already lane:shared.
  • Owned paths touched: docs/lanes.md, docs/decisions/2026-09-22-github-automation-closure.md (the drift-closed entry) and the hash re-registration in manifests/evidence.json.

SOTA sources

  • GitHub CLI manual: gh pr merge. --match-head-commit is the "Commit SHA that the pull request head must match to allow merge".
  • GitHub docs: managing a merge queue. Merge queues are "available in any public repository owned by an organization". This repository is User-owned.
  • GitHub docs: available rules for rulesets, for required status checks and review-thread resolution.
  • docs/decisions/2026-09-22-github-automation-closure.md: strict mode is off (L553-563). The sota-sources drift is recorded as open (L1543-1550). .github/main-ruleset.json L34-43 is the committed target.

Evidence-class table

Claim Evidence class Command / receipt
The merge command was not written down anywhere local_integration grep -rn 'match-head-commit' --include=*.md docs recipes adoption examples AGENTS.md returned nothing (2026-09-27)
Live ruleset 23739774 required 7 contexts, not the committed 8; sota-sources was missing historical, recorded by the PR author, output not retained gh api repos/seathatflowsinourveins/native-agent-stack/rulesets/23739774 (2026-09-27)
Each of the last 60 merged PRs (#344-#424) had a successful sota-sources run; 4 of them also showed an earlier failed or cancelled run historical, recorded by the PR author, output not retained; not carried into the decision-record entry gh pr list --state merged --limit 60 --json number,statusCheckRollup (2026-09-27)
Before-GET 21:00:04Z: 7 contexts. PUT at 21:00:13Z. After-GET: 8 contexts matching the committed file historical, recorded by the PR author, output not retained gh api --method PUT .../rulesets/23739774 --input .github/main-ruleset.json; before and after gh api .../rulesets/23739774
The live ruleset equals .github/main-ruleset.json at main b0fb65b4 in name, target, enforcement, bypass actors, conditions and every rule; the 8 response-metadata keys and the rule order are normalized away, and the negative control at 57fb6d89 differs only by the sota-sources context measured 2026-09-29T03:18:04Z (read-only API and local git) the diff <(gh api ...) <(git show ...) command in the decision-record entry: exit 0, and exit 1 for the control
At the PUT #410 failed sota-sources, #205 and #216 had no run (their last runs predate the job), and #415 and #417 passed historical, recorded by the PR author, output not retained gh pr checks <N> (2026-09-27 21:00Z); on 2026-09-29 #205 and #216 are still CONFLICTING with no sota-sources run
The documented merge-guard read: gh pr checks <N> --required lists the required checks with the latest run of each; exit 0 all passed, 1 one failed, 8 pending measured 2026-09-29 (read-only) gh pr checks 389 --required exit 0 (8 checks pass); #436 exit 1; #409 exit 8; gh pr view 389 --json statusCheckRollup shows the earlier sota-sources failure that --required hides

Local commands run

$ python3 scripts/validate.py
{"components": 69, "hashed_files": 7348, "profiles": 4, "receipts": 159, "status": "passed"}

Status

Ready for review. The ruleset PUT ran at 21:00Z on 2026-09-27 as announced to the owners of the open PRs failing sota-sources (messaged at about 19:58Z); its before-GET and after-GET were not retained. This PR's record of the drift closure, its rollback (git show 57fb6d89:.github/main-ruleset.json | gh api --method PUT .../rulesets/23739774 --input -, not run) and the 2026-09-29 read-only re-derivation are in the decision record.

Review round (2026-09-29, native-agent-stack-10)

Head reviewed: 35b7ed74, by two model families, read-only. GPT-6 (gpt-6-astra, effort max, codex exec -s read-only; the model is the -m request, not an observed resolution): needs_changes (1 major, 2 minor). Claude evidence-reviewer (Opus, max): needs_changes (2 major, 4 minor, 2 nit). Repairs, with an independent Opus stack-verifier that re-ran the checks: the merge-guard procedure now defines <SHA> as the head on which review and required checks completed, reads it with gh pr checks --required (after the verifier showed the first draft's statusCheckRollup filter prints superseded failed runs), and separates head protection from base freshness; the rollback is an executable command; claims without retained output are labelled historical and replaced by the measured re-derivation; the #205/#216 sentence no longer says a rebase is required. This body's Lane line and base commit were corrected. Not fixed: the hot-file edit sits in an earlier commit than the last one in this branch's history (moot under a squash merge).

🤖 Generated with Claude Code

@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 27, 2026
@seathatflowsinourveins
seathatflowsinourveins force-pushed the claude/github-practice-merge-guard-20260927 branch from a9b7fb9 to d9e90e0 Compare September 27, 2026 21:02
@seathatflowsinourveins
seathatflowsinourveins marked this pull request as ready for review September 27, 2026 21:02
Scout and others added 2 commits September 27, 2026 18:00
Strict up-to-date checks stay off and this User-owned repository cannot use
a merge queue (docs/decisions/2026-09-22-github-automation-closure.md), so
`gh pr merge <N> --squash --match-head-commit <SHA>` is the guard against
merging a head nobody reviewed (https://cli.github.com/manual/gh_pr_merge).
It was practised but not written down: grep for match-head-commit across
docs, recipes, adoption, examples and AGENTS.md returned nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The live ruleset 23739774 now requires the committed eight checks. Before-GET
21:00:04Z (seven, no sota-sources); PUT of .github/main-ruleset.json at main
e82e6be at 21:00:13Z; after-GET matches the committed file. Records the open
PRs affected at PUT time and the rollback.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins
seathatflowsinourveins force-pushed the claude/github-practice-merge-guard-20260927 branch from d9e90e0 to 1525c10 Compare September 27, 2026 22:01
@seathatflowsinourveins seathatflowsinourveins added lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement and removed lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers labels Sep 27, 2026
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Relabelled lane:shared: this PR edits docs/lanes.md, and docs/lanes.md ("A change to this file is lane:shared") makes that a shared change. The added section documents gh pr merge <N> --squash --match-head-commit <SHA> for both lanes, and changes no path assignment. Holding the merge for the trading lane's acknowledgement (a comment or review here). CI is green on head 1525c101.

Scout and others added 6 commits September 28, 2026 22:43
…dence manifest, PR files re-registered)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t before merge (B1, B2)

B1: <SHA> is the full 40-character headRefOid read with gh pr view <N> --json headRefOid,statusCheckRollup immediately before the merge, on which the review completed and every required check ran with none running or failed. The hot-file protocol's rebase or merge of main comes before that read; if main changed a shared hot file after <SHA>, merge main again, wait for the checks on the new head and pin it; the review carries over only if the reviewed files are byte-identical (GitHub's stale-approval rule, available-rules-for-rulesets). Sources: gh 2.101.0 'gh pr merge --help'; cli/cli v2.101.0 pkg/cmd/pr/merge/http.go L77-80 (expectedHeadOid); GraphQL MergePullRequestInput.expectedHeadOid read by schema introspection and in github/docs src/graphql/data/fpt/schema-pulls.json.

B2: the flag guards the head, not the base: with strict up-to-date checks off and no merge queue, two PRs green against an older main can still break it together (GitHub docs, loose required status checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls, executable rollback (B3, B4, B5)

B4: the before-GET, PUT, after-GET and PR-status claims are labelled historical, recorded by the PR author, output not retained. Measured today (2026-09-29T03:18:04Z, read-only): the recorded diff of the live ruleset 23739774 against origin/main (b0fb65b, GitHub's main tip then) exited 0 after stripping eight response-metadata keys and sorting rules by type; the rules order is the only other difference; the 57fb6d8 negative control exits 1 on the sota-sources context only; updated_at is still the recorded PUT second. packet.md L90-92 cited as historical corroboration.

B3: rollback is git show 57fb6d8:.github/main-ruleset.json | gh api --method PUT .../rulesets/23739774 --input - (not run); verified 57fb6d8's file equals 7bbb021's minus sota-sources (jq -S, cmp exit 0) and main still carries 7bbb021's file.

B5: a rebase is not the only way to get a sota-sources run (validate.yml L6-9 reopened/edited; docs/lanes.md merge path), GitHub starts no pull_request run while a PR conflicts, and reporting is not passing (the job reads only the description, L517-521); #205/#216 measured CONFLICTING with no sota-sources run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecord in manifests/evidence.json

Registered with host_receipts.register_file; component_matrix.py --write and new_host_grand_list.py --write left the four generated reports unchanged; scripts/validate.py passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks --required; move merge-guard mechanics to the decision record

The round-one verifier showed the documented statusCheckRollup filter prints superseded runs, so 'none failed' could not be judged with it (merged #389, #411 and #413 each show an earlier sota-sources failure and a later success on the final head). gh pr checks --required lists only the required checks with the latest run of each; measured exit 0 (all passed), 1 (one failed, none pending) and 8 (pending). The implementation-level citations move to the decision record, the stale-approval comparison is called an analogy, and 'today' leaves the dated record.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t, branch files re-registered)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Review record, 2026-09-29 (native-agent-stack-10). Merge candidate: head 9f0ca004, which is 35b7ed74 plus the repairs below and a merge of main at c26800f3. The PR is lane:shared; it waits for the trading lane's acknowledgement at this head (docs/lanes.md L149-150).

  • Two model families reviewed 35b7ed74, read-only: GPT-6 (gpt-6-astra, effort max, codex exec -s read-only; the model is the -m request, not an observed resolution): needs_changes (1 major, 2 minor). Claude evidence-reviewer (Opus, max): needs_changes (2 major, 4 minor, 2 nit).
  • Repair: the merge-guard procedure now defines <SHA> as the head on which the review and the required checks completed, and separates head protection from base freshness; claims without retained output are labelled historical and replaced by a read-only re-derivation measured on 2026-09-29 (the live ruleset equals .github/main-ruleset.json at main; the negative control at 57fb6d89 differs only by sota-sources); the rollback is an executable command; the #205/#216 sentence no longer says a rebase is required; the body's Lane line and base commit were corrected.
  • What the independent verifier changed: an Opus stack-verifier showed that the first repair's gh pr view --json statusCheckRollup filter prints superseded runs, so "none failed" could not be judged with it (merged PR-D: Codex worker lane: Codex's own config writer, RTK text inline with exceptions, max-effort stack-worker profile #389, Landscape sweep: fail closed when the worker profile overlays an MCP server the lane config lacks #411 and PR-H (#381) Amendment 2: adopt the #402 role bodies before execution (Opus verifier and builder, builder base binding) #413 each show an earlier sota-sources failure and a later success). The procedure now reads the head with gh pr checks <N> --required, whose exit codes I measured (0 all passed, 1 one failed and none pending, 8 pending). That fix was made by the coordinator after the verifier's report and has not been through a second independent review.
  • Checks on the merge candidate: scripts/validate.py, scripts/evidence_manifest.py --check and scripts/component_matrix.py --check exit 0 locally; the two test modules that mention docs/lanes.md in comments pass. Hosted required checks are read with gh pr checks 430 --required immediately before merging.

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Trading lane acknowledgement (docs/lanes.md:149-150). Reviewed at head 9f0ca004 by ecosystem-roadmap-2026, which holds the trading lane.

  • Changed files: docs/lanes.md (the merge-guard section), the dated entry in docs/decisions/2026-09-22-github-automation-closure.md, and the manifests/evidence.json re-registration.
  • Trading content: no trading path changes, and no added or removed line mentions trading, us-equities or paper.
  • Effect on trading PRs: the merge-guard procedure, which reads the required checks at the pinned head and merges with --match-head-commit, applies to trading PRs too. This lane already merges that way.

No objection.

@seathatflowsinourveins
seathatflowsinourveins merged commit 5da38a4 into main Sep 29, 2026
25 of 30 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/github-practice-merge-guard-20260927 branch September 29, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant