Repository navigation
lease(merge-lane-gate-authority-compare): frozen contract 70890829 (r7) + lease - #88
Conversation
mojomast
left a comment
There was a problem hiding this comment.
APPROVE (independent review — outside reviewer, model family claude) at c635ca0
Posted from the owner's account on the owner's typed overnight yes (2026-12-02 01:09 America/Toronto: lease reviews may be posted when the PR changes only the contract and lease, the hash matches the typed approval verbatim, and every required check is green apart from this missing review).
Checked at this head:
- Exactly two files:
.rizzstack/contracts/708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e.jsonand.rizzstack/leases/merge-lane-gate-authority-compare.json; 1 ahead / 0 behind main e6fb611. - The contract recomputes to 708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e and is identical to the r7 draft the outside reviewer verified;
approved_byand the lease carry the owner's line verbatim; the lease names RED dbf5705 and branch feat/merge-lane-gate-authority-compare-r7. - RED: one tests-only commit on e6fb611, +215/-0. Isolated run: baseline 179 OK; RED 188 tests, 11 failures across 4 methods. A sample correct fix passes 188/188; wrong-direction, missing base-sha check, sha-present-only check, missing-files-as-empty, dropping unreadable entries and ignoring renames each fail a named test.
- Every failing check at this head fails only with
non_slice_requires_independent_review(lease-tamper); gitleaks, owner-held and workflow hygiene are green.
Known gap, accepted by the owner (2026-12-02 01:09): the host's blocking finding on this head is real. Every fixture gives the run entry and the PR payload the same base sha as the fetched tip, so a slice that compares the entry's base sha to the PR payload's base sha instead of the freshly fetched tip passes the RED (reproduced). The owner accepted this gap for r7 instead of a re-cut. The outside reviewer will check that exact point in the slice diff (the comparison must be against the fetched base_tip), and the missing fixture goes on a follow-up card. The three non-blocking host findings are follow-ups.
Generated by Claude Code
mojomast
left a comment
There was a problem hiding this comment.
APPROVE (owner) at c635ca0
Owner attestation, posted from the owner's account by the outside reviewer on the owner's typed overnight yes (2026-12-02 01:09 America/Toronto). Conditions checked: two files only (contract 708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e and its lease); the hash matches the owner's typed approval verbatim; every check at this head fails only for the missing independent review. The owner accepted the host's AC-005 fixture gap for r7 (details in review 6145645660); the outside reviewer checks that point in the slice diff.
Generated by Claude Code
There was a problem hiding this comment.
APPROVE (independent review — outside reviewer, model family claude) at c635ca0
Posted from the owner's account on the owner's typed overnight yes (2026-12-02 01:09 America/Toronto: lease reviews may be posted when the PR changes only the contract and lease, the hash matches the typed approval verbatim, and every required check is green apart from this missing review).
Checked at this head:
- Exactly two files:
.rizzstack/contracts/708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e.jsonand.rizzstack/leases/merge-lane-gate-authority-compare.json; 1 ahead / 0 behind main e6fb611. - The contract recomputes to 708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e and is identical to the r7 draft the outside reviewer verified;
approved_byand the lease carry the owner's line verbatim; the lease names RED dbf5705 and branch feat/merge-lane-gate-authority-compare-r7. - RED: one tests-only commit on e6fb611, +215/-0. Isolated run: baseline 179 OK; RED 188 tests, 11 failures across 4 methods. A sample correct fix passes 188/188; wrong-direction, missing base-sha check, sha-present-only check, missing-files-as-empty, dropping unreadable entries and ignoring renames each fail a named test.
- Every failing check at this head fails only with
non_slice_requires_independent_review(lease-tamper); gitleaks, owner-held and workflow hygiene are green.
Known gap, accepted by the owner (2026-12-02 01:09): the host's blocking finding on this head is real. Every fixture gives the run entry and the PR payload the same base sha as the fetched tip, so a slice that compares the entry's base sha to the PR payload's base sha instead of the freshly fetched tip passes the RED (reproduced). The owner accepted this gap for r7 instead of a re-cut. The outside reviewer will check that exact point in the slice diff (the comparison must be against the fetched base_tip), and the missing fixture goes on a follow-up card. The three non-blocking host findings are follow-ups.
Generated by Claude Code
Relayed by the coordinator as rizzstack-reviewer[bot] on the owner's typed yes; original review 6145645660 by mojomast.
Lease PR (r7) for the W1D merge-lane fix. Two files only: the frozen contract and its lease.
mojomast/rizzstack; basee6fb6119bba3fd7c6e200f8ad70f4931a3203f34; lease branchfeat/merge-lane-gate-authority-compare-r7; contract708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e.review.approved_by):Kyle: approved: merge-lane-gate-authority-compare 708908296376b5a6451c7b8afabf2f7512b033844015610bdb2cc21618ec310e (RED dbf5705661801c2ef08db81ec917105c7d7bc19c on red/w1d-gate-authority-compare-r7).red/w1d-gate-authority-compare-r7dbf5705661801c2ef08db81ec917105c7d7bc19c: one tests-only commit, direct parente6fb6119, +215/-0.Owner ruling on findings for this lease (r7 only): a finding is blocking only if it shows a wrong implementation of the compare-direction swap or the run-entry base-sha check passing the RED. Requests for more guards on behaviour already on main since #49 (entry parsing, renames, compare limit, gate-path matching) are non-blocking and go to a follow-up card, not a re-cut.
Changes vs r6: AC-004 adds a MIXED list (valid non-gate entry beside an unreadable one) and AC-002 adds
docs/moved.mdwithprevious_filename: .github/scripts/lease_tamper.py(renamed out of a gate path). Historical RED-count note removed.Isolated evidence: base
e6fb6119Ran 179 tests,OK; REDdbf57056Ran 188 tests,FAILED (failures=11)across 4 test methods, 0 errors. Freeze collected 188 ids.commit dbf5705661801c2ef08db81ec917105c7d7bc19c Author: Hermes (coordinator) <hermes@localhost> Date: Tue Dec 1 23:06:52 2026 -0500 test(merge-lane): W1d RED r7 - renamed-from gate path and mixed malformed list diff --git a/tests/test_merge_lane_v5.py b/tests/test_merge_lane_v5.py @@ -2104,0 +2105,215 @@ class GateLookupHardeningTests(unittest.TestCase): +class GateAuthorityCompareDirectionTests(unittest.TestCase): + """W1d: the gated head must contain the current base tip. + + The trusted ``pull_request_target`` run's ``head_sha`` is the pull-request + head, not a base commit. Proving that the run judged the current base + therefore means comparing ``base_tip...run.head_sha``: ``ahead`` says the + gated head contains the base tip, ``identical`` says it is the tip. The + reverse compare reports ``behind`` for every normal PR whose branch has + moved past the base, which is the shape that refused rizzstack#73 while its + gate run was green and pinned to exactly the current main. + """ + + REPO = "mojomast/rizzstack" + SUITE = 111 + RUN_ID = 9 + PR = 73 + WORKFLOW = ".github/workflows/gate-authority.yml" + + def base(self): + return "c" * 40 + + def head(self): + return "a" * 40 + + def workflow_run(self, run_base=None): + head = self.head() + base = self.base() + return { + "id": self.RUN_ID, + "check_suite_id": self.SUITE, + "path": self.WORKFLOW, + "event": "pull_request_target", + "head_sha": head, + "status": "completed", + "conclusion": "success", + "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": run_base or base}, + } + ], + "repository": {"full_name": self.REPO}, + "head_repository": {"full_name": self.REPO}, + } + + def pr(self): + return { + "number": self.PR, + "head": {"sha": self.head()}, + "base": {"ref": "main", "sha": self.base()}, + } + + def facts(self, base_status="ahead", head_status="behind", compare_error=None, + compare_files=None, run_base=None, files_present=True, base_sha_missing=False): + """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 + key reproduces GitHub's real answer for the reversed direction, so the + old code reaches a measured ``behind`` instead of an unreadable fact. + """ + head = self.head() + base = self.base() + responses = { + "git/ref/heads/main": {"object": {"sha": base}}, + "check-suites/%d" % self.SUITE: {"app": {"slug": "github-actions"}}, + "compare/%s...%s" % (base, head): ( + compare_error + if compare_error is not None + else { + "status": base_status, + "files": compare_files + if compare_files is not None + else [{"filename": "scripts/merge_lane_v5.py", "status": "modified"}], + } + ), + "compare/%s...%s" % (head, base): ( + compare_error + if compare_error is not None + else {"status": head_status, "files": []} + ), + } + if not files_present: + responses["compare/%s...%s" % (base, head)] = {"status": base_status} + run = self.workflow_run(run_base=run_base) + if base_sha_missing: + run["pull_requests"][0]["base"].pop("sha", None) + api = _FakeApi(responses) + out = lane.gate_authority_facts( + self.REPO, + self.PR, + self.pr(), + [run], + "test-token", + api_url="https://api.test", + http=api, + demanded=True, + ) + return out, api + + 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.""" + facts, _api = self.facts() + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (True, None, self.RUN_ID), + ) + + def test_the_compare_is_directed_from_the_base_tip_to_the_gated_head(self): + """The lane must ask GitHub for base_tip...head, not head...base_tip.""" + _facts, api = self.facts() + compares = [url for url in api.calls if "/compare/" in url] + self.assertEqual(len(compares), 1) + self.assertIn("compare/%s...%s" % (self.base(), self.head()), compares[0]) + + 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.""" + entries = ( + {"filename": ".github/scripts/lease_tamper.py", "status": "modified"}, + {"filename": ".github/workflows/gate-authority.yml", "status": "modified"}, + {"filename": "docs/moved.md", "previous_filename": ".github/scripts/lease_tamper.py", "status": "renamed"}, + ) + for entry in entries: + with self.subTest(entry=entry["filename"]): + facts, _api = self.facts(compare_files=[entry]) + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (False, "gate_authority_stale_gate", self.RUN_ID), + ) + + def test_a_run_tied_to_an_older_base_is_refused(self): + """Ancestry alone is not proof: the run must have judged the base tip.""" + facts, _api = self.facts(run_base="b" * 40) + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (False, "gate_authority_wrong_base", self.RUN_ID), + ) + + def test_a_run_without_a_base_sha_is_refused(self): + """A run with no entry base sha has not proved which base it judged.""" + facts, _api = self.facts(base_sha_missing=True) + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (False, "gate_authority_wrong_base", self.RUN_ID), + ) + + def test_an_incomplete_or_malformed_file_list_is_refused(self): + """No readable, complete change set can ever prove the gate.""" + cases = { + "non_list": dict(compare_files="not-a-list"), + "limit": dict(compare_files=[{"filename": "docs/f%03d.md" % index, "status": "modified"} for index in range(300)]), + "missing_key": dict(files_present=False), + "malformed_entry": dict(compare_files=[{"status": "modified"}]), + "mixed_list": dict(compare_files=[{"filename": "docs/readme.md", "status": "modified"}, {"status": "modified"}]), + } + for name, kwargs in cases.items(): + with self.subTest(case=name): + facts, _api = self.facts(**kwargs) + self.assertEqual( + lane.gate_authority_state(facts, self.head(), []), + (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, reverse in (("diverged", "diverged"), ("behind", "ahead")): + with self.subTest(status=status): + facts, _api = self.facts(base_status=status, head_status=reverse) + 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 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 (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(facts, sha, []), + (True, None, self.RUN_ID), + ) + +Earlier cuts #83/#84/#85/#86/#87 are withdrawn, never merged; PRs closed, branches kept.
supersedesis empty because none reached the base.Per-finding classification (owner ruling, r7)
Host r1 at
c635ca0ae16538e6bfbe14d574f51ffebcf74bc0returned REQUEST_CHANGES.interfacesnames onlygate_authority_facts; the risk section also changesgate_authority_state. Text correction for the next cut, no re-cut tonight.