Repository navigation
fix(artifacts): propose probes from the contents of inspected app bundles - #1969
thefolahan wants to merge 10 commits into
Conversation
Codex Review SummaryThis 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: 41b633cd28
ℹ️ 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".
…dles inspect_artifact chose next probes from the root format alone, so every app bundle directory was sent to analyze_javascript_application, including native Swift bundles that contain no JavaScript. Directory probes now follow the member formats the inventory observed: JavaScript for ASAR or bundled scripts, open_binary for Mach-O, ELF or PE executables, managed inspection for PE, and inspect_plist for property lists.
Path classification now names the same JavaScript source extensions the analyzer reads (.cts, .mts, .jsx, .ts, .tsx), so a bundle holding only TypeScript sources still proposes analyze_javascript_application. Directory probes ignore symlink occurrences, whose path roles the inventory and the analyzers never follow.
41b633c to
7eece9b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eece9bc7e
ℹ️ 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".
|
@greptileai review |
|
Source-reviewed changes. Tests, builds and check reruns were skipped at maintainer request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b7c7e1db2
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22ee275271
ℹ️ 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".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Probe selection used artifact-format labels while JavaScript acquisition used a broader relevant-file classification, excluding source-map-only bundles. Commit 22ee275 moves the acquisition classifier to the shared domain boundary and uses that same classification for directory probes, restricted to regular files as acquisition requires. The private duplicate classifier was removed; existing native/plist ordering and operation deduplication remain. A source-map-only bundle with sourcesContent now has public boundary regression coverage alongside the existing symlink and mixed-format cases. Source and affected-consumer inspection, targeted formatting with two threads, and git diff --check completed. Regression coverage was authored; tests, builds, typechecks, lint, provider execution and CI reruns were skipped at the user’s request. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e283e621df
ℹ️ 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".
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Probe eligibility now retains occurrence identity and walks its parent occurrences: direct filesystem paths may traverse directory ancestors, but a packed ASAR file cannot be reached as a local path by |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e364692ab7
ℹ️ 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".
| "inspect_managed_artifact", | ||
| "open_binary", |
There was a problem hiding this comment.
Expect open_binary before the managed probe
After the metadata follow-up, fresh evidence is that the physicalCopy === true case now contains both the direct Mach-O at Contents/MacOS/Fixture and a direct PE. DIRECTORY_MEMBER_FORMATS visits Mach-O before PE (src/domain/artifactInspection.ts:311-312), and operation deduplication retains that first open_binary, so the actual sequence is analyze_javascript_application, open_binary, inspect_managed_artifact, inspect_plist; this assertion reverses the middle operations and deterministically fails that parameterized case.
Useful? React with 👍 / 👎.
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. The bundle component owner now treats JavaScript bundles as runtime evidence, and the native packed-PE fixture now contains a valid Mach-O plus Info.plist so its probes exercise the actual producer. Both fixes are live at e364692. Source inspection and git diff --check only; tests/checks/provider executions were not run. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e2ade30ba
ℹ️ 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".
| }); | ||
| await createPackageWithOptions( | ||
| source, | ||
| join(bundle, "Contents/Resources/app.asar"), |
There was a problem hiding this comment.
Create Resources before writing the Electron ASAR
In this Electron-style case, writeTree creates Contents and Contents/MacOS but never Contents/Resources; createPackageWithOptions writes the archive file but does not recursively create its destination parent. On a fresh fixture this rejects with ENOENT before probeOperations runs, so create the Resources directory first as the packed-PE fixture below already does.
Useful? React with 👍 / 👎.
Normalize path facts once at the owning filesystem boundary, preserve caller spelling and unavailable inventory members, and retain typed read failures. Record exclusion entry kinds so only proven directories can establish descendant symlink targets; omitted legacy kinds stay unknown. Reviewed fixes include #1969, #2642, #2759, and #2994. Validation: 26 reference graph source tests passed; prior artifact checks passed 275 tests with one Windows-only skip. Updated compiled import workflows are included in final validation after regeneration.
|
Hi @morluto, thank you for taking the fix from this PR into A small request: when you fold a contributor's work into one of your commits, would you consider adding a co-author trailer? GitHub then credits the contributor on the commit, which means a lot to people contributing for the first time. For my work it would be: The same applies to #2877, whose core landed in 80de314. No need to rewrite history for the commits already on |
|
@thefolahan, thanks for catching that directory probes were being inferred from the bundle root alone. Probe suggestions now follow formats observed in the inventory, avoiding a JavaScript recommendation for native-only apps (main). |
Summary
inspect_artifacton a native macOS app bundle proposesanalyze_javascript_applicationas its only next probe, even when the bundle contains no JavaScript at all. Directory probes now follow the member formats that the inventory actually observed. No issue is linked; I found this while running REA 6.4.0 on two of my own Swift apps and searched open and closed issues and PRs before opening this.Problem and expected behavior
probesForinsrc/domain/artifactInspection.tschose probes fromroot_formatalone, and"directory"shared the JavaScript branch withasarandjavascript-bundle. Becauseinspect_artifactonly admits app bundles as directories (a plain directory is refused with "open_binary accepts files and macOS app bundles"), every native.appwas told to run the JavaScript analyzer and was never pointed atopen_binaryorinspect_plist.Smallest trigger: any SwiftUI app bundle.
Expected: the probes match the bundle's members, so
open_binaryandinspect_plist, plusanalyze_javascript_applicationonly when the bundle holds an ASAR or bundled scripts (Electron).Change and scope
For a directory root,
probesFornow collects theartifact_formatof every inventory occurrence and reuses the existing per format probes (renamedprobesForFormat, unchanged otherwise) in a fixed order: ASAR and JavaScript, then Mach-O and ELF, then PE, then plist. Repeated operations are kept once, soopen_binarykeeps the general native rationale when a bundle holds both Mach-O and PE members. Non directory roots behave exactly as before.Following review:
classifyArtifactPathnow names the same JavaScript source extensions the analyzer reads (.cts,.mts,.jsx,.ts,.tsxin addition to.cjs,.mjs,.js), so a bundle holding only TypeScript sources still gets the JavaScript probe; and directory probes ignore symlink occurrences, which the inventory and analyzers never follow.Not included: no new probe operations, no schema change, and no change to hypotheses.
Contract and boundary impact
src/domain/artifactInspection.ts, probe derivation after inventory.next_probesandunexplored_brancheskeep their schema, only their values for directory roots change..cts,.mts,.jsx,.tsand.tsxpaths now carryartifact_kind: javascriptandartifact_format: javascript-bundleinstead ofresourceandfile, matching what the JavaScript analyzer already reads. No schema change.Evidence and regression coverage
tests/boundary/providers/native/artifactProvider.directoryProbes.test.tsrunsinspect_artifactthrough the direct analysis workflow on a minimal native bundle (arm64mach_header_64plusInfo.plist) and on an Electron style bundle (the same plusContents/Resources/app.asar), on a bundle whose only scripts are TypeScript, and on a bundle whose only.jsmember is a symlink. Unexplored branches are checked to carry the same probes.analyze_javascript_application); the TypeScript test fails without the classifier change and the symlink test fails without the symlink filter. All four pass with this change.next_probeschanges from["analyze_javascript_application"]to["open_binary", "inspect_plist"].For evidence-bearing changes:
Validation performed
npx vitest run tests/boundary/providers/native/artifactProvider.directoryProbes.test.ts: 4 passed; each test fails when its corresponding fix is reverted.npx vitest runover every test file whose path mentions artifact, javascript, inventory, electron, asar, bundle, comparison or evidence (251 files): 2852 passed, 4 failed, 41 skipped. The 4 failures are intests/boundary/inspector/javascriptRuntimeObservation.test.tsandjavascriptRuntimeTargetLocations.test.tsand fail identically on unmodifiedb777e5din my environment, so they are unrelated to this change.npm run check:fast: typecheck and lint passed.npm run verify:test-discovery: discovered all test files exactly once.oxfmt --check src tests: passed.Compatibility, safety, and release
inspect_artifactis provider neutral.Review checklist
type(scope): outcome.