Skip to content

fix(android): keep ZIP symlinks out of unavailable components - #8286

Draft
Gaazi wants to merge 2 commits into
morluto:mainfrom
Gaazi:fix/android-unavailable-symlinks
Draft

Gaazi wants to merge 2 commits into
morluto:mainfrom
Gaazi:fix/android-unavailable-symlinks

Conversation

@Gaazi

@Gaazi Gaazi commented Oct 31, 2026

Copy link
Copy Markdown

Problem

unavailable_components in the Android application projection is built from
every inventoried occurrence, so a ZIP symlink entry — which has no content
bytes by design — is reported as content whose identity could not be
authenticated. A real APK with assets/current -> assets/v1 therefore returns

"unavailable": [{ "path": "assets/current" }],
"coverage": { "status": "partial" }

even though the inventory is complete and every real file was read.

Harmony had the same asymmetry and fixed it in #7886 by selecting file and
slice occurrences first. Android and Apple still encoded that rule inline.

Outcome

  • A known symlink no longer appears in unavailable_components; it keeps its
    path-only identity, as Apple already did.
  • coverage.status stays complete-within-inventory when the inventory is
    complete and no file content is missing.
  • The limitation text says "files or slices", matching what the array holds.

Approach

  • Add projectedContentEntries and projectedUnavailableComponents beside
    projectedFileComponents in mobileApplicationGraphProjection.ts, so the
    "content occurrence vs path-only structure" rule has one owner.
  • Android, Harmony and Apple call the shared selectors instead of repeating the
    kind === "file" || kind === "slice" filter.

Evidence

  • New control in tests/boundary/filesystem/android/application.test.ts builds
    an APK containing a Unix symlink and asserts empty unavailable_components
    plus complete-within-inventory coverage. It fails before this change
    (1 failed | 11 skipped) and passes after it.
  • npx vitest run tests/boundary/filesystem/android/application.test.ts — 12/12.
  • npx vitest run src/domain/mobileApplicationGraphProjection.test.ts tests/boundary/filesystem/android/application.test.ts tests/boundary/filesystem/harmony — 46/46.
  • npx vitest run src/domain/apple/appleApplication.test.ts tests/boundary/filesystem/appleApplication.test.ts — 63 passed; the two failures are
    Windows EPERM when creating symlinks and are unrelated to this change.
  • npm run typecheck, npx oxlint on the touched files, and
    npm run verify:module-boundaries (3447 source files) pass.

Not run: the CLI/MCP acceptance lanes, because this checkout has no built
dist/.

Relates to #7886.

Gaazi added 2 commits October 31, 2026 14:54
Android's application projection fed every non-file occurrence into unavailable_components, so a known ZIP symlink was reported without authenticated content and forced coverage.status to partial. Select file and slice occurrences first, as the Harmony projection already does after morluto#7886, and describe the limitation for files or slices only.

Validation: tests/boundary/filesystem/android/application.test.ts (12 checks; the new symlink control fails before this change); tsc --noEmit; oxlint; verify:module-boundaries.

Work-by: OpenCode (DeepSeek V4.1 Flash Free)
Android, Harmony and Apple each repeated the rule that only file and slice occurrences carry content. Move it into projectedContentEntries and projectedUnavailableComponents beside projectedFileComponents, so the next projection inherits the same semantics instead of re-deriving them.

Validation: mobileApplicationGraphProjection, Android and Harmony boundary suites (46 checks); Apple domain and boundary suites (63 passed, two host EPERM symlink failures); tsc --noEmit; oxlint; verify:module-boundaries.

Work-by: OpenCode (DeepSeek V4.1 Flash Free)
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR fixes Android’s unavailable-content list by sharing the file-and-slice selection rule across Android, Apple, and Harmony.

  • Android APK symlinks no longer count as missing file content.

No actionable issues or security findings were identified. Tests were not run during this review. The supersession check could not be completed because GitHub access was unauthenticated.

Reviews (1) · Last reviewed commit: "refactor: share file and slice selection..." · Reviewed by Greptile

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: I ran the PR's 2 changed test files on Node 22.23.4, 24.22.1 and 26.12.1. They pass on head 4877c3f. With the 4 source files from ec10702 swapped in, 2 tests fail on each Node version.

Check Node 22.23.4 Node 24.22.1 Node 26.12.1
Head 4877c3f pass: 2 files, 13 tests pass: 2 files, 13 tests pass: 2 files, 13 tests
Red run (source files from ec10702) fail: 2 files, 2 tests failed, 11 passed fail: 2 files, 2 tests failed, 11 passed fail: 2 files, 2 tests failed, 11 passed
  • The same 2 tests fail in the red run on all three Node versions.
  • The red run fails selects file and slice facts without reordering or deduplicating occurrences in src/domain/mobileApplicationGraphProjection.test.ts.
  • That failure is a TypeError: projectedContentEntries is not a function.
  • The red run also fails keeps a known ZIP symlink out of unavailable content in tests/boundary/filesystem/android/application.test.ts.
  • That failure is an assertion: unavailable_components was expected to be []. It held one entry for assets/current.
  • The PR changes 6 files against the merge base: 2 test files and 4 source files.
  • The head is 446 commits behind main 90c95a6.
  • On this head, the PR readiness run is completed/success.
  • The CI run and the PR title run are both completed/action_required.
  • The check runs Greptile Review and Validate author declaration are success.
  • The commit status PR readiness is pending.
  • No Source tests, Portable tests or Test shard jobs appear in the CI run's check runs.
  • The PR is a draft, with mergeable true and state blocked.

Not run

  • A probe that sends an unreadable or encrypted symlink through the Android path. The aim is to see if coverage still shows a limitation.
  • A run of the Apple symlink tests on a non-Windows host. The aim is to see if the two reported EPERM failures happen only on Windows.
  • A merge with current main, 90c95a6.
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB) on my Nobara 44 PC, Linux 7.2.11
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 4877c3f / ec10702 (merge base with main)
  • Red run: 4877c3f with the changed source files from ec10702
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/domain/mobileApplicationGraphProjection.test.ts tests/boundary/filesystem/android/application.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

This branch has not been deployed

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

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants