Skip to content

fix(apple): select only entries named Assets.car as asset catalogs - #4094

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/3914-asset-catalog-name-match
Oct 15, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/3914-asset-catalog-name-match

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3914. inspect-asset-catalog treated every bundle entry whose relative path ended in Assets.car as a compiled catalog. An unrelated NotAssets.car directory was listed as a skipped catalog. If the app had no real Assets.car, inspection then failed instead of returning the supported empty inventory. Only entries named exactly Assets.car are catalogs now.

Problem and expected behavior

collectAssetCatalogs (src/artifacts/apple/AppleAssetCatalogAnalysis.ts) filtered with entry.path.endsWith("Assets.car"). A suffix match also accepts:

  • the directory Contents/Resources/NotAssets.car, which is recorded as uninspected and, with no catalog present, makes inspection throw ArtifactReaderFailure("path", …);
  • a regular file such as OldAssets.car, which would be sent to assetutil as a catalog.

Reproduced with the issue's fixture: an inert /usr/bin/true copy as the executable, an Info.plist, and an empty NotAssets.car directory.

fixture main this PR
with NotAssets.car directory exit 1, artifact_operation_failed: Asset catalog entries are not regular files and were not inspected: Contents/Resources/NotAssets.car (directory), 564 bytes exit 0, catalogs: [], total_records: 0, no-catalog limitation, 2,169 bytes
control (directory removed) exit 0, empty inventory, 2,162 bytes unchanged

The 7-byte difference between the two passing outputs is the longer fixture path in the subject.

Change and scope

  • Select an entry only when its final /-separated path component is exactly Assets.car. DirectoryArtifactReader always reports /-joined relative paths.
  • Unchanged:
    • symlinked or other non-file entries named Assets.car are still disclosed and still block an absence claim;
    • nested real catalogs (for example in frameworks) are still inspected.

Contract and boundary impact

  • Semantic owner and earliest changed stage: asset catalog entry selection in collectAssetCatalogs.

  • Contribution scope fit and linked maintainer decision: a bug fix within the existing static, read-only boundary; not applicable.

  • CLI and MCP/tool-catalog contract: schemas unchanged.

  • Provider, bridge, target-format, or platform compatibility: macOS assetutil path only.

  • Evidence, artifact, provenance, or reconstruction contract: an app with no catalog now reports the documented empty inventory instead of a false skipped catalog.

  • Target selection, authority, upstream behavior, and cleanup details: assetutil no longer runs on files that are not named Assets.car.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added or updated: src/artifacts/apple/AppleAssetCatalogAnalysis.test.ts. The "app without compiled catalogs" case now also contains a NotAssets.car directory and an OldAssets.car file. It still asserts the empty inventory and that assetutil never runs. The case fails on main (1 failed / 9 passed) and passes with the fix.
  • Real application: /Applications/KeepingYouAwake.app, which has two real Assets.car catalogs (61 records). Median of 3 CLI runs:
build elapsed output result SHA-256 (prefix)
main 553 ms 57,252 bytes, 2 catalogs, 61 records 8b6dd01b6e8eea3d
this PR 537–542 ms 57,252 bytes, 2 catalogs, 61 records 8b6dd01b6e8eea3d

Real catalogs are selected identically, and timing is unchanged within noise.

  • Remaining proof gaps: none known for this selector.

Validation performed

  • npx vitest run src/artifacts/apple/AppleAssetCatalogAnalysis.test.ts — 10 passed; against main, 1 failed as expected.
  • npx vitest run src/artifacts/apple src/domain/apple/appleAssetCatalog.test.ts tests/boundary/filesystem/nativeArtifactGoldens.test.ts tests/acceptance/applications/assetCatalogResourceKeys.test.ts — 9 files, 89 passed.
  • npm run check:fast — passed.
  • Real CLI runs on the issue's fixture and on KeepingYouAwake, as tabulated.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS arm64 with the system assetutil.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: assetutil is no longer launched on unrelated *Assets.car files.

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.

🤖 Generated with Claude Code

inspect-asset-catalog selected every bundle entry whose relative path
ended in Assets.car, so an unrelated NotAssets.car directory was listed
as a skipped catalog and, with no real catalog present, failed the
inspection instead of returning the empty inventory; a regular file such
as OldAssets.car would have been sent to assetutil. The selector now
compares the final path component exactly.

Fixes #3914

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added the track:perf Performance track PRs (issues & perf loop) label Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T11:53:55.675013Z 47ab680 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 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Catalog selection now checks the final path component instead of a suffix.

  • The asset catalog scan selects only entries named exactly Assets.car.

No actionable code or security issues found. Tests were inspected, not run. Local history showed no superseding change; GitHub status and discussions could not be checked because authentication was unavailable.

Reviews (1) · Last reviewed commit: "fix(apple): select only entries named As..." · Reviewed by Greptile

@kaoru0822-kitauji
kaoru0822-kitauji merged commit befbc02 into main Oct 15, 2026
33 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/3914-asset-catalog-name-match branch October 15, 2026 12:21
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 23, 2026
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 track:perf Performance track PRs (issues & perf loop)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] unrelated NotAssets.car directory blocks asset catalog inspection

2 participants