[PR #204] [MERGED] fix: harden PTY events and configured roots #1855

Closed
opened 2026-10-16 21:11:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/204
Author: @N0zoM1z0
Created: 7/14/2026
Status: ✅ Merged
Merged: 7/14/2026
Merged by: @morluto

Base: main ← Head: agent/fix-silent-pty-policy-roots


📝 Commits (1)

  • 31b40f3 fix: harden PTY events and configured roots

📊 Changes

14 files changed (+180 additions, -40 deletions)

View changed files

📝 src/application/AuthorizedArtifactInventory.ts (+2 -1)
📝 src/application/BoundedJsonFiles.ts (+4 -2)
➕ src/application/ConfiguredRoots.ts (+22 -0)
📝 src/application/ProcessCaptureAuthority.ts (+4 -5)
📝 src/application/ProcessCaptureLifecycle.ts (+0 -2)
📝 src/application/ProcessHarness.ts (+6 -22)
📝 src/application/ProjectPermissionStore.ts (+8 -3)
📝 src/application/ReferenceSourceImportPolicy.ts (+5 -2)
➕ tests/authorizedArtifactInventory.test.ts (+34 -0)
📝 tests/evidenceBundleFiles.test.ts (+15 -0)
📝 tests/fixtures/processFidelity.mjs (+7 -0)
📝 tests/processCapture.test.ts (+41 -0)
📝 tests/projectPermissionStore.test.ts (+12 -1)
📝 tests/referenceSourceImport.test.ts (+20 -2)

📄 Description

Summary

  • schedule process-capture input, resize, and signal events immediately after the PTY output handler is installed
  • ignore stale missing configured roots while preserving fail-closed handling for requested paths and non-ENOENT failures
  • classify malformed project permission JSON as an invalid store instead of an I/O failure
  • add regression coverage for evidence, artifact, process, reference-source, and permission-store paths

Root cause

Interactive events were gated on the target's first terminal output, so silent programs waiting for stdin could never receive their scheduled input. Separately, configured policy roots were canonicalized as an all-or-nothing batch, allowing one stale ENOENT entry to disable otherwise valid roots. Project permission JSON parsing also occurred inside the generic I/O catch.

Impact

Silent interactive captures now reproduce scheduled interactions by timestamp. Stale missing policy roots no longer disable valid configured roots, while requested paths and other filesystem errors remain fail closed. Malformed permission stores now produce actionable invalid-store diagnostics.

Verification

  • npm run check — 85 test files, 583 tests passed
  • npm run knip
  • npm run jscpd
  • npm run scan:todos
  • targeted Vitest regression suite — 44 tests passed

Real Hopper verification was not performed; these changes do not affect Hopper behavior.

Closes #196
Closes #197
Closes #198
Closes #199
Closes #201


🔄 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/204 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `agent/fix-silent-pty-policy-roots` --- ### 📝 Commits (1) - [`31b40f3`](https://github.com/morluto/rea/commit/31b40f39e4c29a077deebefbe29e90c30e50cd0c) fix: harden PTY events and configured roots ### 📊 Changes **14 files changed** (+180 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/application/AuthorizedArtifactInventory.ts` (+2 -1) 📝 `src/application/BoundedJsonFiles.ts` (+4 -2) ➕ `src/application/ConfiguredRoots.ts` (+22 -0) 📝 `src/application/ProcessCaptureAuthority.ts` (+4 -5) 📝 `src/application/ProcessCaptureLifecycle.ts` (+0 -2) 📝 `src/application/ProcessHarness.ts` (+6 -22) 📝 `src/application/ProjectPermissionStore.ts` (+8 -3) 📝 `src/application/ReferenceSourceImportPolicy.ts` (+5 -2) ➕ `tests/authorizedArtifactInventory.test.ts` (+34 -0) 📝 `tests/evidenceBundleFiles.test.ts` (+15 -0) 📝 `tests/fixtures/processFidelity.mjs` (+7 -0) 📝 `tests/processCapture.test.ts` (+41 -0) 📝 `tests/projectPermissionStore.test.ts` (+12 -1) 📝 `tests/referenceSourceImport.test.ts` (+20 -2) </details> ### 📄 Description ## Summary - schedule process-capture input, resize, and signal events immediately after the PTY output handler is installed - ignore stale missing configured roots while preserving fail-closed handling for requested paths and non-ENOENT failures - classify malformed project permission JSON as an invalid store instead of an I/O failure - add regression coverage for evidence, artifact, process, reference-source, and permission-store paths ## Root cause Interactive events were gated on the target's first terminal output, so silent programs waiting for stdin could never receive their scheduled input. Separately, configured policy roots were canonicalized as an all-or-nothing batch, allowing one stale ENOENT entry to disable otherwise valid roots. Project permission JSON parsing also occurred inside the generic I/O catch. ## Impact Silent interactive captures now reproduce scheduled interactions by timestamp. Stale missing policy roots no longer disable valid configured roots, while requested paths and other filesystem errors remain fail closed. Malformed permission stores now produce actionable invalid-store diagnostics. ## Verification - `npm run check` — 85 test files, 583 tests passed - `npm run knip` - `npm run jscpd` - `npm run scan:todos` - targeted Vitest regression suite — 44 tests passed Real Hopper verification was not performed; these changes do not affect Hopper behavior. Closes #196 Closes #197 Closes #198 Closes #199 Closes #201 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:11:50 +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#1855
No description provided.