[GH-ISSUE #4882] [Bug] Early APK read failures erase metadata and completed inventory facts #3031

Closed
opened 2026-10-31 00:35:09 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @morluto on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4882

Before submitting

  • Searched open and closed apktool manifest partial metadata failure; #4880 covers later string-table interruption, not earlier read stages.
  • No credentials or sensitive target data included.

Area

Evidence, artifacts, or reconstruction

Observed behavior

Parsed apktool.yml metadata is discarded if the subsequent manifest read, manifest XML interpretation, or workspace enumeration fails. Error partial observation contains only the input snapshot. Enumeration also drops its completed prefix facts.

Reproduction

Three selected authored provider controls on unchanged34a88d6c1 all fail retained-metadata assertions (64 other tests skipped): invalid UTF-8 manifest, well-formed wrong-root <resources/> manifest, and an explicitly injected iterator failure after one real filesystem file entry. Decoder is an authored shell substitute writing real-shaped metadata/manifest files. No real Apktool behavior claimed. Enumeration injection is a boundary control, not an observed OS permission incident.

Expected behavior

Retain completed facts as partial Evidence across stages. A failed/unexamined manifest or file count must not become a fabricated null/zero. Preserve exact primary failure and cleanup ownership. Raw manifest text already read before an XML interpretation failure remains evidence; the unknown package remains omitted.

Impact and scope

Observed in all three authored controls. Human incident frequency: NOT_ENOUGH_INFO. Earlier-stage facts become unavailable after owned workspace removal. Source: provider only creates completed execution after full projection; inventory throws away its local counts on errors other than its capacity stop.

REA version

34a88d6c1 (source)

Runtime and platform

Node24.18.0; macOS arm64

Target and artifact context

Owned synthetic fixture and authored filesystem/iterator controls.

Interface

Shared CLI/MCP provider workflow

Evidence

src/apktool/ApktoolProvider.ts metadata/manifest/inventory sequence and catch snapshot fallback; src/apktool/ApktoolDecodedInventory.ts thrown enumeration path. Three baseline assertions receive file-snapshot-hash instead of expected parsed version1.2.3/code7/SDK24,34 and partial coverage.

Originally created by @morluto on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4882 ### Before submitting - [x] Searched open and closed `apktool manifest partial metadata failure`; #4880 covers later string-table interruption, not earlier read stages. - [x] No credentials or sensitive target data included. ### Area Evidence, artifacts, or reconstruction ### Observed behavior Parsed apktool.yml metadata is discarded if the subsequent manifest read, manifest XML interpretation, or workspace enumeration fails. Error partial observation contains only the input snapshot. Enumeration also drops its completed prefix facts. ### Reproduction Three selected authored provider controls on unchanged34a88d6c1 all fail retained-metadata assertions (64 other tests skipped): invalid UTF-8 manifest, well-formed wrong-root `<resources/>` manifest, and an explicitly injected iterator failure after one real filesystem file entry. Decoder is an authored shell substitute writing real-shaped metadata/manifest files. No real Apktool behavior claimed. Enumeration injection is a boundary control, not an observed OS permission incident. ### Expected behavior Retain completed facts as partial Evidence across stages. A failed/unexamined manifest or file count must not become a fabricated null/zero. Preserve exact primary failure and cleanup ownership. Raw manifest text already read before an XML interpretation failure remains evidence; the unknown package remains omitted. ### Impact and scope Observed in all three authored controls. Human incident frequency: NOT_ENOUGH_INFO. Earlier-stage facts become unavailable after owned workspace removal. Source: provider only creates completed execution after full projection; inventory throws away its local counts on errors other than its capacity stop. ### REA version 34a88d6c1 (source) ### Runtime and platform Node24.18.0; macOS arm64 ### Target and artifact context Owned synthetic fixture and authored filesystem/iterator controls. ### Interface Shared CLI/MCP provider workflow ### Evidence `src/apktool/ApktoolProvider.ts` metadata/manifest/inventory sequence and catch snapshot fallback; `src/apktool/ApktoolDecodedInventory.ts` thrown enumeration path. Three baseline assertions receive file-snapshot-hash instead of expected parsed version1.2.3/code7/SDK24,34 and partial coverage.
bsakaguchi 2026-10-31 00:35:09 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@morluto commented on GitHub (Oct 17, 2026):

Fixed in f5fcf5216, pushed to main. The provider now accumulates observed decode facts across stages, records raw manifest before interpretation, and retains the inventory prefix with the original cause. Partial Evidence omits unexamined fields; complete output is checked against the named result schema. Truncation/inventory limitations are recorded when those facts are produced. The prior late-only partial execution representation is removed.

Six authored stage controls fail unchanged34a88d6c1. Candidate131focused checks across7files pass, including manifest-byte/XML and injected traversal failures, final-cleanup cancellation, denied cleanup/retry and earlier table regressions. check:fast, docs:check and discovery1556 pass. Both source reviews clear after moving known decoded facts before the post-command cancellation checkpoint; that exact handoff race has source-level verification, not separate runtime qualification.

A public CLI manifest-failure task retains parsed metadata/raw manifest with unknown package/strings/file count omitted and unchanged failure framing. Twelve small normal CLI workflows preserve exact replies; no speedup/memory-saving claim. Failure reply estimate189->610cl100k tokens retains needed Evidence. Authored shell decoder and filesystem controls do not qualify real Apktool or all native filesystem failures. Large-case/whole-agent costs remain unmeasured; heavy tests/profiling stayed stopped.

<!-- gh-comment-id:6240633182 --> @morluto commented on GitHub (Oct 17, 2026): Fixed in f5fcf5216, pushed to main. The provider now accumulates observed decode facts across stages, records raw manifest before interpretation, and retains the inventory prefix with the original cause. Partial Evidence omits unexamined fields; complete output is checked against the named result schema. Truncation/inventory limitations are recorded when those facts are produced. The prior late-only partial execution representation is removed. Six authored stage controls fail unchanged34a88d6c1. Candidate131focused checks across7files pass, including manifest-byte/XML and injected traversal failures, final-cleanup cancellation, denied cleanup/retry and earlier table regressions. check:fast, docs:check and discovery1556 pass. Both source reviews clear after moving known decoded facts before the post-command cancellation checkpoint; that exact handoff race has source-level verification, not separate runtime qualification. A public CLI manifest-failure task retains parsed metadata/raw manifest with unknown package/strings/file count omitted and unchanged failure framing. Twelve small normal CLI workflows preserve exact replies; no speedup/memory-saving claim. Failure reply estimate189->610cl100k tokens retains needed Evidence. Authored shell decoder and filesystem controls do not qualify real Apktool or all native filesystem failures. Large-case/whole-agent costs remain unmeasured; heavy tests/profiling stayed stopped.
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#3031
No description provided.