Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6b92bb7fc
ℹ️ 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".
|
All seven review findings are addressed in 560db80:
Real-Ghidra re-verification on this host after the changes: the matching fixture still reports |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 560db80968
ℹ️ 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".
dandgabr
left a comment
There was a problem hiding this comment.
Review corrections
- P2 — Support little-endian universal Mach-O containers during UUID admission.
readMachoFileUuidEntries()recognizes only big-endianFAT_MAGIC/FAT_MAGIC_64before falling back to thin-image parsing. The target parser acceptsFAT_CIGAM/FAT_CIGAM_64too, so a valid little-endian universal target or dSYM member is detected but rejected as non-Mach-O whendsym_pathis selected. Parse the CIGAM table using little-endian fields while preserving per-slice CPU attribution. - P2 — Bound dSYM enumeration, hashing, and staging.
admitDebugCompanion()enumerates every entry in the caller-selected DWARF directory, then hashes the entire first UUID-matching member; the staging path copies that whole file. There is no entry-count or member-size budget, so a crafted bundle can cause unbounded filesystem work, CPU use, and private-runtime disk consumption before analysis. Add explicit limits and reject oversized bundles/members before hashing or staging.
|
Both points addressed in a6a83bd, together with the three follow-up findings from the second Codex pass:
The same commit also keeps legacy snapshot query IDs valid (a null companion is stripped from the hash input, so snapshots written before this change still pass integrity validation) and sizes header reads by the declared load-command span instead of a fixed 64 KiB window. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6a83bdfcb
ℹ️ 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".
a6a83bd to
f5e27ac
Compare
|
The third CI round's failures (prompt completion in shard 1/4 and both darwin package baselines) came from the pre-fix versions of The branch is now rebased onto current main (f5e27ac). Re-validated locally after the rebase: typecheck, full |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5e27ac667
ℹ️ 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".
|
The last CI round after the rebase is green across every code-bearing job — all four test shards, both darwin package baselines, the real Apple E2E, docs, and static gates. The single lane failure is environmental: |
|
All eight findings from the rebase review are addressed in fe386fd:
Domain 15/15 and boundary 27/27 locally, full |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe386fd486
ℹ️ 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".
|
All three follow-up findings are addressed in 6cf3f75:
Local verification: domain 10/10, boundary suites green, full |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cf3f75f81
ℹ️ 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".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
All three findings addressed in bd0434a:
Local: domain + boundary suites green (28/28 in the companion boundary file), full |
bd0434a to
55eddb0
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
The 16:02 CI round failed before running any tests: it compiled the PR merge ref against a main that had since split the thin The branch is rebased onto current main in 55eddb0 and adapted: the field now lives on both Mach-O variants, and the cputype map covers |
|
@greptileai review |
[Medium impact] The reviewed changes appear safe to merge, with both numbered previous findings fixed and no new blocking issue found. SummaryAdds caller-selected dSYM companions for Mach-O targets through
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CLI or MCP selects dsym_path"] --> B["Check bundle and selected target slice"]
B --> C{"CPU identity and UUID match?"}
C -- No --> D["Reject caller input"]
C -- Yes --> E["Hash matching member"]
E --> F["Commit companion identity to profile and snapshot"]
F --> G{"Verified Ghidra checkpoint?"}
G -- Yes --> H["Restore Program without restaging"]
G -- No --> I["Copy beside private target snapshot"]
I --> J{"Digest and file checks pass?"}
J -- Yes --> K["Start Ghidra import"]
J -- No --> L["Stop startup; close handles before removing runtime"]
Reviews (42) · Last reviewed commit: "fix(ghidra): preserve dSYM parse failure..." · Reviewed by Greptile |
|
All six Greptile findings are addressed in da1222e:
Local verification: typecheck without incremental state, full |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da1222e844
ℹ️ 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".
|
The shard-1 failure in the latest round is an upstream test, not this branch: No change on this branch is needed for it; the branch itself remains green in its own suite (all companion/dylib boundary tests pass on this tree, 10/10 including the rest of |
|
Thank you for finishing touches on the branch — the pre-allocation budget check in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f4079ec3e
ℹ️ 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".
|
Thanks again for the re-test and the careful read @CassieFox23! Picked up those items along with the
All checks and review threads are green again on the merged head. |
|
TL;DR: Thanks, jimpablo, for listing the changes. At 57f2edc, all 10 changed test files passed on three Node versions. I have one question about the cleanup path in Edit (8 Nov): I ran the new head, 9560a44, in a VM, and the results are here.
In my comment above, I ran six test files on all three Node versions, and five of them are in this set. I ran From reading the code, line 1103 of One question, also from reading the code. In On 57f2edc, the Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/analysisSnapshot.test.ts src/domain/machoDebugCompanion.test.ts src/ghidra/GhidraProvider.behavior.test.ts tests/boundary/filesystem/ghidraDebugCompanion.test.ts tests/boundary/filesystem/targetDiagnostics.test.ts tests/boundary/mcp/ghidraFailureDiagnostics.test.ts tests/boundary/mcp/sessionMcp.test.ts tests/boundary/providers/ghidra/ghidraCheckpointLifecycle.test.ts tests/process-global/debugCompanionAdmissionFailures.test.ts tests/process-global/ghidraDebugCompanionStagingLifetime.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Good eye @CassieFox23 — that branch was definitely non-obvious from reading In that Looking closely at your question, though, In
|
|
TL;DR: I ran the PR's 12 changed test files on head 9560a44, on three Node versions. All 12 files passed each time, with 464 tests passed and 7 skipped. In CI,
CI on head 9560a44, read live:
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/application/JsonAuthenticationHeadroom.test.ts src/domain/analysisSnapshot.test.ts src/domain/machoDebugCompanion.test.ts src/ghidra/GhidraProvider.behavior.test.ts tests/boundary/filesystem/ghidraDebugCompanion.test.ts tests/boundary/filesystem/targetDiagnostics.test.ts tests/boundary/mcp/ghidraFailureDiagnostics.test.ts tests/boundary/mcp/sessionEvidenceReuseMcp.test.ts tests/boundary/mcp/sessionMcp.test.ts tests/boundary/providers/ghidra/ghidraCheckpointLifecycle.test.ts tests/process-global/debugCompanionAdmissionFailures.test.ts tests/process-global/ghidraDebugCompanionStagingLifetime.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thanks for re-testing On the I pushed |
…-admission # Conflicts: # docs/specs/README.md
…-admission # Conflicts: # src/native/AppleMachoSelection.ts # src/native/MachoArchitectureSelection.ts
…-admission # Conflicts: # src/application/BinaryTargetResolver.ts # src/artifacts/apple/MachoLoadCommandReader.ts # src/ghidra/GhidraClient.ts # src/ghidra/GhidraClientTypes.ts # src/native/AppleMachoSelection.ts # src/server/registerSessionTools.ts
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…pand schema tests
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…-admission Resolve conflicts with upstream/main (8fefe18): - Remove docs/specs/README.md and docs/specs/native/macho-dsym-companion/* per morluto#12856 - Combine caller_input_path and debug_companion in liveBinaryTargetSummary.ts - Combine ComLoader import and debug_companion in GhidraAnalysisProfile.ts - Combine detectDatabaseEngine, boolean hasTrailingZipArchive, and retainTargetCancellation (morluto#12339) with dsym_path admission and cleanup in BinaryTargetResolver.ts - Update advertised schema summary for open_binary.json - Migrate new tests in ghidraCheckpointLifecycle.test.ts and GhidraProvider.behavior.test.ts to createTestTempDirectory (morluto#12722)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbddb9ddba
ℹ️ 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".
…rship - Report Mach-O LC_UUID and FAT format failures with ParseFailureError (kind, format, offset, field) in machoDebugCompanion and preserve them through DebugCompanionAdmission. - Preserve established member refusals in readMemberWithBorrowedResources without running cancellation-sensitive post-read stability validation on rejected outcomes, and preserve physical EIO failures when the caller aborts with the same error object (morluto#12339). - Preserve cancellation arriving during outer target handle close after an inner companion handle close failure. - Defer partial staged-bundle removal in stageGhidraDebugCompanion to the private runtime owner so open destination descriptors are never unlinked before release (matching GhidraTargetSnapshot). - Remove explicit 10s test timeout in sessionMcp.test.ts, use exactOptional() on liveBinaryTargetSummary debug_companion, and align explicit format-selection rejection/docs with TargetFormatHint.
|
Hey @morluto — quick status update and an overlap flag per
What's your preference on merge order / coordination between #2025, #10768, and the #11364 design question? Happy to adjust or rebase onto whichever direction you want to land first. |
Summary
Fixes #1193. REA now admits a caller-selected
.dSYMbundle for Mach-O executable targets (dsym_paththrough MCP,--dsym-pathon the CLI) and stages it beside the private Ghidra import, so DWARF recovers parameter names, data types, and source-anchored type identity that the stripped executable cannot provide. Admission requires a provenLC_UUIDand selected-slice CPU identity match; a non-matching companion is rejected as caller input instead of silently loading wrong types.Problem and expected behavior
.dSYM(built withclang -g+dsymutil). REA's ephemeral import copies the executable into a private runtime root, so the bundle beside the original file is never visible to the session, and every function reportssignature_source: "default"with low type confidence.dsym_path, admission (1) validates the bundle shape, (2) requires a DWARF member whoseLC_UUIDmatches the target image's selected slice (with matching CPU type and base CPU subtype), and (3) stages only the matched member inside REA's runtime root under the snapshot's name — the naming Ghidra'sDSymSectionProviderrequires — leaving the caller's bundle untouched. The staged member digest, source path, and matched UUID are retained as target-admission evidence. Omittingdsym_pathkeeps today's bare-target behavior.Change and scope
src/domain/machoDebugCompanion.ts+src/domain/apple/machoArchitecturePolicy.ts(new): pure Mach-OLC_UUIDreading for thin and universal (32/64-bit, big/little-endian FAT) containers with bounds checks and structuredParseFailureErrorreporting, selected-slice CPU type / base CPU subtype attribution, and the matching rule (an all-zero UUID is a placeholder that never matches; targets with no usable UUID or ambiguous duplicate CPU slices are rejected explicitly).src/application/DebugCompanionAdmission.ts(new): bundle-shape validation (.dSYMdirectory +Contents/Resources/DWARF), bounded header reads (64 KiB window, 64 MiB workflow I/O budget, max 16 DWARF entries, max 1 GiB member/digest cap) through the resolver's open target handle, member digesting, and UUID/slice matching.BinaryTargetResolver: optionaldsymPath; pairing rejections (dsym_pathwith any explicitformatselection —raw-binary,dos-com,gamecube-dol, oresp-flash-image— or non-Mach-O targets including ELF/PE and Hopper/IDA analysis databases) and admission failures carry a newdebug_companion_rejectedconstraint; the admitted identity ridesBinaryTarget.debugCompanion(Mach-O variants only).open_binarygains optional absolutedsym_pathwith contract-level pairing validation against explicitformatselections (scripts/verify/advertised-schemas/tools/open_binary.jsonupdated); CLI--dsym-pathjoinsnativeTargetinsrc/cli/options.ts(CLI help parity fixtures updated), so one-shot native commands accept it;DirectAnalysis,BinarySessionOpen, and the MCP open handler thread it through.GhidraClientOptions.debugCompanion→GhidraAnalysisProfilecommitsdebug_companion { source_path, uuid, member_sha256 }into the profile digest so bare and companion sessions never share Program checkpoints; fresh imports stage the matched member beside the snapshot (GhidraDebugCompanion.ts, digest-verified copy under the shared artifact file owners, with partial staged entries owned and cleaned up by the private runtime root after retained descriptors settle); checkpoint-restored sessions skip redundant restaging (staged_member: null) because DWARF is already ingested in the restored archive; existing-project sessions (REA_GHIDRA_PROJECT_PATH,-process -noanalysis) explicitly rejectdsym_pathinstead of ignoring it.debug_companion_rejectedmaps toinvalid_request/invalid_input(tracked indocs/user-visible-errors.csv) with remediation namingdsym_path, following theload_selection_rejectedpattern from fix(targets): project invalid raw-binary loads as caller input #2004.docs/providers/dsym.md(+ VitePress sidebar indocs/.vitepress/documentation.tsanddocs/README.mdentries, route/dsym). Earlier tracked spec/plan/tasks docs were removed per docs: remove tracked planning and architecture records #12856..dSYMauto-staging (see overlap with fix(ghidra): stage sibling dSYM beside target snapshot for DWARF analysis #10768 / [Design] Include .dSYM sidecars in Ghidra target snapshots #11364), source-file resolution from DWARF, per-slice companion selection inside the bundle, and Hopper/IDA staging (other providers leavedsym_pathunused).Contract and boundary impact
src/domain/machoDebugCompanion.ts+src/application/DebugCompanionAdmission.ts), before any provider starts.open_binaryinput schema gains optionaldsym_path(scripts/verify/advertised-schemas/tools/open_binary.jsoninput hash and CLI help parity fixtures updated; ignored catalog validated bydocs:check).open_binarycompact output schema hash is unchanged;liveBinaryTargetSummaryadds optionaldebug_companionon Mach-O variants.REA_GHIDRA_PROJECT_PATHexisting-project sessions rejectdsym_path; other providers leave it unused (documented). No bridge changes — Ghidra's own DWARF analyzer does the ingestion.dsym { source_path, member_sha256, uuid, staged_member }(staged_member: nullwhen restored from a verified Program checkpoint); persistedAnalysisSnapshot,GhidraAnalysisProfile, and live target summaries recorddebug_companionon Mach-O targets.0600, digest-verified under shared artifact file owners), removed with the existing runtime-root cleanup once retained descriptors settle.scripts/verify/advertised-schemas/tools/open_binary.json,docs/user-visible-errors.csv, and CLI parity fixtures updated;Documentation(docs:check) and package baselines green in CI.<target>.dSYMstaging inGhidraTargetSnapshot.ts/GhidraCheckpoint.ts; both PRs stage under<runtimeRoot>/<snapshotName>.dSYM/Contents/Resources/DWARF/<snapshotName>with exclusivewxcreation, so merge order / coordination should account for that shared staging path.Evidence and regression coverage
Tests added or updated:
src/domain/machoDebugCompanion.test.ts(thin/universal 32/64-bit big/little-endian UUID reading,ParseFailureErrorreporting, CPU type/base subtype matching, zero-UUID and duplicate-slice rejections),src/domain/analysisSnapshot.test.ts,src/contracts/sessionLifecycleInputs.test.ts(explicitformatpairing acrossraw-binary,dos-com,gamecube-dol, andesp-flash-image).tests/boundary/cli/dsymPathCli.test.ts,tests/boundary/cli/cliCommandRegistry.test.ts,tests/boundary/cli/cliContractCommandParity.test.ts,tests/boundary/mcp/absoluteLocalPathSchema.test.ts,tests/boundary/mcp/liveBinaryTargetSummary.test.ts,tests/boundary/mcp/sessionMcp.test.ts.tests/boundary/filesystem/targetDiagnostics.test.ts(explicit format rejections, Hopper/IDA database rejections, darwin realclang -g+dsymutilmatching/mismatching bundles),tests/boundary/filesystem/ghidraDebugCompanion.test.ts,tests/process-global/debugCompanionAdmissionFailures.test.ts,tests/process-global/ghidraDebugCompanionStagingLifetime.test.ts.src/ghidra/GhidraProvider.behavior.test.ts(profile commitment, existing-project refusal, companion mismatch checks),tests/boundary/providers/ghidra/ghidraCheckpointLifecycle.test.ts(bare vs companion checkpoint isolation andstaged_member: nullskip on checkpoint restore).Earlier real-provider verification (recorded pre-checkpoint-merge and pre-feat(ghidra)!: verify the bridge on Ghidra 12.2 #12081 on macOS 27 arm64 with Ghidra 12.1.4 + native
mac_arm_64decompiler), compiled fixturepair.c→clang -O0 -g -c→ link →dsymutil:signature_source: "default", return-type confidencelow.rea function <pair> _pair_sum --provider ghidra --dsym-path <pair.dSYM> --json: signatureint __cdecl pair_sum(Pair p),signature_source: "imported", parameterpof data typePair(8 bytes,x0:8, confidencehigh, type-lock evidence), pseudocodelocal_8 = p.a; uStack_4 = p.b; return local_8 + uStack_4;, value-flow parameter type/DWARF/pair.c/Pair.invalid_request/invalid_input,debug_companion_rejected,"contains no DWARF member whose LC_UUID matches";--dsym-pathpaired with--target-format raw-binary→ pairing rejection (pairing rejection now covers all explicitformatselections:raw-binary,dos-com,gamecube-dol, andesp-flash-image); an unclassifiable blob with--dsym-pathkeeps its format refusal (ordering preserved).Remaining proof gaps:
staged_member: null), existing-project refusal, and universal-target companions have not been exercised end-to-end against a live Ghidra 12.2 install; they are verified viaghidraCheckpointLifecycle.test.ts,GhidraProvider.behavior.test.ts, domain/boundary/process-global suites, and remote CI (includingghidra_bridge / Compile packaged Ghidra bridge sourcesandReal Apple artifact CLI/MCP E2E).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
336d28c05remote GitHub Actionsci:full(run 44871766201) and PR checks — 54 passed, 4 skipped, 0 failed:CI required,Static checks,Deep static checks,Documentation(docs:check),Build package,Portable tests, all 12Test shardjobs,Real Apple artifact CLI/MCP E2E,ghidra_bridge / Compile packaged Ghidra bridge sources,Native package baseline(darwin arm64,darwin x64,linux arm64,linux x64),Windows capability and package lane(capabilities,package),Conventional PR title, andGreptile Review(5/5, 52 files reviewed, 0 comments) — all passed.Source testsandPython producer tests(superseded by the 12ci:fullshards), andCodeQL production(Select production languages,Analyze production).336d28c05: Greptile Review 5/5 (0 new findings), Codex Review completed (0 new findings), 98/98 review threads resolved.rea function/rea analyzeruns with and without--dsym-pathas summarized above. Live Ghidra 12.2 / JDK 25 CLI runs were not locally executed on this host.Compatibility, safety, and release
ci:fullcoverslinux x64/arm64,darwin x64/arm64, Windows capability/package lanes,ghidra_bridgecompilation, andReal Apple artifact CLI/MCP E2E; earlier live Ghidra 12.1.4 macOS arm64 CLI run predates feat(ghidra)!: verify the bridge on Ghidra 12.2 #12081 and live Ghidra 12.2 / JDK 25 CLI execution remains a proof gap above; Hopper/browser not applicable.scripts/verify/advertised-schemas/tools/open_binary.json,docs/user-visible-errors.csv, and CLI parity fixtures updated; ignored generated catalog validated in CI.0600permissions under the shared artifact file owners; the caller's bundle is never modified; no new subprocess or network capability.Review checklist
type(scope): outcome.Author readiness
Human owner: @jimpablo