← Back to Pull requests

docs(agents): protect the pinned toolchain and prepared release outputs from cleanup #2456

Closed
unknown closed this pull request without merging on Oct 21, 2026 10:19 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 08:39 UTC
Author

Summary

Item 6 of the "now" plan in #2422. #2351 protected the release driver's worktrees and journal from branch/worktree cleanup, but the pinned emsdk under build/toolchains/ was deleted the same way during 2.0.122.0 (the first prepare rounds failed with "EMSDK is not configured"; the cause surfaced only after three resumes), and build/release/<tag>/ carries the same exposure: it is the signed plan and asset set that the Draft, the publication and every later resume verify against.

Change

  • AGENTS.md / CLAUDE.md (byte-identical): the standing cleanup rule names the pinned toolchain under build/toolchains/ and the prepared outputs under build/release/ as release-owned, and says a build/ or clean sweep must exclude those two trees.

  • .agents/skills/issue-list/SKILL.md Mode 2: the protect-before-classify text explains what each tree is, why it cannot be regenerated by scripts/release.sh, and forbids sweeping build/ whole (rm -rf build, git clean -x over it, a script clean of the build root); the response table row names the five release-owned paths verbatim.

  • .agents/pitfalls/cleanup-removes-live-release-state.md: a fourth recurrence (2026-10-21, #2422, the emsdk deletion), the "Why" names it, and "How to apply" lists every release-owned path, the doctor reinstall remedy and the operator-host placement below.

  • .agents/skills/lmdj-release/SKILL.md: prepare and the Web proofs activate the SDK from EMSDK with the in-tree fallback; the operator host installs it outside the repository and exports EMSDK.

  • scripts/ci/scope_policy.json: exact rules route .agents/skills/issue-list/SKILL.md and the cleanup pitfall to deploy_contract, the lane that runs release_skill_test; the CI contract requires every document a test asserts on to reach that test's lane (it failed on the first head without them). The rule is the routing prerequisite of the test in this PR, so it lands with it.

  • tests/build/release_skill_test.py: test_cleanup_rules_name_every_release_owned_path pins all five release-owned paths, from one list, in the AGENTS/CLAUDE rule, the Mode 2 text, its table row and the pitfall's "How to apply", and that AGENTS.md and CLAUDE.md stay identical.
  • emsdk path evaluation (item 6, second bullet). The in-tree default build/toolchains/emsdk is the fallback in five scripts (creator-web.sh, web-runtime-host.sh, web-toolchain-conformance.sh, creator-count-in-io-proof.sh, prepare-opfs-webkit.sh), scripts/ci/local_lanes.json, scripts/ci/local_preflight.py and the CI composite action .github/actions/web-ci-proof/action.yml, and every one of them honours EMSDK. Moving the repository default would be a control-plane change across CI and local lanes for no gain on CI workspaces, where the SDK is installed per workspace. The operator host is the only place a cleanup can reach it, so the recommendation is: keep the repository default; on the M1 install the pinned SDK outside the repository (for example ~/Library/Application Support/lmdj-ci/emsdk) and export EMSDK in the shell that runs scripts/release.sh. The doctor (#2454) accepts any EMSDK location and reports a missing or drifted SDK with the exact reinstall command. No repository path changes, so no release operation document records a new path; the operator memory is updated with the recommendation when this item lands.

    Related Issue

    Related issue: #2422

    Premise refresh (issue-done §0)

    Base: origin/main at a8f1232066913490de982d1a744ae7a7d8e00864. The cleanup rule in AGENTS.md/CLAUDE.md, issue-list Mode 2 and the pitfall named only .local/release-worktrees/, .git/worktrees/candidate- and .git/lmdj-release-requests/; no test pinned the list. Still outstanding; delivered here.

    Verification

  • The new contract test was written first and failed on the base (six subtests: the four places lacked both trees, and the pitfall's "How to apply" did not name the worktree paths explicitly either); after the edits it passes.

  • Mutation proofs (files restored with a fresh mtime, exit read): removing build/toolchains/ from the AGENTS/CLAUDE rule and both trees from the Mode 2 table row fails the test in those subtests; writing the shorthand candidate- back into the table row fails the .git/worktrees/candidate- subtest; restored: pass.
  • Commands run on the committed head:

    python3 tests/build/release_skill_test.py        # OK (new test included)
    python3 tests/build/ci_pitfall_ledger_test.py    # OK (recurrence date in UTC)
    python3 tests/build/ci_issue_done_skill_test.py  # OK
    python3 tests/build/ci_change_scope_test.py      # OK (document reach for the two routed files)
    cmp AGENTS.md CLAUDE.md                          # identical
    git diff --cached --check                        # clean
    

    Complete tests/build/release__test.py run (all 80 modules, one at a time, started on ad40e5b): 80 PASS, 0 FAIL. The later commits touched only scripts/ci/scope_policy.json, the issue-list skill's table row and release_skill_test itself, which was rerun on 73525e2 (OK); no release test reads the other two.

    PR Review

    Head SHA: 73525e2db4c91dac36874b0cfb8c76c82d2026e7. The review of ad40e5b raised two findings on the contract test (table coverage not enforced; table expectations not derived from the single list), both fixed in 73525e2; 8d3cf47 added the scope rules after the CI contract's document-reach check failed on ad40e5b. All threads resolved. Current-head review evidence is checked with scripts/ci/review_wait.py before merge; findings and dispositions are recorded in the thread.

    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/scope_policy.json is a full-rule control-plane path; the rest is agent instructions, two .agents skills, a pitfall entry and one release contract test.

    Batch-only Lanes

    core_asan core_coverage core_macos core_ubuntu creator package web_runtime_host web_runtime_lab web_toolchain: not run locally; verified by the next incremental main batch. The change adds two additive exact routing rules and touches no code those lanes execute.

    Version Management

    Version impact: none
    Reason: documentation and a contract test only.

    Documentation Impact

    Documentation impact: none
    Affected portal pages:
    Reason: .agents instructions and the root agent files; no page under apps/docs-site/docs/ changes.

    Pitfall Impact

    Pitfall impact: recurrence cleanup-removes-live-release-state — the emsdk deletion during 2.0.122.0 (#2422) is the fourth recurrence; the entry stays absorbed in issue-list Mode 2, whose text now covers the toolchain and output trees.

    Merge Danger

    Door: two-way
    Blast Radius: agent cleanup behaviour; no code path changes.

    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: 100m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    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%
    60%
    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
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2456"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 57% (MEDIUM) · Higher = larger blast radius
    57%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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