[PR #6054] [CLOSED] fix(artifacts): preserve DMG caller cancellation reason #7133

Closed
opened 2026-11-01 21:45:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6054
Author: @rkfshakti
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: fix/dmg-cancellation-reason


📝 Commits (1)

  • a289058 fix(artifacts): preserve DMG caller cancellation reason

📊 Changes

2 files changed (+50 additions, -2 deletions)

View changed files

📝 src/artifacts/NativeDmgArtifactReader.ts (+6 -2)
➕ tests/process-global/nativeDmgCancellationReason.test.ts (+44 -0)

📄 Description

Summary

Fixes #6032.

DMG command cancellation preserved the ExecFileOutputCancelledError wrapper as ArtifactReaderFailure.cancellation.reason, rather than the exact object supplied to AbortController.abort. This change unwraps the command owner's retained reason at both DMG cancellation translation sites.

Problem and expected behavior

An active hdiutil verify cancellation returns ArtifactReaderFailure with reason: "cancelled", but the typed cancellation reason is the process wrapper. The wrapper still retains the caller object at its cause, so the value is recoverable but is not in the documented position. The lifecycle contract requires the exact caller reason through command wrappers.

The change keeps cancellation classification and cleanup behavior unchanged, and makes cancellation.reason and cause equal to the exact caller object.

Change and scope

  • src/artifacts/NativeDmgArtifactReader.ts: add a small cancellationCause() helper and use it in the system-host AbortError branch and the injected-host runChecked branch.
  • Scope: ordinary fix within the existing DMG cancellation boundary. No new provider, capability, target authority, or cleanup ownership.
  • Not included: changing which failure wins when a physical command failure and a late abort overlap.

Contract and boundary impact

  • Semantic owner and earliest changed stage: NativeDmgCommandFailure / system-host command cancellation translation.
  • Contribution scope fit and linked maintainer decision: ordinary fix inside existing boundaries; no scope decision required.
  • CLI and MCP/tool-catalog contract: none; the cancellation cause is internal typed provenance and is not serialized into public JSON.
  • Provider, bridge, target-format, or platform compatibility: macOS DMG reader only; no bridge or protocol change.
  • Evidence, artifact, provenance, or reconstruction contract: exact caller reason retained on the typed failure.
  • Target selection, authority, upstream behavior, and cleanup details: no target execution or mutation; no cleanup behavior change.
  • Generated metadata/package/installation impact: none.

Expected effects: reads existing files or captured data only. The focused test simulates the command boundary and does not launch hdiutil.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added: tests/process-global/nativeDmgCancellationReason.test.ts asserts the active-command cancellation reason and direct cause are the exact caller object.
  • Base reproduction: the new test was applied alone to main and failed (cancellation.reason was the ExecFileOutputCancelledError wrapper); it passes on this branch.
  • User-visible CLI/MCP output: not applicable; the cause is not part of the public error projection.
  • Remaining proof gaps: no real hdiutil command, DMG image, CLI signal path, or MCP transport cancellation was exercised.

Validation performed

  • npm run test:focused -- tests/process-global/nativeDmgCancellationReason.test.ts — 1 passed.
  • npm run check:fast — passed.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; the test runs on macOS with a simulated command boundary.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: cancellation reasons are caller-supplied values already present on the signal; no target authority or execution effect changes.

Author readiness

Human owner: @rkfshakti

  • 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.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are unchanged where not needed.
  • User-visible CLI/MCP changes include representative output. Not applicable: the cause remains internal.
  • I checked the final diff 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/6054 **Author:** [@rkfshakti](https://github.com/rkfshakti) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/dmg-cancellation-reason` --- ### 📝 Commits (1) - [`a289058`](https://github.com/morluto/rea/commit/a2890585ecf1e5ad7b8184ce58589f59e718d87b) fix(artifacts): preserve DMG caller cancellation reason ### 📊 Changes **2 files changed** (+50 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/artifacts/NativeDmgArtifactReader.ts` (+6 -2) ➕ `tests/process-global/nativeDmgCancellationReason.test.ts` (+44 -0) </details> ### 📄 Description ## Summary Fixes #6032. DMG command cancellation preserved the `ExecFileOutputCancelledError` wrapper as `ArtifactReaderFailure.cancellation.reason`, rather than the exact object supplied to `AbortController.abort`. This change unwraps the command owner's retained reason at both DMG cancellation translation sites. ## Problem and expected behavior An active `hdiutil verify` cancellation returns `ArtifactReaderFailure` with `reason: "cancelled"`, but the typed cancellation reason is the process wrapper. The wrapper still retains the caller object at its `cause`, so the value is recoverable but is not in the documented position. The lifecycle contract requires the exact caller reason through command wrappers. The change keeps cancellation classification and cleanup behavior unchanged, and makes `cancellation.reason` and `cause` equal to the exact caller object. ## Change and scope - `src/artifacts/NativeDmgArtifactReader.ts`: add a small `cancellationCause()` helper and use it in the system-host `AbortError` branch and the injected-host `runChecked` branch. - Scope: ordinary fix within the existing DMG cancellation boundary. No new provider, capability, target authority, or cleanup ownership. - Not included: changing which failure wins when a physical command failure and a late abort overlap. ## Contract and boundary impact - Semantic owner and earliest changed stage: `NativeDmgCommandFailure` / system-host command cancellation translation. - Contribution scope fit and linked maintainer decision: ordinary fix inside existing boundaries; no scope decision required. - CLI and MCP/tool-catalog contract: none; the cancellation cause is internal typed provenance and is not serialized into public JSON. - Provider, bridge, target-format, or platform compatibility: macOS DMG reader only; no bridge or protocol change. - Evidence, artifact, provenance, or reconstruction contract: exact caller reason retained on the typed failure. - Target selection, authority, upstream behavior, and cleanup details: no target execution or mutation; no cleanup behavior change. - Generated metadata/package/installation impact: none. Expected effects: reads existing files or captured data only. The focused test simulates the command boundary and does not launch `hdiutil`. - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [x] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [x] Contact network services. - [x] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [x] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added: `tests/process-global/nativeDmgCancellationReason.test.ts` asserts the active-command cancellation reason and direct cause are the exact caller object. - Base reproduction: the new test was applied alone to `main` and failed (`cancellation.reason` was the `ExecFileOutputCancelledError` wrapper); it passes on this branch. - User-visible CLI/MCP output: not applicable; the cause is not part of the public error projection. - Remaining proof gaps: no real `hdiutil` command, DMG image, CLI signal path, or MCP transport cancellation was exercised. ## Validation performed - `npm run test:focused -- tests/process-global/nativeDmgCancellationReason.test.ts` — 1 passed. - `npm run check:fast` — passed. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable; the test runs on macOS with a simulated command boundary. - Package or release metadata impact: none. - Security, privacy, process, or containment review: cancellation reasons are caller-supplied values already present on the signal; no target authority or execution effect changes. ## Author readiness Human owner: @rkfshakti - [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 this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are unchanged where not needed. - [x] User-visible CLI/MCP changes include representative output. Not applicable: the cause remains internal. - [x] I checked the final diff 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-11-01 21:45:38 +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#7133
No description provided.