Skip to content

fix(artifacts): retain expanded ASAR container parents - #583

Merged
morluto merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/artifact-expanded-container-parents
Oct 5, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/artifact-expanded-container-parents

Conversation

@kaoru0822-kitauji

@kaoru0822-kitauji kaoru0822-kitauji commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Attach expanded ASAR members to their actual archive occurrence, preserving the archive's file kind and byte-derived identity.

No tracking issue: found during real nested-ASAR inventory testing; no matching dedicated issue or PR was found.

Problem and expected behavior

Inventorying a filesystem application containing resources/app.asar/main.js previously attached main.js and the archive's top-level directories to resources. The expanded ASAR had no child edges. Opening the same ASAR directly produced the correct hierarchy.

The nearest-parent helper accepted directories only, while expanded archives correctly retain entry_kind: "file". This affected occurrence parents, containment edges, enclosing virtual-directory identities, and the parent artifact identified by record-and-continue integrity evidence.

Change and scope

Track the occurrence IDs of containers whose nested reader is actually entered, and admit those IDs alongside real directories when resolving nearest parents against the completed index.

Archive occurrences remain files with byte-derived artifact IDs. A filename, node kind, or format alone does not make an opaque archive a parent. No additional container formats or recursive expansion behavior is introduced.

Built on the now-merged #578 completed-index parent pass. #580 relative-directory hash behavior is retained. No JavaScript resolver/container regression is claimed: that workflow independently preserves the reader's container digest.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application inventory expansion tracking and nearest-parent resolution, before directory identities, occurrence rekeying, edges, and integrity evidence.
  • CLI and MCP/tool-catalog contract: unchanged schemas/tools; corrected containment and integrity-parent references.
  • Provider, bridge, target-format, or platform compatibility: real ASAR/ZIP and filesystem fixtures on Linux; no provider wire changes.
  • Evidence, artifact, provenance, or reconstruction contract: archive/member byte identities remain unchanged; affected virtual-directory/root identities and graph commitments intentionally reflect corrected containment. Integrity mismatch evidence retains its untrusted state and names the actual archive.
  • Process execution, authorization, cleanup, or containment impact: no new execution or expansion permissions; existing reader cleanup, path registration, and fail/record integrity policies remain.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

Eight real boundary tests cover:

  • Expanded ASAR child parents and contains edges, unchanged archive/member byte identities, repeated scans, and direct-root ASAR compatibility.
  • Corrupted packed-member strict rejection and record-and-continue integrity evidence referencing its archive.
  • Valid ASAR bytes, ordinary ASAR-named data, and encrypted ASAR-named ZIP members remaining opaque.
  • Ordinary ASAR-named members inside ASAR remaining opaque.
  • Real directories named .asar, both filesystem and ZIP.
  • Opaque file/child-prefix conflicts in both entry orders.
  • Malformed filesystem archive rejection and unfollowed ASAR symlinks (symlink control skips Windows).

On unchanged baseline f73bb0f, the two defect regressions fail and six controls pass. The fixed combined matrix passes 42/42 (new containment, ASAR freshness, ZIP parenting, relative-directory identity, and JavaScript reconstruction tests).

Executed the built CLI and a real stdio MCP client on an application-bundle fixture: both return Contents/Resources/app.asar/main.js → Contents/Resources/app.asar and the corresponding corrected containment relationships. Native-addon loading was explicitly blocked during these probes; this does not claim native macOS/provider execution.

Independent review found no blocking issues. Additional cancellation-after-hash, rescan, malformed-scan isolation, occurrence-rekey, and corrupted-evidence probes passed.

  • 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

Compatibility, safety, and release

No public schema, dependency, or release-metadata changes. Corrected containment changes affected virtual-directory/root IDs and graph commitments; archive and member content digests are unchanged.

Real Hopper/Ghidra and native Windows/macOS execution were not run locally. No bulk extraction, extension-based parent eligibility, path-validation relaxation, or unrelated cleanup.

Review checklist

  • One focused outcome with a Conventional Commit title.
  • Reason for no linked issue stated.
  • Regression, negative-path, and identity compatibility controls included.
  • Existing contracts/docs remain accurate; generated metadata checks run.
  • Representative real CLI/MCP behavior executed.
  • Final diff checked for secrets, unrelated cleanup, and unsupported claims.

Copy link
Copy Markdown
Collaborator Author

@codex review

@morluto
morluto merged commit 00fa974 into morluto:main Oct 5, 2026
19 checks passed
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants