← Back to Pull requests

feat(release): freeze CI and release-tool merges while a release request is active #2475

Closed
unknown closed this pull request without merging on Oct 23, 2026 01:29 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 00:04 UTC
Author

Summary

Item 10 of the "Next" plan in #2422 (tool-enforced freeze; #2404 item 1). Decision recorded with the Owner on 2026-10-22 (option A of three) in docs/prd/decisions/2026-10-22-release-control-plane-freeze.md.

During 2.0.122.0 three PRs (#2365, #2371, #2375) merged inside the cut window; one changed the host admission script that then rerouted candidate 118's Web lanes. The freeze was enforced only by people and agents agreeing to it. The facts that shaped the design: the repository has no rulesets and main's only protection is conversation resolution; the release driver, agents and the Owner all authenticate as the same account, so a ruleset bypass cannot tell the driver from an agent and the driver would have to toggle a ruleset around its own cut and witness merges; repository variables are already a pattern (vars.); the issue-done skill forbids adding a required check under a Task's authority.

Change

  • tools/release/release_freeze.py: ReleaseFreeze(github, repository) with read, hold(request_id) and release(request_id) over the repository variable LMDJ_RELEASE_FREEZE. hold creates the variable or is a no-op for the same request and refuses while another request holds it; release deletes only this request's freeze and refuses to clear another's; request ids are validated before any write; API refusals propagate.

  • tools/release/github_api.py: get_repository_variable (404 is None), create_repository_variable (201), update_repository_variable and delete_repository_variable (204), with closed bodies and a validated variable name.

  • tools/release/cli.py: run/resume hold the freeze for the request the journal will drive (resolve_active adopts a same-scope unfinished original and refuses another scope first) before any journal write, and release it when the result is complete; both retire paths release it before the journal changes (their docstrings now say the one remote write is this variable). release_freeze/retire_freeze are the patchable factories.

  • tools/release/doctor.py: release freeze check after journal lock, reading the repository and then the variable through gh api (only an HTTP 404 means absent): absent is ok, an active request holding it is ok and says so, a stale or unknown holder fails with the gh variable delete remedy (after confirming no release runs elsewhere), an unreadable variable API fails closed; run_doctor takes the policy's repository.

  • scripts/ci/release_freeze_check.py and .github/workflows/pr-contract.yml: the Release freeze job reads vars.LMDJ_RELEASE_FREEZE and the frozen change-scope manifest, and fails when the variable names a request and the PR changes a frozen path (.github/workflows/, .github/actions/, scripts/ci/, scripts/release.sh, tools/release/); no variable means nothing is frozen; a malformed variable or manifest fails closed. Not a required status check (no protection change).

  • Skills and governance: issue-done §5 "Check the release freeze" (read the variable, do not merge frozen control-plane PRs, never clear it to merge); lmdj-release skill (the freeze lifecycle and the doctor check); docs/governance/git-workflow.md (the frozen path set beside "a cut does not freeze all ordinary PR merges", which stays true).

  • Tests: ci_release_freeze_check_test (5), release_freeze_test (8), release_github_api_test (+2), release_doctor_test (+5 and the fixed order), release_cli_orchestration_test (+3: hold and release on completion, a blocked request keeps it and resume holds it again, a second release refuses before any journal write; fakes gain an in-memory variable store), ci_workflow_topology_test (+1), ci_hosted_runner_policy_test (job set), skill pins in release_skill_test and ci_issue_done_skill_test.
  • Related Issue

    Related issue: #2422

    Premise refresh (issue-done §0)

    Base: origin/main at 7c317286c (after #2473). Verified on the base: gh api repos/endaye/lmdj/rulesets is empty; main protection has no required status checks, no reviews, conversation resolution only; the driver's PR branches are feat/release-candidate-, docs/release-witness-, docs/release-evidence- and touch no frozen path; pr-contract.yml has change-scope, ci-contract, docs-static, documentation-impact, portal-provenance; the change-scope manifest carries changed_files[].paths; canary-assessment.yml and the Cloudflare workflows already read vars.. No open issue or branch delivers a freeze. Still outstanding; delivered here. No release request is active (every journal request is retired; no driver process).

    Verification

  • Every new test was written first and failed on the base (ModuleNotFoundError for the two new modules, AttributeError for the missing client methods and CLI factories, assertion failures for the missing job and pins); after the change they pass.

  • Mutation proofs (file restored with a fresh mtime, exit read), one gate at a time: workflows dropped from the frozen set fails the path-set test; hold taking over another request's freeze fails the refusal test; a complete request keeping the freeze fails both CLI lifecycle tests; a stale freeze reported ok fails all three stale subtests; the job no longer reading the variable fails the topology pin; after the review fix: a failed start keeping the freeze fails the failed-start test, retire_freeze ignoring the record's repository fails the binding test, a bare delete remedy for an unknown holder fails the ordering test; hold trusting its create without the confirming read fails two hold tests; an unreadable journal counted as absence fails the keep-freeze test; a failed confirming read counted as held, retire releasing before the retirement, any read failure counted as no freeze, and a skipped repository probe each fail their test. Restored after each: all suites OK.

  • The local actionlint reports zero findings on pr-contract.yml on main and on this branch.
  • Commands run on the committed head:

    python3 tests/build/ci_release_freeze_check_test.py       # OK (5)
    python3 tests/build/release_freeze_test.py                # OK (11)
    python3 tests/build/release_github_api_test.py            # OK (46)
    python3 tests/build/release_doctor_test.py                # OK (28)
    python3 tests/build/release_cli_orchestration_test.py     # OK (49)
    python3 tests/build/release_prepare_test.py               # OK (45)
    python3 tests/build/release_entry_enrollment_test.py      # OK (145)
    python3 tests/build/release_skill_test.py                 # OK (15)
    python3 tests/build/ci_issue_done_skill_test.py           # OK (11)
    python3 tests/build/ci_workflow_topology_test.py          # OK (64)
    python3 tests/build/ci_hosted_runner_policy_test.py       # OK (10)
    python3 tests/build/ci_change_scope_test.py               # OK (77)
    git diff --cached --check                                 # clean
    

    Complete tests/build/release__test.py run (all 80 modules, one at a time, on 1a1e230 in a detached worktree; the runs started on 27c4c88, 044b8da and 11e9d89 were stopped because each review fix changed release-tool modules the suite reads): 81 PASS, 0 FAIL (the 80 existing modules plus the new release_freeze_test).

    PR Review

    Head SHA: 1a1e230026afeba5bfbd59fe84d45b8f254a186d. Review of 27c4c88 raised three findings, all fixed in 044b8da: a start that fails before the request exists now releases its freeze (an unfinished request keeps it, by design and by test); retire releases the freeze in the repository the request record names; the doctor splits a retired holder (stale, clearing command) from an unknown well-formed holder (possibly another host's live release: go to that host first, clearing only behind a confirmed absence, never to merge) and a malformed value. Review of 044b8da raised two more, fixed in 11e9d89: hold is a create followed by a confirming read (a refused create is settled by rereading the holder; a holder that is not this request is refused, never taken over), and the failed-start cleanup releases only on a positively observed absence (an unreadable journal keeps the freeze). Review of 11e9d89 raised three more, fixed in 1a1e230: a confirming read that fails after our create is reported as an unproven hold to rerun (the hold runs outside the cleanup's try, so the described release path cannot occur); retire releases only after the journal retirement is durable; the doctor reads the repository and then the variable through gh api with only an HTTP 404 meaning absent, because gh variable get says "not found" for an unreadable repository too. All threads resolved. Current-head review evidence is checked with scripts/ci/review_wait.py before merge.

    CI Scope

    Expected mode: full
    Expected selected lanes: ci_contract core_asan core_coverage core_macos core_ubuntu creator deploy_contract docs_static package portal web_runtime_host web_runtime_lab web_toolchain
    Expected skipped lanes:
    ci:full required: no
    Reason: scripts/ci/release_freeze_check.py is a scripts/ci/ control-plane path (full rule); the rest is release tooling, the PR Contract workflow, their tests, two skills, a governance document and a decision file.

    Batch-only Lanes

    core_asan core_coverage core_macos core_ubuntu creator deploy_contract package web_runtime_host web_runtime_lab web_toolchain: not run locally; verified by the next incremental main batch. The change adds a PR Contract job and release-tool behaviour; no product code or lane command changes. The deploy_contract lane's release suite is run locally one module at a time (see Verification).

    Version Management

    Version impact: none
    Reason: release tooling, a PR Contract job and documents; no Product, Module, Contract or Provider version changes.

    Documentation Impact

    Documentation impact: none
    Affected portal pages:
    Reason: two .agents skills, docs/governance/git-workflow.md and a decision file; no page under apps/docs-site/docs/ changes.

    Pitfall Impact

    Pitfall impact: none — reason: the mid-window merges are #2422's root cause 4 and are now prevented by a tool rule with gates (gate:tests/build/ci_release_freeze_check_test.py, gate:tests/build/release_freeze_test.py); the operator rule is recorded in both skills.

    Merge Danger

    Door: two-way
    Blast Radius: while a release request is active, PRs that change CI or release-tool control-plane paths fail the new check and are not merged; everything else is unchanged. A stale freeze would block such PRs until cleared as the doctor directs.

    Release Impact

    Release impact: none
    Candidate tag: none
    Profile: none
    Channel: none
    Intent disposition: none
    Release assets: none
    Release gates: none
    Reason: no release is active; tags, Releases and the ledger are untouched; the variable is created only by a future run.

    Transition authority

    Authorized transitions: push | PR | merge (standing Task authorization in CLAUDE.md; cleanup not requested)
    No tag, Release, deploy, publication, or Channel promotion is implied.

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: endaye Review duration: 84m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2475"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%
    Repository