[PR #3495] feat(android): check split APK set consistency from manifest facts #5779

Open
opened 2026-10-31 01:09:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3495
Author: @cevieiras
Created: 10/14/2026
Status: 🔄 Open

Base: main ← Head: feat/android-split-set-check


📝 Commits (3)

  • 24bfc62 feat(android): check split APK set consistency from manifest facts
  • 9b3f4fd fix(android): keep unknown split-set facts unknown and order reasons
  • 9f7e987 Merge upstream/main into feat/android-split-set-check

📊 Changes

3 files changed (+616 additions, -0 deletions)

View changed files

➕ src/domain/android/androidManifestFacts.ts (+33 -0)
➕ src/domain/android/androidSplitSet.test.ts (+316 -0)
➕ src/domain/android/androidSplitSet.ts (+267 -0)

📄 Description

Summary

Adds a pure domain check over caller-selected Android manifest facts that reports whether a set of APKs (base.apk plus split_config.* / feature splits) is internally consistent. It is the first step of the split-set design discussed in #1813; it adds no tool surface and has no consumer yet.

Refs #1813

Problem and expected behavior

Today a pulled split set is analyzed as unrelated files. REA records no relationship between members, so an analysis of base.apk alone silently omits resources, native libraries and feature-module DEX that live elsewhere.

Given manifest facts for the selected members, the check reports:

  • package and effective version-code agreement (versionCodeMajor is combined with versionCode, so two different effective versions cannot compare equal);
  • duplicate split names;
  • missing parents (configForSplit pointing at a member that was not selected);
  • coverage of the caller's selection, with unknown for an empty or all-silent selection rather than "consistent".

Change and scope

  • src/domain/android/androidManifestFacts.ts: the fact shape (observed values only).
  • src/domain/android/androidSplitSet.ts: the pure check. Agreement and duplicates are derived claims; a role that depends on the platform default of an undeclared isFeatureSplit is marked derived, not observed.
  • Not included: the manifest reader (separate PR), ZIP adapter, any MCP/CLI surface, bundletool, signature verification.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/android/ (domain; no I/O).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none; no provider is involved.
  • Evidence, artifact, provenance, or reconstruction contract: none changed. Coverage describes the caller's selection and never claims every installed APK was selected.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: src/domain/android/androidSplitSet.test.ts (15 tests).

  • Base reproduction or other evidence: not applicable (new capability); two guards were mutation-checked while developing.

  • User-visible CLI/MCP output: none.

  • Remaining proof gaps: the check has only seen synthetic facts; real-world manifests are exercised by the reader PR and later work.

  • 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

Run on this branch tip, based on origin/main at cbc0e97c2:

  • npm run test:focused -- src/domain/android/androidSplitSet.test.ts — 15 passed
  • npm run verify:test-discovery — all test files discovered exactly once
  • npm run check — 6/6 tasks successful (typecheck, lint with 0 errors, format, knip, metadata)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: pure functions over already-parsed values; no input parsing here.

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


🔄 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/3495 **Author:** [@cevieiras](https://github.com/cevieiras) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/android-split-set-check` --- ### 📝 Commits (3) - [`24bfc62`](https://github.com/morluto/rea/commit/24bfc6203ec80c481e6ef67010d6e5221bc49e1c) feat(android): check split APK set consistency from manifest facts - [`9b3f4fd`](https://github.com/morluto/rea/commit/9b3f4fdba3ef887bad8bbdccf02903deeabb04ad) fix(android): keep unknown split-set facts unknown and order reasons - [`9f7e987`](https://github.com/morluto/rea/commit/9f7e987a7bbd8ea113dde136a427df78f4a4f50c) Merge upstream/main into feat/android-split-set-check ### 📊 Changes **3 files changed** (+616 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/android/androidManifestFacts.ts` (+33 -0) ➕ `src/domain/android/androidSplitSet.test.ts` (+316 -0) ➕ `src/domain/android/androidSplitSet.ts` (+267 -0) </details> ### 📄 Description ## Summary Adds a pure domain check over caller-selected Android manifest facts that reports whether a set of APKs (`base.apk` plus `split_config.*` / feature splits) is internally consistent. It is the first step of the split-set design discussed in #1813; it adds no tool surface and has no consumer yet. Refs #1813 ## Problem and expected behavior Today a pulled split set is analyzed as unrelated files. REA records no relationship between members, so an analysis of `base.apk` alone silently omits resources, native libraries and feature-module DEX that live elsewhere. Given manifest facts for the selected members, the check reports: - package and effective version-code agreement (`versionCodeMajor` is combined with `versionCode`, so two different effective versions cannot compare equal); - duplicate split names; - missing parents (`configForSplit` pointing at a member that was not selected); - coverage of the caller's selection, with `unknown` for an empty or all-silent selection rather than "consistent". ## Change and scope - `src/domain/android/androidManifestFacts.ts`: the fact shape (observed values only). - `src/domain/android/androidSplitSet.ts`: the pure check. Agreement and duplicates are derived claims; a role that depends on the platform default of an undeclared `isFeatureSplit` is marked derived, not observed. - Not included: the manifest reader (separate PR), ZIP adapter, any MCP/CLI surface, bundletool, signature verification. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/domain/android/` (domain; no I/O). - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: none; no provider is involved. - Evidence, artifact, provenance, or reconstruction contract: none changed. Coverage describes the caller's selection and never claims every installed APK was selected. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Tests added or updated: `src/domain/android/androidSplitSet.test.ts` (15 tests). - Base reproduction or other evidence: not applicable (new capability); two guards were mutation-checked while developing. - User-visible CLI/MCP output: none. - Remaining proof gaps: the check has only seen synthetic facts; real-world manifests are exercised by the reader PR and later work. - [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 Run on this branch tip, based on `origin/main` at `cbc0e97c2`: - `npm run test:focused -- src/domain/android/androidSplitSet.test.ts` — 15 passed - `npm run verify:test-discovery` — all test files discovered exactly once - `npm run check` — 6/6 tasks successful (typecheck, lint with 0 errors, format, knip, metadata) ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: pure functions over already-parsed values; no input parsing here. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: <!-- @GitHub-handle --> - [ ] 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 <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5779
No description provided.