Skip to content

Commit 8bd5e56

Browse files
committed
chore: update progress for US-113
1 parent 879d007 commit 8bd5e56

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@
19831983
"Tests pass"
19841984
],
19851985
"priority": 118,
1986-
"passes": false,
1986+
"passes": true,
19871987
"notes": "LOW \u2014 found during PTY review. pty.ts:~374 calls onSignal?.() with no error handling. Currently protected by kernel try/catch wiring but fragile if wiring changes."
19881988
},
19891989
{

progress.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,3 +1706,18 @@ PRD: ralph/kernel-hardening (46 stories)
17061706
- Multiple TerminalHarness instances on the same kernel work correctly — each gets its own PTY pair via openShell()
17071707
- MockShellDriver supports multiple concurrent shell processes since each spawn() creates independent state
17081708
---
1709+
1710+
## 2026-03-18 - US-113
1711+
- What was implemented: Added try/catch around PTY onSignal callback and tests
1712+
- pty.ts: wrapped onSignal?.(pgid, signal) in try/catch at line ~393 — errors caught silently, line discipline continues
1713+
- Test 1: onSignal throws on ^C → PTY doesn't crash, subsequent write/read/echo still works
1714+
- Test 2: multiple ^C with throwing handler → no accumulated errors, echo and input delivery still work
1715+
- Files changed:
1716+
- packages/kernel/src/pty.ts — added try/catch around onSignal call
1717+
- packages/kernel/test/resource-exhaustion.test.ts — added "PTY signal callback error handling" describe with 2 tests
1718+
- prd.json — marked US-113 (P118) as passes: true
1719+
- **Learnings for future iterations:**
1720+
- Kernel already wraps onSignal at line 57 (try/catch around processTable.kill), but PTY-level protection is defense-in-depth
1721+
- PtyManager constructor takes optional onSignal callback — pass a throwing function in tests to verify resilience
1722+
- setForegroundPgid requires a non-zero pgid for signal delivery to trigger
1723+
---

0 commit comments

Comments
 (0)