Skip to content

Commit 023b9b6

Browse files
committed
chore: update progress for US-109
1 parent 667669d commit 023b9b6

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

prd.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@
18781878
"Tests pass"
18791879
],
18801880
"priority": 111,
1881-
"passes": false,
1881+
"passes": true,
18821882
"notes": "MEDIUM — found during PTY review. pty.ts:~444-447 silently drops echo when output buffer full. User types but sees nothing — violates 'what you type is what you see' principle."
18831883
},
18841884
{
@@ -1895,7 +1895,7 @@
18951895
"Tests pass"
18961896
],
18971897
"priority": 112,
1898-
"passes": false,
1898+
"passes": true,
18991899
"notes": "MEDIUM — found during PTY review. kernel.ts:~691-696 and pty.ts:~274-279 accept any number. Setting foregroundPgid to non-existent group causes ^C to silently fail (caught by try/catch)."
19001900
},
19011901
{
@@ -1911,7 +1911,7 @@
19111911
"Tests pass"
19121912
],
19131913
"priority": 113,
1914-
"passes": false,
1914+
"passes": true,
19151915
"notes": "MEDIUM — test-audit.md M11 flags this as HIGH priority. Current tests only fill buffer to exact limit and check one extra byte. No realistic adversarial patterns."
19161916
},
19171917
{
@@ -1925,7 +1925,7 @@
19251925
"Tests pass"
19261926
],
19271927
"priority": 114,
1928-
"passes": false,
1928+
"passes": true,
19291929
"notes": "LOW — found during PTY review. PTY foregroundPgid goes stale when process exits. Protected by try/catch in kernel constructor wiring but untested."
19301930
},
19311931
{

progress.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,3 +1667,16 @@ PRD: ralph/kernel-hardening (46 stories)
16671667
- TypeScript narrows `let x = null` to `null` inside async closures when it doesn't see reassignment in the same scope — use an object wrapper `{ prop: null }` to prevent narrowing
16681668
- PTY slave close notifies master outputWaiters with `null`; master close notifies slave inputWaiters with `null` (pty.ts close method)
16691669
---
1670+
1671+
## 2026-03-18 - US-109
1672+
- What was implemented: Added two tests verifying stale foregroundPgid behavior after process group leader exit
1673+
- Test 1: Set foregroundPgid → kill group leader → send ^C — verifies no crash (try/catch in kernel handles stale PGID gracefully)
1674+
- Test 2: Set foregroundPgid → kill group leader → set new valid group → ^C reaches new group — verifies recovery
1675+
- Files changed:
1676+
- packages/kernel/test/kernel-integration.test.ts — 2 new tests in PTY section
1677+
- Also marked US-106 (P111), US-107 (P112), US-108 (P113) as passes: true (already committed in prior iterations but not marked)
1678+
- **Learnings for future iterations:**
1679+
- Kernel constructor wires PtyManager signal callback with try/catch: `try { this.processTable.kill(-pgid, signal); } catch {}` — this is what makes stale foregroundPgid safe
1680+
- `hasProcessGroup(pgid)` in process-table.ts checks for any non-exited process with that pgid — once all members exit, the group is gone
1681+
- MockRuntimeDriver with `neverExit: true` + `killSignals: []` is the standard pattern for testing signal delivery
1682+
---

0 commit comments

Comments
 (0)