← Back to Pull requests

fix(release): build Web Hosts reproducibly in prepare instead of re-proving them #2453

Closed
unknown closed this pull request without merging on Oct 21, 2026 06:15 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 05:04 UTC
Author

Summary

Item 4 of the "now" plan in #2422. prepare ran each Web Host's complete local proof (configure, build, test, proof: unit tests, generated fixtures and Playwright journeys) although it already refuses an intent without the exact target's complete candidate batch evidence (_verify_ci), which proved the same revision on CI. On the loaded M1 that duplicate proof was the slowest and least reliable prepare leg: two Slice UI timeouts during 2.0.122.0.

Spec check and decision. Design §8.1 step 5 asks prepare to build per profile from the exact committed target; it never named the Playwright proofs, which the script proof mode bundles with the two-clean-builds byte reproducibility check. The candidate batch retains no Web Host distribution artifacts, so a comparison with batch-retained digests needs a CI change first and is not claimed here. The Owner confirmed option A on 2026-10-21 (recorded on #2422).

Change

  • scripts/creator-web.sh reproducible and scripts/web-runtime-host.sh reproducible: a new mode of the existing proof function that runs clean → configure → build (→ package) twice, byte-compares the distributions, then runs the non-browser distribution checks (Creator: package_test.py, deployment_smoke_test.py; Runtime Host: the proof's distribution_test.py leg) and returns. No unit-test suites, fixtures, Playwright requirement (Creator waives only the tests/platform/web tree in its dependency check; its own locked tree stays required), audio-worklet conformance or browser journeys, and no local-audio-output.py wrapper (nothing plays audio). proof, quick and smoke are unchanged.

  • ProfileRuntime.reprove (default False): _build_web_host runs ("reproducible",) by default and ("configure", "build", "test", "proof") under --reprove.

  • scripts/release.sh prepare TAG --reprove, run … --reprove, resume ID --reprove thread the switch through build_context to the runtime. run/resume --reprove also record it as a private operations/<id>/reprove-requested marker once the driver has returned for the request; a later plain resume keeps it, status reports it, and both retirement paths clear it. The request scope stays the immutable identity.

  • Design §8.1 step 5 and the lmdj-release skill record the scope.
  • No gate is relaxed: prepare still requires the exact target's complete candidate batch evidence, the reproducibility check is unchanged, and the full local proof remains available on demand.

    Related Issue

    Related issue: #2422

    Premise refresh (issue-done §0)

    Base: origin/main at 057539838e0e7d5e94c9459fe4ad281e505591ec. At that revision profiles._build_web_host ran ("configure", "build", "test", "proof") unconditionally, no reproducible script mode and no --reprove flag existed. No successor PR touched this (git log on tools/release/profiles.py and the Host scripts since #2422). Still outstanding; delivered here.

    Verification

    New or changed tests, each fixing one fact:

  • ci_web_proof_server_test (3 new): the real require_dependencies body refuses without the Playwright tree by default, passes once reproducible waives it, and still refuses a missing Creator tree; reproducible runs clean/configure/build twice plus diff for both Hosts, then exactly the named distribution checks after the diff, and none of the unit-test, fixture, Playwright or browser legs; a diff failure exits 2 without a pass line; the dispatch case exists and carries no audio wrapper.

  • release_prepare_test: the dual Host builder issues exactly creator-web.sh reproducible and web-runtime-host.sh reproducible by default, and configure/build/test/proof per Host under reprove=True; the dependency-bootstrap test's first builder vector is now reproducible.

  • release_cli_orchestration_test (3 new): resume <unknown> --reprove records nothing, and both retirement paths clear the marker; prepare, run and resume pass --reprove into ProfileRuntime and default to False; run --reprove records the marker (mode 0600), a plain resume keeps reprove=True, status reports it, and without the marker a resume builds reproducibly.
  • Mutation proofs (file restored with a fresh mtime, __pycache__ cleared, exit read):

  • default commands restored to the full proof: 2 prepare tests fail.

  • reproducible mode falling through into the tests: the script test fails for creator.

  • build_context called without reprove: 3 CLI cases fail.

  • resume ignoring the recorded marker: test_reprove_is_recorded_with_the_request_and_kept_on_resume fails.

  • retirement not clearing the marker: test_reprove_marker_follows_the_request_lifecycle fails; Creator check ignoring the waiver: test_creator_dependency_check_waives_only_the_playwright_tree fails.

  • restored: 45 / 20 / 35 pass.
  • Commands run on the committed head:

    python3 tests/build/release_prepare_test.py          # 45 OK
    python3 tests/build/ci_web_proof_server_test.py      # 20 OK
    python3 tests/build/release_cli_orchestration_test.py # 35 OK
    python3 tests/build/release_skill_test.py            # OK
    bash -n scripts/creator-web.sh scripts/web-runtime-host.sh
    git diff --cached --check                            # clean
    

    Complete tests/build/release_*_test.py run, all 79 modules one at a time in this worktree: 79 PASS, 0 FAIL. The run started on 2cb976b; the later commits changed only the Host scripts (faked by the release tests), the script contract test, tools/release/cli.py and release_cli_orchestration_test, and that module executed after the final commit 9614e3c (35 OK).

    Real run on 9614e3c with tests/platform/web/node_modules moved aside: scripts/creator-web.sh reproducible → reproducibility PASS, package_test.py 15 OK, deployment_smoke_test.py 12 OK, Reproducible: PASS, exit 0 in 209 s (the Playwright tree was restored afterwards).

    Real runs on 7319ca9 (with the distribution checks): scripts/web-runtime-host.sh reproducible → reproducibility PASS, distribution_test.py 6 tests OK, Reproducible: PASS, exit 0 in 200 s; scripts/creator-web.sh reproducible → reproducibility PASS, package_test.py 15 tests OK, deployment_smoke_test.py 12 tests OK, Reproducible: PASS, exit 0 in 207 s.

    Real runs on 2cb976b — scripts/web-runtime-host.sh reproducible in this worktree with the pinned emsdk 6.0.5: Web Runtime Host reproducibility: PASS, Web Runtime Host Reproducible: PASS (two clean builds byte-identical; tests and browser journeys not run), exit 0 in 200 s under host load ~5. Real scripts/creator-web.sh reproducible (after npm ci for tests/platform/web and apps/creator-web): Creator Web distribution reproducibility: PASS, Creator Web Reproducible: PASS (two clean distributions byte-identical; tests and browser journeys not run), exit 0 in 204 s.

    PR Review

    Head SHA: 9614e3c9aa8d13f02a31a8a2a0b40e235855d535. Reviews: 2cb976b → two findings (distribution validation), fixed in 7319ca9; 7319ca9 → three (--reprove across resumes ×2, fixed in a5a9984; Creator Playwright requirement, answered); a5a9984 → four (marker for a refused request, mkdir race, marker on retirement, Playwright waiver), all fixed in 9614e3c. 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: the two Host scripts and the release tooling touch three expensive families (creator, deploy-package, web-runtime), which the scope policy classifies as full. The batch-only lanes are ownership information for the next main batch; the Task's own tests are listed above.

    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 to the creator and web_runtime_host lanes' scripts adds a mode those lanes do not invoke (quick/proof/smoke are unchanged, pinned by ci_web_proof_server_test and ci_batch_execution_workflow_test).

    Version Management

    Version impact: none
    Reason: release tooling and Host build scripts only; no Module, Host, Contract or Product identity changes.

    Documentation Impact

    Documentation impact: none
    Affected portal pages:
    Reason: design document, .agents skill and tooling behaviour; no page under apps/docs-site/docs/ changes.

    Pitfall Impact

    Pitfall impact: none — reason: tooling scope change recorded in the design document and skill, with regression tests pinning the new default and the --reprove path; no process knowledge outside the code.

    Merge Danger

    Door: two-way
    Blast Radius: prepare for Web Host profiles. The built bytes and signatures are produced exactly as before (same clean build, same packager); only the local tests and journeys are no longer repeated.

    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: 70m
    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 #2453"
    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