Skip to content

refactor(domain): move the binary image, Mach-O selection and fixup readers into domain - #11482

Merged
morluto merged 1 commit into
mainfrom
refactor/native-image-readers-domain
Nov 15, 2026
Merged

morluto merged 1 commit into
mainfrom
refactor/native-image-readers-domain

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Moves twelve I/O-free binary format readers from the native provider into domain, using git mv and specifier rewrites. Each file's content is unchanged apart from its relative imports.

Into src/domain/apple/:

  • AppleDispatchDecodeFacts.ts -> appleDispatchDecodeFacts.ts
  • AppleMachoFixups.ts -> appleMachoFixups.ts
  • AppleMachoNames.ts -> appleMachoNames.ts
  • AppleMachoSelection.ts -> appleMachoSelection.ts
  • MachoArchitectureSelection.ts (and its test) -> machoArchitectureSelection.ts
  • MachoCommandNames.ts -> machoCommandNames.ts
  • metadata/MachoImage.ts -> machoImage.ts
  • metadata/MachoSliceSelection.ts -> machoSliceSelection.ts

Into src/domain/native/:

  • metadata/ElfImage.ts -> elfImage.ts
  • metadata/ElfPointerRelocations.ts (and its test) -> elfPointerRelocations.ts
  • metadata/PeImage.ts -> peImage.ts
  • metadata/readBinaryContainer.ts -> readBinaryContainer.ts

The go, rust, il2cpp and kuna providers imported these from native, so four pairs leave the crossProvider baseline: il2cpp -> native 5, go -> native 2, rust -> native 2, kuna -> native 2.

Refs #11359. Part of plan W9. Enabled by #11449 (NativeSectionDirectory, which ElfImage reads) and #11460 (the lipo parser, which MachoArchitectureSelection names).

Problem and expected behavior

Four providers read ELF, PE and Mach-O containers, Mach-O slices, chained fixups and command names through the native provider's internals. Expected: format readers that do no I/O live with the other domain format readers (#11415, #11449), and providers import them inward.

Change and scope

Not included: native's own native -> artifacts imports (#11426), android -> native (AndroidJniLibrary), and il2cpp -> ghidra.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the readers keep their code; their location moves from native to domain. No behaviour change.
  • Contribution scope fit and linked maintainer decision: [Design] Provider-to-provider import rule with declared exceptions #11359. No new capability.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

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: specifier updates only; two tests move with their modules.

  • Base reproduction or other evidence: node scripts/verify-module-boundaries.mjs reported go -> native: 0, baseline 2, il2cpp -> native: 0, baseline 5, kuna -> native: 0, baseline 2 and rust -> native: 0, baseline 2.

  • User-visible CLI/MCP output (if applicable): none.

  • Remaining proof gaps: the il2cpp tests under tests/ and the JNI analysis-efficiency script were not run; il2cpp's change is two import specifiers, and the script change is two path strings.

  • 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, including the architecture guards.
  • node scripts/verify-module-boundaries.mjs: passed after lowering the baseline.
  • npm run test:focused -- on the 24 changed test files: 883 tests passed (14.3 s).
  • npm run test:focused -- on src/go/*.test.ts, src/kuna/*.test.ts and src/rust/*.test.ts (6 files): 71 tests passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. These are internal modules.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

This is a pure move (git mv, specifier rewrites, two path strings and baseline re-keys), so the squash commit goes in .git-blame-ignore-revs after merge.

Author readiness

Human owner:

  • 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

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-15T20:51:34.971339Z
We couldn’t complete this review. Comment @codex review to try again.
c4077f3 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Moves twelve binary readers into src/domain/apple/ and src/domain/native/ without changing their parsing logic.

  • Binary-format readers now live with domain format code.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P["Provider adapters"] --> A["Mach-O readers in domain"]
  P --> N["ELF and PE readers in domain"]
  A --> D["Shared domain helpers"]
  N --> D
Loading

Reviews (2) · Last reviewed commit: "refactor(domain): move the binary image,..." · Reviewed by Greptile

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

Labels

area: domain Domain logic, errors, and pure functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant