rdmpw3275m-changelog-20260922-2242-tyrell-turn-interruption-process-tree-feat-20260905-17
rdmpw3275m-changelog-20260922-2242-tyrell-turn-interruption-process-tree-feat-20260905-17
Implemented process tree turn cancellation, pre-teardown worktree checkpointing, live git/codesign process refusal guard, and turn state disk persistence in Tyrell (FEAT-20260905-17).
Summary
- Scope:
apps/Tyrell(TyrellCore,tyrelld,tyrell-app), verified on Intel (rdmpw3275m) and Apple Silicon (rdmsm4x). - Ticket:
FEAT-20260905-17(resolved). - Commit:
9bbdc06merged tomainand pushed tofleet(git.ecs0.net:git/apps/Tyrell.git) andbackup(github.com/richhdoty/rdmsm4x-dev-apps-tyrell.git).
Changes
TurnInterruption.swift:- Defined
TurnStateenum (pending,in_progress,interrupted,completed,failed). - Defined
TurnRecordstruct capturing session identity, conversation ID, turn index, state, root PID, worktree path, checkpoint OID, interruption reason, and signalled PIDs. - Defined
TurnCancellationResultenum (success,refusedProtectedChild,processNotFound,invalidPID,checkpointFailed). - Implemented
TurnStateStoreactor providing thread-safe durable JSON persistence to~/.tyrell/turns/<id>.json.
- Defined
ProcessSafetyActor.swift:- Implemented
isProtectedProcess(name:)identifying in-flightgitandcodesignprocesses (same guard as the orchestrator SIGSTOP rule). - Implemented
findDescendantTree(rootPid:in:)returning all attributed child processes in depth-first post-order (leaves first). - Implemented
cancelTurnTreecapturing an out-of-band pre-teardown checkpoint viaECSWorktreeManager.captureCheckpointbefore signaling, refusing if any protected process is alive, signaling descendants bottom-up followed by root with SIGINT, and persisting.interruptedstate. - Updated
cancelTurn(pid:)to delegate tocancelTurnTree(rootPid:)while maintaining full backward compatibility.
- Implemented
AgentsPanel.swift:- Updated
cancelTurn(_:)inAgentsRosterStoreto delegate toProcessSafetyActor.shared.cancelTurnTree.
- Updated
ApprovalRoutes.swift&ApprovalModels.swift:- Registered
POST /api/turn/cancelendpoint supporting HTTP turn cancellation. - Updated
/api/approvals/{id}/decisionto triggercancelTurnTreewhen decision action is.cancelTurnand PID is present.
- Registered
TyrellBootstrap.swift:- Added
turnsDirectoryURL pointing to~/.tyrell/turns.
- Added
TurnInterruptionTests.swift:- 6 comprehensive tests asserting:
- Synthetic multi-level child tree signaling with post-order traversal and unrelated process isolation.
- Protected
gitchild process refusal with zero signals sent. - Protected
codesignchild process refusal with zero signals sent. - Pre-teardown dirty worktree checkpoint capture preserving uncommitted edits without index corruption.
- Durable turn state persistence to disk across store reloads.
- Live subprocess SIGINT termination.
- 6 comprehensive tests asserting:
Verification Evidence
- Test Results:
TurnInterruptionTests: 6/6 passed (0.69s on Intel, 0.36s on Apple Silicon).M3_Challenger2_EmpiricalStreamAndCancellationTests: 7/7 passed.ApprovalQueueTests: 14/14 passed.WorktreeEngineTests: 14/14 passed.swift build: built all executable targets (tyrell-app,tyrell,tyrellbar,tyrelld,tyrell-mcp) cleanly with zero warnings.
- Fleet Sync:
- Ticket
FEAT-20260905-17resolved in ticket store. - Fleet broadcast
resolve-feat-20260905-17dispatched viaagent_msg.zshand synced to reachable hosts (rdmsm4x,rdmbair13m5,rdmbair15m5,rdmpw3265m).
- Ticket