You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prd.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1878,7 +1878,7 @@
1878
1878
"Tests pass"
1879
1879
],
1880
1880
"priority": 111,
1881
-
"passes": false,
1881
+
"passes": true,
1882
1882
"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."
1883
1883
},
1884
1884
{
@@ -1895,7 +1895,7 @@
1895
1895
"Tests pass"
1896
1896
],
1897
1897
"priority": 112,
1898
-
"passes": false,
1898
+
"passes": true,
1899
1899
"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)."
1900
1900
},
1901
1901
{
@@ -1911,7 +1911,7 @@
1911
1911
"Tests pass"
1912
1912
],
1913
1913
"priority": 113,
1914
-
"passes": false,
1914
+
"passes": true,
1915
1915
"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."
1916
1916
},
1917
1917
{
@@ -1925,7 +1925,7 @@
1925
1925
"Tests pass"
1926
1926
],
1927
1927
"priority": 114,
1928
-
"passes": false,
1928
+
"passes": true,
1929
1929
"notes": "LOW — found during PTY review. PTY foregroundPgid goes stale when process exits. Protected by try/catch in kernel constructor wiring but untested."
- 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
1668
1668
- PTY slave close notifies master outputWaiters with `null`; master close notifies slave inputWaiters with `null` (pty.ts close method)
1669
1669
---
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
0 commit comments