Skip to content

0.1.2 CR3: a red or missing rehearsal blocks release candidate's ship #2451

Done

Description

@jparker2006

Parent

Ticket CR3 of spec #2437 (0.1.2), the release gate. Size: M.

What to build

A red or missing rehearsal blocks a ship. Add one new gate to release candidate, as spec #2437 fixes it, run by both evaluate and publish before the tag:

  • read the latest trusted Packages run at the candidate commit (.github/workflows/packages.yml, the github-actions app; the same trust rules as required_check);
  • require its rehearsal check run completed success;
  • for every target in TARGETS, read its openwiz-rehearsal-<version>-<target> receipt (contracts/rehearsal.v1.md) and require status pass with version, source and archive_sha256 equal to the candidate's sealed artifacts.

Reasons: rehearsal_missing, rehearsal_failed, rehearsal_untrusted, rehearsal_stale and rehearsal_unreadable. Add row 19 to the README's precondition table, and the gate to the evidence the record keeps. Rows 1 to 18, their functions, their order and their reasons stay unchanged: never weaken an existing gate.

Owned paths

  • tools/release/candidate.py (only the new rehearsal gate, called once by evaluate and once by publish)
  • tools/release/test_candidate.py (only new tests)
  • tools/release/README.md (only row 19 and one paragraph on the gate)
  • changes/2451.md

Relies on: tools/rehearsal/rehearse.py

Links

Acceptance criteria

  • On fixtures, each of these is blocked with its exact reason in both evaluate and publish, red first: no Packages run at the commit, a run from an untrusted app or path, a red or missing rehearsal check run, a missing target receipt, a fail receipt, and a receipt for other bytes or another commit
  • A candidate with a green run and matching receipts for all three targets passes the new gate
  • Every existing test_candidate.py test passes unchanged, and the diff leaves rows 1 to 18's code and reasons byte-for-byte as they were
  • python3 tools/release/test.py passes

Proof

P3 (gate): seam 3 red first, and the review's check that no existing gate is weakened.

Activity

  1. added this to the 0.1.2 milestone on Nov 22, 2026
  2. added
    ready-for-agent
    on Nov 22, 2026
  3. jparker2006 commented on Nov 23, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: started

    Hand checks before the builder starts (lead of spec #2437, under machine plan approval revision 1): the ticket is open; its only label is ready-for-agent; no claim, builder or pull request; its blockers #2446 and #2383 are merged; no open pull request touches its owned paths, since #2781 (which held tools/release/test_candidate.py and tools/release/README.md) has merged. Builder: Claude Code Opus 5.5, medium effort. An approach note comes first.

  4. jparker2006 commented on Nov 23, 2026

    @jparker2006
    MemberAuthor

    Approach note: #2451, a red or missing rehearsal blocks release candidate's ship (row 19)

    Where. One new function, rehearsal_reasons(record), in tools/release/candidate.py. It is called once by evaluate, inside the existing if reasons != ['candidate_changed'] block after first_write_reasons, and its reasons are collected with the others. It is called once by publish, on the first pass only, after tagger (row 18) and before git tag. There it blocks on its first failure, like rows 15 to 18. It is not in reasons_for, so publish does not run it again before the release. Reasons: rehearsal_missing, rehearsal_failed, rehearsal_untrusted, rehearsal_stale, rehearsal_unreadable.

    Trust: required_check's rules, for the Packages workflow.

    • Workflow runs come from actions/workflows/packages.yml/runs?head_sha=<commit> and must have path == .github/workflows/packages.yml and head_sha == commit.
    • Check runs come from the shared commits/<commit>/check-runs read, filtered to the name rehearsal.
    • missing: no rehearsal check run.
    • untrusted: no Packages run at that path, or any rehearsal check run whose app slug is not github-actions.
    • Skipped runs are dropped. The latest run is chosen by (created_at, run_attempt). That run must be completed success, and its own rehearsal check run (matched by check_suite_id) must be completed success at the commit; otherwise failed.
    • unreadable: any read error.
    • It reuses check_runs and pages unchanged. I re-state the selection rather than call required_check, because required_check looks up WORKFLOWS[gate], and adding a key there would edit row 7's table.

    Receipts, bound to the sealed bytes, with no new network trust. All reads go through the same gh api channel to api.github.com that the gate already trusts.

    • For every target in TARGETS (three today; the gate keeps no list of its own), it lists actions/runs/<run id>/artifacts. It takes the newest unexpired openwiz-rehearsal-<release_version>-<target> whose workflow_run is that run at the commit. None: missing.
    • It fetches actions/artifacts/<id>/zip. The zip's sha256 must equal the listing's digest. The zip must hold exactly one member, rehearsal.json, at most 64 KiB, strict JSON in the openwiz.rehearsal.v1 shape, for the right target. Anything else: unreadable.
    • status: fail: failed.
    • version other than release_version, source other than the candidate commit, or archive_sha256 other than the sealed archive row for that target: stale.
    • Evidence: on a pass it writes evidence/rehearsal.json (run id and attempt, check-run ids, and for each target the artifact id, digest and receipt sha256) in the state folder. It never writes a new slot in record.json's gates, because that would change the release-candidate.v1 contract (not owned).

    Rows 1 to 18 unchanged.

    • git diff -U0 origin/main -- tools/release/candidate.py has no - lines (additions only).
    • An ast.dump comparison of every function named in rows 1 to 18 shows they are identical at origin/main and at the head.
    • All 76 existing tests pass with their test bodies unchanged.

    Tests (seam 3, red first), in test_candidate.py. One new test runs each case through both evaluate and publish and asserts the exact reason, with no write in any case: no Packages run; a run from another path; a run from another app; a red rehearsal; a missing rehearsal; a missing target receipt; a fail receipt; a receipt for other bytes; a receipt for another commit; a zip that doesn't match its digest. A green run with three matching receipts passes evaluate and publish.

    Supporting edit (standing rule 4, synthetic answers to test fakes my change breaks). A stub gate fails 44 of the 76 existing tests, because the fixture world has no Packages run. So World.checks() adds a green rehearsal check run, a Packages run and three pass receipts built from the sealed record, and FAKE_GH returns zip bytes for /zip reads. No assertion and no existing test body changes.

    Ask. The README intro line "evaluate runs all 18" is outside "row 19 and one paragraph". My pick: leave it, and make the new paragraph say row 19 is added to both. Say if you'd rather I change "18" to "19" there.

    Dropped. Calling required_check('rehearsal') through a new WORKFLOWS key (it edits row 7's table). gh run download (more moving parts). Binding manifest_sha256 too (beyond the spec).

    One-way door. None in this ticket's code: the gate only reads, and a refusal blocks a ship, which a later fix can undo.

  5. jparker2006 commented on Nov 23, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for #2451:
    tools/release/README.md
    tools/release/test_candidate.py

    Lead of spec #2437, under the planner's grant authority for my own tickets. In tools/release/README.md, the intro's count of the preconditions evaluate runs may change from 18 to 19. In tools/release/test_candidate.py, the shared fixture world (World.checks() and the fake gh) may gain a green Packages run, its rehearsal check run and pass receipts built from the sealed record, so existing tests see a passing row 19. No existing assertion or test body changes. Nothing else is granted.

  6. added 2 commits that reference this issue on Nov 23, 2026
  7. jparker2006 commented on Nov 23, 2026

    @jparker2006
    MemberAuthor

    agent: builder
    state: done
    harness: Claude Code
    model: Opus 5.5
    skills: build-ticket@0.2.2
    step: Row 19 is built red first and handed back green as pull request 2917; awaiting review.
    pr: #2917

  8. added 3 commits that reference this issue on Nov 24, 2026
  9. jparker2006 commented on Nov 24, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for #2451:
    docs/evidence/2451/

    Lead of spec #2437, under the planner's grant authority for my own tickets. The folder holds the red and green proof logs of the build and its fix round (red.log, red-2.log, green.log) and nothing else. Lead ruling on the fix round: with the rehearsal check run held green, a candidate with no trusted Packages run at the commit reads rehearsal_untrusted, not rehearsal_missing. This matches required_check's trust rules (a check run without a trusted workflow run is untrusted).

  10. jparker2006 commented on Nov 24, 2026

    @jparker2006
    MemberAuthor

    agent: reviewer
    state: done
    harness: claude
    model: claude-opus-5-5
    skills: review-ticket@0.4.0
    step: re-check posted: APPROVE at 4f9bcdf
    time: 2026-11-24T12:16:11Z
    pr: #2917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions