Skip to content

test(release): truncated-download resilience check (§6b) - #276

Merged
maui1911 merged 4 commits into
mainfrom
test/release-validation-truncation
Jun 12, 2026
Merged

test(release): truncated-download resilience check (§6b)#276
maui1911 merged 4 commits into
mainfrom
test/release-validation-truncation

Conversation

@maui1911

Copy link
Copy Markdown
Owner

Follow-up to #275. Closes the validation gap that let the truncated-download bug ship: RELEASE-VALIDATION §6 serves the archive from localhost, which never truncates, so it proves extraction works but structurally can't catch a truncating network.

What's added

  • dist/truncating_server.py — serves a file but advertises the real Content-Length while cutting the body short on the first N requests, then serves it in full. A faithful stand-in for a TLS-inspecting proxy / AV middlebox clipping a large HTTPS download (the exact thing that produced the user's Could not find EOCD).
  • RELEASE-VALIDATION §6b (mandatory) — two runs:
    • --truncate-first 2: the install self-heals on attempt 3 → "Update installed".
    • --truncate-first 999: ends on the honest "Download incomplete: received N of M bytes" — not EOCD — with the server's attempt count (exactly 3) as proof the verify+retry path ran.

Verified end-to-end

Driver-instrumented build against the real updater (#275 code):

  • 2 truncated + 1 full → server log TRUNCATED, TRUNCATED, full → toast reached "Update installed" (self-heal).
  • always-truncate → server log shows exactly 3 TRUNCATED per click, then give up (old code would issue a single GET then fail at extract — 3 attempts can only be the new verify+retry loop).

The exact failure wording is already pinned by the verify_complete unit tests in #275; this is the end-to-end socket-level wiring check.

🤖 Generated with Claude Code

§6 serves the update archive from localhost, which never truncates —
it proves extraction works but cannot catch a download cut short on a
real network (the v0.5.0 'Could not find EOCD' field failure, fixed in
#275). Close that validation gap:

- dist/truncating_server.py: serves a file but advertises the full
  Content-Length while cutting the body short on the first N requests,
  then serves it in full — a stand-in for a TLS-inspecting proxy
  clipping a large HTTPS download.
- RELEASE-VALIDATION §6b: two runs — truncate-first 2 (the install
  self-heals on attempt 3) and truncate-first 999 (ends on the honest
  'Download incomplete', not EOCD), with the server's attempt count as
  the proof the verify+retry path ran.

Verified end-to-end against the real updater with the driver build:
2 truncated + 1 full -> 'Update installed'; always-truncate -> exactly
3 attempts then give up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an end-to-end manual release validation step that simulates real-world truncated HTTP downloads (middlebox/proxy clipping) to ensure the updater’s verify+retry logic (from PR #275) both self-heals when truncation is transient and fails with an honest “Download incomplete …” error when it’s persistent.

Changes:

  • Adds dist/truncating_server.py, an HTTP server that advertises full Content-Length but intentionally cuts response bodies short for the first N requests.
  • Extends docs/RELEASE-VALIDATION.md with mandatory §6b guidance to validate retry/self-heal and honest failure messaging under truncation.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/RELEASE-VALIDATION.md Adds mandatory §6b manual validation procedure for truncated-download resilience and expected outcomes.
dist/truncating_server.py Introduces a localhost HTTP server utility to simulate truncated downloads while keeping Content-Length unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/RELEASE-VALIDATION.md Outdated
…_server.py

Address Copilot review: §6b no longer inherits §6's reference to the
missing dist/slow_server.py. §6b spells out the build + Compress-Archive
staging, and §6 now serves via the in-repo truncating_server.py
(--truncate-first 0 = serve full) instead of the retired script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Comment thread docs/RELEASE-VALIDATION.md Outdated
Comment thread docs/RELEASE-VALIDATION.md Outdated
Address Copilot round 2: drop the now-stale 'do not use §6's
slow_server.py' warning (§6 no longer has that step), and fix the
sign-off range to '1-6b' since 6b sits outside 1-6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread docs/RELEASE-VALIDATION.md
Address Copilot round 3: §6 now recommends a plain localhost server,
so the checklist item no longer hard-requires a 'visibly advancing'
byte count (that only happens with a throttled server) — it accepts an
instant jump to total. The extraction check remains the load-bearing
assertion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

@maui1911
maui1911 merged commit fa655b1 into main Jun 12, 2026
1 check passed
@maui1911
maui1911 deleted the test/release-validation-truncation branch June 12, 2026 08:59
maui1911 added a commit that referenced this pull request Jun 12, 2026
Patch release: in-app updater now verifies download completeness and
retries truncated downloads (#275), so a TLS-inspecting proxy / AV
middlebox clipping the archive no longer surfaces as a baffling
'Could not find EOCD' extract failure. Adds the truncated-download
resilience check to RELEASE-VALIDATION §6b (#276).

Tag v0.5.1 after this merges to trigger the release pipeline.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants