[PR #3290] [CLOSED] fix(artifacts): classify localized DMG verification failures #5702

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3290
Author: @ShitK
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/native-dmg-localized-diagnostics


📝 Commits (2)

  • 3e2a92f fix(artifacts): classify localized DMG verification failures
  • 194bed3 test(artifacts): cover localized DMG I/O verification result

📊 Changes

2 files changed (+159 additions, -63 deletions)

View changed files

📝 src/artifacts/NativeDmgArtifactReader.ts (+27 -6)
📝 tests/boundary/providers/native/nativeDmgArtifactReader.test.ts (+132 -57)

📄 Description

Summary

On a Chinese-language macOS host, invalid, inaccessible and checksum-damaged DMGs were reported as unavailable: the native reader recognized only English hdiutil verify diagnostics. Request verbose verification and classify its known numeric result records, preserving the original localized output and the existing English fallback. Actual CLI and stdio MCP calls now report format for a malformed DMG and integrity for a checksum mismatch.

No dedicated issue is linked: this was found while reproducing existing main-branch test failures. #1765 / #1772 covered an English spelling variant; #2878 also reports the remaining localized failures and explicitly leaves them unchanged. This does not implement the extraction capability requested in #3095.

Change and scope

  • The owning boundary is NativeDmgArtifactReader: use hdiutil verify -verbose and distinguish its terminal verification result from the process exit status, which is 1 for all observed failures. Do not change caller language preferences or environment.
  • Normalize known DiskImages results (111, 117) and Darwin access/I/O results (2, 13, 5). Result 35 follows the existing bounded transient retry policy; deadlines and mount/cleanup ownership remain unchanged.
  • Preserve raw stdout/stderr, causes, command arguments and exit-status provenance. Unknown localized output and ambiguous result records stay unavailable. Existing exact English diagnostics remain a fallback.
  • Extend existing reader regressions and remove English-only assertions from actual-host tests. No public schema, dependency, package, generated metadata or installation change. This is a fix within the existing read-only DMG capability; no separate scope approval is applicable.

Expected effects: existing local-file reads and /usr/bin/hdiutil subprocesses; the existing workflow can mount images read-only and owns their detach/temporary-root cleanup. No new target execution, injection, extraction, network or user-configuration authority.

Evidence and validation

Executed on macOS 26.5.2 arm64, hdiutil 683.100.3, Chinese preferred languages, pinned Node 24.18.0 / npm 11.16.0. Base: cf6ea097116bdf3578b1e02e35c772d8aa92db00.

  • Unmodified base: the existing DMG file had 36 passing / 3 failing tests (format, io, integrity all received unavailable). Adding the new regression cases before the source fix produced 40 passing / 8 failing tests; the five additional failures cover localized classification and transient recovery.
  • Fixed reader: 49/49 tests pass, including actual malformed-image, missing/unreadable-target and deliberately damaged-checksum cases. Recorded Chinese producer output, unknown/ambiguous results, unchanged evidence, retries, cancellation and ownership are covered.
  • npm run test:focused -- tests/boundary/providers/native/nativeDmgArtifactReader.test.ts tests/boundary/providers/native/artifactProvider.failureDetail.test.ts tests/boundary/providers/native/artifactProvider.cleanupRetry.test.ts tests/boundary/providers/native/artifactProvider.archiveInventory.test.ts tests/boundary/mcp/artifactMcp.test.ts tests/boundary/mcp/artifactMcp.inlineInventory.test.ts — 69 passed across 6 files.
  • npm run check — passed, with existing repository warnings.
  • npm run verify:macos-bundle — passed with real native tools, CLI / stdio MCP, DMG inventory and confirmed detach.
  • npm run verify:test-discovery — all 1,261 files discovered exactly once. git diff --check passed.
  • Additional real CLI / stdio MCP probes: a 513-byte malformed image with the koly footer signature returned details.reason: "format"; an hdiutil-created image with one data byte flipped returned "integrity". Both retained localized diagnostics and numeric verification results. Owned fixtures were removed and no image remained attached.
  • An actual exclusive lock on an owned image confirmed result 35 with the Chinese transient diagnostic. Recovery/deadline behavior is covered by controlled host fixtures.

Verification limits: this host establishes the observed macOS/tool version and Chinese output, not every macOS release or language. Unmapped results without recognized diagnostics remain unknown. Windows/Linux and the complete deterministic suite were not run locally. The initial CI failures documented below were fixed upstream. The current CI workflow and required gate pass; platform-specific jobs that were not selected remain unverified by this CI run. No unrelated engine or performance claim.

Initial CI baseline comparison (resolved upstream)

CI run 38534325171 checked out merge 0c3b2a3dd20dc93f83516ea9567373949df766a6, whose main parent is ca7450beffff59325ce3bddc78e181693ce77177. Clean archived snapshots of both revisions, using the same locked dependencies and pinned Node/npm on macOS, reproduce the same 3 failures / 67 passes with:

npm run test:built -- tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/clientConfigurationBom.test.ts

The failures are Codex comment-preserving setup/uninstall, owned-entry removal, and BOM-prefixed JSONC restoration. All expect an absolute-path registration to be removed; the new main-branch ownership check retains it instead. Main commit 187f113f798b5b8a080d22285b51c05596c3e0f2 removed basename-only ownership of absolute rea paths, while these fixtures still use synthetic paths. Relevant application/process code, both test files, dependencies and runner configuration are identical between main and the CI merge; their only source-tree differences are this PR's two DMG files.

The initial PR head (3e2a92f327ac254056d53a994809931e08afb80c) on its earlier base passed these same 70/70 cases. This comparison attributes the three observed failures to the CI main baseline, not this DMG change; it does not establish a green full suite. Remaining matrix jobs were cancelled by fast-tier fail-fast, and the aggregate gates therefore fail. No ownership checks or unrelated tests were changed to make CI green. The initial PR was kept in draft during this investigation.

Result-5 regression coverage

Addressed the localized I/O coverage finding with a synthetic Darwin EIO fixture: result 5 plus a non-English diagnostic must produce io, retain the raw diagnostic in the error and cause, preserve command provenance, and perform no retry. The fixture is explicitly distinguished from recorded native output; no actual low-level I/O fault was induced. Production code is unchanged.

Mutation check: temporarily removing only the numeric result-5 mapping makes the new case fail; restoring the unchanged production code makes it pass. On 2026-10-15, the six focused files passed 69/69, including 49/49 DMG tests and the three real macOS cases; npm run check passed. An initial sandboxed run could not create the real checksum fixture. The identical hdiutil create probe failed inside the sandbox and succeeded with normal host access; the full focused rerun then passed. Earlier bundle/CLI/MCP and discovery evidence above remains from the initial implementation revision, not newly rerun for this test-only change.

Current CI: run 38689571893 completed successfully for head 194bed35adc92a91946bcfec7317561ac7cf260b, including all five test shards and CI required. The tested merge is b4aec08570a2d43cab5fde407a6aed79b1e6299f on main parent cf0a38ad9774ee9acff3164052688f7a58a1c72c. On the Linux CI host the DMG file has 46 passed / 3 macOS-only skipped; all three real macOS cases passed locally in the 49-test reader run. The previously failing client lifecycle and BOM files now pass 56/56 and 16/16, respectively: main includes a154b9752, which updates the uninstall fixtures to use verified invocations. No unrelated fix was added to this PR.

Author readiness

Human owner: @ShitK

  • 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 the current revision ready for maintainer review.

AI assistance was used for investigation, implementation and verification. The human owner reviewed the result-5 follow-up and its validation evidence and explicitly renewed readiness for revision 194bed35a on 2026-10-15.


🔄 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/3290 **Author:** [@ShitK](https://github.com/ShitK) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/native-dmg-localized-diagnostics` --- ### 📝 Commits (2) - [`3e2a92f`](https://github.com/morluto/rea/commit/3e2a92f327ac254056d53a994809931e08afb80c) fix(artifacts): classify localized DMG verification failures - [`194bed3`](https://github.com/morluto/rea/commit/194bed35adc92a91946bcfec7317561ac7cf260b) test(artifacts): cover localized DMG I/O verification result ### 📊 Changes **2 files changed** (+159 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/NativeDmgArtifactReader.ts` (+27 -6) 📝 `tests/boundary/providers/native/nativeDmgArtifactReader.test.ts` (+132 -57) </details> ### 📄 Description ## Summary On a Chinese-language macOS host, invalid, inaccessible and checksum-damaged DMGs were reported as `unavailable`: the native reader recognized only English `hdiutil verify` diagnostics. Request verbose verification and classify its known numeric result records, preserving the original localized output and the existing English fallback. Actual CLI and stdio MCP calls now report `format` for a malformed DMG and `integrity` for a checksum mismatch. No dedicated issue is linked: this was found while reproducing existing main-branch test failures. #1765 / #1772 covered an English spelling variant; #2878 also reports the remaining localized failures and explicitly leaves them unchanged. This does not implement the extraction capability requested in #3095. ## Change and scope - The owning boundary is `NativeDmgArtifactReader`: use `hdiutil verify -verbose` and distinguish its terminal verification result from the process exit status, which is `1` for all observed failures. Do not change caller language preferences or environment. - Normalize known DiskImages results (`111`, `117`) and Darwin access/I/O results (`2`, `13`, `5`). Result `35` follows the existing bounded transient retry policy; deadlines and mount/cleanup ownership remain unchanged. - Preserve raw stdout/stderr, causes, command arguments and exit-status provenance. Unknown localized output and ambiguous result records stay unavailable. Existing exact English diagnostics remain a fallback. - Extend existing reader regressions and remove English-only assertions from actual-host tests. No public schema, dependency, package, generated metadata or installation change. This is a fix within the existing read-only DMG capability; no separate scope approval is applicable. Expected effects: existing local-file reads and `/usr/bin/hdiutil` subprocesses; the existing workflow can mount images read-only and owns their detach/temporary-root cleanup. No new target execution, injection, extraction, network or user-configuration authority. ## Evidence and validation Executed on macOS 26.5.2 arm64, hdiutil 683.100.3, Chinese preferred languages, pinned Node 24.18.0 / npm 11.16.0. Base: `cf6ea097116bdf3578b1e02e35c772d8aa92db00`. - Unmodified base: the existing DMG file had **36 passing / 3 failing** tests (`format`, `io`, `integrity` all received `unavailable`). Adding the new regression cases before the source fix produced **40 passing / 8 failing** tests; the five additional failures cover localized classification and transient recovery. - Fixed reader: **49/49 tests pass**, including actual malformed-image, missing/unreadable-target and deliberately damaged-checksum cases. Recorded Chinese producer output, unknown/ambiguous results, unchanged evidence, retries, cancellation and ownership are covered. - `npm run test:focused -- tests/boundary/providers/native/nativeDmgArtifactReader.test.ts tests/boundary/providers/native/artifactProvider.failureDetail.test.ts tests/boundary/providers/native/artifactProvider.cleanupRetry.test.ts tests/boundary/providers/native/artifactProvider.archiveInventory.test.ts tests/boundary/mcp/artifactMcp.test.ts tests/boundary/mcp/artifactMcp.inlineInventory.test.ts` — **69 passed across 6 files**. - `npm run check` — passed, with existing repository warnings. - `npm run verify:macos-bundle` — passed with real native tools, CLI / stdio MCP, DMG inventory and confirmed detach. - `npm run verify:test-discovery` — all **1,261 files** discovered exactly once. `git diff --check` passed. - Additional real CLI / stdio MCP probes: a 513-byte malformed image with the `koly` footer signature returned `details.reason: "format"`; an hdiutil-created image with one data byte flipped returned `"integrity"`. Both retained localized diagnostics and numeric verification results. Owned fixtures were removed and no image remained attached. - An actual exclusive lock on an owned image confirmed result `35` with the Chinese transient diagnostic. Recovery/deadline behavior is covered by controlled host fixtures. Verification limits: this host establishes the observed macOS/tool version and Chinese output, not every macOS release or language. Unmapped results without recognized diagnostics remain unknown. Windows/Linux and the complete deterministic suite were not run locally. The initial CI failures documented below were fixed upstream. The current CI workflow and required gate pass; platform-specific jobs that were not selected remain unverified by this CI run. No unrelated engine or performance claim. ## Initial CI baseline comparison (resolved upstream) CI [run 38534325171](https://github.com/morluto/rea/actions/runs/38534325171) checked out merge `0c3b2a3dd20dc93f83516ea9567373949df766a6`, whose main parent is `ca7450beffff59325ce3bddc78e181693ce77177`. Clean archived snapshots of both revisions, using the same locked dependencies and pinned Node/npm on macOS, reproduce **the same 3 failures / 67 passes** with: ```sh npm run test:built -- tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/clientConfigurationBom.test.ts ``` The failures are Codex comment-preserving setup/uninstall, owned-entry removal, and BOM-prefixed JSONC restoration. All expect an absolute-path registration to be removed; the new main-branch ownership check retains it instead. Main commit `187f113f798b5b8a080d22285b51c05596c3e0f2` removed basename-only ownership of absolute `rea` paths, while these fixtures still use synthetic paths. Relevant application/process code, both test files, dependencies and runner configuration are identical between main and the CI merge; their only source-tree differences are this PR's two DMG files. The initial PR head (`3e2a92f327ac254056d53a994809931e08afb80c`) on its earlier base passed these same **70/70** cases. This comparison attributes the three observed failures to the CI main baseline, not this DMG change; it does not establish a green full suite. Remaining matrix jobs were cancelled by fast-tier fail-fast, and the aggregate gates therefore fail. No ownership checks or unrelated tests were changed to make CI green. The initial PR was kept in draft during this investigation. ## Result-5 regression coverage Addressed the [localized I/O coverage finding](https://github.com/morluto/rea/pull/3290#discussion_r4269269291) with a synthetic Darwin EIO fixture: result `5` plus a non-English diagnostic must produce `io`, retain the raw diagnostic in the error and cause, preserve command provenance, and perform no retry. The fixture is explicitly distinguished from recorded native output; no actual low-level I/O fault was induced. Production code is unchanged. Mutation check: temporarily removing only the numeric result-`5` mapping makes the new case fail; restoring the unchanged production code makes it pass. On 2026-10-15, the six focused files passed **69/69**, including **49/49** DMG tests and the three real macOS cases; `npm run check` passed. An initial sandboxed run could not create the real checksum fixture. The identical `hdiutil create` probe failed inside the sandbox and succeeded with normal host access; the full focused rerun then passed. Earlier bundle/CLI/MCP and discovery evidence above remains from the initial implementation revision, not newly rerun for this test-only change. Current CI: [run 38689571893](https://github.com/morluto/rea/actions/runs/38689571893) completed successfully for head `194bed35adc92a91946bcfec7317561ac7cf260b`, including all five test shards and `CI required`. The tested merge is `b4aec08570a2d43cab5fde407a6aed79b1e6299f` on main parent `cf0a38ad9774ee9acff3164052688f7a58a1c72c`. On the Linux CI host the DMG file has **46 passed / 3 macOS-only skipped**; all three real macOS cases passed locally in the 49-test reader run. The previously failing client lifecycle and BOM files now pass **56/56** and **16/16**, respectively: main includes [a154b9752](https://github.com/morluto/rea/commit/a154b9752c81ff660666d11acd40744f52de81ab), which updates the uninstall fixtures to use verified invocations. No unrelated fix was added to this PR. ## Author readiness Human owner: @ShitK - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare the current revision ready for maintainer review. AI assistance was used for investigation, implementation and verification. The human owner reviewed the result-5 follow-up and its validation evidence and explicitly renewed readiness for revision `194bed35a` on 2026-10-15. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:46 +00:00
bsakaguchi changed title from [PR #3290] [CLOSED] fix(artifacts): classify localized DMG verification failures to [PR #3290] fix(artifacts): classify localized DMG verification failures 2026-11-04 13:14:21 +00:00
bsakaguchi changed title from [PR #3290] fix(artifacts): classify localized DMG verification failures to [PR #3290] [CLOSED] fix(artifacts): classify localized DMG verification failures 2026-11-04 14:16:49 +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#5702
No description provided.