← Back to Pull requests

fix(ci): hold automatic batches while main's tip is a release cut #2470

Closed
unknown closed this pull request without merging on Oct 22, 2026 01:16 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 00:12 UTC
Author

Summary

Item 9 of the "Next" plan in #2422 (candidate priority in the batch controller; #2404 "related"). A release allocation cut bumps products/lmdj/version.json and freezes the Portal snapshot under apps/architecture-portal/versioned_metadata/ in one squash; the squash witness adds only a record under apps/architecture-portal/versioned_provenance/. Both land as main pushes, and products/lmdj/ is a full-rule path, so the cut alone admitted a full automatic batch and the release's own candidate batch queued behind it (candidate 120 waited about 40 minutes during 2.0.122.0).

Mechanism chosen with the Owner on 2026-10-22: the automatic batch yields while main's tip is a cut or witness commit with no finished candidate for it. No remote mutation, no cancellation, no new queue kind.

Change

  • scripts/ci/batch_controller.py:

  • - classify_release_commit(changes) and GitInputs.release_commit(sha): one verified main commit is allocation (changes the version file and a snapshot path together), witness (every change adds a versioned_provenance/version--squash-witness.json record; an edited record or any other provenance file is neither) or None, from its git diff-tree --no-renames --name-status -z listing, read NUL-separated and refused on an unexpected shape or status.
    - Controller._release_hold(latest): on the automatic branch of reconcile only, after the explicit fair queue and never for bootstrap, returns waiting with the reason main tip is a release <kind> commit; automatic admission yields to the candidate batch for it (dispatch the candidate, or push to main to resume) while the tip is such a commit and no candidate request for that exact target has a durable result. A queued candidate is admitted ahead of it, a finished candidate lifts it, any newer main push ends it. The hold appends no observation and moves no cursor, so the retained automatic cursor still covers the interval as an automatic batch afterwards; explicit node work is never held.
  • tests/build/ci_batch_controller_test.py: the fake inputs gain release_commit; test_automatic_admission_yields_while_main_tip_is_a_release_cut (cut tip → waiting with the reason, no admission; a candidate result for that tip → the interval is then admitted as an automatic batch), test_a_newer_main_push_ends_the_release_hold, test_release_hold_never_touches_bootstrap_or_explicit_work, and the real-Git test_real_git_classifies_allocation_and_witness_commits (allocation, witness, a witness correction, an unrelated provenance file, a record whose name contains a tab, a version bump without a snapshot, the base commit, an empty listing).

  • docs/plans/2026-09-08-lmdj-ci-batch-controller.md: new section "Release cut yields to the candidate batch" and the verification list names the new journeys.

  • .agents/skills/lmdj-release/SKILL.md: one sentence after the allocated-identity rule telling the operator that the controller holds automatic admission at the cut/witness tip and that the candidate (whose target is the witness merge, never the cut SHA) must be dispatched promptly because any ordinary merge ends the hold.
  • Related Issue

    Related issue: #2422

    Premise refresh (issue-done §0)

    Base: origin/main at 84136533c. Controller.reconcile admitted an automatic batch for any new tip after the explicit queue, with no notion of a release commit; GitInputs had no per-commit path classification; no test covered a cut at the tip. Still outstanding; delivered here. No release request is active (every journal request is retired; no driver process), so the goal's "no release-tool merges during a release" rule is satisfied.

    Verification

  • The three hold tests and the real-Git classification test were written first and failed on the base (AttributeError/wrong action); after the change they pass.

  • Mutation proofs (file restored with a fresh mtime, exit read): making _release_hold return None fails test_automatic_admission_yields_while_main_tip_is_a_release_cut and test_a_newer_main_push_ends_the_release_hold (the bootstrap/explicit negative test passes, as it should); restored: 58/58 OK. Making the witness rule ignore the change status and the record name fails the real-Git test on the correction commit ('witness' is not None); restored: OK. A first draft split the listing with split("\n"), so the trailing empty line made every witness commit "neither"; the real-Git test caught it and the fix is splitlines().
  • Commands run on the committed head:

    python3 tests/build/ci_batch_controller_test.py   # OK (58, four new)
    python3 tests/build/ci_batch_runtime_test.py      # OK (85)
    python3 tests/build/ci_report_runtime_test.py     # OK
    python3 tests/build/ci_change_scope_test.py       # OK
    python3 tests/build/release_skill_test.py         # OK
    python3 tests/build/ci_issue_done_skill_test.py   # OK
    git diff --cached --check                         # clean
    

    Complete tests/build/release__test.py run (all 80 modules, one at a time, started on 94e9d18): 80 PASS, 0 FAIL. The three later commits touched scripts/ci/batch_controller.py, its test, the controller plan and one sentence of the lmdj-release skill; no release test reads the first three, and release_skill_test was rerun on d3a671e (OK).

    PR Review

    Head SHA: d3a671e1fa4cefb5e88503019df2c7f05d5a863b. Three review rounds: 94e9d18 (three findings: any durable result lifts the hold — answered, the hold orders dispatch and is not evidence; a cut-SHA candidate — answered, the candidate targets the witness merge; provenance-only commits classified as witnesses — fixed in b547185), b547185 (rename entries — hardened with --no-renames in 639c831; enqueued-but-undispatched candidate — answered, the explicit queue runs before the hold), 639c831 (exact-tip keying — answered and the skill now names the target; tab-split parsing — fixed with -z and fail-closed shape checks in d3a671e). The review of d3a671e is eligible with no findings; all threads are 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/batch_controller.py is a central CI control-plane path (full rule); the rest is one plan document, one .agents skill and the controller's own test.

    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 touches the controller's admission decision only; 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: CI control plane and documentation only; no product, module or contract version changes.

    Documentation Impact

    Documentation impact: none
    Affected portal pages:
    Reason: a plan document under docs/plans/ and a .agents skill; no page under apps/docs-site/docs/ changes.

    Pitfall Impact

    Pitfall impact: none — reason: the defect is a controller admission rule now fixed in code with a gate (gate:tests/build/ci_batch_controller_test.py); the operator consequence (dispatch the candidate promptly) is recorded in the lmdj-release skill, and the retrospective root cause is #2422 / #2404.

    Merge Danger

    Door: two-way
    Blast Radius: automatic batch admission at a release cut or witness tip; explicit, bootstrap and ordinary pushes are unchanged.

    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.

    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: 64m
    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 #2470"
    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