Repository navigation
fix(artifacts): report ZIP Zstd window refusals as resource limits - #8625
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no blocking code issues were found. SummaryMethod-93 ZIP frames that exceed the fixed Zstandard window allowance now report a memory limit instead of archive corruption.
No actionable issues were found. This review used source checks; it did not run tests. Whether another PR supersedes this one could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Method-93 ZIP member] --> B[Native Zstandard decoder]
B --> C{Window exceeds fixed cap?}
C -->|Yes| D[ArtifactReaderFailure: limit / memory]
D --> E[translateArtifactFailure]
E --> F[CLI and MCP: truncated / memory]
C -->|No| G[Existing decode, CRC and size checks]
Reviews (2) · Last reviewed commit: "fix(artifacts): report ZIP Zstd window r..." · Reviewed by Greptile |
Keep native decoder constraints distinct from corrupt compressed bytes. Derive recovery labels from the enforced window cap, and exercise the shared reader through CLI/MCP with retained Evidence and cleanup controls. Fixes morluto#8623 Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
Fixes #8623. A valid method-93 ZIP with a Zstandard window above REA's fixed 128 MiB cap now reports a resource refusal, with actionable recovery:
{"code":"truncated","details":{"reason":"limit","boundary":"memory","truncated":true}}The ZIP reader classifies the native
ZSTD_error_frameParameter_windowTooLargeonce; existing application projection carries it through CLI and MCP. The cap remainswindowLogMax: 27. Both allowance labels derive from that constant. CRC, declared-size, expansion, corruption and cancellation handling remain covered. One shared raw-frame fixture replaces duplicated bytes, and the superseded test helper alias is removed. The CLI ZIP documentation explains recovery without implying a runtime override.Validation
81ada025c: 1 failure / 38 passes with the new regression; the valid oversized-window frame was classifiedformatwith no memory boundary.subject.digest.sha256model before the passing rerun.glfw==2.11.0arm64 dylib from PyPI, 263,308 bytes, SHA256409f1c5acc4f512c448f8297a5a7e8f8a1d41fcc90e065d1ba25b4a25508d19a. The library is never executed or modified. An owned method-93 ZIP wraps its actual compressed bytes; the large control changes only the frame's window descriptor to 256 MiB. Independent zstd 1.5.4 admits both valid frames with 256 MB and reproduces the exact payload; 128 MB refuses the large frame. A bad-magic control fails independently.format/ fresh-copy advice tolimit/memoryand the fixed-cap recovery; corrupt input remainsformat. All input ZIP hashes stay unchanged. Summary inspection retains complete source Evidence in the explicitly selected file.check:fast,docs:check(9 consistency tests), formatting and diff checks pass on Linux / Node 24.22.1. Technical CI passes on the final head, including all eight test shards and required aggregates. Greptile reviews this head at 5/5 with no unresolved threads. Codex review is unavailable because the repository review quota is exhausted. The original unchecked human declarations remain subject to the explicitly authorized readiness-only exception; no human-review attestation is added. No binary or generated artifact is committed.Resources and remaining scope
Two CPUs, bounded time/RSS, no guard stop or OOM. Equivalent six-call CLI batches observed 11.30 s wall / 12.21 CPU s / 275.8 MiB sampled family RSS before and 12.10 s / 12.32 CPU s / 273.1 MiB after. Fresh Node processes, uncontrolled warm OS caches; these observations establish no speedup claim. Sampling sums descendants at 100 ms and may double-count shared pages or miss short peaks. Model tokens and other platforms are unmeasured.
Sibling production codec controls confirm that valid large-window frames still become
malformedin the ELF section-name decoder andBinaryFormatFailurein the GPU payload decoder, while admitted-window controls decode exactly. Those are component observations, not complete public ELF/GPU artifact reproductions. Their format-specific resource outcomes and partial-result behavior need separate workflow validation; this PR fixes the reported ZIP boundary only.Author readiness
Human owner: @SahinurDEV
Before merge
type(scope): outcome.