Repository navigation
lease(merge-lane-gate-authority-compare): frozen contract a2ce4269 (r2) + lease - #84
Closed
rizzstack-coordinator[bot] wants to merge 1 commit into
Closed
rizzstack-coordinator[bot] wants to merge 1 commit into
rizzstack-coordinator[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
Superseded by the r3 cut for host r1: the r2 RED head had two commits (its direct parent was not the declared base) and AC-002 covered only a gate script. New RED red/w1d-gate-authority-compare-r2 @ 5246de7 (one commit, parent e6fb611, +174/-0) and new contract feb3863e7940fcb195815d2c3ff2a1140ce3b092d76d693995245fa7c9f94131 (owner approval pending). Branch kept; nothing merged. |
This was referenced Dec 2, 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.
Lease PR (r2) for the W1D merge-lane fix. Two files only: the frozen contract and its lease.
Facts
mojomast/rizzstack. Basee6fb6119bba3fd7c6e200f8ad70f4931a3203f34.merge-lane-gate-authority-compare, sha256a2ce4269af29bd0999a8329b639ef165baf76fd6dc9c4443857d0f54b1d8b692.review.approved_by):Kyle: approved: merge-lane-gate-authority-compare a2ce4269af29bd0999a8329b639ef165baf76fd6dc9c4443857d0f54b1d8b692 (RED cfee5cdeb3e10b2112d2445b168ab4cda75b419f on red/w1d-gate-authority-compare).red/w1d-gate-authority-compareheadcfee5cdeb3e10b2112d2445b168ab4cda75b419f, two tests-only commits, parente6fb6119, +172/-0 intests/test_merge_lane_v5.pyagainst the base.feat/merge-lane-gate-authority-compare-r2.The r1 findings and how r2 fixes them
.github/scripts/lease_tamper.pyentry through the facts and requiresgate_authority_stale_gate.divergedandbehind. AC-004 assertserrortrue andcompare_statusNone as well as the unproven refusal. AC-005 drives an equal head/base SHA (d*40) throughgate_authority_factswith anidenticalcompare.Evidence
Isolated empty HOME and XDG dirs:
e6fb6119:Ran 179 tests,OK.cfee5cde:Ran 185 tests in 2.690s,FAILED (failures=3)— the two AC-001 cases and the AC-002 gate-path case; 0 errors.hermes bundlebees tdd red:behavioral_failure,red: valid.hermes bundlebees contract freeze:tests collected: 185 ids at source_rev, every AC reference resolved.Slice dry run:
lease-tamper: OK ... class=slice TIER=T3(tier fromexisting_test_edit),dry run: class=slice OK.The r2 RED commit (delta the host asked for)
Chain
The first contract
7ac505af4c4722d2b36566be902a34aeb448276d85e100c7a444bfa3e4773692was never merged; its lease PR #83 is closed as superseded and its branch is kept.supersedesis empty because a predecessor that never reached the base can never resolve in the gate; the withdrawn hash is named in the contract notes and here. This is the contract intended to land.commit cfee5cdeb3e10b2112d2445b168ab4cda75b419f Author: Hermes (coordinator) <hermes@localhost> Date: Tue Dec 1 21:29:10 2026 -0500 test(merge-lane): W1d RED r2 - equal-SHA, gate-path and unreadable-compare cases diff --git a/tests/test_merge_lane_v5.py b/tests/test_merge_lane_v5.py index b0558d8..92a305c 100644 --- a/tests/test_merge_lane_v5.py +++ b/tests/test_merge_lane_v5.py @@ -2157,7 +2157,8 @@ class GateAuthorityCompareDirectionTests(unittest.TestCase): "base": {"ref": "main", "sha": self.base()}, } - def facts(self, base_status="ahead", head_status="behind", compare_error=None): + def facts(self, base_status="ahead", head_status="behind", compare_error=None, + compare_files=None): """Drive gate_authority_facts through a GitHub double in both directions. The base-first key is the direction the fix must request; the head-first @@ -2174,7 +2175,9 @@ class GateAuthorityCompareDirectionTests(unittest.TestCase): if compare_error is not None else { "status": base_status, - "files": [{"filename": "scripts/merge_lane_v5.py", "status": "modified"}], + "files": compare_files + if compare_files is not None + else [{"filename": "scripts/merge_lane_v5.py", "status": "modified"}], } ), "compare/%s...%s" % (head, base): ( @@ -2196,43 +2199,24 @@ class GateAuthorityCompareDirectionTests(unittest.TestCase): ) return out, api - def comparable(self, compare_status): - head = self.head() - base = self.base() - return { - "demanded": True, - "error": False, - "number": self.PR, - "repo": self.REPO, - "base_ref": "main", - "base_tip": base, - "head_check_present": False, - "runs": [ - { - "id": self.RUN_ID, - "path": self.WORKFLOW, - "event": "pull_request_target", - "status": "completed", - "conclusion": "success", - "head_sha": head, - "created_at": "2026-12-02T01:30:38Z", - "run_started_at": "2026-12-02T01:30:36Z", - "pull_requests": [ - { - "number": self.PR, - "head": {"sha": head}, - "base": {"ref": "main", "sha": base}, - } - ], - "repository": {"full_name": self.REPO}, - "head_repository": {"full_name": self.REPO}, - "app": "github-actions", - "compare_status": compare_status, - "compare_files_present": True, - "compare_files": [], - } - ], - } + def identical_facts(self): + """The equal-SHA case: the run's head is the base tip itself.""" + sha = "d" * 40 + run = self.workflow_run() + run["head_sha"] = sha + run["pull_requests"][0]["head"]["sha"] = sha + run["pull_requests"][0]["base"]["sha"] = sha + pr = {"number": self.PR, "head": {"sha": sha}, "base": {"ref": "main", "sha": sha}} + api = _FakeApi({ + "git/ref/heads/main": {"object": {"sha": sha}}, + "check-suites/%d" % self.SUITE: {"app": {"slug": "github-actions"}}, + "compare/%s...%s" % (sha, sha): {"status": "identical", "files": []}, + }) + out = lane.gate_authority_facts( + self.REPO, self.PR, pr, [run], "test-token", + api_url="https://api.test", http=api, demanded=True, + ) + return out, api def test_a_gate_run_at_the_head_is_proven_against_an_ancestor_base(self): """The #73 shape: run head == PR head, base an ancestor, all green.""" @@ -2249,26 +2233,43 @@ class GateAuthorityCompareDirectionTests(unittest.TestCase): self.assertEqual(len(compares), 1) self.assertIn("compare/%s...%s" % (self.base(), self.head()), compares[0]) - def test_a_base_that_moved_past_the_gated_head_is_refused(self): - """A base the gated head does not contain is still a wrong base.""" - facts, _api = self.facts(base_status="diverged", head_status="diverged") + def test_a_changed_gate_path_in_the_compare_still_refuses(self): + """The base-first compare's file list still feeds the gate-code check.""" + facts, _api = self.facts( + compare_files=[{"filename": ".github/scripts/lease_tamper.py", "status": "modified"}] + ) self.assertEqual( lane.gate_authority_state(facts, self.head(), []), - (False, "gate_authority_wrong_base", self.RUN_ID), + (False, "gate_authority_stale_gate", self.RUN_ID), ) + def test_a_base_that_moved_past_the_gated_head_is_refused(self): + """A base the gated head does not contain is still a wrong base.""" + for status in ("diverged", "behind"): + with self.subTest(status=status): + facts, _api = self.facts(base_status=status, head_status=status) + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (False, "gate_authority_wrong_base", self.RUN_ID), + ) + def test_an_unreadable_compare_refuses(self): - """An unreadable compare is unproven, never a pass.""" + """An unreadable compare is flagged unreadable and refused as unproven.""" facts, _api = self.facts(compare_error=lane.FetchError("compare unavailable")) + self.assertTrue(facts["error"]) + self.assertIsNone(facts["runs"][0]["compare_status"]) self.assertEqual( lane.gate_authority_state(facts, self.head(), []), (False, "gate_authority_unproven", None), ) def test_an_identical_compare_is_accepted(self): - """A run whose head is the base tip is proven (identical).""" + """A run whose head is the base tip is proven (equal SHA, identical).""" + facts, api = self.identical_facts() + sha = "d" * 40 + self.assertIn("compare/%s...%s" % (sha, sha), " ".join(api.calls)) self.assertEqual( - lane.gate_authority_state(self.comparable("identical"), self.head(), []), + lane.gate_authority_state(facts, sha, []), (True, None, self.RUN_ID), )