@os-eco/overstory-cli 0.10.3 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -2
  2. package/agents/builder.md +10 -1
  3. package/agents/lead.md +106 -5
  4. package/package.json +1 -1
  5. package/src/agents/headless-mail-injector.ts +8 -0
  6. package/src/agents/mail-poll-detect.test.ts +153 -0
  7. package/src/agents/mail-poll-detect.ts +73 -0
  8. package/src/agents/overlay.test.ts +56 -0
  9. package/src/agents/overlay.ts +33 -0
  10. package/src/agents/scope-detect.test.ts +190 -0
  11. package/src/agents/scope-detect.ts +146 -0
  12. package/src/agents/turn-runner.test.ts +862 -0
  13. package/src/agents/turn-runner.ts +225 -8
  14. package/src/commands/agents.ts +9 -0
  15. package/src/commands/coordinator.test.ts +127 -0
  16. package/src/commands/coordinator.ts +71 -4
  17. package/src/commands/dashboard.ts +1 -1
  18. package/src/commands/log.test.ts +131 -0
  19. package/src/commands/log.ts +37 -2
  20. package/src/commands/merge.test.ts +118 -0
  21. package/src/commands/merge.ts +51 -8
  22. package/src/commands/sling.test.ts +104 -0
  23. package/src/commands/sling.ts +95 -8
  24. package/src/commands/stop.test.ts +81 -0
  25. package/src/index.ts +5 -1
  26. package/src/insights/quality-gates.test.ts +141 -0
  27. package/src/insights/quality-gates.ts +156 -0
  28. package/src/logging/theme.ts +4 -0
  29. package/src/merge/predict.test.ts +387 -0
  30. package/src/merge/predict.ts +249 -0
  31. package/src/merge/resolver.ts +1 -1
  32. package/src/mulch/client.ts +3 -3
  33. package/src/sessions/store.test.ts +267 -5
  34. package/src/sessions/store.ts +105 -7
  35. package/src/types.ts +51 -1
  36. package/src/watchdog/daemon.test.ts +124 -2
  37. package/src/watchdog/daemon.ts +27 -12
  38. package/src/watchdog/health.test.ts +133 -8
  39. package/src/watchdog/health.ts +37 -5
  40. package/src/worktree/manager.test.ts +218 -1
  41. package/src/worktree/manager.ts +55 -0
  42. package/src/worktree/tmux.test.ts +25 -0
  43. package/src/worktree/tmux.ts +17 -0
  44. package/templates/overlay.md.tmpl +2 -0
@@ -404,6 +404,17 @@ function sendSignal(pid: number, signal: "SIGTERM" | "SIGKILL"): void {
404
404
  * failures are silently handled since the goal is best-effort cleanup)
405
405
  */
406
406
  export async function killSession(name: string): Promise<void> {
407
+ // Defense in depth: an empty session name passed to `tmux -t` is prefix-matched
408
+ // against every session in the server, wildcard-killing the entire overstory
409
+ // swarm (overstory-74ce). Reject empty names at the boundary so a regression in
410
+ // any caller surfaces loudly instead of silently nuking the tmux server.
411
+ if (name === "") {
412
+ throw new AgentError(
413
+ "killSession called with empty session name (would wildcard-kill all tmux sessions due to prefix matching)",
414
+ { agentName: name },
415
+ );
416
+ }
417
+
407
418
  // Step 1: Get the pane PID before killing the tmux session
408
419
  const panePid = await getPanePid(name);
409
420
 
@@ -457,6 +468,12 @@ export async function getCurrentSessionName(): Promise<string | null> {
457
468
  * @returns true if the session exists, false otherwise
458
469
  */
459
470
  export async function isSessionAlive(name: string): Promise<boolean> {
471
+ // Defense in depth: an empty `-t` argument is prefix-matched against every
472
+ // session, so `has-session` would return true whenever any overstory session
473
+ // exists. Treat empty as "not alive" without contacting tmux (overstory-74ce).
474
+ if (name === "") {
475
+ return false;
476
+ }
460
477
  const { exitCode } = await runCommand(tmuxCmd("has-session", "-t", name));
461
478
  return exitCode === 0;
462
479
  }
@@ -25,6 +25,8 @@
25
25
 
26
26
  {{DISPATCH_OVERRIDES}}
27
27
 
28
+ {{SIBLINGS}}
29
+
28
30
  ## Working Directory
29
31
 
30
32
  Your worktree root is: `{{WORKTREE_PATH}}`