[PR #6071] [MERGED] fix(process): name the Swift compile deadline #7139

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6071
Author: @morluto
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: cursor/swiftc-compile-deadline-19d7


📝 Commits (1)

  • 8dac533 fix(process): name the Swift compile deadline

📊 Changes

26 files changed (+321 additions, -95 deletions)

View changed files

📝 docs/installation.md (+4 -2)
📝 docs/kuna-provider.md (+1 -1)
📝 docs/mcp-contracts.md (+7 -7)
📝 docs/native-investigation.md (+4 -2)
📝 docs/process-capture.md (+9 -0)
📝 src/captures/TsharkCaptureProvider.ts (+7 -4)
📝 src/config/providerStartupTimeout.ts (+6 -3)
📝 src/contracts/officialToolContracts.ts (+2 -2)
📝 src/contracts/sessionToolContracts.ts (+1 -1)
📝 src/domain/fixedAllowanceRemediation.ts (+13 -0)
📝 src/domain/process/processScenario.test.ts (+16 -1)
📝 src/domain/process/processScenario.ts (+3 -3)
📝 src/process/ArtifactAnalysisResources.test.ts (+75 -1)
📝 src/process/ArtifactAnalysisResources.ts (+19 -10)
📝 src/process/DarwinProcessRunTokenReader.timeout.test.ts (+15 -1)
📝 src/process/DarwinProcessRunTokenReader.ts (+19 -4)
📝 src/process/ProcessOwnership.ts (+10 -11)
📝 src/process/ProcessOwnership.validation.test.ts (+3 -2)
📝 src/process/RegexMatcher.ts (+33 -23)
📝 src/process/ownedDebuggerSession.ts (+1 -1)

...and 6 more files

📄 Description

Summary

Names the existing REA_SWIFTC_COMPILE_TIMEOUT_MS control on a Darwin ownership-helper compile timeout, and says when REA retains a tighter inherited producer limit. Agent-visible fixed caps in the process/swiftc theme say this release has no runtime override. Part of #5910 (parent #5808). Numbers are unchanged.

Problem and expected behavior

A timed-out swiftc helper reported milliseconds without the setting name, the allowed range, the omitted default, or when a change applies. SIGXCPU and SIGXFSZ recovery did not say that REA keeps the tighter inherited ceiling. Other agent-visible process caps in this theme omitted the no-override sentence.

A timeout now names the effective REA_SWIFTC_COMPILE_TIMEOUT_MS value in milliseconds, the integer range 1..2147483647, and the omitted default of 120000 ms. The reader captures that value when it is created. Production creates systemProcessOwnershipHost from the launch environment at process start, so a change applies after REA restarts, on the next ownership-helper compile. Invalid ambient values still fall back to 120000 in the reader; parseConfig still rejects them at CLI/MCP admission.

Change and scope

Wording and error projection only. The timeout sentence is built from resolveSwiftcCompileTimeoutMs and MAX_PROVIDER_STARTUP_TIMEOUT_MS (the same schema bound as providerStartupTimeoutSchema). SIGXCPU and SIGXFSZ name the reported inherited address-space, file, and CPU ceilings and say REA retains the tighter inherited limit. Fixed producer command, input, and output allowances, the 512-byte compiler diagnostic excerpt, regex deadline and heap, terminal cell budget, debugger detach, and process-group revalidation say there is no runtime override.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Not applicable. This stays inside existing process, capture, and signal error text. No new provider, target execution, injection, mutation, or protection recovery.

Out of scope: MCP (#6005), providers (#6014), JavaScript (#6022), Android (#6024), browser (#6036), native (#6059), engines, and ASAR. No settings tool. Internal poll intervals and stored bounds that are not an agent sentence are unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: process ownership and producer command projection; the swiftc deadline is read when the Darwin token reader is constructed.
  • Contribution scope fit and linked maintainer decision: not applicable. Wording within existing boundaries.
  • CLI and MCP/tool-catalog contract: recovery text and tool descriptions change. No new arguments or settings.
  • Provider, bridge, target-format, or platform compatibility: Darwin helper timeout text; Linux producer SIGXCPU/SIGXFSZ and sigrok/tshark limitation text. No behavior change on either platform.
  • Evidence, artifact, provenance, or reconstruction contract: none. Compiler outcome facts stay the same; the timeout message names the deadline that was already applied.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): cleanup still uses the same intervals. Failure reasons now include the fixed count and a no-override sentence.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): docs updated in docs/installation.md, docs/mcp-contracts.md, docs/process-capture.md, docs/kuna-provider.md, and docs/native-investigation.md. No package or catalog source change.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • 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 or updated: Darwin timeout unit and boundary tests, producer command projection, process-group revalidation, debugger detach, regex matcher, terminal cell budget, and sigrok/tshark SIGXFSZ recovery.
  • Base reproduction or other evidence: source inspection of resolveSwiftcCompileTimeoutMs, createDarwinProcessRunTokenReader, and systemProcessOwnershipHost. The control is REA_SWIFTC_COMPILE_TIMEOUT_MS in src/config/environment.ts, parsed by providerStartupTimeoutSchema (1..2147483647, default 120000).
  • User-visible CLI/MCP output (if applicable): a timeout includes The effective REA_SWIFTC_COMPILE_TIMEOUT_MS value is <ms> ms (integer range 1..2147483647; omitted default 120000 ms). Set it in the environment that starts REA and restart REA; the next ownership-helper compile uses the new value.
  • Remaining proof gaps: no real swiftc, Xcode, or prlimit run. Linux fixture compilers and projected errors only. A successful compile remains cached for the process, so the captured deadline also covers retries in that process.

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

  • npm run check:fast — typecheck and lint succeeded (turbo 2.11.7, 2 tasks, 5.723s).
  • npm run format:check — oxfmt reported all matched files correctly formatted.
  • npm run test:focused -- the ten process, swiftc, capture, and signal tests listed below — 10 files passed, 250 tests passed, 7 skipped.

Source: DarwinProcessRunTokenReader.timeout.test.ts, ArtifactAnalysisResources.test.ts, ProcessOwnership.validation.test.ts, processScenario.test.ts, fixedAllowanceRemediation.test.ts. Boundary: darwinProcessRunTokenReader.test.ts, ownedDebuggerSession.test.ts, regexMatcher.test.ts, captureProvider.test.ts, recordingProvider.test.ts.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Recovery text is more specific. Callers that match old timeout or cleanup sentences need to expect the added sentences.
  • Real Hopper/Ghidra, browser, or OS coverage: not run. No macOS swiftc or live prlimit producer.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no authority change. The SIGXCPU/SIGXFSZ sentence still says the signal's exact cause is not independently established. Inherited address space, file size, and CPU time stay clamped; command, input, and output budgets stay REA fixed caps.

Author readiness

Human owner: @morluto

  • 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.
Open in Web Open in Cursor 

🔄 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/6071 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cursor/swiftc-compile-deadline-19d7` --- ### 📝 Commits (1) - [`8dac533`](https://github.com/morluto/rea/commit/8dac533fd594b2b1025c2a0a04612f3869c6df15) fix(process): name the Swift compile deadline ### 📊 Changes **26 files changed** (+321 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+4 -2) 📝 `docs/kuna-provider.md` (+1 -1) 📝 `docs/mcp-contracts.md` (+7 -7) 📝 `docs/native-investigation.md` (+4 -2) 📝 `docs/process-capture.md` (+9 -0) 📝 `src/captures/TsharkCaptureProvider.ts` (+7 -4) 📝 `src/config/providerStartupTimeout.ts` (+6 -3) 📝 `src/contracts/officialToolContracts.ts` (+2 -2) 📝 `src/contracts/sessionToolContracts.ts` (+1 -1) 📝 `src/domain/fixedAllowanceRemediation.ts` (+13 -0) 📝 `src/domain/process/processScenario.test.ts` (+16 -1) 📝 `src/domain/process/processScenario.ts` (+3 -3) 📝 `src/process/ArtifactAnalysisResources.test.ts` (+75 -1) 📝 `src/process/ArtifactAnalysisResources.ts` (+19 -10) 📝 `src/process/DarwinProcessRunTokenReader.timeout.test.ts` (+15 -1) 📝 `src/process/DarwinProcessRunTokenReader.ts` (+19 -4) 📝 `src/process/ProcessOwnership.ts` (+10 -11) 📝 `src/process/ProcessOwnership.validation.test.ts` (+3 -2) 📝 `src/process/RegexMatcher.ts` (+33 -23) 📝 `src/process/ownedDebuggerSession.ts` (+1 -1) _...and 6 more files_ </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Names the existing `REA_SWIFTC_COMPILE_TIMEOUT_MS` control on a Darwin ownership-helper compile timeout, and says when REA retains a tighter inherited producer limit. Agent-visible fixed caps in the process/swiftc theme say this release has no runtime override. Part of #5910 (parent #5808). Numbers are unchanged. ## Problem and expected behavior A timed-out `swiftc` helper reported milliseconds without the setting name, the allowed range, the omitted default, or when a change applies. SIGXCPU and SIGXFSZ recovery did not say that REA keeps the tighter inherited ceiling. Other agent-visible process caps in this theme omitted the no-override sentence. A timeout now names the effective `REA_SWIFTC_COMPILE_TIMEOUT_MS` value in milliseconds, the integer range 1..2147483647, and the omitted default of 120000 ms. The reader captures that value when it is created. Production creates `systemProcessOwnershipHost` from the launch environment at process start, so a change applies after REA restarts, on the next ownership-helper compile. Invalid ambient values still fall back to 120000 in the reader; `parseConfig` still rejects them at CLI/MCP admission. ## Change and scope Wording and error projection only. The timeout sentence is built from `resolveSwiftcCompileTimeoutMs` and `MAX_PROVIDER_STARTUP_TIMEOUT_MS` (the same schema bound as `providerStartupTimeoutSchema`). SIGXCPU and SIGXFSZ name the reported inherited address-space, file, and CPU ceilings and say REA retains the tighter inherited limit. Fixed producer command, input, and output allowances, the 512-byte compiler diagnostic excerpt, regex deadline and heap, terminal cell budget, debugger detach, and process-group revalidation say there is no runtime override. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Not applicable. This stays inside existing process, capture, and signal error text. No new provider, target execution, injection, mutation, or protection recovery. Out of scope: MCP (#6005), providers (#6014), JavaScript (#6022), Android (#6024), browser (#6036), native (#6059), engines, and ASAR. No settings tool. Internal poll intervals and stored bounds that are not an agent sentence are unchanged. ## Contract and boundary impact - Semantic owner and earliest changed stage: process ownership and producer command projection; the swiftc deadline is read when the Darwin token reader is constructed. - Contribution scope fit and linked maintainer decision: not applicable. Wording within existing boundaries. - CLI and MCP/tool-catalog contract: recovery text and tool descriptions change. No new arguments or settings. - Provider, bridge, target-format, or platform compatibility: Darwin helper timeout text; Linux producer SIGXCPU/SIGXFSZ and sigrok/tshark limitation text. No behavior change on either platform. - Evidence, artifact, provenance, or reconstruction contract: none. Compiler outcome facts stay the same; the timeout message names the deadline that was already applied. - Target selection, authority, upstream behavior, and cleanup details (if applicable): cleanup still uses the same intervals. Failure reasons now include the fixed count and a no-override sentence. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): docs updated in `docs/installation.md`, `docs/mcp-contracts.md`, `docs/process-capture.md`, `docs/kuna-provider.md`, and `docs/native-investigation.md`. No package or catalog source change. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] 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. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: Darwin timeout unit and boundary tests, producer command projection, process-group revalidation, debugger detach, regex matcher, terminal cell budget, and sigrok/tshark SIGXFSZ recovery. - Base reproduction or other evidence: source inspection of `resolveSwiftcCompileTimeoutMs`, `createDarwinProcessRunTokenReader`, and `systemProcessOwnershipHost`. The control is `REA_SWIFTC_COMPILE_TIMEOUT_MS` in `src/config/environment.ts`, parsed by `providerStartupTimeoutSchema` (`1..2147483647`, default `120000`). - User-visible CLI/MCP output (if applicable): a timeout includes `The effective REA_SWIFTC_COMPILE_TIMEOUT_MS value is <ms> ms (integer range 1..2147483647; omitted default 120000 ms). Set it in the environment that starts REA and restart REA; the next ownership-helper compile uses the new value.` - Remaining proof gaps: no real `swiftc`, Xcode, or `prlimit` run. Linux fixture compilers and projected errors only. A successful compile remains cached for the process, so the captured deadline also covers retries in that process. 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 - `npm run check:fast` — typecheck and lint succeeded (turbo 2.11.7, 2 tasks, 5.723s). - `npm run format:check` — oxfmt reported all matched files correctly formatted. - `npm run test:focused --` the ten process, swiftc, capture, and signal tests listed below — 10 files passed, 250 tests passed, 7 skipped. Source: `DarwinProcessRunTokenReader.timeout.test.ts`, `ArtifactAnalysisResources.test.ts`, `ProcessOwnership.validation.test.ts`, `processScenario.test.ts`, `fixedAllowanceRemediation.test.ts`. Boundary: `darwinProcessRunTokenReader.test.ts`, `ownedDebuggerSession.test.ts`, `regexMatcher.test.ts`, `captureProvider.test.ts`, `recordingProvider.test.ts`. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Recovery text is more specific. Callers that match old timeout or cleanup sentences need to expect the added sentences. - Real Hopper/Ghidra, browser, or OS coverage: not run. No macOS `swiftc` or live `prlimit` producer. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no authority change. The SIGXCPU/SIGXFSZ sentence still says the signal's exact cause is not independently established. Inherited address space, file size, and CPU time stay clamped; command, input, and output budgets stay REA fixed caps. ## Author readiness Human owner: @morluto - [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 - [ ] 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. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-b0abc371-9120-5b11-b445-e9790d4619d7?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-b0abc371-9120-5b11-b445-e9790d4619d7&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <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:40 +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#7139
No description provided.