From 0b129e8b22a844049dd87e4e7d08bb1c7e8d49ff Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 12:08:58 -0500 Subject: [PATCH 1/7] lease(owner-comment-approvals): frozen contract 5ceefe59 + lease Contract sha256 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67, source_rev 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca (red/owner-comment-approvals-r2), branch feat/owner-comment-approvals. Metadata only; no gate code. --- ...66597d3782267f4bf421f223806ad66cf2d67.json | 381 ++++++++++++++++++ .../leases/owner-comment-approvals.json | 49 +++ 2 files changed, 430 insertions(+) create mode 100644 .rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json create mode 100644 .rizzstack/leases/owner-comment-approvals.json diff --git a/.rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json b/.rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json new file mode 100644 index 0000000..c41dcab --- /dev/null +++ b/.rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json @@ -0,0 +1,381 @@ +{ + "acceptance_criteria": [ + { + "id": "AC-001", + "regression": false, + "statement": "A contract that records approval_comment_id and approval_pr is accepted when the comment fetched by that id is authored by mojomast, sits on that pull request, and carries exactly the approved body for this contract.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_matching_owner_comment_is_accepted" + ], + "verification": "test" + }, + { + "id": "AC-002", + "regression": false, + "statement": "The comment body is compared after leading and trailing whitespace is trimmed.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_the_comment_body_is_trimmed_before_comparison" + ], + "verification": "test" + }, + { + "id": "AC-003", + "regression": false, + "statement": "A comment body naming another hash, another contract id, upper-case APPROVED, extra prose, or no colon is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_different_body_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-004", + "regression": false, + "statement": "A comment authored by the reviewer app, the coordinator app, an empty login or no login is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_non_owner_author_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-005", + "regression": false, + "statement": "A comment that belongs to a pull request other than the recorded approval_pr is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_comment_on_another_pull_request_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-006", + "regression": false, + "statement": "review.approved_by must contain the trimmed comment body verbatim; an approved_by without it is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_approved_by_must_quote_the_comment_verbatim" + ], + "verification": "test" + }, + { + "id": "AC-007", + "regression": false, + "statement": "review.approved_by must start with the literal prefix 'Kyle (owner) typed:'; a date before the colon is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_approved_by_must_use_the_literal_owner_prefix" + ], + "verification": "test" + }, + { + "id": "AC-008", + "regression": false, + "statement": "A contract carrying approval_pr without approval_comment_id, or approval_comment_id without approval_pr, is refused with contract_approval_missing.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_one_field_without_the_other_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-009", + "regression": false, + "statement": "A contract with neither approval field keeps the legacy path (status frozen/approved plus a non-empty approved_by) and makes no API call.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_contract_without_the_fields_keeps_the_legacy_path" + ], + "verification": "test" + }, + { + "id": "AC-010", + "regression": false, + "statement": "A strict contract evaluated without a token is refused with contract_approval_unreadable before any HTTP call is attempted.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_missing_token_refuses_before_any_call" + ], + "verification": "test" + }, + { + "id": "AC-011", + "regression": false, + "statement": "A transport failure or an unparseable response is refused with contract_approval_unreadable.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_transport_failure_refuses" + ], + "verification": "test" + }, + { + "id": "AC-012", + "regression": false, + "statement": "A response that is not a JSON object is refused with contract_approval_unreadable.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_non_object_response_refuses" + ], + "verification": "test" + }, + { + "id": "AC-013", + "regression": false, + "statement": "An approval_comment_id that is not 1-20 ASCII digits (superscript, 5000 digits, sign, spaces, empty, null, float, bool) is refused with contract_approval_mismatch and never raises.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_malformed_comment_id_refuses_without_raising" + ], + "verification": "test" + }, + { + "id": "AC-014", + "regression": false, + "statement": "approved_contract() itself runs the owner-comment check: a contract on base with a foreign author is refused, and the same contract with the owner comment returns the contract and path.", + "tests": [ + "tests/test_owner_approvals.py::ApprovedContractWiringTest::test_approved_contract_runs_the_owner_comment_check" + ], + "verification": "test" + }, + { + "id": "AC-015", + "regression": false, + "statement": "approved_contract() called without a token refuses a strict contract with contract_approval_unreadable, so a local run cannot bypass the check.", + "tests": [ + "tests/test_owner_approvals.py::ApprovedContractWiringTest::test_approved_contract_without_a_token_refuses_for_a_strict_contract" + ], + "verification": "test" + }, + { + "id": "AC-016", + "regression": false, + "statement": "independent_review() accepts a bot-posted owner-form approval that carries exactly one disclosure line naming the owner's review at the same head, and refuses the same relay without it.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_a_disclosed_relay_is_accepted_and_an_undisclosed_one_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-017", + "regression": false, + "statement": "A relay body carrying two disclosure lines is refused.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_two_disclosure_lines_are_refused" + ], + "verification": "test" + }, + { + "id": "AC-018", + "regression": false, + "statement": "A disclosure naming a review recorded at a different commit is refused.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_a_disclosure_naming_another_commit_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-019", + "regression": false, + "statement": "A disclosure naming a review authored by a login other than mojomast is refused.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_a_disclosure_naming_a_non_owner_review_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-020", + "regression": false, + "statement": "A relay whose body differs above the disclosure line from the named owner review is refused.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_a_relay_body_edited_above_the_disclosure_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-021", + "regression": false, + "statement": "Both gate jobs can read issue comments: gate-authority.yml and the lease-tamper job in gitleaks.yml declare issues: read.", + "tests": [ + "tests/test_owner_approvals.py::SharedPolicyAndWorkflowTest::test_both_gate_jobs_can_read_issue_comments" + ], + "verification": "test" + }, + { + "id": "AC-022", + "regression": true, + "statement": "The canonical bot approval form (APPROVE (independent review - rizzstack-reviewer, model family openai) at ) is still accepted.", + "tests": [ + "tests/test_owner_approvals.py::RelayedOwnerApprovalTest::test_the_bot_canonical_form_still_counts" + ], + "verification": "test" + }, + { + "id": "AC-023", + "regression": true, + "statement": "The shared policy block remains byte-identical to tests/fixtures/shared_policy.sha256 in both the gate and the merge lane.", + "tests": [ + "tests/test_owner_approvals.py::SharedPolicyAndWorkflowTest::test_the_shared_policy_block_is_byte_identical" + ], + "verification": "test" + }, + { + "id": "AC-024", + "regression": true, + "statement": "The gate-authority exact-shape check admits both the legacy contents-only permission set and the contents+issues set, so the must-fail workflow fixtures stay single-violation files while the real workflow gains the issue-comment read the owner-approval check needs.", + "tests": [ + "tests/test_gate_authority.py::BasePinnedGateWorkflowTest::test_workflow_is_exactly_the_base_pinned_gate" + ], + "verification": "test" + } + ], + "assumptions": [ + "The owner comment is read from the GitHub API with the workflow token; both gate jobs get issues: read.", + "The contract is read from the base branch, so a recorded approval predates every head built on it; no head-time ordering comparison is needed.", + "The canonical contract hash is the compact, key-sorted, ASCII JSON of the body without the review block (bundlebees contract identity), so editing review.approval_comment_id does not change the hash the owner approved." + ], + "authorization": { + "human_gates": [ + "merge", + "tag", + "release", + "deploy", + "publish" + ], + "not_authorized": [ + "merge", + "tag", + "release", + "deploy", + "publish", + "force-push", + "branch deletion", + "edit approved tests", + "ruleset or settings changes", + "app or key changes", + "marking red-evidence or any new check required (owner-only)" + ] + }, + "contract_version": "acdd/1", + "dependencies": [], + "evidence_required": [ + "red", + "green", + "review", + "security" + ], + "id": "owner-comment-approvals", + "interfaces": [ + { + "change": "add", + "kind": "function", + "name": "lease_tamper.verify_owner_approval" + }, + { + "change": "modify", + "kind": "function", + "name": "lease_tamper.approved_contract" + }, + { + "change": "modify", + "kind": "function", + "name": "lease_tamper.resolve_contract" + }, + { + "change": "modify", + "kind": "function", + "name": "lease_tamper.approvals_at_head" + }, + { + "change": "modify", + "kind": "function", + "name": "lease_tamper.approval_chain" + }, + { + "change": "modify", + "kind": "file", + "name": "gate-authority.yml" + }, + { + "change": "modify", + "kind": "file", + "name": "gitleaks.yml" + } + ], + "notes": [ + "verify_owner_approval(repo, document, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch.", + "Legacy rule: the gate resolves contracts from the base branch, so demanding a comment id from every contract would refuse every contract already on base and make every existing lease unrunnable. The strict form applies only when approval_pr and approval_comment_id are both present; the freeze tool must write both for new contracts. An unconditional dated cutover remains an owner decision.", + "review.approved_by must start with the literal 'Kyle (owner) typed:' and contain the trimmed comment body verbatim.", + "The disclosure predicate is ported from scripts/merge_lane_v5.py _relay_disclosure_ok: exactly one disclosure line at the end, two newlines after a byte-identical owner body, the named review at the same commit_id with owner login and owner form. The shared policy block is not touched.", + "The gate compares the comment bytes and never executes them; the id is bounded ASCII decimal before any URL is built.", + "Both workflows gain issues: read; tests/test_gate_authority.py's exact-shape expectation is updated in the same RED commit." + ], + "outcome": { + "observable_behavior": [ + "an approved frozen contract carrying approval_pr and approval_comment_id is accepted only when that comment body is exactly 'approved: <64-hex>' by mojomast on that PR", + "any mismatch, unreadable fetch, missing token, or malformed comment id refuses", + "a contract with neither approval field keeps the legacy prose path with no API call", + "a bot-posted owner-form approval counts only with exactly one disclosure line naming the owner review at the same head", + "the canonical bot approval form still counts", + "the shared policy block is unchanged" + ], + "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." + }, + "review": { + "status": "approved", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", + "approved_at": "2026-12-01T17:08:33Z", + "contract_sha256": "5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67", + "test_collection": { + "manifest_sha256": "b8e6c9c4b29c9479af806494c509cd69067286dff1c28b14edeaa68aaeac1c05", + "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", + "collected": 87 + } + }, + "risk": { + "blast_radius": "Every gate run in rizzstack: both the base gate and the lease-tamper job resolve contracts, and both workflows gain a token permission", + "reasons": [ + "the change is under .github/** and .github/scripts/lease_tamper.py, which are T3 gate paths", + "the gate now makes an authenticated API request to read an owner approval comment" + ], + "tier": "high" + }, + "scope": { + "assigned_files": [ + ".github/scripts/lease_tamper.py", + ".github/workflows/gate-authority.yml", + ".github/workflows/gitleaks.yml" + ], + "prohibited": [ + "policy/**", + "scripts/**", + "bundlebees_plugin/**", + "conftest.py", + ".github/scripts/check_ci_gate.py", + ".github/scripts/gate_drill.py", + ".github/scripts/gate_drill.lock.json", + ".github/workflows/codemap.yml", + ".github/workflows/review-rerun.yml" + ], + "read_only": [ + "tests/test_lease_tamper.py", + "tests/fixtures/shared_policy.sha256", + ".rizzstack/contracts/**", + ".rizzstack/leases/**" + ], + "test_files": [ + "tests/test_owner_approvals.py", + "tests/test_gate_authority.py" + ] + }, + "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", + "supersedes": [], + "targets": [ + { + "base": "5833668105380a96b3626655ec9bc5bd3e3602c1", + "red": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", + "red_branch": "red/owner-comment-approvals-r2", + "repo": "mojomast/rizzstack" + } + ], + "tdd": { + "applicable": true, + "test_first": true + }, + "title": "Owner-comment contract approvals and the disclosed owner relay in the base gate", + "verification": { + "commands": [ + "python3 -m unittest tests.test_owner_approvals -v", + "python3 -m unittest tests.test_gate_authority -v" + ], + "independent": true + } +} diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json new file mode 100644 index 0000000..f2d59ec --- /dev/null +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -0,0 +1,49 @@ +{ + "branch": "feat/owner-comment-approvals", + "contract_id": "owner-comment-approvals", + "contract_sha256": "5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67", + "derived_from": { + "approved_at": "2026-12-01T17:08:33Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", + "contract": ".rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json" + }, + "id": "owner-comment-approvals", + "lease_version": "rizzstack.lease/1", + "review": { + "approved_at": "2026-12-01T17:08:33Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", + "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", + "status": "frozen" + }, + "scope": { + "assigned_files": [ + ".github/scripts/lease_tamper.py", + ".github/workflows/gate-authority.yml", + ".github/workflows/gitleaks.yml" + ], + "prohibited": [ + "policy/**", + "scripts/**", + "bundlebees_plugin/**", + "conftest.py", + ".github/scripts/check_ci_gate.py", + ".github/scripts/gate_drill.py", + ".github/scripts/gate_drill.lock.json", + ".github/workflows/codemap.yml", + ".github/workflows/review-rerun.yml" + ], + "read_only": [ + "tests/test_lease_tamper.py", + "tests/fixtures/shared_policy.sha256", + ".rizzstack/contracts/**", + ".rizzstack/leases/**" + ], + "test_files": [ + "tests/test_owner_approvals.py", + "tests/test_gate_authority.py" + ] + }, + "slice": "OWNER-COMMENT-APPROVALS", + "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", + "verify_sha": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca" +} From d59769a463b8d0d0a8208dfb1499e45b6199e1e8 Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 12:57:39 -0500 Subject: [PATCH 2/7] lease(owner-comment-approvals): re-freeze contract 11049114 (r2) The r2 contract replaces the superseded r1 file, so this PR adds exactly one frozen contract and its lease: - states explicitly that this lease delivers opt-in gate-side verification only; making the freeze tool write both approval fields for every new contract is a separate bundlebees change, outside this contract's scope - AC-025: a matching owner comment whose recorded approval_pr is a plain issue (no pull_request marker) is refused with contract_approval_mismatch - AC-026: a matching owner comment is refused with contract_approval_mismatch when the recorded approval_pr's file list does not add .rizzstack/contracts/.json RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, one tests-only commit off 5833668; 23 failed / 66 passed at that commit; tdd red behavioral_failure; freeze collected 89 ids. --- ...9b4829ea10fda955d40fa12cb20bfacf6fe0.json} | 54 +++++++++++++------ .../leases/owner-comment-approvals.json | 16 +++--- 2 files changed, 45 insertions(+), 25 deletions(-) rename .rizzstack/contracts/{5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json => 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json} (84%) diff --git a/.rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json b/.rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json similarity index 84% rename from .rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json rename to .rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json index c41dcab..785742d 100644 --- a/.rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json +++ b/.rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json @@ -215,6 +215,24 @@ "tests/test_gate_authority.py::BasePinnedGateWorkflowTest::test_workflow_is_exactly_the_base_pinned_gate" ], "verification": "test" + }, + { + "id": "AC-025", + "regression": false, + "statement": "A matching owner comment whose recorded approval_pr resolves to a plain issue rather than a pull request is refused with contract_approval_mismatch.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_matching_comment_on_a_plain_issue_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-026", + "regression": false, + "statement": "A matching owner comment is refused with contract_approval_mismatch when the recorded approval_pr's file list does not add .rizzstack/contracts/.json (absent, renamed, modified, removed or under another directory).", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_matching_comment_on_a_pr_that_did_not_add_the_contract_is_refused" + ], + "verification": "test" } ], "assumptions": [ @@ -292,11 +310,12 @@ ], "notes": [ "verify_owner_approval(repo, document, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch.", - "Legacy rule: the gate resolves contracts from the base branch, so demanding a comment id from every contract would refuse every contract already on base and make every existing lease unrunnable. The strict form applies only when approval_pr and approval_comment_id are both present; the freeze tool must write both for new contracts. An unconditional dated cutover remains an owner decision.", + "Legacy rule: the gate resolves contracts from the base branch, so demanding a comment id from every contract would refuse every contract already on base and make every existing lease unrunnable. The strict form applies only when approval_pr and approval_comment_id are both present. This lease delivers opt-in gate-side verification only: making the freeze tool write both fields for every new contract is a separate bundlebees change, outside this contract's scope. A contract added to base without the fields after this lands therefore keeps the legacy path; that residual hand-edit hole is disclosed here, and an unconditional dated cutover remains an owner decision.", "review.approved_by must start with the literal 'Kyle (owner) typed:' and contain the trimmed comment body verbatim.", "The disclosure predicate is ported from scripts/merge_lane_v5.py _relay_disclosure_ok: exactly one disclosure line at the end, two newlines after a byte-identical owner body, the named review at the same commit_id with owner login and owner form. The shared policy block is not touched.", "The gate compares the comment bytes and never executes them; the id is bounded ASCII decimal before any URL is built.", - "Both workflows gain issues: read; tests/test_gate_authority.py's exact-shape expectation is updated in the same RED commit." + "Both workflows gain issues: read; tests/test_gate_authority.py's exact-shape expectation is updated in the same RED commit.", + "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable." ], "outcome": { "observable_behavior": [ @@ -305,21 +324,11 @@ "a contract with neither approval field keeps the legacy prose path with no API call", "a bot-posted owner-form approval counts only with exactly one disclosure line naming the owner review at the same head", "the canonical bot approval form still counts", - "the shared policy block is unchanged" + "the shared policy block is unchanged", + "a matching owner comment is refused when its recorded pull request is a plain issue or did not add the contract file" ], "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." }, - "review": { - "status": "approved", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", - "approved_at": "2026-12-01T17:08:33Z", - "contract_sha256": "5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67", - "test_collection": { - "manifest_sha256": "b8e6c9c4b29c9479af806494c509cd69067286dff1c28b14edeaa68aaeac1c05", - "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", - "collected": 87 - } - }, "risk": { "blast_radius": "Every gate run in rizzstack: both the base gate and the lease-tamper job resolve contracts, and both workflows gain a token permission", "reasons": [ @@ -356,13 +365,13 @@ "tests/test_gate_authority.py" ] }, - "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", + "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", "supersedes": [], "targets": [ { "base": "5833668105380a96b3626655ec9bc5bd3e3602c1", - "red": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", - "red_branch": "red/owner-comment-approvals-r2", + "red": "34cd8b349a703d833273f202fdacf3bfe81431af", + "red_branch": "red/owner-comment-approvals-r3", "repo": "mojomast/rizzstack" } ], @@ -377,5 +386,16 @@ "python3 -m unittest tests.test_gate_authority -v" ], "independent": true + }, + "review": { + "status": "approved", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", + "approved_at": "2026-12-01T17:55:47Z", + "contract_sha256": "1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0", + "test_collection": { + "manifest_sha256": "951e6cbd91e1dae4e6070aa964fc757e1f999aa334ad1973f672b608d137415d", + "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", + "collected": 89 + } } } diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index f2d59ec..592ae02 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67", + "contract_sha256": "1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0", "derived_from": { - "approved_at": "2026-12-01T17:08:33Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", - "contract": ".rizzstack/contracts/5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67.json" + "approved_at": "2026-12-01T17:55:47Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", + "contract": ".rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-01T17:08:33Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 5ceefe59236d538f8d6c1eae05166597d3782267f4bf421f223806ad66cf2d67 (RED 86118c772bb3cd3bdcdc28f5ed21ae0b829278ca on red/owner-comment-approvals-r2). Freeze it and proceed.", + "approved_at": "2026-12-01T17:55:47Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, @@ -44,6 +44,6 @@ ] }, "slice": "OWNER-COMMENT-APPROVALS", - "source_rev": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca", - "verify_sha": "86118c772bb3cd3bdcdc28f5ed21ae0b829278ca" + "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", + "verify_sha": "34cd8b349a703d833273f202fdacf3bfe81431af" } From 9fc8b2322ab98e95af5211834e650b294b21d8b6 Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 17:22:06 -0500 Subject: [PATCH 3/7] lease(owner-comment-approvals): re-freeze contract ce48da5b (r3) + lease r3 answers the second lease-PR review: the approval pull request must be merged and its merge commit equal to or an ancestor of the base revision (compare status behind/identical), and approval_pr is a bounded positive decimal refused before any request. RED 2e4fc42 on red/owner-comment-approvals-r4, tests only, 94 ids collected, every AC reference resolved. The r2 contract file is replaced in the same commit so the pull request adds exactly one contract. --- ...f283547d899a81501941da09667a0bd1d242.json} | 63 ++++++++++++++----- .../leases/owner-comment-approvals.json | 16 ++--- 2 files changed, 56 insertions(+), 23 deletions(-) rename .rizzstack/contracts/{1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json => ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json} (79%) diff --git a/.rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json b/.rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json similarity index 79% rename from .rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json rename to .rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json index 785742d..ebc74c1 100644 --- a/.rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json +++ b/.rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json @@ -233,6 +233,35 @@ "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_matching_comment_on_a_pr_that_did_not_add_the_contract_is_refused" ], "verification": "test" + }, + { + "id": "AC-027", + "regression": false, + "statement": "An approval pull request that is not merged (merged is false or absent in the API response) is refused with contract_approval_mismatch, and no ancestry query is made.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_an_unmerged_approval_pr_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-028", + "regression": false, + "statement": "A merged approval pull request is refused with contract_approval_mismatch when merge_commit_sha is not 40 lowercase hex, or when that merge commit is not equal to or an ancestor of the base revision the contract is resolved from (GET /repos/{repo}/compare/{revision}...{merge_commit_sha} must answer status behind or identical). A strict contract evaluated without a 40-hex base revision is refused before any HTTP call.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_merge_commit_not_on_the_base_revision_is_refused", + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_malformed_merge_commit_sha_refuses_without_raising", + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_strict_contract_without_a_base_revision_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-029", + "regression": false, + "statement": "approval_pr must be a positive decimal of at most 20 digits - an int in [1, 10^20) or a string matching [1-9][0-9]{0,19}; booleans, floats, signs, spaces, leading zeros, zero, superscript digits and runs over 20 digits are refused with contract_approval_mismatch before any HTTP request.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_malformed_approval_pr_refuses_without_raising" + ], + "verification": "test" } ], "assumptions": [ @@ -309,13 +338,15 @@ } ], "notes": [ - "verify_owner_approval(repo, document, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch.", + "verify_owner_approval(repo, document, revision=None, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch. A strict contract is evaluated only with the base revision the contract was resolved from: revision must be a 40-hex sha and approved_contract passes the revision it was given; the recorded pull request must be merged with a 40-hex lowercase merge_commit_sha that is equal to or an ancestor of that revision.", "Legacy rule: the gate resolves contracts from the base branch, so demanding a comment id from every contract would refuse every contract already on base and make every existing lease unrunnable. The strict form applies only when approval_pr and approval_comment_id are both present. This lease delivers opt-in gate-side verification only: making the freeze tool write both fields for every new contract is a separate bundlebees change, outside this contract's scope. A contract added to base without the fields after this lands therefore keeps the legacy path; that residual hand-edit hole is disclosed here, and an unconditional dated cutover remains an owner decision.", "review.approved_by must start with the literal 'Kyle (owner) typed:' and contain the trimmed comment body verbatim.", "The disclosure predicate is ported from scripts/merge_lane_v5.py _relay_disclosure_ok: exactly one disclosure line at the end, two newlines after a byte-identical owner body, the named review at the same commit_id with owner login and owner form. The shared policy block is not touched.", "The gate compares the comment bytes and never executes them; the id is bounded ASCII decimal before any URL is built.", "Both workflows gain issues: read; tests/test_gate_authority.py's exact-shape expectation is updated in the same RED commit.", - "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable." + "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable.", + "The r3 cases answer the second lease-PR review: the r2 file-list check only proved that an unmerged proposal listed the contract as added, so the pull request must now be merged and its merge commit must be on the base revision; and approval_pr, previously unbounded while interpolated into two authenticated requests, is validated as a bounded positive decimal before any request.", + "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str()." ], "outcome": { "observable_behavior": [ @@ -325,7 +356,9 @@ "a bot-posted owner-form approval counts only with exactly one disclosure line naming the owner review at the same head", "the canonical bot approval form still counts", "the shared policy block is unchanged", - "a matching owner comment is refused when its recorded pull request is a plain issue or did not add the contract file" + "a matching owner comment is refused when its recorded pull request is a plain issue or did not add the contract file", + "an approval pull request that is unmerged, or whose merge commit is not on the base revision, refuses with contract_approval_mismatch", + "a malformed or out-of-range approval_pr refuses before any HTTP request" ], "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." }, @@ -365,21 +398,21 @@ "tests/test_gate_authority.py" ] }, - "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", + "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", "supersedes": [], "targets": [ { - "base": "5833668105380a96b3626655ec9bc5bd3e3602c1", - "red": "34cd8b349a703d833273f202fdacf3bfe81431af", - "red_branch": "red/owner-comment-approvals-r3", - "repo": "mojomast/rizzstack" + "repo": "mojomast/rizzstack", + "base": "288279afc003345c20b0d78abfb472658b174aad", + "red": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", + "red_branch": "red/owner-comment-approvals-r4" } ], "tdd": { "applicable": true, "test_first": true }, - "title": "Owner-comment contract approvals and the disclosed owner relay in the base gate", + "title": "Owner-comment contract approvals and the disclosed owner relay in the base gate (r3)", "verification": { "commands": [ "python3 -m unittest tests.test_owner_approvals -v", @@ -389,13 +422,13 @@ }, "review": { "status": "approved", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", - "approved_at": "2026-12-01T17:55:47Z", - "contract_sha256": "1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", + "approved_at": "2026-12-01T22:21:13Z", + "contract_sha256": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", "test_collection": { - "manifest_sha256": "951e6cbd91e1dae4e6070aa964fc757e1f999aa334ad1973f672b608d137415d", - "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", - "collected": 89 + "manifest_sha256": "51093173a9cea853a89db382e67008ea82821ebf54a9ea5ea748ffb01cd2a930", + "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", + "collected": 94 } } } diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index 592ae02..60756e8 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0", + "contract_sha256": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", "derived_from": { - "approved_at": "2026-12-01T17:55:47Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", - "contract": ".rizzstack/contracts/1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0.json" + "approved_at": "2026-12-01T22:21:13Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", + "contract": ".rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-01T17:55:47Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals 1104911447f65c7e9a9586bfbba09b4829ea10fda955d40fa12cb20bfacf6fe0 (RED 34cd8b349a703d833273f202fdacf3bfe81431af on red/owner-comment-approvals-r3, r2 carrying the review's two lease-PR findings). Freeze it and proceed.", + "approved_at": "2026-12-01T22:21:13Z", + "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, @@ -44,6 +44,6 @@ ] }, "slice": "OWNER-COMMENT-APPROVALS", - "source_rev": "34cd8b349a703d833273f202fdacf3bfe81431af", - "verify_sha": "34cd8b349a703d833273f202fdacf3bfe81431af" + "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", + "verify_sha": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa" } From 620ad9b35fcf69997990eb87ed0c86ee2400a3b1 Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 20:04:12 -0500 Subject: [PATCH 4/7] lease(owner-comment-approvals): re-freeze contract a09f114b (r4) + lease The r3 lease PR review found that the pull request file list and merge ancestry do not prove the merge introduced the contract. r4 adds AC-030 (the merge commit's change against its first parent must add the contract file), AC-031 (rejection when the file list and ancestry pass but the merge introduced nothing) and AC-032 (an unreadable merge payload refuses). The contract is frozen at 32 ACs, 97 collected ids; the lease repoints contract_sha256, source_rev and verify_sha at the r4 RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5. --- ...6995191107458a57dc17fafe82f63d4c4935.json} | 72 +++++++++++++------ .../leases/owner-comment-approvals.json | 16 ++--- 2 files changed, 59 insertions(+), 29 deletions(-) rename .rizzstack/contracts/{ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json => a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json} (82%) diff --git a/.rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json b/.rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json similarity index 82% rename from .rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json rename to .rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json index ebc74c1..4e5dd80 100644 --- a/.rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json +++ b/.rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json @@ -262,6 +262,33 @@ "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_malformed_approval_pr_refuses_without_raising" ], "verification": "test" + }, + { + "id": "AC-030", + "regression": false, + "statement": "A matching owner comment is refused with contract_approval_mismatch unless the recorded approval_pr's merge commit (GET /repos/{repo}/commits/{merge_commit_sha}) is readable, reports its own sha equal to merge_commit_sha, carries at least one parent with a 40-hex lowercase sha, and lists .rizzstack/contracts/.json with status 'added' in its files list - the change the merge introduced against its first parent. A passing pull request file list and merge ancestry are not sufficient.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_the_merge_commit_must_add_the_contract_to_its_first_parent" + ], + "verification": "test" + }, + { + "id": "AC-031", + "regression": false, + "statement": "A matching owner comment is refused with contract_approval_mismatch when the approval_pr's pull request file list and merge ancestry both pass but the merge commit's files list does not add .rizzstack/contracts/.json (empty, modified, removed, renamed, under another directory, or another contract's file); the merge result must be consulted before the refusal.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_a_merge_that_did_not_introduce_the_contract_is_refused" + ], + "verification": "test" + }, + { + "id": "AC-032", + "regression": false, + "statement": "A merge result whose payload is unreadable - missing files, missing or malformed parents, a sha that differs from merge_commit_sha, or a non-object - refuses with contract_approval_mismatch without raising.", + "tests": [ + "tests/test_owner_approvals.py::OwnerCommentApprovalTest::test_an_unreadable_merge_commit_refuses_without_raising" + ], + "verification": "test" } ], "assumptions": [ @@ -338,7 +365,7 @@ } ], "notes": [ - "verify_owner_approval(repo, document, revision=None, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch. A strict contract is evaluated only with the base revision the contract was resolved from: revision must be a 40-hex sha and approved_contract passes the revision it was given; the recorded pull request must be merged with a 40-hex lowercase merge_commit_sha that is equal to or an ancestor of that revision.", + "verify_owner_approval(repo, document, revision=None, token=None, api_url=DEFAULT_API_URL, http=None) returns the comment dict for a strict contract, None for a legacy contract, and raises GateError with reason contract_approval_missing / contract_approval_unreadable / contract_approval_mismatch. A strict contract is evaluated only with the base revision the contract was resolved from: revision must be a 40-hex sha and approved_contract passes the revision it was given; the recorded pull request must be merged with a 40-hex lowercase merge_commit_sha that is equal to or an ancestor of that revision, and the merge commit's own files list (its change against the first parent) must add the contract file.", "Legacy rule: the gate resolves contracts from the base branch, so demanding a comment id from every contract would refuse every contract already on base and make every existing lease unrunnable. The strict form applies only when approval_pr and approval_comment_id are both present. This lease delivers opt-in gate-side verification only: making the freeze tool write both fields for every new contract is a separate bundlebees change, outside this contract's scope. A contract added to base without the fields after this lands therefore keeps the legacy path; that residual hand-edit hole is disclosed here, and an unconditional dated cutover remains an owner decision.", "review.approved_by must start with the literal 'Kyle (owner) typed:' and contain the trimmed comment body verbatim.", "The disclosure predicate is ported from scripts/merge_lane_v5.py _relay_disclosure_ok: exactly one disclosure line at the end, two newlines after a byte-identical owner body, the named review at the same commit_id with owner login and owner form. The shared policy block is not touched.", @@ -346,7 +373,8 @@ "Both workflows gain issues: read; tests/test_gate_authority.py's exact-shape expectation is updated in the same RED commit.", "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable.", "The r3 cases answer the second lease-PR review: the r2 file-list check only proved that an unmerged proposal listed the contract as added, so the pull request must now be merged and its merge commit must be on the base revision; and approval_pr, previously unbounded while interpolated into two authenticated requests, is validated as a bounded positive decimal before any request.", - "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str()." + "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str().", + "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch." ], "outcome": { "observable_behavior": [ @@ -358,10 +386,23 @@ "the shared policy block is unchanged", "a matching owner comment is refused when its recorded pull request is a plain issue or did not add the contract file", "an approval pull request that is unmerged, or whose merge commit is not on the base revision, refuses with contract_approval_mismatch", - "a malformed or out-of-range approval_pr refuses before any HTTP request" + "a malformed or out-of-range approval_pr refuses before any HTTP request", + "a matching owner comment is refused unless the approval pull request's merge commit, as its own change against the first parent, adds the contract file; the pull request file list and merge ancestry alone do not prove the merge introduced it", + "an unreadable merge result refuses" ], "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." }, + "review": { + "status": "approved", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "approved_at": "2026-12-02T01:03:00Z", + "contract_sha256": "a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935", + "test_collection": { + "manifest_sha256": "ca5e0fb2230e9fe1736eab6df9196e78b11d1260f888844350b684485b784812", + "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", + "collected": 97 + } + }, "risk": { "blast_radius": "Every gate run in rizzstack: both the base gate and the lease-tamper job resolve contracts, and both workflows gain a token permission", "reasons": [ @@ -398,37 +439,26 @@ "tests/test_gate_authority.py" ] }, - "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", - "supersedes": [], + "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", + "supersedes": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", "targets": [ { - "repo": "mojomast/rizzstack", - "base": "288279afc003345c20b0d78abfb472658b174aad", - "red": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", - "red_branch": "red/owner-comment-approvals-r4" + "base": "02d16f1c009ba24ae7ae396bc6edf49f920b9d2e", + "red": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", + "red_branch": "red/owner-comment-approvals-r5", + "repo": "mojomast/rizzstack" } ], "tdd": { "applicable": true, "test_first": true }, - "title": "Owner-comment contract approvals and the disclosed owner relay in the base gate (r3)", + "title": "Owner-comment contract approvals and the disclosed owner relay in the base gate (r4)", "verification": { "commands": [ "python3 -m unittest tests.test_owner_approvals -v", "python3 -m unittest tests.test_gate_authority -v" ], "independent": true - }, - "review": { - "status": "approved", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", - "approved_at": "2026-12-01T22:21:13Z", - "contract_sha256": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", - "test_collection": { - "manifest_sha256": "51093173a9cea853a89db382e67008ea82821ebf54a9ea5ea748ffb01cd2a930", - "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", - "collected": 94 - } } } diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index 60756e8..f7fe9c4 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", + "contract_sha256": "a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935", "derived_from": { - "approved_at": "2026-12-01T22:21:13Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", - "contract": ".rizzstack/contracts/ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242.json" + "approved_at": "2026-12-02T01:03:00Z", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "contract": ".rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-01T22:21:13Z", - "approved_by": "Kyle (owner) typed: standing approval 2026-12-01 (until W3 lands or 2026-12-08) - approved: owner-comment-approvals ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242 (RED 2e4fc428e41f90fd236462b5a7e1c8f8131408aa on red/owner-comment-approvals-r4, r3 carrying the review's unmerged-PR and unbounded-approval_pr findings). Freeze it and proceed.", + "approved_at": "2026-12-02T01:03:00Z", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, @@ -44,6 +44,6 @@ ] }, "slice": "OWNER-COMMENT-APPROVALS", - "source_rev": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa", - "verify_sha": "2e4fc428e41f90fd236462b5a7e1c8f8131408aa" + "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", + "verify_sha": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d" } From 25148c821f124cb75140a0c287b26074f16580d4 Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 20:10:17 -0500 Subject: [PATCH 5/7] lease(owner-comment-approvals): r4 fix - supersedes is a list; summary states the opt-in limit The r4 review host read a character-wise supersedes because the field was a string. r3/r2/r1 were branch-local re-cuts, none ever on the base branch, so supersedes is an empty list and the notes carry the lineage. The outcome summary now states that the strict owner-comment path applies only when approval_pr and approval_comment_id are both present. Contract 15a28be4, 32 ACs, 97 ids; RED unchanged at 5326db9a on red/owner-comment-approvals-r5. --- ...3389af068470be321ac86b28023924026760f780.json} | 15 ++++++++------- .rizzstack/leases/owner-comment-approvals.json | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) rename .rizzstack/contracts/{a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json => 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json} (96%) diff --git a/.rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json b/.rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json similarity index 96% rename from .rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json rename to .rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json index 4e5dd80..efb6713 100644 --- a/.rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json +++ b/.rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json @@ -374,7 +374,8 @@ "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable.", "The r3 cases answer the second lease-PR review: the r2 file-list check only proved that an unmerged proposal listed the contract as added, so the pull request must now be merged and its merge commit must be on the base revision; and approval_pr, previously unbounded while interpolated into two authenticated requests, is validated as a bounded positive decimal before any request.", "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str().", - "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch." + "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch.", + "The r1-r3 predecessor contracts were branch-local re-cuts: each was added and removed within this lease branch and none ever existed on the base branch, so supersedes is empty and the head tree carries exactly one owner-comment-approvals contract. The lineage is in the campaign record." ], "outcome": { "observable_behavior": [ @@ -390,15 +391,15 @@ "a matching owner comment is refused unless the approval pull request's merge commit, as its own change against the first parent, adds the contract file; the pull request file list and merge ancestry alone do not prove the merge introduced it", "an unreadable merge result refuses" ], - "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." + "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable. The strict form applies only to a contract that records both approval_pr and approval_comment_id; a contract carrying neither keeps the legacy prose path." }, "review": { "status": "approved", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", - "approved_at": "2026-12-02T01:03:00Z", - "contract_sha256": "a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "approved_at": "2026-12-02T01:09:33Z", + "contract_sha256": "15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780", "test_collection": { - "manifest_sha256": "ca5e0fb2230e9fe1736eab6df9196e78b11d1260f888844350b684485b784812", + "manifest_sha256": "95eb39eaa1a563a82dec57388198386d37d95172adc0270b3a98809614b5fc0e", "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", "collected": 97 } @@ -440,7 +441,7 @@ ] }, "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", - "supersedes": "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242", + "supersedes": [], "targets": [ { "base": "02d16f1c009ba24ae7ae396bc6edf49f920b9d2e", diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index f7fe9c4..d1b04c5 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935", + "contract_sha256": "15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780", "derived_from": { - "approved_at": "2026-12-02T01:03:00Z", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", - "contract": ".rizzstack/contracts/a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935.json" + "approved_at": "2026-12-02T01:09:33Z", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "contract": ".rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-02T01:03:00Z", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals a09f114b720d091888f11ab99ded6995191107458a57dc17fafe82f63d4c4935 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "approved_at": "2026-12-02T01:09:33Z", + "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, From a36011120401e9a28d1c64b2e32f710d6cb30b23 Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 20:12:00 -0500 Subject: [PATCH 6/7] lease(owner-comment-approvals): re-freeze contract 3e9d9cf4 (r5) - supersedes as a list Owner: go on #73 r5: supersedes as a list ["ce48da5b..."], nothing else changed. The r4 contract carried supersedes as a bare string, which the gate reads per character; every other contract carries a list. This cut restores the r4 text exactly and changes only that field. Contract 3e9d9cf44abd8e14, 32 ACs, 97 ids at source_rev 5326db9a; lease repointed. --- ...6fad3782815c395c48bc3c4477870deb8e951e.json} | 17 +++++++++-------- .rizzstack/leases/owner-comment-approvals.json | 12 ++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) rename .rizzstack/contracts/{15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json => 3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json} (94%) diff --git a/.rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json b/.rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json similarity index 94% rename from .rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json rename to .rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json index efb6713..fb50693 100644 --- a/.rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json +++ b/.rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json @@ -374,8 +374,7 @@ "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable.", "The r3 cases answer the second lease-PR review: the r2 file-list check only proved that an unmerged proposal listed the contract as added, so the pull request must now be merged and its merge commit must be on the base revision; and approval_pr, previously unbounded while interpolated into two authenticated requests, is validated as a bounded positive decimal before any request.", "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str().", - "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch.", - "The r1-r3 predecessor contracts were branch-local re-cuts: each was added and removed within this lease branch and none ever existed on the base branch, so supersedes is empty and the head tree carries exactly one owner-comment-approvals contract. The lineage is in the campaign record." + "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch." ], "outcome": { "observable_behavior": [ @@ -391,15 +390,15 @@ "a matching owner comment is refused unless the approval pull request's merge commit, as its own change against the first parent, adds the contract file; the pull request file list and merge ancestry alone do not prove the merge introduced it", "an unreadable merge result refuses" ], - "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable. The strict form applies only to a contract that records both approval_pr and approval_comment_id; a contract carrying neither keeps the legacy prose path." + "summary": "The base gate accepts an owner-form contract approval only from the owner's own comment on the lease pull request that carried the contract, includes the W1b relay-disclosure rule in the same review predicate, and leaves every contract already on base runnable." }, "review": { "status": "approved", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", - "approved_at": "2026-12-02T01:09:33Z", - "contract_sha256": "15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780", + "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", + "approved_at": "2026-12-02T01:11:39Z", + "contract_sha256": "3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e", "test_collection": { - "manifest_sha256": "95eb39eaa1a563a82dec57388198386d37d95172adc0270b3a98809614b5fc0e", + "manifest_sha256": "3c36570e53f8231222db2dec552cad9631b3d081acd3d6953083da55a93920f0", "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", "collected": 97 } @@ -441,7 +440,9 @@ ] }, "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", - "supersedes": [], + "supersedes": [ + "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242" + ], "targets": [ { "base": "02d16f1c009ba24ae7ae396bc6edf49f920b9d2e", diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index d1b04c5..20564b3 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780", + "contract_sha256": "3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e", "derived_from": { - "approved_at": "2026-12-02T01:09:33Z", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", - "contract": ".rizzstack/contracts/15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780.json" + "approved_at": "2026-12-02T01:11:39Z", + "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", + "contract": ".rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-02T01:09:33Z", - "approved_by": "Kyle (owner) typed: yes to r4 - AC-030 (approval PR's merge commit, diffed against its first parent, adds .rizzstack/contracts/.json) and AC-031 (rejection case where the file list and ancestry both pass but the merge introduced nothing); correct the description; proceed under the standing approval. Standing approval 2026-12-01: approved: owner-comment-approvals 15a28be4782032a377fa516b3389af068470be321ac86b28023924026760f780 (RED 5326db9a867c12dcd2f07d10b48e8fc161d6d07d on red/owner-comment-approvals-r5).", + "approved_at": "2026-12-02T01:11:39Z", + "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" }, From 751990c20a8131fa4a441b6ea2f6c634dac6ff8b Mon Sep 17 00:00:00 2001 From: "Hermes (coordinator)" Date: Tue, 1 Dec 2026 20:16:01 -0500 Subject: [PATCH 7/7] lease(owner-comment-approvals): re-freeze contract 19f90591 (r6) - supersedes empty, one lineage note Owner: supersedes [] plus one note that r1-r4 were branch-local re-cuts that never reached main; restore r4's summary and notes otherwise. The r4 text is restored verbatim except supersedes (now []) and one appended note. The host's r5 round rejected the ce48da5b reference because that contract never existed on main: 17 contracts are on main and none of them belong to this lineage. Contract 19f905910fea364e, 32 ACs, 97 ids at source_rev 5326db9a. --- ...b302e804925af44d006cbcc896c922ef7c6e8b5b.json} | 15 +++++++-------- .rizzstack/leases/owner-comment-approvals.json | 12 ++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) rename .rizzstack/contracts/{3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json => 19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b.json} (96%) diff --git a/.rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json b/.rizzstack/contracts/19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b.json similarity index 96% rename from .rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json rename to .rizzstack/contracts/19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b.json index fb50693..a997f5e 100644 --- a/.rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json +++ b/.rizzstack/contracts/19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b.json @@ -374,7 +374,8 @@ "The approval target is resolved as a pull request before the file check: GET /repos/{repo}/issues/{approval_pr} must return an object carrying a pull_request marker (a plain issue refuses with contract_approval_mismatch), then GET /repos/{repo}/pulls/{approval_pr}/files?per_page=100 is read across pages (Link rel=next, MAX_PAGES) and must contain an entry with status 'added' and filename '.rizzstack/contracts/.json'. A well-formed non-PR or a file list without that added entry refuses with contract_approval_mismatch; a transport or parse failure on either read refuses with contract_approval_unreadable.", "The r3 cases answer the second lease-PR review: the r2 file-list check only proved that an unmerged proposal listed the contract as added, so the pull request must now be merged and its merge commit must be on the base revision; and approval_pr, previously unbounded while interpolated into two authenticated requests, is validated as a bounded positive decimal before any request.", "approval_pr normal form is the int GitHub returns; a canonical decimal string is accepted so a hand-written contract can be reviewed, but no other type is, and the value is rendered with a bound rather than passed through str().", - "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch." + "The r4 cases answer the third lease-PR review: the pull request file list describes the proposed diff, and merge ancestry only proves the merge commit is in history, so neither proves the merge introduced the contract. The gate reads GET /repos/{repo}/commits/{merge_commit_sha} and requires an added entry for .rizzstack/contracts/.json in that commit's files list, which GitHub computes against the commit's first parent; a malformed or mismatched payload refuses with contract_approval_mismatch.", + "The r1-r4 predecessor contracts were branch-local re-cuts: each was added and removed inside this lease branch and none of them ever reached main, so supersedes is empty and the head tree carries exactly one owner-comment-approvals contract." ], "outcome": { "observable_behavior": [ @@ -394,11 +395,11 @@ }, "review": { "status": "approved", - "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", - "approved_at": "2026-12-02T01:11:39Z", - "contract_sha256": "3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e", + "approved_by": "Kyle (owner) typed: #73: supersedes [] plus one note that r1-r4 were branch-local re-cuts that never reached main. Restore r4's summary and notes otherwise (no other text changes), re-freeze, one review. If APPROVE, run the lane with --merge.", + "approved_at": "2026-12-02T01:15:44Z", + "contract_sha256": "19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b", "test_collection": { - "manifest_sha256": "3c36570e53f8231222db2dec552cad9631b3d081acd3d6953083da55a93920f0", + "manifest_sha256": "3552388418e1f5d2652d15446604b2ea44410b5698bba21d4ab7d11ba99993bd", "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", "collected": 97 } @@ -440,9 +441,7 @@ ] }, "source_rev": "5326db9a867c12dcd2f07d10b48e8fc161d6d07d", - "supersedes": [ - "ce48da5b37061bf2315a2fd8f2d8f283547d899a81501941da09667a0bd1d242" - ], + "supersedes": [], "targets": [ { "base": "02d16f1c009ba24ae7ae396bc6edf49f920b9d2e", diff --git a/.rizzstack/leases/owner-comment-approvals.json b/.rizzstack/leases/owner-comment-approvals.json index 20564b3..f0222f1 100644 --- a/.rizzstack/leases/owner-comment-approvals.json +++ b/.rizzstack/leases/owner-comment-approvals.json @@ -1,17 +1,17 @@ { "branch": "feat/owner-comment-approvals", "contract_id": "owner-comment-approvals", - "contract_sha256": "3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e", + "contract_sha256": "19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b", "derived_from": { - "approved_at": "2026-12-02T01:11:39Z", - "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", - "contract": ".rizzstack/contracts/3e9d9cf44abd8e14218bae512f6fad3782815c395c48bc3c4477870deb8e951e.json" + "approved_at": "2026-12-02T01:15:44Z", + "approved_by": "Kyle (owner) typed: #73: supersedes [] plus one note that r1-r4 were branch-local re-cuts that never reached main. Restore r4's summary and notes otherwise (no other text changes), re-freeze, one review. If APPROVE, run the lane with --merge.", + "contract": ".rizzstack/contracts/19f905910fea364ea4671fc2b302e804925af44d006cbcc896c922ef7c6e8b5b.json" }, "id": "owner-comment-approvals", "lease_version": "rizzstack.lease/1", "review": { - "approved_at": "2026-12-02T01:11:39Z", - "approved_by": "Kyle (owner) typed: go on #73 r5: supersedes as a list [\"ce48da5b\u2026\"], nothing else changed. Re-freeze, push to the same branch (no force), one review.", + "approved_at": "2026-12-02T01:15:44Z", + "approved_by": "Kyle (owner) typed: #73: supersedes [] plus one note that r1-r4 were branch-local re-cuts that never reached main. Restore r4's summary and notes otherwise (no other text changes), re-freeze, one review. If APPROVE, run the lane with --merge.", "note": "contract_sha256 names the approved frozen contract; scope and source_rev are its verbatim scope", "status": "frozen" },