Skip to content

fix(artifacts): report ZIP Zstd window refusals as resource limits - #8625

Merged
gensokyo-dev merged 2 commits into
morluto:mainfrom
SahinurDEV:fix-8623
Nov 6, 2026
Merged

gensokyo-dev merged 2 commits into
morluto:mainfrom
SahinurDEV:fix-8623

Conversation

@SahinurDEV

@SahinurDEV SahinurDEV commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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_windowTooLarge once; existing application projection carries it through CLI and MCP. The cap remains windowLogMax: 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

  • Fresh main 81ada025c: 1 failure / 38 passes with the new regression; the valid oversized-window frame was classified format with no memory boundary.
  • 39 reader and 4 failure-translation tests pass. Three additional compiled CLI/stdio MCP cases pass for an admitted window, oversized window and corrupt magic. They exercise inspection and extraction, retain complete Evidence for summary delivery, validate source identity, preserve input bytes and verify failed output roots are absent. The normal Evidence assertion was corrected to the actual subject.digest.sha256 model before the passing rerun.
  • Public payload, authored carriers: the official glfw==2.11.0 arm64 dylib from PyPI, 263,308 bytes, SHA256 409f1c5acc4f512c448f8297a5a7e8f8a1d41fcc90e065d1ba25b4a25508d19a. 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.
  • Six public CLI calls before and six after: normal inspection/extraction succeeds with exact extracted bytes; the large frame changes from format / fresh-copy advice to limit / memory and the fixed-cap recovery; corrupt input remains format. 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 malformed in the ELF section-name decoder and BinaryFormatFailure in 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

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T19:24:54.869813Z
We couldn’t complete this review. Comment @codex review to try again.
93100d0 New commits
ℹ️ 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 Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking code issues were found.

Summary

Method-93 ZIP frames that exceed the fixed Zstandard window allowance now report a memory limit instead of archive corruption.

  • ZIP Zstandard window refusals now appear as memory limits.

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]
Loading

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)
@gensokyo-dev gensokyo-dev changed the title fix(artifacts): report oversized Zstandard ZIP windows as a resource limit fix(artifacts): report ZIP Zstd window refusals as resource limits Nov 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@gensokyo-dev
gensokyo-dev merged commit fdc4e39 into morluto:main Nov 6, 2026
43 of 45 checks passed
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Valid Zstandard ZIP window-limit refusal is reported as corrupt input

3 participants