Skip to content

fix(artifacts): complete positional ZIP reads - #4414

Merged
morluto merged 3 commits into
morluto:mainfrom
Afloat16:fix/zip-complete-short-reads
Oct 21, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
Afloat16:fix/zip-complete-short-reads

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

A valid ZIP can fail enumeration or extraction when a positional FileHandle.read returns fewer bytes than requested. Complete each read within the admitted file extent before handing it to zip.js, and report premature EOF as an integrity failure. Existing allocation limits and beyond-EOF format classification remain enforced. This is an archive-reader correction within existing scope.

On main d72d856f, the identical regression suite gives 3 failures/8 passes before the fix, then 11 passes. All 29 related filesystem/lifecycle/ZIP boundary tests pass, including compiled CLI controls. compile:termux, locked TypeScript 6 --noEmit, lint/module boundaries, knip, metadata, architecture, changed-file formatting, pre-commit and diff checks pass on pinned Node 24.18.0/npm 11.16.0.

Short reads are injected on real descriptors; ZIP parsing and extraction use production code. Cancellation coverage establishes no entry publication after cancellation. Standard npm run check remains blocked by the native compiler's unavailable /proc/self/exe. Full-suite, other-host and forced-short-read public CLI/MCP coverage remain unverified.

Refs #3847, ZIP short-read candidate.

Author readiness

Human owner: @Afloat16

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.

  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.

  • I declare this PR ready for initial maintainer review.

Copy link
Copy Markdown
Contributor Author

Synchronized with main 5fa4def in 0b5df5e. Resolved the test import conflict using the new artifactExpansionBudget owner; the deleted decompression-budget API/tests were not restored. The diff against current main remains only the original two ZIP files.

Revalidated identical final ZIP tests: current main without the short-read fix fails 3 / passes 9; fixed passes all 12. The short-read injection still uses a real descriptor and production ZIP parsing/extraction. A fresh compiled control completed enumeration and byte-exact extraction with 128 short descriptor reads. The broader artifact/ZIP suite passed 289 tests across 31 files, with 3 public CLI extraction failures: “Extraction output parent is unavailable.” The same three failures reproduce on the no-ZIP-fix current-main control. Normal ZIP inspect-artifact CLI succeeds. A real SDK stdio MCP attempt fails at open_binary readiness, leaving inspect_artifact without a target; it is not counted as passing.

Fallback compile:termux, TypeScript 6, lint/module boundaries, knip, metadata, architecture guards, discovery, two-file formatting and the scoped actual pre-commit hook passed. Standard npm run check remains blocked by native typecheck's missing /proc/self/exe. Cancellation coverage proves no entry is published, not immediate interruption of every underlying read; forced-short-read public CLI/MCP remains unverified. No performance claim.

@Afloat16
Afloat16 marked this pull request as ready for review October 21, 2026 03:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T04:02:02.925047Z 0b5df5e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

ZipArtifactReader now completes short positional reads before returning bytes to zip.js.

  • ZIP reads fill the requested range before the archive is parsed.

Reviews (1) · Last reviewed commit: "fix(artifacts): retain ZIP short reads a..." · Reviewed by Greptile

@morluto
morluto merged commit 82e4e03 into morluto:main Oct 21, 2026
41 checks passed
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
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