[PR #6348] [CLOSED] fix(windows): type missing process-control refusals as capability_unavailable (#6050) #7297

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6348
Author: @agnaylor
Created: 10/22/2026
Status: ❌ Closed

Base: main ← Head: pr/windows-control-refusal-6050


📝 Commits (1)

  • 80640da fix(windows): type missing process-control refusals as capability_unavailable (#6050)

📊 Changes

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

View changed files

📝 src/windows/WindowsOwnedProcess.test.ts (+17 -0)
📝 src/windows/WindowsOwnedProcess.ts (+18 -2)

📄 Description

Summary

Fixes #6050. When a Windows native artifact lacks a requested process control (a Job Object memory limit, or owned protocol stdin), WindowsOwnedProcess refused the launch with a plain Error, which the public error projection reports as execution_failure with a generic rea doctor hint. The refusal is a host capability gap, so it now throws AnalysisCapabilityUnavailableError, which the existing projection table maps to capability_unavailable.

Problem and expected behavior

Trigger: a Windows+Bun host whose admitted native artifact omits the optional jobMemoryLimit control, and a workflow (the issue used trace_web_source_location) that requests a bounded launch. Observed: execution_failure. Expected: capability_unavailable with the same message and a remediation naming the matching Windows x64 package.

Change and scope

One helper in src/windows/WindowsOwnedProcess.ts, missingControl, builds the typed error (provider windows-native-authority, operation launch_owned_process, the existing message as userMessage, and a remediation). Both pre-launch refusals use it. The projection in src/domain/analysisErrorProjection.ts already maps the class to capability_unavailable, so no projection change was needed. Other throw sites in the file (runtime failures after launch) are unchanged on purpose: they are execution failures.

Contribution scope: ordinary fix inside the Windows process boundary; not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the Windows owned-process launcher, at the pre-launch control check.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: the public error code for this refusal changes from execution_failure to capability_unavailable; message unchanged, remediation added.
  • Provider, bridge, target-format, or platform compatibility: Windows only.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: the refusal still happens before any process starts, so there is nothing to clean up.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests: the existing test that a requested limit is refused before launch still passes; a new test in src/windows/WindowsOwnedProcess.test.ts asserts the thrown value is an AnalysisCapabilityUnavailableError with the stated provider, operation, user message and remediation.
  • Base reproduction: source-derived from the issue's own report; the issue's in-memory MCP reproduction with simulated Windows+Bun facts was not run here.
  • Remaining proof gaps: the end-to-end MCP error frame is inferred from the projection table, not observed; Bun on Windows was not run.

Validation performed

  • npm run test:focused -- src/windows/WindowsOwnedProcess.test.ts on Windows 11 (Ales), Node 24.19.0 — 21 passed (21), on this branch against upstream main 957bcfa14
  • npm run check:fast — typecheck and lint, 2 of 2 tasks successful (branch rebased on upstream main 957bcfa14)

Compatibility, safety, and release

  • Breaking changes or migration steps: callers matching on execution_failure for this specific refusal will now receive capability_unavailable; this is the documented meaning for a missing host capability.
  • Real Hopper/Ghidra, browser, or OS coverage: unit tests on Windows 11 with a simulated authority.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: unchanged; no process is launched when the control is missing.

Author readiness

Human owner: @agnaylor

  • 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/6348 **Author:** [@agnaylor](https://github.com/agnaylor) **Created:** 10/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/windows-control-refusal-6050` --- ### 📝 Commits (1) - [`80640da`](https://github.com/morluto/rea/commit/80640dabe3c7ff038368fc6abae8ddb0795e44dd) fix(windows): type missing process-control refusals as capability_unavailable (#6050) ### 📊 Changes **2 files changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/windows/WindowsOwnedProcess.test.ts` (+17 -0) 📝 `src/windows/WindowsOwnedProcess.ts` (+18 -2) </details> ### 📄 Description ## Summary Fixes #6050. When a Windows native artifact lacks a requested process control (a Job Object memory limit, or owned protocol stdin), `WindowsOwnedProcess` refused the launch with a plain `Error`, which the public error projection reports as `execution_failure` with a generic `rea doctor` hint. The refusal is a host capability gap, so it now throws `AnalysisCapabilityUnavailableError`, which the existing projection table maps to `capability_unavailable`. ## Problem and expected behavior Trigger: a Windows+Bun host whose admitted native artifact omits the optional `jobMemoryLimit` control, and a workflow (the issue used `trace_web_source_location`) that requests a bounded launch. Observed: `execution_failure`. Expected: `capability_unavailable` with the same message and a remediation naming the matching Windows x64 package. ## Change and scope One helper in `src/windows/WindowsOwnedProcess.ts`, `missingControl`, builds the typed error (provider `windows-native-authority`, operation `launch_owned_process`, the existing message as `userMessage`, and a remediation). Both pre-launch refusals use it. The projection in `src/domain/analysisErrorProjection.ts` already maps the class to `capability_unavailable`, so no projection change was needed. Other throw sites in the file (runtime failures after launch) are unchanged on purpose: they are execution failures. Contribution scope: ordinary fix inside the Windows process boundary; not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: the Windows owned-process launcher, at the pre-launch control check. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: the public error code for this refusal changes from `execution_failure` to `capability_unavailable`; message unchanged, remediation added. - Provider, bridge, target-format, or platform compatibility: Windows only. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: the refusal still happens before any process starts, so there is nothing to clean up. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Tests: the existing test that a requested limit is refused before launch still passes; a new test in `src/windows/WindowsOwnedProcess.test.ts` asserts the thrown value is an `AnalysisCapabilityUnavailableError` with the stated provider, operation, user message and remediation. - Base reproduction: source-derived from the issue's own report; the issue's in-memory MCP reproduction with simulated Windows+Bun facts was not run here. - Remaining proof gaps: the end-to-end MCP error frame is inferred from the projection table, not observed; Bun on Windows was not run. ## Validation performed - `npm run test:focused -- src/windows/WindowsOwnedProcess.test.ts` on Windows 11 (Ales), Node 24.19.0 — 21 passed (21), on this branch against upstream main 957bcfa14 - `npm run check:fast` — typecheck and lint, 2 of 2 tasks successful (branch rebased on upstream main 957bcfa14) ## Compatibility, safety, and release - Breaking changes or migration steps: callers matching on `execution_failure` for this specific refusal will now receive `capability_unavailable`; this is the documented meaning for a missing host capability. - Real Hopper/Ghidra, browser, or OS coverage: unit tests on Windows 11 with a simulated authority. - Package or release metadata impact: none. - Security, privacy, process, or containment review: unchanged; no process is launched when the control is missing. ## Author readiness Human owner: @agnaylor - [ ] 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:51 +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#7297
No description provided.