← Back to Pull requests

fix(release): verify Draft assets and replace an interrupted upload #2433

Closed
unknown closed this pull request without merging on Oct 20, 2026 19:01 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 17:19 UTC
Author

Summary

Item 2 of the "now" plan in #2422. During 2.0.122.0 one asset upload (lmdj-web-runtime-host-4.3.9-product-2.0.122.0.zip) stalled in GitHub's starter state. Two defects let that reach publication.

1. The draft step verified on metadata alone. draft_step.read_back checks only that a Release exists with the right tag and plan digest.

  • After create_draft failed mid-upload, the next resume marked the Draft verified even though one asset could never be downloaded.

  • publish-release.yml run 39399785171 then failed at Reverify exact Draft.

  • That failed run used up the driver's single publication dispatch, which became a terminal conflict.
  • 2. create_draft could not repair the Draft. _resume_assets treated the starter asset as present and tried to download it (404) on every resume. Recovery needed an owner-authorised manual asset delete.

    Change

  • DraftCarrier takes a required verify_assets, wired by the trusted composition to verify_draft.

  • - A Draft counts as this step's verified work only after every asset downloads and matches the plan.
    - An incomplete or unreadable asset makes the step pending, so advance resumes create_draft.
    - A divergent asset still surfaces as create_draft's named TransitionError.
  • _resume_assets, on an unpublished Draft, removes a declared asset whose state is not uploaded and uploads it again from the prepared bytes.

  • - A completed upload is never deleted or replaced.
    - A published Release is never edited: it raises instead.
    - After removal the inventory is re-read to confirm the asset is gone.
  • New GitHubClient.delete_incomplete_draft_asset issues DELETE /repos/{repo}/releases/assets/{id}. It refuses an uploaded asset, an asset owned by another Release, a foreign API URL, and any non-204 response.

  • _compare_download and _download_and_verify_assets name an incomplete asset and its state with the remedy: GitHub Release asset X upload is incomplete (state=starter); remedy: resume scripts/release.sh create-draft TAG while the Release is a Draft.
  • Related Issue

    Related issue: #2422

    Verification

    Current head: 6fd2a6cb2126ea082ea4287ae9957ec2e9e98b95, rebased on 21c0d8007 (#2431).

    New tests:

  • release_transitions_test:

  • - an interrupted upload, modelled as a starter asset, is named by the uncertain-upload read-back and by verify_draft;
    - a resumed create_draft deletes only that asset, re-uploads it and verifies all assets uploaded;
    - a published Release with an incomplete asset is refused with no deletion.
  • release_draft_step_test: a Draft whose assets do not verify is pending, and advance repairs it through create_draft; the carrier refuses a missing verifier.

  • release_github_api_test: the client sends exactly one DELETE for a starter asset and refuses an uploaded asset, another Release's asset and a 404.
  • Updated test: test_publish_rejects_metadata_or_asset_identity_drift, case asset-state. The case is still refused, now with the more specific "upload is incomplete (state=open)" before the snapshot comparison.

    Mutation proof: with transitions.py and draft_step.py restored to main, the new transitions tests fail and every CarrierTest in release_draft_step_test errors. With the change, all pass.

    All 78 tests/build/release_*_test.py suites pass locally on the pre-rebase head. After the rebase, the six suites touching the driver, CLI, transitions, Draft step, enrollment and GitHub client pass again. git diff --cached --check: clean.

    CI Scope

    Expected mode: focused
    Expected selected lanes: ci_contract deploy_contract docs_static
    Expected skipped lanes: core_asan core_coverage core_macos core_ubuntu creator package portal web_runtime_host web_runtime_lab web_toolchain
    ci:full required: no
    Reason: release tooling and its Python tests only.

    Version Management

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

    Documentation Impact

    Documentation impact: none
    Affected portal pages:
    Reason: internal release-tool verification and recovery; no portal page or documented behaviour changes.

    Pitfall Impact

    Pitfall impact: none

    Merge Danger

    Door: two-way
    Blast Radius: release Draft step and create_draft resume.
    The only new remote write is deleting an asset whose upload never completed, on an unpublished Draft. Uploaded assets, tags and published Releases are untouched.

    Release Impact

    Release impact: none
    Candidate tag: none
    Profile: none

    🤖 Generated with Claude Code

    Diff: 587 lines (+440 / -147) across 7 files Reviewer: endaye Review duration: 102m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 587 lines diff across 7 files
    0.50
    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.382
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2433"
    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: 49.9% (MEDIUM) · Higher = larger blast radius
    49.9%
    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: 19.7% · Safe to merge
    19.7%
    Repository