[PR #873] [MERGED] refactor(android): group layered source and verification #2309

Closed
opened 2026-10-16 21:17:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/873
Author: @N0zoM1z0
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @N0zoM1z0

Base: main ← Head: refactor/android-capability-layout


📝 Commits (1)

  • b572e8c refactor(android): group layered source and verification

📊 Changes

35 files changed (+98 additions, -71 deletions)

View changed files

📝 docs/capability-migration.md (+17 -0)
📝 docs/testing.md (+8 -0)
📝 package.json (+2 -2)
📝 scripts/fixtures/android/apidemos.json (+0 -0)
📝 scripts/fixtures/android/fetch.mjs (+6 -4)
📝 scripts/lib/catalog-core.mjs (+1 -1)
📝 scripts/verify/android/analysis.mjs (+7 -7)
📝 scripts/verify/android/cli-cancellation.mjs (+1 -1)
📝 src/android/AndroidTargetSnapshot.ts (+1 -1)
📝 src/android/JadxAnalysis.ts (+2 -2)
📝 src/android/JadxConfiguration.ts (+1 -1)
📝 src/android/JadxProtocol.ts (+1 -1)
📝 src/android/JadxProvider.ts (+2 -2)
📝 src/android/JadxSession.ts (+1 -1)
📝 src/application/android/AndroidAnalysisPort.ts (+5 -5)
📝 src/application/android/AndroidAnalysisService.ts (+8 -8)
📝 src/application/android/AndroidApplicationService.ts (+6 -6)
📝 src/cli/androidCommands.ts (+2 -2)
📝 src/cli/applicationCommands.ts (+2 -2)
📝 src/composition/android.ts (+1 -1)

...and 15 more files

📄 Description

Summary

Give Android workflows, pure semantics, contracts and verification an explicit owner inside REA's existing layers. Incremental T6 work for #740.

Problem and expected behavior

Android inspection and inventory projection were mixed among application/domain root files, while the real verifier, cancellation helper and fixture downloader were scattered. Maintainers should find the capability and its proof entrypoints together without changing analysis behavior.

Change and scope

  • Move three application files, two domain files and the named inspection contracts into Android subdirectories within their current layers. Update both callers, typed factory, producer imports and catalog generation.
  • Move the existing inventory-projection composition test under Android ownership with its original assertions.
  • Group the real verifier and cancellation helper under scripts/verify/android; colocate the explicit downloader and byte-identical fixture manifest under scripts/fixtures/android. Preserve npm command names and the repository-root fixture default.
  • Document capability ownership and distinct synthetic/package/real-engine proof levels.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Android source ownership and local/compiled module resolution.
  • CLI and MCP/tool-catalog contract: unchanged names, schemas, tool inventory and execution intent.
  • Provider, bridge, target-format, or platform compatibility: existing JADX adapter, APK/JAR handling and supported host scope unchanged. No engine installation.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged; inventory projection remains execution-free.
  • Process execution, authorization, cleanup, or containment impact: unchanged queue, cancellation, cleanup-failure state and JVM/worker limits; no additional permissions.
  • Generated metadata, package, or installation impact: generator reads the relocated compiled contract; committed generated outputs are unchanged. Verification npm scripts follow their new paths.

Evidence and regression coverage

  • Tests added or updated: original composition test moved; affected tests follow new imports. No assertion rewrites or new tests that freeze folder names.

  • Base evidence: normalized AST comparison confirms unchanged implementation/assertion bodies for all 27 affected TypeScript files; the fixture manifest is byte-identical. Script diffs only adjust resolution and recovery command locations.

  • User-visible CLI/MCP output: unchanged. The relocated verifier reports the actual missing APK/JAR prerequisites; downloader usage points to the existing npm command. Their imports and repository/default fixture resolution were exercised without downloading assets.

  • Remaining proof gaps: no local fixed APK/JADX JAR was available, so real JADX analysis was not run. Synthetic producer and SDK success establish their narrower contracts. No new engine or host coverage claim.

  • 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

  • npm run check -- --output-logs=errors-only — five static tasks passed.
  • npm run docs:check — clean build and generated-document checks passed, with no generated output changes.
  • Exact Vitest files for Android producer/configuration/protocol, Android/mobile MCP, inventory projection, cancellation, canonical contracts and resolved layer guards — 102 cases passed after rebuilding.
  • npm run verify:test-discovery — all 504 files discovered exactly once, including the moved composition case.
  • npm run verify:package — passed: isolated installs with/without optional dependencies, 129 tools, Evidence CLI/MCP transfer, target-free/lifecycle/setup recovery and update. Measured startup to tools/list 4241.98 ms; sampled MCP peak RSS 433,704,960 bytes (~414 MiB).
  • Relocated real-verifier/downloader prerequisite and resolution probes — passed; no assets downloaded.
  • git diff --check and final diff review — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for CLI/MCP callers; internal imports and repository verification paths are updated together.
  • Real Hopper/Ghidra, browser, or OS coverage: not run locally for this structural Android increment; external provider/bridge/native assets are not moved. Real JADX remains explicitly unverified in this batch. All applicable CI is required before merge.
  • Package or release metadata impact: one existing distribution, no new dependencies or version change.
  • Security, privacy, process, or containment review: heavy checks run serially with two-CPU affinity, reduced priority and bounded Node heaps; no Windows host writes, private paths, credentials or binary artifacts published.

Review checklist

  • One focused outcome and Conventional Commit title.
  • Related roadmap linked.
  • Existing behavior and meaningful producer/cancellation/failure paths covered.
  • Owning documentation, generator paths and metadata checked.
  • CLI/MCP behavior remains compatible.
  • Final diff checked for secrets, unrelated cleanup and unsupported claims.

🔄 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/873 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `refactor/android-capability-layout` --- ### 📝 Commits (1) - [`b572e8c`](https://github.com/morluto/rea/commit/b572e8cadd777c61cdf880cea88880160a12b809) refactor(android): group layered source and verification ### 📊 Changes **35 files changed** (+98 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `docs/capability-migration.md` (+17 -0) 📝 `docs/testing.md` (+8 -0) 📝 `package.json` (+2 -2) 📝 `scripts/fixtures/android/apidemos.json` (+0 -0) 📝 `scripts/fixtures/android/fetch.mjs` (+6 -4) 📝 `scripts/lib/catalog-core.mjs` (+1 -1) 📝 `scripts/verify/android/analysis.mjs` (+7 -7) 📝 `scripts/verify/android/cli-cancellation.mjs` (+1 -1) 📝 `src/android/AndroidTargetSnapshot.ts` (+1 -1) 📝 `src/android/JadxAnalysis.ts` (+2 -2) 📝 `src/android/JadxConfiguration.ts` (+1 -1) 📝 `src/android/JadxProtocol.ts` (+1 -1) 📝 `src/android/JadxProvider.ts` (+2 -2) 📝 `src/android/JadxSession.ts` (+1 -1) 📝 `src/application/android/AndroidAnalysisPort.ts` (+5 -5) 📝 `src/application/android/AndroidAnalysisService.ts` (+8 -8) 📝 `src/application/android/AndroidApplicationService.ts` (+6 -6) 📝 `src/cli/androidCommands.ts` (+2 -2) 📝 `src/cli/applicationCommands.ts` (+2 -2) 📝 `src/composition/android.ts` (+1 -1) _...and 15 more files_ </details> ### 📄 Description ## Summary Give Android workflows, pure semantics, contracts and verification an explicit owner inside REA's existing layers. Incremental T6 work for #740. ## Problem and expected behavior Android inspection and inventory projection were mixed among application/domain root files, while the real verifier, cancellation helper and fixture downloader were scattered. Maintainers should find the capability and its proof entrypoints together without changing analysis behavior. ## Change and scope - Move three application files, two domain files and the named inspection contracts into Android subdirectories within their current layers. Update both callers, typed factory, producer imports and catalog generation. - Move the existing inventory-projection composition test under Android ownership with its original assertions. - Group the real verifier and cancellation helper under scripts/verify/android; colocate the explicit downloader and byte-identical fixture manifest under scripts/fixtures/android. Preserve npm command names and the repository-root fixture default. - Document capability ownership and distinct synthetic/package/real-engine proof levels. ## Contract and boundary impact - Semantic owner and earliest changed stage: Android source ownership and local/compiled module resolution. - CLI and MCP/tool-catalog contract: unchanged names, schemas, tool inventory and execution intent. - Provider, bridge, target-format, or platform compatibility: existing JADX adapter, APK/JAR handling and supported host scope unchanged. No engine installation. - Evidence, artifact, provenance, or reconstruction contract: unchanged; inventory projection remains execution-free. - Process execution, authorization, cleanup, or containment impact: unchanged queue, cancellation, cleanup-failure state and JVM/worker limits; no additional permissions. - Generated metadata, package, or installation impact: generator reads the relocated compiled contract; committed generated outputs are unchanged. Verification npm scripts follow their new paths. ## Evidence and regression coverage - Tests added or updated: original composition test moved; affected tests follow new imports. No assertion rewrites or new tests that freeze folder names. - Base evidence: normalized AST comparison confirms unchanged implementation/assertion bodies for all 27 affected TypeScript files; the fixture manifest is byte-identical. Script diffs only adjust resolution and recovery command locations. - User-visible CLI/MCP output: unchanged. The relocated verifier reports the actual missing APK/JAR prerequisites; downloader usage points to the existing npm command. Their imports and repository/default fixture resolution were exercised without downloading assets. - Remaining proof gaps: no local fixed APK/JADX JAR was available, so real JADX analysis was not run. Synthetic producer and SDK success establish their narrower contracts. No new engine or host coverage claim. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run check -- --output-logs=errors-only` — five static tasks passed. - `npm run docs:check` — clean build and generated-document checks passed, with no generated output changes. - Exact Vitest files for Android producer/configuration/protocol, Android/mobile MCP, inventory projection, cancellation, canonical contracts and resolved layer guards — 102 cases passed after rebuilding. - `npm run verify:test-discovery` — all 504 files discovered exactly once, including the moved composition case. - `npm run verify:package` — passed: isolated installs with/without optional dependencies, 129 tools, Evidence CLI/MCP transfer, target-free/lifecycle/setup recovery and update. Measured startup to tools/list 4241.98 ms; sampled MCP peak RSS 433,704,960 bytes (~414 MiB). - Relocated real-verifier/downloader prerequisite and resolution probes — passed; no assets downloaded. - `git diff --check` and final diff review — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none for CLI/MCP callers; internal imports and repository verification paths are updated together. - Real Hopper/Ghidra, browser, or OS coverage: not run locally for this structural Android increment; external provider/bridge/native assets are not moved. Real JADX remains explicitly unverified in this batch. All applicable CI is required before merge. - Package or release metadata impact: one existing distribution, no new dependencies or version change. - Security, privacy, process, or containment review: heavy checks run serially with two-CPU affinity, reduced priority and bounded Node heaps; no Windows host writes, private paths, credentials or binary artifacts published. ## Review checklist - [x] One focused outcome and Conventional Commit title. - [x] Related roadmap linked. - [x] Existing behavior and meaningful producer/cancellation/failure paths covered. - [x] Owning documentation, generator paths and metadata checked. - [x] CLI/MCP behavior remains compatible. - [x] Final diff checked for secrets, unrelated cleanup and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:05 +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#2309
No description provided.