Skip to content

fix(zstd): share exact-frame Zstandard decoding across ELF and OTA - #12416

Merged
morluto merged 30 commits into
mainfrom
cursor/zstd-exact-frame-bfba
Nov 19, 2026
Merged

morluto merged 30 commits into
mainfrom
cursor/zstd-exact-frame-bfba

Conversation

@morluto

@morluto morluto commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #12398 and #12447.

ELF compressed sections and Android OTA REPLACE_ZSTD operations accepted incomplete Zstandard input when they trusted the decoder's consumed-byte count. That check, introduced for review in #12382 and #12383 by @ShuaixinHuang, rejects some valid suffix frames on Node 22 and still accepts a truncated checksum or a partial next-frame magic on the runtimes where the count is reported. This PR replaces both byte-count checks with one shared exact-frame decoder.

Problem and expected behavior

RFC 8878 allows concatenated and skippable frames. A complete stream must include each frame header, every block, and the optional 4-byte content checksum. Trailing garbage and a partial next-frame magic are not part of that stream.

Node 22.23.4 stops after the first frame and can return the declared output when the checksum bytes are missing. Node 24.22.1 and Node 26 accept a full sequence, but bytesWritten can include a 1–3 byte prefix of the next magic. rejectGarbageAfterEnd closes that suffix case only where the runtime actually implements it.

Change and scope

src/domain/compression/zstandardExactFrame.ts walks each frame per RFC 8878 §3.1. The walk, not the decoder's byte count, decides the frame boundary. Where Node decodes a whole sequence and rejectGarbageAfterEnd rejects a trailing byte, one strict decode consumes the walked span. Otherwise each walked frame is decoded on its own, and each output is copied off the decoder chunk before the next frame. A single output buffer is returned as that buffer.

zstd.max_frames (REA_ZSTD_MAX_FRAMES) is a runtime setting: default 4096, floor 1, maximum 65536. It is listed for the artifact, GPU, DWARF, ELF note, hardening, unwind, export, initializer, kernel-module, debug-link, Go, Rust, IL2CPP, and Android JNI operations that read an ELF directory or decode Zstandard. Exceeding it is work_limit. readElfDirectoryFromBuffer requires the caller's operation and throws projectZstandardFrameAllowance, so a section-name frame cap is an AnalysisResourceConstraintError whose limit.setting is zstd.max_frames. GPU inventory throws that projected error from payload decode and #retainFailure. An invalid launch seed is a ConfigurationError, not malformed content.

decodeZstandardFramesCooperative is the yield point. GPU payload decode, inspect_elf_notes, inspect_dwarf_units, and Android OTA partition reconstruction pass the caller's existing abort signal into that pause. The frame-by-frame fallback awaits the pause before each data frame and once more before success. The strict sequence uses the async decoder and pauses again after it. ELF directory reads that already own a cancellation signal use the cooperative reader: hardening, unwind, exports, initializers, kernel modules, debug link, Android JNI, Go, Rust, and IL2CPP. Go, Rust, and IL2CPP go through readBinaryContainerCooperative when the inspection has a signal. A compressed kernel module is recognized before that ELF read and stays an unsupported container. Synchronous parseElfNotes and reconstructAndroidOtaPartition remain for callers that have no signal.

ZIP method 93 stays on zip.js streaming and uses the same frame grammar. It writes at frame boundaries for Node 22 compatibility and validates the final frame before reporting EOF. #12461 supplied the ZIP change. CRC, decoded size, and staged extraction remain owned by the ZIP reader and extractor.

Follow the contribution scope. Contribution scope: not applicable. This stays inside the existing read-only decode of files and captured data.

Contract and boundary impact

  • Semantic owner and earliest changed stage: decodeZstandardFrames owns Zstandard framing. readElfDirectoryFromBuffer projects a section-name frame cap through projectZstandardFrameAllowance for the operation the caller names.
  • Contribution scope fit and linked maintainer decision: not applicable. The maintainer decision is [Design] Bound exact ELF Zstandard decoding on Node 22 #12398.
  • CLI and MCP/tool-catalog contract: zstd.max_frames is a runtime analysis setting. No new tool. The setting registry now names the additional ELF directory operations. npm run verify:advertised-schemas -- --update-summary reported no compact-digest change.
  • Provider, bridge, target-format, or platform compatibility: Node 22 decodes frame by frame and yields between frames for GPU, ELF notes, DWARF, and OTA. Node 24.22.1 uses the async strict decoder and yields before and after that call. The choice is a probe of the running runtime. locateDwarfSections is asynchronous so it can await that pause.
  • Evidence, artifact, provenance, or reconstruction contract: truncation and trailing bytes are malformed with a structured reason. A frame-count refusal is a resource limit. An invalid seed is a configuration failure. A cancelled GPU, ELF note, DWARF, hardening, or unwind read stays cancelled.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata: earlier npm run verify:advertised-schemas -- --update-summary refreshed the input compact digests for inspect_analysis_settings and update_analysis_settings. The same command after the directory projection reported no further digest change.

Expected effects:

  • 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: exact-frame tests cover concatenation, skippable frames, truncation classes, trailing bytes, partial next-frame magic, checksum mismatch, 65,536 one-byte frames, tight ownership of a short view, and valid plus truncated frames for content-size widths, window descriptors, dictionary ids, and RLE blocks. ELF, OTA, GPU, and ELF note callers assert structured fields. inspect_analysis_settings includes zstd.max_frames for each enforcing operation and provider. A 32-frame GPU payload aborted before its promise settles is reason: "cancelled" on Node 22 and Node 24.22.1. The same 32-frame cancellation is covered for inspect_elf_notes, inspect_dwarf_units, and Android OTA REPLACE_ZSTD reads. Hardening and unwind tests assert AnalysisResourceConstraintError with limit.setting zstd.max_frames, source runtime, and the floor and maximum, and assert AnalysisCancelledError when a many-frame section-name read is aborted. The cooperative decoder also refuses success when the first pause records an abort and the required second pause observes it.
  • Base reproduction or other evidence: [Design] Bound exact ELF Zstandard decoding on Node 22 #12398 and the review on fix(elf): reject unconsumed Zstandard section bytes #12382. The byte-count fixes in fix(elf): reject unconsumed Zstandard section bytes #12382 and fix(android-ota): require complete REPLACE_ZSTD input consumption #12383 are the origin; their tests were not copied.
  • User-visible CLI/MCP output (if applicable): inspect_analysis_settings lists zstd.max_frames for the operations above. A work refusal names that setting. A cancelled read of those providers stays cancelled.
  • Remaining proof gaps: No vendor OTA payload or real ELF corpus was decoded. Callers that stay on the synchronous decoder, including parseElfNotes and reconstructAndroidOtaPartition without a pause, still block the event loop. The async strict decoder cannot abort the native call itself; the signal is observed when that call returns. A frame that fails inside the last synchronous decode can still return that failure before a queued abort is observed. Peak heap during 65,536 frames was not sampled.

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

  • npx oxfmt on the changed files — completed. npx oxfmt --check passes for the cooperative cancellation files.
  • npm run check:fast — typecheck, lint, and architecture guards passed, including after c29d6a41e. That script does not run format:check.
  • npm run test:focused -- analysis settings, GPU payload, and exact-frame suites — passed on Node 22.23.4.
  • The same GPU payload and exact-frame suites — passed on Node 24.22.1, including cancellation and the post-decode pause.
  • npm run verify:advertised-schemas -- --update-summary — updated the input compact digests for inspect_analysis_settings and update_analysis_settings. Packaged catalogs were listed and the checked engines accepted the patterns. Re-run after the directory projection; no digest changed.
  • npm run test:focused -- src/gpu/GpuPayloadCodec.test.ts tests/boundary/gpu/codeObjects.test.ts src/application/AnalysisSettings.test.ts src/resources/ArtifactOperationFailure.test.ts — 166 passed, 1 skipped, on Node 22.23.4 after the GPU projection change. GPU payload and code-object tests passed again after the directory-driver change.
  • ELF note, DWARF, OTA boundary, compressed-section, and note-parser tests passed on Node 22.23.4. The three 32-frame cancellation tests passed on Node 22.23.4 and Node 24.22.1.
  • CI on 1dea3c3aa: Build package and Documentation passed. Static checks failed format:check on src/gpu/GpuInventory.ts.
  • CI on 6bef8a752 (run 44567169009): Static checks, Build package, and Documentation passed. A duplicate Conventional PR title check was cancelled.
  • At 975c14d4b7, the shared structural walk now yields while examining frame and block headers, and the GPU kernel directory reparse uses its owning signal. Both regressions failed before the patch and passed afterward.
  • Node 24.22.1 passed 305 focused tests with one existing skip across 11 suites, all 183 CI-selected tests for the review changes, and nine compiled OTA MCP and GPU lifecycle checks. Node 22.23.4 and 26.12.1 each passed 231 tests across seven codec and boundary suites.
  • check:fast, changed TypeScript formatting, and diff checks passed. Hosted CI for that revision was pending at the time.
  • f02dfc714: npm run check:fast passed. Focused hardening, unwind, analysis-settings, ELF notes, DWARF, and native-directory tests passed, 77 tests. The hardening and unwind cases assert the typed zstd.max_frames limit fields.
  • c29d6a41e: npm run check:fast passed. Kernel-module parser and filesystem tests passed, 31 tests. gzip, xz, and zstd containers return the unsupported report through the service before any ELF decode.
  • a7f54c26c: npm run check:fast passed. Go provider, Rust budget, and IL2CPP image-cancellation tests passed, 24 tests. A many-frame ELF section-name read aborts as cancellation when the inspection has a signal.
  • 3bde307b5: npm run check:fast passed. Focused hardening, unwind, kernel-module, debug-link, and native-export tests passed, 72 tests, including the hardening and unwind cancellation cases.

At 9c1969f940, all 81 focused tests and check:fast passed. The kernel-module entry points share one compression classification rule. IL2CPP retains the prior generic-layout refusal order, the native mapping checkpoints, typed cancellation, and selected artifact evidence. Stacked #12472 is included at 0126135170. It reuses admitted compressed section names for build-ID notes and carries cancellation to any remaining decode. The squash tree matches the tested stack head, which passed 640 tests with one existing skip and check:fast.

Hosted Static checks flagged formatting in five section-reader tests. At 338bf90157, the full formatter check passed and the five focused suites passed 201 tests with one existing skip.

The hosted retry at 338bf90157 reproduced the Hopper lease fixture timeout from the first attempt. The fixture repair landed separately in #12481. This branch now includes it through the merge of main at c361039007. The combined revision passed the full formatter and all 25 focused Hopper cleanup and ELF debug-link tests. Hosted checks and exact-revision review are rerunning.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for CLI or MCP. readElfDirectoryFromBuffer now requires the caller's operation name. locateDwarfSections returns a promise. Truncated checksums and trailing bytes are malformed. Streams with more than 4096 frames need zstd.max_frames raised, up to 65536.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. Node 22.23.4, 24.18.0, 24.22.1, and 26.12.1 were executed for the suites recorded above.
  • Package or release metadata impact: advertised analysis-setting input summaries changed earlier. The directory projection did not change those digests. No package version bump.
  • Security, privacy, process, or containment review: the frame cap bounds decoder work. Frame output is copied off the decoder chunk only when the backing store is larger than the bytes in use. GPU, ELF note, DWARF, OTA, and the signal-owning ELF directory readers yield so cancellation can land. Dictionary and the 128 MiB window cap are unchanged.

The optional-evidence follow-up passed 404 incremental tests with one existing skip and 357 native and lifecycle tests. The ZIP change passed 66 focused tests on each supported Node floor and 30 compiled ZIP integrity tests. After the squash, the combined head passed 112 tests. Main integration at 86d80bccb1 incorporates merged #12449 and passed 233 focused tests with one existing skip, plus check:fast. Hardening now uses cooperative ELF directory decoding when the provider has a signal. At 6d9623ca92, the cancellation regression passed, along with 354 focused tests, 419 incremental tests, 84 Node 22 and 84 Node 26 controls, and check:fast. The broader sibling audit and hosted checks are pending.

At 9cd35954da, unwind and exports observe owned cancellation while reading ELF section names. Initializers and JNI share a single directory read for their mappings and section facts. Native exports retain the existing symbol-row checkpoints. The optional debug-link comparison retains the completed candidate identity on cancellation and reports capped candidate facets as unknown. The combined branch passed 295 tests across eight focused suites, plus check:fast. Hosted checks remain pending. Go, Rust, and IL2CPP now use the cooperative container reader when their inspection has a signal.

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 

Walk RFC 8878 frames once so ELF sections, Android OTA REPLACE_ZSTD, and GPU payloads reject truncated headers, blocks, checksums, and trailing bytes on every supported Node runtime. Bound that walk with the runtime zstd.max_frames setting.
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T19:28:34.136883Z c361039 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32d64326d3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gpu/GpuPayloadCodec.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · The interrupted debug-link report must preserve saved Evidence before merging to satisfy the repository requirement.RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[High impact] The shared framing rules reach several binary-analysis and artifact-reading workflows.

The interrupted debug-link report must preserve saved Evidence before merging to satisfy the repository requirement.

FindingsFix All in CodexFindings

  1. P2 Cancelled reports bypass Evidence storage ▶
Fix with agent prompt
### Issue 1
src/native/elf/ElfDebugLinkProvider.ts:186-199
When cancellation stops comparison after the candidate read completes, `unverifiedCandidateObservation` returns a non-null `candidate` with `verification: null`. `ElfDebugLinkService.verificationAgrees` rejects that pair, so the service never creates Evidence for the report. MCP keeps the completed image report and candidate identity inline but cannot save them for later calls.

Add an explicit path for this partial report and test it through the service. The repository requires preserving Evidence provenance and session semantics through both adapters; this requirement must be satisfied before merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Shares exact Zstandard framing across ELF, OTA, and GPU reads, with the same frame grammar used by ZIP method 93.

  • Zstandard readers check complete frame boundaries before decoding.
  • Analysis settings can cap Zstandard frames per read.
  • ELF and binary inspections share exact decoding and cooperative reads.
  • Android OTA reads validate complete Zstandard frames and pause for cancellation.
  • GPU payload reads use exact Zstandard frames and cooperative pauses.
  • ZIP method 93 checks Zstandard frames as the member streams.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  ELF[ELF sections and names] --> Exact[Exact frame decoder]
  OTA[OTA REPLACE_ZSTD] --> Exact
  GPU[GPU payloads] --> Exact
  Exact --> Walk[Walk frame grammar and enforce frame cap]
  Walk --> Choice{Runtime supports strict sequences?}
  Choice -->|Yes| Sequence[Decode the walked sequence]
  Choice -->|No| Frames[Decode each data frame]
  Sequence --> Output[Bounded output]
  Frames --> Output
  ZIP[ZIP method 93] --> Chunks[Split writes at frame boundaries]
  Chunks --> Native[Streaming decoder]
  Walk -. shared grammar .-> Chunks
Loading

Reviews (17) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread src/native/elf/ElfNoteParser.ts Resolved
Copy each Node 22 frame off its decoder chunk before the next frame is decoded. Map a GPU zstd.max_frames refusal through the resource-limit contract instead of a provider failure.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a49b5ee405

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/native/dwarf/DwarfUnitsProvider.ts Resolved
Comment thread src/gpu/GpuPayloadCodec.ts Resolved
cursoragent and others added 2 commits November 19, 2026 16:15
…ults

Project zstd.max_frames through one resource-limit helper for ELF notes, DWARF, GPU, and artifact reads. An invalid REA_ZSTD_MAX_FRAMES seed stays a configuration failure, and frame-header tests cover content size, window, dictionary id, and RLE blocks.

Co-authored-by: morluto <[email protected]>
The frame-by-frame fallback awaits a caller pause before each data frame. GPU yields and checks the read signal there, so a many-frame payload does not finish before a disconnect is observed.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b5dd2eb5a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/gpu/GpuPayloadCodec.ts Resolved
…able

List every operation that enforces zstd.max_frames, including GPU, DWARF, and ELF notes. The strict sequence uses the async decoder and checks the caller signal again after it returns, and a single output buffer is not copied a second time.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17d71b1b69

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

cursoragent and others added 2 commits November 19, 2026 16:28
Regenerate the advertised input summaries for inspect_analysis_settings and update_analysis_settings. GPU inventory now throws the projected zstd.max_frames resource limit from payload decode and #retainFailure, so the adjustable setting survives the public failure.

Co-authored-by: morluto <[email protected]>
oxfmt keeps the zstd.max_frames throw in #retainFailure on one line so CI format:check matches the local formatter.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bef8a752c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

cursoragent and others added 2 commits November 19, 2026 16:37
The fallback returned success in the same turn as the final synchronous frame, so a queued abort was still invisible to the caller's signal check. Pause once more before that success, matching the strict sequence.

Co-authored-by: morluto <[email protected]>
The synchronous frame loop ignored abort signals owned by inspect_elf_notes, inspect_dwarf_units, and Android OTA partition reads. Those callers now use the cooperative decoder and yield before Zstandard work, and 32-frame cancellations cover each path.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d636d4b7b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/gpu/GpuSource.ts Resolved
…tive-structural-walk

# Conflicts:
#	src/artifacts/AndroidOtaPayloadArtifactReader.boundaries.test.ts
#	src/artifacts/AndroidOtaPayloadArtifactReader.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 975c14d4b7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

readElfDirectoryFromBuffer now requires the caller's operation and throws the adjustable zstd.max_frames resource limit. Hardening, unwind, and the other directory consumers keep that typed refusal instead of an adapter or I/O error.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f02dfc7148

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/native/hardening/ElfHardening.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bde307b5e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/native/elfImage.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9cd35954da

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelModuleParser.ts Resolved
Comment thread src/native/elf/KernelModuleParser.ts Resolved
cursoragent and others added 4 commits November 19, 2026 18:26
These inspections already own an abort signal. Their ELF directory read now uses the cooperative container decoder so a queued cancellation can land during a many-frame section-name table.

Co-authored-by: morluto <[email protected]>
The cooperative module reader decoded the bytes as ELF before the container check, so gzip, xz, and zstd modules became malformed images. The compression check now returns the unsupported-container report first.

Co-authored-by: morluto <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c1969f940

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/ElfDebugLink.ts Resolved
@morluto
morluto disabled auto-merge November 19, 2026 19:25
@morluto
morluto enabled auto-merge (squash) November 19, 2026 19:32
@morluto
morluto merged commit 7fd50eb into main Nov 19, 2026
50 checks passed
@morluto
morluto deleted the cursor/zstd-exact-frame-bfba branch November 19, 2026 19:45
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 22, 2026
Comment on lines +186 to +199
const unverifiedCandidateObservation = (
report: ElfDebugLink,
candidate: ElfDebugCandidateFile,
): ElfDebugLink => ({
...report,
candidate: {
path: candidate.path,
sha256: candidate.sha256,
bytes: candidate.bytes,
format: null,
byte_order: null,
debug_info: "unknown",
symtab: "unknown",
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Cancelled reports bypass Evidence storage

When cancellation stops comparison after the candidate read completes, unverifiedCandidateObservation returns a non-null candidate with verification: null. ElfDebugLinkService.verificationAgrees rejects that pair, so the service never creates Evidence for the report. MCP keeps the completed image report and candidate identity inline but cannot save them for later calls.

Add an explicit path for this partial report and test it through the service. The repository requires preserving Evidence provenance and session semantics through both adapters; this requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Knowledge Base Used: Binary diagnostics and comparison

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/native/elf/ElfDebugLinkProvider.ts
Line: 186-199

Comment:
**Cancelled reports bypass Evidence storage**

When cancellation stops comparison after the candidate read completes, `unverifiedCandidateObservation` returns a non-null `candidate` with `verification: null`. `ElfDebugLinkService.verificationAgrees` rejects that pair, so the service never creates Evidence for the report. MCP keeps the completed image report and candidate identity inline but cannot save them for later calls.

Add an explicit path for this partial report and test it through the service. The repository requires preserving Evidence provenance and session semantics through both adapters; this requirement must be satisfied before merging.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

**Knowledge Base Used:** [Binary diagnostics and comparison](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fbinary-diagnostics-and-comparison.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Design] Bound exact ELF Zstandard decoding on Node 22

2 participants