[PR #3830] [CLOSED] fix(mobile): exclude directory entries from application components #5931

Closed
opened 2026-10-31 01:10:33 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3830
Author: @flyl1u
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/mobile-directory-components


📝 Commits (1)

  • 42f0a59 fix(mobile): exclude directory entries from application components

📊 Changes

2 files changed (+190 additions, -2 deletions)

View changed files

📝 src/domain/mobileApplicationGraphProjection.ts (+4 -2)
➕ tests/acceptance/applications/mobileDirectoryComponents.test.ts (+186 -0)

📄 Description

Summary

Fixes #3349.

An APK directory named classes.dex/, or a Harmony directory named ets/modules.abc/, was projected as bytecode. Library-shaped directories also supplied false runtime hints and bridge candidates. Exclude directory occurrences at the shared component projection boundary, preserving their original inventory Evidence and any real files beneath them.

Problem and expected behavior

Directory tree hashes authenticate directories; they do not establish file components. Before the fix, the new public-workflow regressions fail for APK, HAP and App Pack inputs: Android reports six directory components and Harmony reports seven. After the fix, directory-only inputs have no file components, runtime hints or bridges. Identically named regular files retain the existing projections, and real bytecode files inside those directories remain discoverable.

Change and scope

Use the inventory producer's entry_kind in projectedComponents, before Android/Harmony classification, packaging-model inference and bridge construction. One shared rule also excludes directory-shaped manifests, resources, signing entries and App Pack child packages. No additional per-classifier filtering or bytecode decoding is introduced.

Contract and boundary impact

  • Semantic owner and earliest changed stage: authenticated mobile inventory-to-component projection.
  • Contribution scope and maintainer decision: routine static correctness fix within existing boundaries; a new capability decision is not applicable.
  • CLI/MCP and tool catalog: existing inputs and schemas; corrected component arrays, runtime hints, bridge candidates and derived projection IDs.
  • Provider/platform compatibility: shared Android and Harmony projection; no engine/provider changes.
  • Evidence/provenance: original inventory paths, entry kinds, digests and source Evidence IDs remain intact. Unavailable-component and partial-coverage handling is unchanged.
  • Authority and cleanup: static archive inspection and projection; no target execution, injection, network access or source mutation is added.
  • Generated metadata/package/install impact: none.

Expected product effects:

  • Read existing files or captured data.

Evidence and regression coverage

New acceptance coverage runs real inspect-artifact output through the compiled CLI and stdio MCP projection tools. APK, HAP and App Pack fixtures exercise directory-only inputs, same-name regular-file controls, and real bytecode beneath a directory with a code-like name. Assertions cover components, runtime families, bridge counts, Harmony packaging model, App Pack children, retained inventory kinds, source Evidence IDs, complete coverage, CLI/MCP equality and unchanged package bytes.

  • Base 4135c911d: all three new cases failed on directory component assertions before the production edit.
  • Fixed revision: all three pass, covering nine generated packages through both projection surfaces.
  • Existing regression suites: 28 tests pass, including encrypted/unavailable content, partial coverage, bridge budgets, framework conventions and the Harmony public lifecycle.

For evidence-bearing changes:

  • Observed, derived and inferred claims remain distinguishable.
  • Artifact identity and source provenance remain preserved.
  • Incomplete and unavailable outcomes remain visible.

Validation performed

Windows x64, Node.js 24.18.0, npm 11.16.0:

  • npm run test:focused -- tests/acceptance/applications/mobileDirectoryComponents.test.ts — 3 passed after first demonstrating 3 failures on the base.
  • npm run test:focused -- tests/boundary/filesystem/android/application.test.ts tests/boundary/filesystem/harmony/application.test.ts tests/boundary/mcp/mobileApplicationGraphMcp.test.ts tests/acceptance/applications/mobileFrameworkConventions.test.ts tests/acceptance/harmonyArtifactJourney.test.ts — 28 passed.
  • npm run check — passed typecheck, lint, format, knip, metadata, module boundaries and architecture guards.
  • npm run verify:test-discovery — all 1,304 test files discovered exactly once.
  • git diff --check — passed.

Compatibility, safety and release

No new schemas, migration, dependencies or generated metadata changes. Incorrect directory-derived projections are corrected; regular-file heuristics retain their existing limitations. Local verification covers static ZIP inventory/projection on Windows, not Android execution or real analysis engines. The matching published 6.5.0 Windows addon was restored using the documented source-checkout procedure and passed artifact verification. Linux/macOS and the complete deterministic suite are left to CI; no performance improvement is claimed.

Author readiness

Human owner: @flyl1u (PR author; human review pending)

  • 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 and links its issue.
  • The change has one focused outcome and a Conventional Commit title.
  • Relevant public-workflow regressions and static checks pass locally.
  • Required CI checks pass for the current revision.
  • Human owner completes Author readiness.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3830 **Author:** [@flyl1u](https://github.com/flyl1u) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mobile-directory-components` --- ### 📝 Commits (1) - [`42f0a59`](https://github.com/morluto/rea/commit/42f0a5981be06e84df2e5468fe04eb270d058960) fix(mobile): exclude directory entries from application components ### 📊 Changes **2 files changed** (+190 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/mobileApplicationGraphProjection.ts` (+4 -2) ➕ `tests/acceptance/applications/mobileDirectoryComponents.test.ts` (+186 -0) </details> ### 📄 Description ## Summary Fixes #3349. An APK directory named `classes.dex/`, or a Harmony directory named `ets/modules.abc/`, was projected as bytecode. Library-shaped directories also supplied false runtime hints and bridge candidates. Exclude directory occurrences at the shared component projection boundary, preserving their original inventory Evidence and any real files beneath them. ## Problem and expected behavior Directory tree hashes authenticate directories; they do not establish file components. Before the fix, the new public-workflow regressions fail for APK, HAP and App Pack inputs: Android reports six directory components and Harmony reports seven. After the fix, directory-only inputs have no file components, runtime hints or bridges. Identically named regular files retain the existing projections, and real bytecode files inside those directories remain discoverable. ## Change and scope Use the inventory producer's `entry_kind` in `projectedComponents`, before Android/Harmony classification, packaging-model inference and bridge construction. One shared rule also excludes directory-shaped manifests, resources, signing entries and App Pack child packages. No additional per-classifier filtering or bytecode decoding is introduced. ## Contract and boundary impact - Semantic owner and earliest changed stage: authenticated mobile inventory-to-component projection. - Contribution scope and maintainer decision: routine static correctness fix within existing boundaries; a new capability decision is not applicable. - CLI/MCP and tool catalog: existing inputs and schemas; corrected component arrays, runtime hints, bridge candidates and derived projection IDs. - Provider/platform compatibility: shared Android and Harmony projection; no engine/provider changes. - Evidence/provenance: original inventory paths, entry kinds, digests and source Evidence IDs remain intact. Unavailable-component and partial-coverage handling is unchanged. - Authority and cleanup: static archive inspection and projection; no target execution, injection, network access or source mutation is added. - Generated metadata/package/install impact: none. Expected product effects: - [x] Read existing files or captured data. ## Evidence and regression coverage New acceptance coverage runs real `inspect-artifact` output through the compiled CLI and stdio MCP projection tools. APK, HAP and App Pack fixtures exercise directory-only inputs, same-name regular-file controls, and real bytecode beneath a directory with a code-like name. Assertions cover components, runtime families, bridge counts, Harmony packaging model, App Pack children, retained inventory kinds, source Evidence IDs, complete coverage, CLI/MCP equality and unchanged package bytes. - Base `4135c911d`: all three new cases failed on directory component assertions before the production edit. - Fixed revision: all three pass, covering nine generated packages through both projection surfaces. - Existing regression suites: 28 tests pass, including encrypted/unavailable content, partial coverage, bridge budgets, framework conventions and the Harmony public lifecycle. For evidence-bearing changes: - [x] Observed, derived and inferred claims remain distinguishable. - [x] Artifact identity and source provenance remain preserved. - [x] Incomplete and unavailable outcomes remain visible. ## Validation performed Windows x64, Node.js 24.18.0, npm 11.16.0: - `npm run test:focused -- tests/acceptance/applications/mobileDirectoryComponents.test.ts` — 3 passed after first demonstrating 3 failures on the base. - `npm run test:focused -- tests/boundary/filesystem/android/application.test.ts tests/boundary/filesystem/harmony/application.test.ts tests/boundary/mcp/mobileApplicationGraphMcp.test.ts tests/acceptance/applications/mobileFrameworkConventions.test.ts tests/acceptance/harmonyArtifactJourney.test.ts` — 28 passed. - `npm run check` — passed typecheck, lint, format, knip, metadata, module boundaries and architecture guards. - `npm run verify:test-discovery` — all 1,304 test files discovered exactly once. - `git diff --check` — passed. ## Compatibility, safety and release No new schemas, migration, dependencies or generated metadata changes. Incorrect directory-derived projections are corrected; regular-file heuristics retain their existing limitations. Local verification covers static ZIP inventory/projection on Windows, not Android execution or real analysis engines. The matching published 6.5.0 Windows addon was restored using the documented source-checkout procedure and passed artifact verification. Linux/macOS and the complete deterministic suite are left to CI; no performance improvement is claimed. ## Author readiness Human owner: @flyl1u (PR author; human review pending) - [ ] 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 - [x] This PR addresses a concrete problem and links its issue. - [x] The change has one focused outcome and a Conventional Commit title. - [x] Relevant public-workflow regressions and static checks pass locally. - [ ] Required CI checks pass for the current revision. - [ ] Human owner completes Author readiness. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:10:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5931
No description provided.