Skip to content

fix(artifacts): name the ASAR header admission budget - #6172

Merged
morluto merged 1 commit into
mainfrom
cursor/asar-header-admission-0059
Oct 21, 2026
Merged

morluto merged 1 commit into
mainfrom
cursor/asar-header-admission-0059

Conversation

@morluto

@morluto morluto commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #5910 (parent #5808). ASAR header/index admission stays a fixed 16 MiB / 16777216 byte policy. When that budget fails, the public error names the budget, says this release has no runtime override, and says that selecting fewer sources or narrowing an internal path does not bypass it.

Problem and expected behavior

MAX_ASAR_HEADER_BYTES in src/artifacts/AsarHeader.ts rejects a header before the archive index is decoded. The projected limit recovery was "Artifact is too large to process safely. Narrow the requested path or use a smaller artifact." That text does not identify header/index admission, does not say whether the ceiling can change, and suggests path narrowing that cannot skip the prerequisite header read.

The ceiling is a fixed implementation admission for this release. No caller argument or configuration setting already controls it. The numeric cap is unchanged.

Change and scope

Header admission failures from direct decode and from archive classification share one recovery. It names ASAR header/index admission, 16 MiB / 16777216 bytes, that this release has no runtime override, why source selection does not bypass the index read, and the supported alternative: analyze an extracted application directory, or supply an archive whose header fits. Raising max_heap_mb or host memory does not raise it. Repeating the unchanged request fails the same way.

Other artifact limit failures keep the existing generic recovery. Electron page resolution still refuses an oversized header as an unauthorized member; that path does not emit this artifact-operation message. The header cache's separate 16 MiB retention across eight archives is unchanged and does not raise admission.

Intentionally not in this PR: MCP response budgets (#6005), process regex (#6099), and browser/native/engine limit slices already merged. No new setting and no ASAR streaming.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: ASAR header admission in src/artifacts/AsarHeader.ts; the public message is the CLI/MCP analysis-error projection.
  • Contribution scope fit and linked maintainer decision: ordinary error-recovery fix inside the existing read-only artifact boundary. Not applicable.
  • CLI and MCP/tool-catalog contract: inventory_artifact, inspect_artifact, and analyze_javascript_application now return the named header-admission recovery for this limit. details.admission is asar-header and details.maximum_header_bytes is 16777216. Tool schemas are unchanged.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none. The failure still occurs before inventory Evidence is produced.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): read-only. Cleanup wrapping still preserves the admission message; a failed close reports cleanup_incomplete.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): authored skill text only. No package or catalog change.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/asarHeaderAdmission.test.ts locks the recovery wording, the direct 16 MiB boundary, public inventory and analyze_javascript_application projection, and that source_paths plus max_heap_mb still hit the same admission. Unrelated artifact limits keep the generic recovery.
  • Base reproduction or other evidence: source review of admitAsarHeader and archive classification. The ~532 MB / ~102,600-file archive cited in [Bug] Limit errors omit adjustment controls and leave hard-coded ceilings unexplained #5910 was not re-run.
  • User-visible CLI/MCP output (if applicable): projected message and remediation.action are ASAR header/index admission is limited to 16 MiB / 16777216 bytes. This release has no runtime override. Selecting fewer sources or narrowing an internal path does not bypass header admission, because the archive index is read before any member can be selected. Raising max_heap_mb or available host memory does not raise it. Analyze an extracted application directory, which does not admit an ASAR header, or supply an archive whose header fits this allowance. Repeating the unchanged request fails the same way.
  • Remaining proof gaps: no live CLI process was spawned; the test projects the same error object the CLI and MCP adapters print. No real multi-hundred-megabyte ASAR was opened.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check:fast — passed (typecheck and lint).
  • npm run test:focused -- tests/boundary/filesystem/asarHeaderAdmission.test.ts src/artifacts/AsarHeader.test.ts tests/boundary/filesystem/artifactInventoryRegularRoot.test.ts — 15 tests passed.
  • npm run test:focused -- tests/boundary/filesystem/asarHeaderAdmission.test.ts src/artifacts/AsarHeader.test.ts src/artifacts/inventory/ArtifactGraphConstruction.test.ts — ArtifactGraphConstruction.test.ts passed (28 tests) before the final admission-test assertion fix; that source did not change afterward.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. The limit value is unchanged. The user-visible limit message for this one failure changed.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. Linux Node 24.18.0 fixture coverage only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: read-only admission text. No new authority.

Author readiness

Human owner: @morluto

  • 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.
Open in Web Open in Cursor 

Keep the 16 MiB ASAR header/index ceiling fixed and report that budget,
the lack of a runtime override, and that source selection does not bypass
header admission.

Refs #5910

Co-authored-by: morluto <morluto@users.noreply.github.com>
@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-21T22:07:05.874212Z 08e778d PR opened
ℹ️ 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 Tier: plus

[Medium impact] The PR appears safe to merge; it clarifies recovery without changing the ASAR admission boundary.

Summary

Names the existing ASAR header/index allowance without changing its 16 MiB ceiling.

  • Oversized ASAR headers now name their fixed admission limit.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Direct header check] --> C[Named ASAR admission failure]
  B[Archive classification] --> C
  C --> D[Preserve through cleanup]
  D --> E[Artifact operation error]
  E --> F[Shared CLI and MCP error fields]
Loading

Reviews (1) · Last reviewed commit: "fix(artifacts): name the ASAR header adm..." · Reviewed by Greptile

@morluto
morluto merged commit d7ca93c into main Oct 21, 2026
42 of 44 checks passed
@morluto
morluto deleted the cursor/asar-header-admission-0059 branch October 21, 2026 22:33
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction bug Something isn't working labels Nov 23, 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.

2 participants