[PR #4414] [MERGED] fix(artifacts): complete positional ZIP reads #6225

Closed
opened 2026-10-31 01:12:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4414
Author: @Afloat16
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix/zip-complete-short-reads


📝 Commits (3)

  • efa33fa fix(artifacts): complete ZIP positional reads
  • 3f37a7a fix(artifacts): complete positional ZIP reads on current main
  • 0b5df5e fix(artifacts): retain ZIP short reads across budget update

📊 Changes

2 files changed (+177 additions, -3 deletions)

View changed files

📝 src/artifacts/ZipArtifactReader.test.ts (+161 -1)
📝 src/artifacts/ZipArtifactReader.ts (+16 -2)

📄 Description

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 https://github.com/morluto/rea/discussions/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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4414 **Author:** [@Afloat16](https://github.com/Afloat16) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/zip-complete-short-reads` --- ### 📝 Commits (3) - [`efa33fa`](https://github.com/morluto/rea/commit/efa33fa6a4df3f3f8b10b14ede8173254c96a877) fix(artifacts): complete ZIP positional reads - [`3f37a7a`](https://github.com/morluto/rea/commit/3f37a7a4d008cddfbca6ae9a105ce6ae80862073) fix(artifacts): complete positional ZIP reads on current main - [`0b5df5e`](https://github.com/morluto/rea/commit/0b5df5eccd434f4bfdfc0c5b62cec653d4c0fa0a) fix(artifacts): retain ZIP short reads across budget update ### 📊 Changes **2 files changed** (+177 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/ZipArtifactReader.test.ts` (+161 -1) 📝 `src/artifacts/ZipArtifactReader.ts` (+16 -2) </details> ### 📄 Description 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 https://github.com/morluto/rea/discussions/3847, ZIP short-read candidate. ## Author readiness Human owner: @Afloat16 - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6225
No description provided.