[PR #2059] [MERGED] fix(artifacts): describe ZIP non-entry coverage accurately #4995

Closed
opened 2026-10-31 00:57:47 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2059
Author: @1052326311
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/zip-non-entry-coverage


📝 Commits (9)

  • be2bc68 fix(artifacts): describe ZIP non-entry coverage accurately
  • 7940226 fix(artifacts): preserve ZIP scope across retained evidence
  • f81d79d fix(process): report no remaining time after a provider deadline fires
  • 0dbf5da chore: merge captured main into PR 2059
  • 9e43115 style: format comparison and IDA sources
  • cf910e5 chore: merge main into PR #2059
  • f07ce2b Merge commit '8fef2aa64e' into codex/ci-wave3-2059
  • 72e92e7 Merge branch 'main' into fix/zip-non-entry-coverage
  • 7726970 fix(artifacts): reconcile ZIP inventory coverage with main

📊 Changes

5 files changed (+103 additions, -9 deletions)

View changed files

📝 src/artifacts/inventory/reader.ts (+2 -2)
📝 src/domain/artifactInventoryEvidence.ts (+2 -2)
📝 src/domain/zipPackageFormat.ts (+9 -3)
📝 tests/boundary/filesystem/artifactComparison.test.ts (+88 -0)
📝 tests/boundary/filesystem/harmony/application.test.ts (+2 -2)

📄 Description

Summary

Correct the ZIP inventory explanation that places an APK Signing Block after the central directory. The block is immediately before it; a ZIP comment follows the directory. Preserve comparisons against previously retained Evidence carrying the old explanation.

Problem and expected behavior

inspect-artifact package.apk --format json currently emits:

Bytes after the central directory, including an APK Signing Block or a ZIP comment, are not occurrences.

This misstates the APK Signing Block layout. Inventory enumerates central-directory entries, not all non-entry bytes on either side of the directory. This was found while inspecting the current contract; there is no separate issue.

Change and scope

The inventory now says:

Non-entry bytes, including an APK Signing Block before the central directory or a ZIP comment after it, are not occurrences.

Rename the owning constant to avoid describing all non-entry bytes as a tail. Keep recognition of the exact historical wording beside the current wording in zipPackageFormat, so previously retained inventories remain comparable. Other limitations still indicate unknown coverage. No new archive parser or signature-verification capability is introduced.

Contract and boundary impact

  • Semantic owner and earliest changed stage: ZIP inventory scope description; artifact comparison consumes its compatibility classifier.
  • CLI and MCP/tool-catalog contract: corrected inventory limitation text; no schema or tool changes.
  • Provider, bridge, target-format, or platform compatibility: ZIP-backed formats share the corrected text; no engine/bridge changes.
  • Evidence, artifact, provenance, or reconstruction contract: old Evidence remains untouched and accepted; root hashes still detect non-entry byte changes.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none; generated checks pass and outputs remain ignored.

Evidence and regression coverage

  • A real ZIP fixture receives APK Signing Block framing immediately before its central directory. Only the opaque padding pair changes between two files. Inventory retains the same entry, and comparison reports the root content change without claiming unknown entry coverage.
  • The regression checks current-versus-historical scope descriptions and an unrelated read limitation that must remain unknown.
  • Restoring all three changed production files to base 3bdc8730bd98e073522bcb8ba86527be402c0cbe makes this regression fail at the emitted explanation (5 existing tests pass). Restoring the fix passes all 6 tests.
  • A compiled inspect-artifact CLI smoke against a local ZIP exits 0 and returns the corrected text.
  • The fixture is structural, not a cryptographically signed APK; signature verification is not claimed. No separate live MCP or native-engine run.

For evidence-bearing changes:

  • 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

Node 24.18.0 / npm 11.16.0, macOS arm64:

  • npm run test:focused -- tests/boundary/filesystem/artifactComparison.test.ts tests/boundary/filesystem/artifactComparisonSummary.test.ts tests/boundary/filesystem/android/application.test.ts tests/boundary/filesystem/harmony/application.test.ts — 32 tests passed.
  • npm run check — passed (lint reports warnings, zero errors).
  • npm run docs:check — passed.
  • npm run verify:test-discovery — all 912 test files discovered exactly once.
  • node scripts/rea.mjs inspect-artifact <local-fixture.zip> --format json — passed; corrected output verified.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Historical limitation wording is recognized without rewriting retained Evidence.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable to this static ZIP inventory change; local filesystem/CLI exercised on macOS.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no execution, trust, signature, or containment authority changed.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • 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.

AI-assisted with Codex.


🔄 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/2059 **Author:** [@1052326311](https://github.com/1052326311) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/zip-non-entry-coverage` --- ### 📝 Commits (9) - [`be2bc68`](https://github.com/morluto/rea/commit/be2bc6828b61e5e648931afe18b94786fa25cdff) fix(artifacts): describe ZIP non-entry coverage accurately - [`7940226`](https://github.com/morluto/rea/commit/794022690b9d82514f54e2ec0063fcc6d3f3fb6f) fix(artifacts): preserve ZIP scope across retained evidence - [`f81d79d`](https://github.com/morluto/rea/commit/f81d79d14d89820baedfda103a4ecee4637b3fb1) fix(process): report no remaining time after a provider deadline fires - [`0dbf5da`](https://github.com/morluto/rea/commit/0dbf5dab65cb455c3f152a27b51e9d3d1adbac5e) chore: merge captured main into PR 2059 - [`9e43115`](https://github.com/morluto/rea/commit/9e43115ccb891268e67af5d0d8142a3122471516) style: format comparison and IDA sources - [`cf910e5`](https://github.com/morluto/rea/commit/cf910e53d329cf3bc371de9bfd82678a726cad56) chore: merge main into PR #2059 - [`f07ce2b`](https://github.com/morluto/rea/commit/f07ce2bf468da8ea5397ede09d2ec10cbd6b4b41) Merge commit '8fef2aa64ec1ee742e8b70b825938d30a0ea7319' into codex/ci-wave3-2059 - [`72e92e7`](https://github.com/morluto/rea/commit/72e92e79e5f2a5911890958fbefa867da2378c20) Merge branch 'main' into fix/zip-non-entry-coverage - [`7726970`](https://github.com/morluto/rea/commit/7726970b2a3a8b8072f4c2c22d39ce7798f03ae2) fix(artifacts): reconcile ZIP inventory coverage with main ### 📊 Changes **5 files changed** (+103 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/inventory/reader.ts` (+2 -2) 📝 `src/domain/artifactInventoryEvidence.ts` (+2 -2) 📝 `src/domain/zipPackageFormat.ts` (+9 -3) 📝 `tests/boundary/filesystem/artifactComparison.test.ts` (+88 -0) 📝 `tests/boundary/filesystem/harmony/application.test.ts` (+2 -2) </details> ### 📄 Description ## Summary Correct the ZIP inventory explanation that places an APK Signing Block after the central directory. The block is immediately **before** it; a ZIP comment follows the directory. Preserve comparisons against previously retained Evidence carrying the old explanation. ## Problem and expected behavior `inspect-artifact package.apk --format json` currently emits: > Bytes after the central directory, including an APK Signing Block or a ZIP comment, are not occurrences. This misstates the [APK Signing Block layout](https://source.android.com/docs/security/features/apksigning/v2#apk-signing-block). Inventory enumerates central-directory entries, not all non-entry bytes on either side of the directory. This was found while inspecting the current contract; there is no separate issue. ## Change and scope The inventory now says: > Non-entry bytes, including an APK Signing Block before the central directory or a ZIP comment after it, are not occurrences. Rename the owning constant to avoid describing all non-entry bytes as a tail. Keep recognition of the exact historical wording beside the current wording in `zipPackageFormat`, so previously retained inventories remain comparable. Other limitations still indicate unknown coverage. No new archive parser or signature-verification capability is introduced. ## Contract and boundary impact - Semantic owner and earliest changed stage: ZIP inventory scope description; artifact comparison consumes its compatibility classifier. - CLI and MCP/tool-catalog contract: corrected inventory limitation text; no schema or tool changes. - Provider, bridge, target-format, or platform compatibility: ZIP-backed formats share the corrected text; no engine/bridge changes. - Evidence, artifact, provenance, or reconstruction contract: old Evidence remains untouched and accepted; root hashes still detect non-entry byte changes. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none; generated checks pass and outputs remain ignored. ## Evidence and regression coverage - A real ZIP fixture receives APK Signing Block framing immediately before its central directory. Only the opaque padding pair changes between two files. Inventory retains the same entry, and comparison reports the root content change without claiming unknown entry coverage. - The regression checks current-versus-historical scope descriptions and an unrelated read limitation that must remain unknown. - Restoring all three changed production files to base `3bdc8730bd98e073522bcb8ba86527be402c0cbe` makes this regression fail at the emitted explanation (5 existing tests pass). Restoring the fix passes all 6 tests. - A compiled `inspect-artifact` CLI smoke against a local ZIP exits 0 and returns the corrected text. - The fixture is structural, not a cryptographically signed APK; signature verification is not claimed. No separate live MCP or native-engine run. For evidence-bearing changes: - [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 Node 24.18.0 / npm 11.16.0, macOS arm64: - `npm run test:focused -- tests/boundary/filesystem/artifactComparison.test.ts tests/boundary/filesystem/artifactComparisonSummary.test.ts tests/boundary/filesystem/android/application.test.ts tests/boundary/filesystem/harmony/application.test.ts` — 32 tests passed. - `npm run check` — passed (lint reports warnings, zero errors). - `npm run docs:check` — passed. - `npm run verify:test-discovery` — all 912 test files discovered exactly once. - `node scripts/rea.mjs inspect-artifact <local-fixture.zip> --format json` — passed; corrected output verified. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Historical limitation wording is recognized without rewriting retained Evidence. - Real Hopper/Ghidra, browser, or OS coverage: not applicable to this static ZIP inventory change; local filesystem/CLI exercised on macOS. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no execution, trust, signature, or containment authority changed. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. AI-assisted with Codex. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:57:47 +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#4995
No description provided.