pi-crew 0.2.3 → 0.2.5

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 (348) hide show
  1. package/AGENTS.md +57 -32
  2. package/CHANGELOG.md +466 -448
  3. package/LICENSE +21 -21
  4. package/NOTICE.md +16 -16
  5. package/README.md +323 -323
  6. package/docs/FEATURE_INTAKE.md +126 -0
  7. package/docs/HARNESS.md +86 -0
  8. package/docs/HARNESS_BACKLOG.md +41 -0
  9. package/docs/TEST_MATRIX.md +49 -0
  10. package/docs/actions-reference.md +595 -595
  11. package/docs/architecture.md +180 -180
  12. package/docs/code-review-2026-05-11.md +592 -592
  13. package/docs/commands-reference.md +347 -347
  14. package/docs/comparison-pi-subagents-vs-pi-crew.md +303 -0
  15. package/docs/decisions/0001-durable-state.md +41 -0
  16. package/docs/decisions/0002-child-process-for-async.md +42 -0
  17. package/docs/decisions/0003-depth-guard.md +36 -0
  18. package/docs/decisions/0004-execfile-over-exec.md +34 -0
  19. package/docs/decisions/0005-no-parameter-properties.md +49 -0
  20. package/docs/decisions/0006-publish-bundled-esm.md +63 -0
  21. package/docs/decisions/0007-active-run-binary-index.md +54 -0
  22. package/docs/decisions/0008-child-pi-warm-pool.md +61 -0
  23. package/docs/decisions/README.md +23 -0
  24. package/docs/followup-review-round4-2026-05-13.md +107 -0
  25. package/docs/implementation-plan-top3.md +333 -0
  26. package/docs/live-mailbox-runtime.md +36 -36
  27. package/docs/next-upgrade-roadmap.md +808 -808
  28. package/docs/oh-my-pi-research.md +509 -0
  29. package/docs/perf/baseline-2026-05.md +113 -0
  30. package/docs/perf/final-report-2026-05.md +206 -0
  31. package/docs/perf/sprint-1-report.md +71 -0
  32. package/docs/perf/sprint-2-report.md +81 -0
  33. package/docs/perf/sprint-2.5-report.md +53 -0
  34. package/docs/perf/sprint-3-report.md +36 -0
  35. package/docs/perf/sprint-4-report.md +47 -0
  36. package/docs/perf/sprint-5-report.md +51 -0
  37. package/docs/perf/sprint-6-report.md +94 -0
  38. package/docs/perf/sprint-7-report.md +74 -0
  39. package/docs/perf/upgrade-plan-2026-05.md +147 -0
  40. package/docs/pi-subagents3-deep-analysis.md +508 -0
  41. package/docs/product/README.md +31 -0
  42. package/docs/product/platform.md +27 -0
  43. package/docs/product/runtime-safety.md +37 -0
  44. package/docs/product/team-run.md +39 -0
  45. package/docs/product/team-tool.md +37 -0
  46. package/docs/publishing.md +65 -65
  47. package/docs/resource-formats.md +134 -134
  48. package/docs/runtime-analysis-child-vs-live.md +171 -0
  49. package/docs/runtime-flow.md +148 -148
  50. package/docs/runtime-migration-in-process-analysis.md +250 -0
  51. package/docs/stories/README.md +30 -0
  52. package/docs/stories/backlog.md +36 -0
  53. package/docs/templates/decision.md +27 -0
  54. package/docs/templates/story.md +44 -0
  55. package/docs/templates/validation-report.md +32 -0
  56. package/docs/usage.md +238 -238
  57. package/index.ts +7 -6
  58. package/install.mjs +65 -65
  59. package/package.json +107 -100
  60. package/schema.json +222 -222
  61. package/skills/child-pi-spawning/SKILL.md +213 -0
  62. package/skills/context-artifact-hygiene/SKILL.md +32 -0
  63. package/skills/event-log-tracing/SKILL.md +299 -0
  64. package/skills/git-master/SKILL.md +225 -24
  65. package/skills/live-agent-lifecycle/SKILL.md +192 -0
  66. package/skills/mailbox-interactive/SKILL.md +300 -19
  67. package/skills/model-routing-context/SKILL.md +94 -0
  68. package/skills/multi-perspective-review/SKILL.md +88 -0
  69. package/skills/read-only-explorer/SKILL.md +250 -26
  70. package/skills/safe-bash/SKILL.md +307 -21
  71. package/skills/verification-before-done/SKILL.md +11 -2
  72. package/skills/widget-rendering/SKILL.md +258 -0
  73. package/skills/workspace-isolation/SKILL.md +202 -0
  74. package/skills/worktree-isolation/SKILL.md +202 -18
  75. package/src/adapters/claude-adapter.ts +25 -25
  76. package/src/adapters/codex-adapter.ts +21 -21
  77. package/src/adapters/cursor-adapter.ts +17 -17
  78. package/src/adapters/export-util.ts +137 -137
  79. package/src/adapters/index.ts +15 -15
  80. package/src/adapters/registry.ts +18 -18
  81. package/src/adapters/types.ts +23 -23
  82. package/src/agents/agent-config.ts +38 -38
  83. package/src/agents/agent-serializer.ts +38 -38
  84. package/src/agents/discover-agents.ts +121 -118
  85. package/src/config/config.ts +740 -858
  86. package/src/config/defaults.ts +96 -96
  87. package/src/config/drift-detector.ts +211 -211
  88. package/src/config/markers.ts +327 -327
  89. package/src/config/resilient-parser.ts +109 -108
  90. package/src/config/suggestions.ts +74 -74
  91. package/src/config/types.ts +199 -0
  92. package/src/extension/async-notifier.ts +123 -89
  93. package/src/extension/autonomous-policy.ts +169 -169
  94. package/src/extension/cross-extension-rpc.ts +104 -104
  95. package/src/extension/help.ts +47 -47
  96. package/src/extension/import-index.ts +69 -69
  97. package/src/extension/management.ts +395 -382
  98. package/src/extension/notification-router.ts +116 -116
  99. package/src/extension/notification-sink.ts +51 -51
  100. package/src/extension/project-init.ts +168 -168
  101. package/src/extension/register.ts +859 -668
  102. package/src/extension/registration/artifact-cleanup.ts +15 -15
  103. package/src/extension/registration/command-utils.ts +54 -54
  104. package/src/extension/registration/commands.ts +559 -452
  105. package/src/extension/registration/compaction-guard.ts +125 -125
  106. package/src/extension/registration/subagent-helpers.ts +102 -102
  107. package/src/extension/registration/subagent-tools.ts +220 -159
  108. package/src/extension/registration/team-tool.ts +159 -99
  109. package/src/extension/registration/viewers.ts +29 -0
  110. package/src/extension/result-watcher.ts +128 -128
  111. package/src/extension/run-bundle-schema.ts +89 -89
  112. package/src/extension/run-export.ts +73 -73
  113. package/src/extension/run-import.ts +84 -84
  114. package/src/extension/run-index.ts +94 -94
  115. package/src/extension/run-maintenance.ts +142 -142
  116. package/src/extension/session-summary.ts +8 -8
  117. package/src/extension/team-manager-command.ts +96 -96
  118. package/src/extension/team-recommendation.ts +188 -188
  119. package/src/extension/team-tool/api.ts +5 -2
  120. package/src/extension/team-tool/cancel.ts +224 -209
  121. package/src/extension/team-tool/config-patch.ts +36 -36
  122. package/src/extension/team-tool/context.ts +60 -60
  123. package/src/extension/team-tool/doctor.ts +242 -242
  124. package/src/extension/team-tool/handle-settings.ts +421 -195
  125. package/src/extension/team-tool/inspect.ts +41 -41
  126. package/src/extension/team-tool/lifecycle-actions.ts +139 -139
  127. package/src/extension/team-tool/parallel-dispatch.ts +156 -156
  128. package/src/extension/team-tool/plan.ts +19 -19
  129. package/src/extension/team-tool/respond.ts +112 -111
  130. package/src/extension/team-tool/run.ts +246 -229
  131. package/src/extension/team-tool/status.ts +110 -110
  132. package/src/extension/team-tool-types.ts +13 -13
  133. package/src/extension/team-tool.ts +344 -344
  134. package/src/extension/tool-result.ts +16 -16
  135. package/src/extension/validate-resources.ts +77 -77
  136. package/src/hooks/registry.ts +61 -61
  137. package/src/hooks/types.ts +40 -40
  138. package/src/i18n.ts +184 -184
  139. package/src/observability/correlation.ts +35 -35
  140. package/src/observability/event-to-metric.ts +68 -68
  141. package/src/observability/exporters/adapter.ts +30 -30
  142. package/src/observability/exporters/otlp-exporter.ts +106 -92
  143. package/src/observability/exporters/prometheus-exporter.ts +54 -54
  144. package/src/observability/metric-registry.ts +87 -87
  145. package/src/observability/metric-retention.ts +54 -54
  146. package/src/observability/metric-sink.ts +81 -56
  147. package/src/observability/metrics-primitives.ts +167 -167
  148. package/src/prompt/prompt-runtime.ts +72 -72
  149. package/src/runtime/adaptive-plan.ts +338 -0
  150. package/src/runtime/agent-control.ts +169 -169
  151. package/src/runtime/agent-memory.ts +72 -72
  152. package/src/runtime/agent-observability.ts +114 -114
  153. package/src/runtime/async-marker.ts +26 -26
  154. package/src/runtime/async-runner.ts +153 -153
  155. package/src/runtime/attention-events.ts +28 -28
  156. package/src/runtime/auto-resume.ts +100 -100
  157. package/src/runtime/background-runner.ts +122 -89
  158. package/src/runtime/cancellation.ts +61 -61
  159. package/src/runtime/capability-inventory.ts +116 -116
  160. package/src/runtime/child-pi-pool.ts +68 -0
  161. package/src/runtime/child-pi.ts +541 -461
  162. package/src/runtime/code-summary.ts +247 -247
  163. package/src/runtime/compaction-summary.ts +271 -271
  164. package/src/runtime/concurrency.ts +58 -58
  165. package/src/runtime/crash-recovery.ts +317 -301
  166. package/src/runtime/crew-agent-records.ts +379 -281
  167. package/src/runtime/crew-agent-runtime.ts +60 -60
  168. package/src/runtime/cross-extension-rpc.ts +72 -0
  169. package/src/runtime/custom-tools/irc-tool.ts +201 -201
  170. package/src/runtime/custom-tools/submit-result-tool.ts +90 -90
  171. package/src/runtime/deadletter.ts +47 -47
  172. package/src/runtime/delivery-coordinator.ts +176 -176
  173. package/src/runtime/delta-conflict.ts +360 -360
  174. package/src/runtime/diagnostic-export.ts +102 -102
  175. package/src/runtime/direct-run.ts +35 -35
  176. package/src/runtime/effectiveness.ts +82 -81
  177. package/src/runtime/errors/crew-errors.ts +166 -0
  178. package/src/runtime/event-stream-bridge.ts +92 -92
  179. package/src/runtime/foreground-control.ts +82 -82
  180. package/src/runtime/green-contract.ts +46 -46
  181. package/src/runtime/group-join.ts +234 -106
  182. package/src/runtime/heartbeat-watcher.ts +145 -124
  183. package/src/runtime/iteration-hooks.ts +267 -267
  184. package/src/runtime/live-agent-control.ts +88 -88
  185. package/src/runtime/live-agent-manager.ts +377 -179
  186. package/src/runtime/live-control-realtime.ts +36 -36
  187. package/src/runtime/live-session-runtime.ts +676 -600
  188. package/src/runtime/loop-gates.ts +129 -129
  189. package/src/runtime/manifest-cache.ts +263 -263
  190. package/src/runtime/mcp-proxy.ts +113 -113
  191. package/src/runtime/metric-parser.ts +40 -40
  192. package/src/runtime/model-fallback.ts +282 -274
  193. package/src/runtime/model-resolver.ts +118 -0
  194. package/src/runtime/output-validator.ts +187 -187
  195. package/src/runtime/overflow-recovery.ts +175 -175
  196. package/src/runtime/parallel-research.ts +44 -44
  197. package/src/runtime/parallel-utils.ts +156 -156
  198. package/src/runtime/parent-guard.ts +80 -80
  199. package/src/runtime/phase-progress.ts +217 -217
  200. package/src/runtime/pi-args.ts +165 -165
  201. package/src/runtime/pi-json-output.ts +111 -111
  202. package/src/runtime/pi-spawn.ts +167 -167
  203. package/src/runtime/policy-engine.ts +79 -79
  204. package/src/runtime/post-checks.ts +125 -125
  205. package/src/runtime/post-exit-stdio-guard.ts +86 -86
  206. package/src/runtime/process-status.ts +97 -73
  207. package/src/runtime/progress-event-coalescer.ts +43 -43
  208. package/src/runtime/recovery-recipes.ts +74 -74
  209. package/src/runtime/retry-executor.ts +81 -81
  210. package/src/runtime/role-permission.ts +39 -39
  211. package/src/runtime/run-tracker.ts +99 -0
  212. package/src/runtime/runtime-policy.ts +21 -0
  213. package/src/runtime/runtime-resolver.ts +94 -91
  214. package/src/runtime/scheduler.ts +294 -0
  215. package/src/runtime/semaphore.ts +131 -131
  216. package/src/runtime/sensitive-paths.ts +92 -92
  217. package/src/runtime/session-usage.ts +79 -79
  218. package/src/runtime/settings-store.ts +103 -0
  219. package/src/runtime/sidechain-output.ts +29 -29
  220. package/src/runtime/skill-instructions.ts +222 -222
  221. package/src/runtime/stale-reconciler.ts +198 -189
  222. package/src/runtime/streaming-output.ts +47 -0
  223. package/src/runtime/subagent-manager.ts +404 -400
  224. package/src/runtime/subprocess-tool-registry.ts +67 -67
  225. package/src/runtime/task-display.ts +38 -38
  226. package/src/runtime/task-graph-scheduler.ts +122 -122
  227. package/src/runtime/task-graph.ts +207 -207
  228. package/src/runtime/task-output-context.ts +177 -177
  229. package/src/runtime/task-packet.ts +93 -93
  230. package/src/runtime/task-quality.ts +207 -207
  231. package/src/runtime/task-runner/capabilities.ts +78 -78
  232. package/src/runtime/task-runner/live-executor.ts +131 -113
  233. package/src/runtime/task-runner/progress.ts +119 -119
  234. package/src/runtime/task-runner/prompt-builder.ts +139 -139
  235. package/src/runtime/task-runner/prompt-pipeline.ts +64 -64
  236. package/src/runtime/task-runner/result-utils.ts +14 -14
  237. package/src/runtime/task-runner/run-projection.ts +103 -103
  238. package/src/runtime/task-runner/state-helpers.ts +22 -22
  239. package/src/runtime/task-runner.ts +469 -459
  240. package/src/runtime/team-runner.ts +693 -945
  241. package/src/runtime/usage-tracker.ts +71 -0
  242. package/src/runtime/worker-heartbeat.ts +21 -21
  243. package/src/runtime/worker-startup.ts +57 -57
  244. package/src/runtime/workflow-state.ts +187 -187
  245. package/src/runtime/yield-handler.ts +190 -190
  246. package/src/schema/config-schema.ts +172 -168
  247. package/src/schema/team-tool-schema.ts +126 -126
  248. package/src/schema/validation-types.ts +151 -148
  249. package/src/skills/discover-skills.ts +67 -67
  250. package/src/skills/skill-templates.ts +374 -374
  251. package/src/state/active-run-registry.ts +227 -191
  252. package/src/state/artifact-store.ts +130 -129
  253. package/src/state/atomic-write.ts +262 -195
  254. package/src/state/blob-store.ts +116 -116
  255. package/src/state/contracts.ts +111 -111
  256. package/src/state/event-log-rotation.ts +161 -158
  257. package/src/state/event-log.ts +383 -303
  258. package/src/state/event-reconstructor.ts +217 -217
  259. package/src/state/jsonl-writer.ts +82 -82
  260. package/src/state/locks.ts +146 -146
  261. package/src/state/mailbox.ts +446 -405
  262. package/src/state/state-store.ts +364 -351
  263. package/src/state/task-claims.ts +44 -44
  264. package/src/state/types.ts +285 -285
  265. package/src/state/usage.ts +29 -29
  266. package/src/subagents/async-entry.ts +1 -1
  267. package/src/subagents/index.ts +3 -3
  268. package/src/subagents/live/control.ts +1 -1
  269. package/src/subagents/live/manager.ts +1 -1
  270. package/src/subagents/live/realtime.ts +1 -1
  271. package/src/subagents/live/session-runtime.ts +1 -1
  272. package/src/subagents/manager.ts +1 -1
  273. package/src/subagents/spawn.ts +1 -1
  274. package/src/teams/discover-teams.ts +116 -116
  275. package/src/teams/team-config.ts +27 -27
  276. package/src/teams/team-serializer.ts +38 -38
  277. package/src/types/diff.d.ts +18 -18
  278. package/src/ui/agent-management-overlay.ts +144 -144
  279. package/src/ui/crew-widget.ts +487 -370
  280. package/src/ui/dashboard-panes/agents-pane.ts +109 -28
  281. package/src/ui/dashboard-panes/cancellation-pane.ts +42 -42
  282. package/src/ui/dashboard-panes/capability-pane.ts +59 -59
  283. package/src/ui/dashboard-panes/health-pane.ts +30 -30
  284. package/src/ui/dashboard-panes/mailbox-pane.ts +35 -35
  285. package/src/ui/dashboard-panes/progress-pane.ts +30 -30
  286. package/src/ui/dashboard-panes/transcript-pane.ts +10 -10
  287. package/src/ui/heartbeat-aggregator.ts +63 -63
  288. package/src/ui/keybinding-map.ts +97 -94
  289. package/src/ui/live-conversation-overlay.ts +152 -0
  290. package/src/ui/live-run-sidebar.ts +180 -180
  291. package/src/ui/mascot.ts +442 -442
  292. package/src/ui/overlays/agent-picker-overlay.ts +57 -57
  293. package/src/ui/overlays/confirm-overlay.ts +58 -58
  294. package/src/ui/overlays/mailbox-compose-overlay.ts +144 -144
  295. package/src/ui/overlays/mailbox-compose-preview.ts +63 -63
  296. package/src/ui/overlays/mailbox-detail-overlay.ts +122 -122
  297. package/src/ui/pi-ui-compat.ts +57 -57
  298. package/src/ui/powerbar-publisher.ts +221 -197
  299. package/src/ui/render-scheduler.ts +216 -143
  300. package/src/ui/run-action-dispatcher.ts +118 -118
  301. package/src/ui/run-dashboard.ts +526 -464
  302. package/src/ui/run-event-bus.ts +208 -208
  303. package/src/ui/run-snapshot-cache.ts +826 -777
  304. package/src/ui/settings-overlay.ts +721 -0
  305. package/src/ui/snapshot-types.ts +86 -70
  306. package/src/ui/theme-adapter.ts +190 -190
  307. package/src/ui/tool-progress-formatter.ts +89 -0
  308. package/src/ui/transcript-cache.ts +94 -94
  309. package/src/ui/transcript-viewer.ts +335 -335
  310. package/src/utils/conflict-detect.ts +662 -0
  311. package/src/utils/file-coalescer.ts +86 -86
  312. package/src/utils/frontmatter.ts +68 -68
  313. package/src/utils/fs-watch.ts +88 -31
  314. package/src/utils/gh-protocol.ts +479 -0
  315. package/src/utils/ids.ts +17 -17
  316. package/src/utils/incremental-reader.ts +104 -104
  317. package/src/utils/internal-error.ts +6 -6
  318. package/src/utils/names.ts +27 -27
  319. package/src/utils/paths.ts +102 -63
  320. package/src/utils/redaction.ts +44 -44
  321. package/src/utils/safe-paths.ts +47 -47
  322. package/src/utils/scan-cache.ts +136 -136
  323. package/src/utils/sse-parser.ts +134 -134
  324. package/src/utils/task-name-generator.ts +337 -337
  325. package/src/utils/timings.ts +33 -33
  326. package/src/utils/visual.ts +243 -198
  327. package/src/workflows/discover-workflows.ts +139 -139
  328. package/src/workflows/validate-workflow.ts +40 -40
  329. package/src/workflows/workflow-config.ts +26 -26
  330. package/src/workflows/workflow-serializer.ts +32 -32
  331. package/src/worktree/branch-freshness.ts +45 -45
  332. package/src/worktree/cleanup.ts +75 -75
  333. package/src/worktree/worktree-manager.ts +188 -188
  334. package/teams/default.team.md +12 -12
  335. package/teams/fast-fix.team.md +11 -11
  336. package/teams/implementation.team.md +18 -18
  337. package/teams/parallel-research.team.md +14 -14
  338. package/teams/research.team.md +11 -11
  339. package/teams/review.team.md +12 -12
  340. package/tsconfig.json +19 -19
  341. package/workflows/default.workflow.md +30 -30
  342. package/workflows/fast-fix.workflow.md +23 -23
  343. package/workflows/implementation.workflow.md +43 -43
  344. package/workflows/parallel-research.workflow.md +46 -46
  345. package/workflows/research.workflow.md +22 -22
  346. package/workflows/review.workflow.md +30 -30
  347. package/skills/task-packet/SKILL.md +0 -28
  348. package/skills/verify-evidence/SKILL.md +0 -27
package/CHANGELOG.md CHANGED
@@ -1,448 +1,466 @@
1
- # Changelog
2
-
3
- ## 0.2.3 — Bug Fixes & Hardening (2026-05-12)
4
-
5
- ### Security
6
-
7
- - **[MEDIUM] Event log append concurrency** — `appendFileSync` on Windows is not atomic; concurrent parent + background-runner writes could interleave JSONL lines. Fix: cross-process `withEventLogLockSync` using atomic `mkdirSync` + stale-lock detection via owner PID.
8
- - **[MEDIUM] Subagent path traversal** — `persistedSubagentPath(cwd, id)` did not validate `id` before joining into a file path. Fix: `isValidSubagentId` regex guard (`^[a-z0-9_]+$`, max 128 chars).
9
- - **[LOW] PEM redaction unbounded scan** — `PEM_PRIVATE_KEY_PATTERN` used `\s\S]*?` without length limit, causing full-file scan on truncated input. Fix: capped to 65,536 characters.
10
- - **[LOW] Sleep utility `require()` in ESM** — `sleep.ts` used `require("node:child_process")` inside an ES module. Fix: top-level ESM `import { execFileSync }`.
11
-
12
- ### Correctness
13
-
14
- - **Async lock fail-fast** — `acquireLockWithRetryAsync` previously waited the full deadline (~60 s) when an active (non-stale) lock existed. Fix: throw immediately, matching sync behavior.
15
- - **Atomic-write sync parity** — Async `atomicWriteFileAsync` had a "matches" fallback (read existing, compare content) for race conditions; sync path lacked it. Fix: added identical fallback to sync.
16
- - **Sequence cache leak** — `sequenceCache` was an unbounded Map. Fix: `MAX_SEQUENCE_CACHE_ENTRIES = 256` with oldest-entry eviction.
17
- - **Iteration hooks / post-checks env inconsistency** — `runSetupHook` used `sanitizeEnvSecrets(..., { allowList })` but `runIterationHook` and `runPostCheck` used hard-coded env whitelists. Fix: unified all three to `sanitizeEnvSecrets` with the same allow-list (includes Windows vars: `USERPROFILE`, `TEMP`, `ComSpec`, `SystemRoot`).
18
- - **Worktree error parsing locale-dependent** — `git worktree add` error messages parsed with English regexes but `git()` helper did not force locale. Fix: `LANG: "C"`, `LC_ALL: "C"` injected into all `git()` calls in `worktree-manager.ts` and `cleanup.ts`.
19
- - **Event log lock stale-detect** — `withEventLogLockSync` previously had no stale-lock recovery and always `rmdirSync`ed in `finally` even when lock was never acquired. Fix: PID-based stale detection + conditional cleanup only on `acquired=true`.
20
-
21
- ### Portability
22
-
23
- - **Windows `.cmd/.bat` spawn safety** — Node ≥ 20 CVE-2024-27980 blocks direct `.cmd/.bat` spawn. Fix: `.cmd`/`.bat` scripts on Windows now run via `cmd.exe /d /s /c scriptPath`.
24
- - **Git Bash fallback on Windows** — `resolveShellForScript` now prefers Git Bash (`bash.exe` from `Git\bin`) when available, falling back to PowerShell/cmd only when absent.
25
- - **Jiti loader resolution for hoisted installs** — `resolveJitiRegisterPath` used hard-coded `../../` candidates that failed when pi-crew was installed via local path or in a hoisted monorepo. Fix: ancestor walk upward from `packageRoot` plus fallback candidates `register.mjs` and `dist/register.mjs`.
26
-
27
- ### Tests
28
-
29
- - Added `test/unit/worktree-manager.test.ts` (branch recovery, reuse, clean leader, file node_modules skip).
30
- - Added `test/unit/artifact-store.test.ts` (hash integrity, path traversal, nested dirs).
31
- - Added `test/unit/locks-race.test.ts` tests (stale lock recovery sync+async, active lock fail-fast).
32
- - Added `test/unit/redaction-transcript-roundtrip.test.ts`.
33
- - Added `test/unit/env-filter.test.ts` and `test/unit/resolve-shell.test.ts`.
34
- - Added `scripts/check-lazy-imports.mjs` with `npm run check:lazy-imports` CI gate.
35
-
36
- ---
37
-
38
- ## 0.2.0 — Security & Performance Hardening
39
-
40
- ### Performance
41
-
42
- - **Extension registration: 72% faster** — Lazy-loaded the entire runtime chain (team-tool, team-runner, runtime-resolver, etc.) from `register.ts`. Pi cold-start: 3,200ms → 780ms.
43
- - **Commands UI: 65% faster** — Lazy-loaded RunDashboard (288ms), DurableTextViewer (658ms), and 5 overlay components that were statically imported but only used on demand.
44
- - **Verifier: 80% faster** — 6-turn budget enforced at runtime via `maxTurns` agent config. Run-once + cache strategy (tee to `.crew/cache/`) eliminates repeated 3-minute test suite runs. Typical verifier runtime: 40+ min → ~8 min.
45
- - **Transcript viewer: lazy-loaded** — DurableTranscriptViewer (658ms) only loaded when user runs `/crew transcript`.
46
-
47
- ### Security
48
-
49
- - **[HIGH] Path traversal in `handleImport`** — Bundle paths were accepted without containment validation. Arbitrary file read was possible via absolute paths. Fix: `isContained` check validates paths stay within `cwd`, `userCrewRoot`, or `projectCrewRoot`.
50
- - **[HIGH] Env variable leak in hooks** — Iteration hooks and post-checks passed the full `process.env` to user bash scripts, exposing API keys and tokens. Fix: minimal env with only `PATH`, `HOME`, `USER`, `LANG`.
51
- - **[HIGH] Ownership check on `handleForget`** — The most destructive action (recursive `fs.rmSync`) had no session ownership guard. Any Pi session could delete any other session's run data. Fix: `foreignRun` guard matching `handleCancel`/`handleRetry`.
52
- - **[MEDIUM] TOCTOU on Windows `O_NOFOLLOW=0`** On Windows where `O_NOFOLLOW` is unsupported (0), a symlink race between validation and write was possible. Fix: post-open `fstat`/`fstatSync` verification in both sync and async atomic-write paths.
53
- - **[MEDIUM] Ownership check on `handleCleanup`** — Worktree cleanup had no cross-session guard. Any session could clean up another session's worktrees. Fix: `foreignRun` guard added.
54
- - **[MEDIUM] `handleForget` scope detection** — Used `startsWith(userCrewRoot())` which could false-match `pi-crew-evil` against `pi-crew`. Fix: `startsWith(userCrewRoot() + path.sep)`.
55
- - **[MEDIUM] `isSafeToPrune` always used `projectCrewRoot`** — User-scoped runs could never be pruned, causing stale data accumulation. Fix: same scope detection as `handleForget`.
56
- - **[MEDIUM] `readJsonFile` swallowed all errors silently** Permission denied, corrupt JSON, and other errors were silently swallowed, preventing crash recovery. Fix: `logInternalError` for non-ENOENT/ENOTDIR errors.
57
- - **[LOW] TOCTOU in `atomic-write mkdirSync`** — Between `isSymlinkSafePath` check and `mkdirSync`, an attacker could replace a directory with a symlink. Mitigated by `O_EXCL` on subsequent file open.
58
- - **[LOW] `handlePrune` cross-session behavior documented** — Pruning all finished runs regardless of session is intentional maintenance behavior, now documented.
59
- - **[INFO] `handleExport` intentionally cross-session** — Read-only export deliberately allows cross-session access, documented with comment.
60
-
61
-
62
- ### Correctness
63
-
64
- - **Ghost run accumulation** — 73 deadletter runs were stuck as `queued` forever because their temp CWD directories had been cleaned by the OS. Fix: `collectRuns` now filters by CWD existence, `pruneUserLevelRuns` auto-cleans ghost runs.
65
- - **Double-close file descriptor in `readTailLines`** — Giant-line fallback was calling `closeSync(fd)` then falling through to `finally { closeSync(fd) }` (double close). Fix: sentinel `GiantLineFallbackError` class caught in outer `catch`.
66
- - **Race condition in lazy-load caches** — `ui()` and `handleTeamTool()` in `commands.ts` could trigger redundant parallel imports if multiple `/crew` commands fired before cache populated. Fix: promise-deduplication pattern (`_uiCachePromise` / `_handleTeamToolPromise`).
67
- - **`handlePrune` hook only fired for first run** Batch pruning fired `before_cleanup` hook for only the first run. Fix: fires once with `removedRunIds` in data payload.
68
- - **`maxTurns` parsing accepted invalid values** — `parseInt("0")` `0` (falsy `undefined`) was accidental; `parseInt("-1")` `-1` (truthy passed through). Fix: explicit `Number.isFinite(n) && n > 0` check in both parsing and runtime override.
69
- - **`GiantLineFallbackError` sentinel string**Using a magic string for control flow was fragile. Fix: dedicated error class.
70
- - **Tail reader UTF-8 corruption**Reading from middle of file could split a multibyte character at the boundary. Fix: search for first newline boundary before reading.
71
- - **Tail reader empty result on giant line** Single line >256KB with no newlines: `lines.shift()` removed ALL content. Fix: fallback to full file read when no newline found in tail chunk, with 2MB safety cap.
72
- - **Stale JSDoc in hooks** — Security notes still said "full inherited environment" after minimal env change. Fix: updated to "minimal environment (PATH, HOME, USER, LANG)".
73
- - **`readJsonFile` redundant `existsSync` check** TOCTOU guard was redundant since `catch` handles ENOENT anyway. Fix: removed redundant check.
74
-
75
- ### Architecture
76
-
77
- - **`maxTurns` agent frontmatter** — New `maxTurns` field in `AgentConfig` (parsed from `agents/*.md` frontmatter) enforces per-agent turn limits at runtime. Verifier uses `maxTurns: 6` for efficiency.
78
- - **Verifier efficiency contract** — Complete rewrite of `agents/verifier.md`: 6-turn budget, run-once-cache strategy, targeted verification only, PASS/FAIL with evidence format.
79
- - **Sensitive path detection expanded** — Added `.config/gh` (GitHub CLI tokens), `jwt.json`, `session.cookie`, `.token` to detection patterns.
80
- - **Manifest goal sanitization** — `manifest.goal` in compaction summaries now collapsed (newlines → spaces) and truncated (500 chars) to prevent markdown injection.
81
- - **`utils/atomic-write.ts` dead code removed** — This module had zero production imports; tests were testing the wrong (unsafe) version. Deleted; tests rewritten against `src/state/atomic-write.ts`.
82
- - **Test coverage** — 17 new tests: `atomic-write.test.ts` (9 tests), `compaction-summary.test.ts` (8 tests, all pass).
83
-
84
- ### Research (not in package)
85
-
86
- - `docs/research/CAVEMAN-DEEP-RESEARCH.md` Caveman output contract patterns, role-based compression, verification framework.
87
- - `docs/research/LIVE-SESSION-PRODUCTION-READY-PLAN.md`9-phase plan for live-session reliability, all phases implemented.
88
-
89
- ### Contributors
90
-
91
- - 6 rounds of structured code review across 3 sessions
92
- - 30+ issues found and fixed (0 CRITICAL remaining, 0 HIGH remaining)
93
-
94
-
95
- ## 0.1.51
96
-
97
- ### Fixed
98
-
99
- - **Stale foreground spinner** — Working message/spinner now always clears when foreground run completes, even if session generation changed during the run.
100
- - **Completed-run widget grace period (8s)** — Runs that just completed stay visible in the widget for 8 seconds so users can see results before the widget hides.
101
-
102
- ## 0.1.50
103
-
104
- ### Fixed
105
-
106
- - **Parallel execution** — Raised default concurrency (implementation 2→4, review 2→3, research 2→3). Fixed `defaultWorkflowConcurrency()` routing bug where review/default both returned the implementation value.
107
- - **Planner prompt** — Added explicit "MAXIMIZE PARALLELISM" instruction with examples, so planner models produce parallel phases instead of sequential.
108
- - **20 review findings** — 6 CRITICAL (optional chaining crash, env leak, path redaction, RPC validation, hook JSON safety, temp dir security), 6 HIGH (unsafe casts, busy-wait CPU, timestamp merge guard, prompt injection delimiter, binary validation), 5 MEDIUM, 3 LOW.
109
- - **Widget flicker** Pinned preloaded manifests to widget component model to prevent manifestCache TTL race. Scoped snapshotCache invalidation to specific run instead of clearing all.
110
- - **Delegation policy** Rewritten as mandatory decision table with concrete thresholds (>3 files read or >2 files edit = must delegate). Injected into every session via system prompt.
111
- - **ignoreMethod option** — New config to write ignore entries to `.git/info/exclude` instead of `.gitignore` (Closes #2).
112
-
113
- ## 0.1.49
114
-
115
- ### Added
116
-
117
- - **Caveman output contracts** — Role-based output validation framework with `output-validator.ts`: regex-based format checking for explorer, executor, reviewer, verifier, security-reviewer roles. Non-blocking: validation failures emit `task.output_validation` events + set `needs_attention` but do NOT fail the task.
118
- - **Prose compressor** — `prose-compressor.ts` compresses verbose worker output for token-sensitive contexts (role-aware compression levels).
119
- - **Sensitive paths** — Word-boundary-aware token matching in `sensitive-paths.ts` prevents false positives (e.g. `secretary.ts` no longer flagged as `secret`).
120
- - **Symlink-safe I/O** — Artifact and shared output paths reject traversal attempts and symlinked root escapes.
121
- - **Output contract eval harness** — 19 unit tests covering three-arm evaluation (contract vs terse vs baseline), format compliance, token savings, regex safety (no `/g` lastIndex state leak).
122
-
123
- ### Changed
124
-
125
- - **Delegation policy rewritten** — Replaced advisory "you should consider" text with a mandatory decision table: concrete thresholds (>3 files read OR >2 files edit = MUST delegate), explicit YES/NO cases per task type, conflict-safe task splitting rules. Injected into every session via `before_agent_start` hook.
126
- - **Powerbar dedup** — `powerbar-publisher.ts` now skips `powerbar:update` emit when segment data is unchanged (inspired by pi-powerbar's `segmentEquals` pattern). Combined with existing 200ms coalescing for minimal unnecessary renders.
127
- - **UI responsiveness** — `task-runner.ts` now emits `streamBridge` event immediately after `task.started`, giving the widget agent status within ~100ms instead of 2-5s (child process startup delay).
128
- - **"spawning…" indicator** — Widget shows "spawning…" for agents < 5 seconds old with no tool activity, distinguishing from "thinking…" for long-running agents.
129
-
130
- ### Fixed
131
-
132
- - **H1: MCP proxy fallback** — `mcp-proxy.ts` now falls back to `enableMcp: true` when `createMcpProxyTools()` returns empty, so child sessions self-discover MCP instead of losing all access.
133
- - **H2: parallel-utils throw undefined** — `mapConcurrent` now throws the actual error instead of `throw undefined`.
134
- - **H3: Semaphore over-release** — `release()` guard against `#current > 0` prevents over-release corruption.
135
- - **M1: IRC tool TOCTOU** — `irc-tool.ts` wraps `sendIrcMessage`/`broadcastIrcMessage` in try-catch.
136
- - **M2: submit-result ordering** — Builds response string before calling `onYield`, wrapped in try-catch.
137
- - **M3: Sensitive paths false positives** — Word-boundary-aware token matching replaces substring matching.
138
- - **M4: atomic-write sleepSync** — Added WARNING comment about blocking main thread.
139
- - **M7: URL regex trailing punctuation** — Precise regex excludes trailing punctuation from URL matches.
140
- - **L1: parent-guard comment** — Corrected misleading comment about `process.kill` on Windows.
141
- - **Yield handler DRY** — Extracted `extractYieldDataFromArgs` helper, `isObjectRecord`/`isStringRecord` type guards, safe `find()` pattern.
142
- - **Event-log-rotation TOCTOU** — `compactEventLog` re-reads file after initial read to merge concurrent appends; `readEvents` skips corrupt JSON lines.
143
- - **Ghost agent dedup** — Fixed duplicate agent records in `crew-agent-records` after crash recovery.
144
-
145
- ### Research
146
-
147
- - `docs/research/AGENT-EXECUTION-ARCHITECTURE.md` — Detailed comparison of 3 execution modes (oh-my-pi in-process, pi-crew child-process, pi-crew live-session).
148
- - `docs/research/UI-RESPONSIVENESS-AUDIT.md` — Root cause analysis for 2-5s agent spawn visibility delay, 5 proposed fixes with priority matrix.
149
- - `docs/research/DEEP-RESEARCH-PI-POWERBAR.md` — Deep analysis of pi-powerbar architecture (producer/consumer pattern, rendering, settings, comparison with pi-crew's powerbar publisher).
150
-
151
- ## 0.1.48
152
-
153
- ### Added
154
-
155
- - **Yield-based completion contract** — Workers can call `submit_result` tool to return structured results; task-runner warns on workers that don't yield.
156
- - **Typed event channels** — `RunEventBus` supports 5 channels (`worker:progress`, `worker:lifecycle`, `worker:stream`, `run:state`, `ui:invalidate`) with `onChannel`/`onChannelForRun` subscriptions and auto-classification.
157
- - **Human-readable task names** — `generateTaskName()` produces AdjectiveNoun names (14,400 combinations); `displayName` field on `TeamTaskState`.
158
- - **SubprocessToolRegistry** — Extensible tool event handling with `register`/`extractAll`/`shouldTerminate` pattern; wired into event-stream-bridge.
159
- - **Event log rotation/compaction** — Auto-compacts event logs over 5MB/50k events, keeping last 1000 events; atomic file replacement.
160
- - **Incremental JSONL reader** — `readLinesSince`/`readJsonlSince` for seek-based file reading; wired into `readEventsCursor` with `fromByteOffset`.
161
-
162
- ### Fixed
163
-
164
- - Fixed `readBlob`/`readBlobMetadata` crash on missing files — now returns `undefined`.
165
- - Fixed `readSseJson` crash on non-JSON SSE data now skips malformed events.
166
- - Fixed wrong value `"long_running"` `"active_long_running"` in agent-control.
167
- - Fixed `consecutiveFailures` type bypass added to `CrewAgentProgress` interface.
168
- - Fixed `streamBridge.dispose()` memory leak — now in try/finally.
169
- - Fixed blob-store redundant ternary `typeof x === "string" ? x : x`.
170
- - Fixed team-runner non-null assertion on potentially empty array.
171
- - Fixed event-log silent error swallowing — now logs via `logInternalError`.
172
- - Fixed team-tool switch case indentation.
173
- - Removed dead code `expandIcon` in agent-management-overlay.
174
-
175
- ### Changed
176
-
177
- - Moved 6 research .md files from repo root to `docs/research/`.
178
- - `discoverAgents`/`discoverSkills` silent catches now log via `logInternalError`.
179
- - `executeHook` accumulates non-blocking diagnostics instead of short-circuiting.
180
- - `CancellationToken.heartbeat` wired into `collectRuns` and `pruneFinishedRuns`.
181
- - `CapabilitySource` extended with `"git"` to match `ResourceSource`.
182
-
183
- ## 0.1.47
184
-
185
- ### Added
186
-
187
- - **Typed hook lifecycle** 8 of 9 hooks wired: `before_run_start`, `before_task_start`, `task_result`, `before_cancel`, `before_forget`, `before_cleanup`, `before_publish`, `run_recovery`. Hooks are opt-in, blocking/non-blocking, with audit events.
188
- - **Event-first UI bus** — `RunEventBus` emits on every `appendEvent` call; dashboard, crew widget, sidebar, and snapshot cache subscribe for event-driven invalidation instead of polling.
189
- - **Shared scan cache** — `SharedScanCache` caches manifest reads and active-run entries with TTL, mtime/size invalidation, and LRU eviction.
190
- - **Capability inventory** `buildCapabilityInventory()` enumerates teams, workflows, agents, and skills with stable `kind:name` IDs; supports policy disable and shadowing detection.
191
- - **Skills in capability inventory** — `discoverSkills()` reads SKILL.md frontmatter; skills appear with kind=`skill` and source=`package`/`project`.
192
- - **Mailbox kind-separated breakdown** — `RunUiMailbox` tracks `steerUnread`/`followUpUnread`/`responseUnread`/`messageUnread`; mailbox pane shows urgency indicators.
193
- - **Run recovery hook** — `applyRecoveryPlan` fires `run_recovery` hook; blocked recovery emits `crew.run.recovery_blocked` event.
194
- - **Synthetic tool cancellation evidence** — Cancelled in-flight tasks receive `tool`-level terminal evidence alongside `worker`-level.
195
- - **CancellationToken wired into production loops** `collectRuns` and `pruneFinishedRuns` use `CancellationToken.heartbeat(stage)` for progress diagnostics.
196
- - **Blob artifact store** SHA-256 content-addressed storage with metadata sidecars.
197
- - **Run event provenance** Event metadata includes `parentEventId`, `attemptId`, `branchId`, `causationId`, `correlationId`.
198
- - **Control channel reservation** `ControlReservation` before worker spawn with deterministic `controllerId`.
199
- - **Release smoke test** `npm run smoke:release` automates tarball install + version consistency check.
200
- - **Width-safety tests** — Crew widget rendering verified at widths 1/40/200/empty/multiple.
201
-
202
- ### Changed
203
-
204
- - `handleCancel`, `handleForget`, `handleCleanup`, `handlePrune`, `handleExport` converted to async for hook execution.
205
- - `before_cancel`/`before_forget`/`before_cleanup` hooks can block their respective operations.
206
- - `before_publish` hook fires before run export.
207
- - `task_result` hook fires before `task.completed`/`task.failed` events.
208
- - Dashboard, widget, and sidebar auto-invalidate on `RunEventBus` events.
209
-
210
- ## 0.1.45
211
-
212
- ### Added
213
-
214
- - Added `/team-respond <runId> <taskId|--all> <message>` for replying to interactive/waiting tasks from slash commands.
215
- - Added runtime-extensible run ownership metadata (`ownerSessionId`) so destructive cancellation can be guarded by session ownership.
216
- - Added async manifest and crew-agent readers used by snapshot preloading.
217
-
218
- ### Fixed
219
-
220
- - Fixed `respond` action to validate waiting-only tasks, write replies to task mailboxes, and reject non-waiting task responses instead of reporting false success.
221
- - Fixed `cancel` ownership handling so runs created by another Pi session are not cancelled when `ownerSessionId` mismatches.
222
- - Fixed `DeliveryCoordinator` to requeue payloads when active delivery callbacks throw, and to drop queued payloads from stale session generations.
223
- - Fixed `OverflowRecoveryTracker` collisions by keying recovery state with `runId + taskId`, plus cleanup of terminal recovery states.
224
- - Fixed stale reconciliation false positives for foreground/live no-PID runs by preserving runs with recent task heartbeat or agent progress evidence.
225
- - Fixed UI waiting counts: snapshots, powerbar, and crew widget now include `waiting` tasks/agents where appropriate.
226
- - Fixed team tool `cwd` override handling so valid overrides are applied consistently and invalid overrides return a clear error.
227
- - Fixed session history pollution by only appending `crew:run-started` after a successful run with a real `runId`.
228
- - Fixed async snapshot preload path to avoid synchronous manifest/agent reads.
229
- - Fixed mailbox count semantics for large mailbox files by marking tail-derived counts as approximate when the file is larger than the bounded tail window.
230
- - Fixed auto-retry freshness by reloading manifest/tasks before retry attempts and fallback task runs.
231
-
232
- ### Changed
233
-
234
- - Wired session snapshots into `session_before_switch` logging so active runs and pending deliveries are captured before session transitions.
235
- - Dashboard mailbox pane now indicates when counts are approximate tail-derived values.
236
-
237
- ## 0.1.43
238
-
239
- ### Added
240
-
241
- - `/team-settings` command: view and manage all pi-crew config from Pi CLI (`list`, `get`, `set`, `unset`, `path`, `scope`).
242
- - `addTranslations(locale, bundle)` and `listLocales()` for runtime-extensible i18n.
243
-
244
- ### Fixed
245
-
246
- - **UI freeze crash**: replaced `setInterval` with recursive `setTimeout` in `RenderScheduler` and `HeartbeatWatcher` to prevent timer storms when renders exceed the interval.
247
- - **Growing-file I/O bottleneck**: `safeRecentEvents`, `readMailboxCounts`, `readGroupJoinMailbox` now use tail-reading (last 32 KB) instead of reading entire `.jsonl` files that grow unbounded over long runs.
248
- - **Snapshot cache TTL** increased from 250 ms to 500 ms, halving unnecessary I/O.
249
- - **Heartbeat watcher memory leak**: stale keys are now cleaned after 10 minutes of inactivity instead of being held forever.
250
- - **Dashboard crash guard**: `render()` is wrapped in `try/catch` with a fallback error display.
251
- - **Dashboard selected-index mismatch**: reset `selected` to 0 when the selected run disappears from the manifest cache.
252
- - **`live-run-sidebar.ts` crash**: fixed missing optional chaining on `agent.progress?.recentOutput?.at(-1)`.
253
- - **`signatureFor` crash**: `JSON.stringify` in snapshot cache wrapped in `try/catch` with a timestamp fallback.
254
- - **Render scheduler timer leak**: added a `disposed` guard after `schedule()` to prevent orphaned timers.
255
- - **Render scheduler loop guard**: capped at 5 iterations per `flush()` to prevent infinite loops when `render()` re-enters `flush()`.
256
- - **`powerbar-publisher.ts`**: replaced `.filter().length` with `.reduce()` counting to avoid temporary array allocations.
257
-
258
- ### Changed
259
-
260
- - **i18n module hardened**: locale validated at runtime (not hardcoded union type), `currentLocale` reset on dispose, missing-key guard (`fallback[key] ?? key`), `__test__resetI18n()` helper.
261
-
262
- ## 0.1.42
263
-
264
- ### Fixed
265
-
266
- - Reduced atomic-write rename retries from 20 to 5 and added busy-wait fallback for `Atomics.wait` to avoid event-loop stalls on Windows with aggressive file-locking.
267
- - Applied the same `sleepSync` fallback pattern to `locks.ts` for consistent lock-acquisition resilience.
268
- - Removed dead `findReadyTask` function in team-runner.
269
- - Eliminated a redundant `refreshTaskGraphQueues` O(n) call per batch iteration by reusing the already-computed `taskGraphSnapshot` for ready-task selection.
270
- - Expanded `appendTaskAttentionEvent` dedup window from 100 to 200 events and switched to a computed dedup key.
271
-
272
- ### Changed
273
-
274
- - Extended `MUTATING_TOOLS` set in completion guard with `replace_in_file`, `insert`, `delete_files`, `create_file`, `overwrite`, and `patch`.
275
- - Extended `MUTATING_COMMANDS` regex with `sed -i`, `tee`, `wget -O`, and `curl -o` patterns.
276
- - Reordered bash-command mutation check so mutating patterns (`sed -i`) take priority over read-only patterns (`sed`).
277
- - Unknown bash commands that don't match the read-only list are now treated as potentially mutating (conservative default).
278
-
279
- ### Hardened
280
-
281
- - Replaced `timer.unref?.()` with `timer.unref()` in `SubagentManager` blocked-poll and stuck-notify timers.
282
- - Added session-liveness guard to `notifyOperator` fallback so it won't attempt `sendFollowUp` after extension cleanup.
283
-
284
- ## 0.1.41
285
-
286
- ### Added
287
-
288
- - Added strict-provider-friendly team tool schema shapes and config schema coverage for result delivery controls.
289
- - Added resilient result watcher fallback polling for resource-limit watch failures and partial JSON retry handling.
290
- - Added `runtime.completionMutationGuard` (`off`/`warn`/`fail`) with structured `task.attention` events when implementation-style workers complete without observed mutations.
291
- - Added group-join mailbox delivery metadata, request-id dedupe, ack observability, timeout events, and dashboard/status visibility.
292
- - Expanded `team doctor` and `team status` with schema, async/result delivery, worktree/readiness, attention, transcript, and group-join diagnostics.
293
-
294
- ### Fixed
295
-
296
- - Recovered adaptive implementation planner output when compaction truncates the end marker but complete phase objects are still present.
297
-
298
- ## 0.1.40
299
-
300
- ### Added
301
-
302
- - Added owner-session generation guards for background subagents, async run notifications, result watchers, and live-session callbacks so stale sessions do not receive completions.
303
- - Added `runtime.requirePlanApproval` with approve/cancel API support to gate mutating adaptive implementation tasks behind an explicit planner artifact approval.
304
- - Added shared secret redaction for event logs, mailbox persistence, artifacts, JSONL streams, agent records, notifications, metrics, and diagnostics.
305
-
306
- ### Changed
307
-
308
- - Project-local agents, teams, and workflows can no longer shadow builtin or user resources with the same name.
309
- - Project-level sensitive config such as worker execution, runtime mode, autonomy, agent overrides, worktree setup hooks, and OTLP headers is ignored with warnings unless configured in trusted user scope.
310
-
311
- ### Fixed
312
-
313
- - Fixed lost async completion notifications after auto-compaction/session restart by continuing to track active runs across notifier restarts.
314
- - Fixed stale background subagent wakeups after session switch/shutdown while preserving terminal results for explicit joins.
315
- - Fixed resume bypasses in plan approval by re-gating persisted mutating adaptive tasks when approval state is missing or pending.
316
- - Restricted plan approval and cancellation to non-read-only roles and rejected cancel/approve after the approval state is no longer pending.
317
-
318
- ## 0.1.39
319
-
320
- ### Fixed
321
-
322
- - Made CI test execution deterministic across Node 22/macOS/Linux/Windows by running Node test files sequentially to avoid cross-file environment races.
323
- - Fixed live-agent durable control symlink-file rejection to return an API error instead of throwing from the tool handler.
324
- - Tightened symlink artifact security assertions so tests check leaked file contents rather than safe metadata paths.
325
-
326
- ## 0.1.38
327
-
328
- ### Added
329
-
330
- - Added parent-session wake-up for completed background subagents so the main agent automatically joins results and continues the original task.
331
- - Added stronger resource/parser coverage for team role metadata and workflow task-body headings.
332
-
333
- ### Changed
334
-
335
- - Clarified the current default worker execution model and local disable controls in project guidance.
336
- - Aligned config schema constraints for UI settings with the published package schema.
337
-
338
- ### Fixed
339
-
340
- - Hardened subagent abort handling so stopped records are persisted and late runner completion does not regress them to completed/error.
341
- - Fixed blocked subagent result joins, blocked duration persistence, and final wake-up after blocked runs resume to terminal status.
342
- - Blocked path traversal through workflow shared artifacts, run ids, imported run bundles, task-scoped mailbox APIs, agent runtime files, and untrusted artifact/transcript paths; hardened reads/writes with realpath containment to prevent symlink escapes; bound live-agent control to the selected run.
343
- - Documented actual project resource paths for `.crew/` and `.pi/teams/` layouts.
344
-
345
- ## 0.1.31
346
-
347
- ### Fixed
348
-
349
- - Added required Agent Skills frontmatter (`name` and `description`) to built-in coding skills so Pi loads them without conflicts.
350
- - Tightened built-in skill package coverage to require standards-compliant frontmatter.
351
-
352
- ## 0.1.30
353
-
354
- ### Added
355
-
356
- - Added Phase 6 async hardening: jiti loader resolution/fail-fast, async startup marker files, and early background-runner exit detection.
357
- - Added worker concurrency hard cap with explicit `limits.allowUnboundedConcurrency` opt-out and observability event.
358
- - Added persisted model routing metadata on tasks and agent records: requested model, resolved model, fallback chain, reason, and used attempt.
359
- - Added self-contained architecture/runtime-flow docs and five built-in coding skills.
360
- - Added mailbox replay on resume for pending inbox messages, including task-scoped messages.
361
- - Added task resume checkpoints and recovery for crash-after-final-stdout and crash-after-artifact-write child-process tasks.
362
- - Added async notifier detection for quiet dead background runners with durable `async.died` events.
363
- - Added adaptive planner repair for malformed JSON, oversized task plans, and common role aliases before blocking implementation runs.
364
- - Added package snapshot coverage for Phase 6 docs, skills, Pi manifest entries, and the runtime `jiti` dependency.
365
- - Added `src/subagents/*` consolidation entrypoints for child spawning, background runner commands, and subagent manager APIs.
366
- - Split `team-tool.ts` actions into focused status, inspect, lifecycle, cancel, and plan modules while preserving public action names.
367
- - Split `register.ts` lifecycle wiring into command, team-tool, subagent-tool, and artifact-cleanup registration modules.
368
- - Added async restart recovery integration smoke coverage for stale background pids.
369
- - Added explicit recursive subagent depth and read-only role spawn-denial tests.
370
-
371
- ### Changed
372
-
373
- - Async background runs now use an explicit jiti loader path and expose startup markers for recovery/health checks.
374
- - Active batch selection now caps excessive user concurrency by default to protect local machines.
375
- - Resume now emits mailbox replay metadata before restarting queued work.
376
- - Child-process tasks now persist checkpoint phases (`started`, `child-spawned`, `child-stdout-final`, `artifact-written`) during execution.
377
- - Split `task-runner.ts` prompt/progress/state/live helpers into focused modules while keeping `runTeamTask` as the public entrypoint.
378
- - Moved live-session access behind `src/subagents/live/*` and dynamic task-runner imports so default child-process flow does not eagerly load live runtime code.
379
-
380
- ### Fixed
381
-
382
- - Background runner startup failures are reported earlier instead of silently leaving queued/running manifests stale.
383
-
384
- ### Release prep notes
385
-
386
- - Suggested next release grouping: `0.1.30` for Phase 6 runtime hardening, resume recovery, model observability, docs/skills, and internal refactors.
387
- - Gate run locally: `npm run typecheck`, `npm test`, and `npm pack --dry-run`.
388
- - No breaking public API changes: tool actions, slash commands, config schema, and package name remain stable.
389
-
390
- ## 0.1.29
391
-
392
- - Republished the child worker response timeout fix as a fresh npm version.
393
-
394
- ## 0.1.28
395
-
396
- - Fixed child-process workers being terminated after only 15 seconds of quiet provider/tool time by increasing the default response watchdog to five minutes and clarifying the timeout error message.
397
-
398
- ## 0.1.20
399
-
400
- - Reworked the implementation workflow into an adaptive planner-led orchestration flow that decides the number, roles, and phases of subagents from the task instead of using a fixed fanout template.
401
- - Added dynamic adaptive task injection, persisted adaptive task metadata, and resume reconstruction for planner-selected subagent steps.
402
- - Block implementation runs when the planner does not produce a valid adaptive plan, including missing/unreadable planner artifacts and malformed/oversized plans.
403
- - Added tests for adaptive plan parsing, dynamic batch fanout, invalid-plan blocking, writer-role support, and adaptive resume recovery.
404
- - Hardened subagent/runtime fixes from post-0.1.19 review: env-isolated depth tests, foreground failure status updates, generic tool conflict aliases, and max_turns propagation.
405
-
406
- ## 0.1.19
407
-
408
- - Added Claude-style `Agent`, `get_subagent_result`, and `steer_subagent` tools backed by pi-crew's durable worker runtime, plus conflict-safe `crew_agent`, `crew_agent_result`, and `crew_agent_steer` aliases.
409
- - Added a durable subagent manager with background queueing, completion notifications, result joins, session-bound cleanup, and direct single-agent runs via `team run agent=...`.
410
- - Disabled risky auto-opening of the right sidebar by default, added foreground completion notifications, and reduced duplicate widget/sidebar UI.
411
- - Added progress coalescing and workflow concurrency helpers to keep foreground sessions responsive during busy worker output.
412
- - Fixed live-session runs being classified as scaffold when workers are enabled and hardened session switch/shutdown cleanup for foreground child processes.
413
-
414
- ## 0.1.18
415
-
416
- - Added a built-in `parallel-research` team/workflow for map-reduce style source audits with dynamic `Source/pi-*` fanout and parallel explorer shards.
417
- - Made the live right sidebar the default foreground UI: active foreground runs auto-open a top-right live sidebar when the terminal is wide enough.
418
- - Added live sidebar sections for active agents, waiting tasks, completed agents, task graph, model, tool, and token/usage details.
419
- - Stopped materializing queued dependency tasks as child-process agents; status now separates active agents, waiting tasks, and completed agents.
420
- - Added workflow-aware default concurrency so research/parallel-research can use ready parallel work instead of always running one worker.
421
- - Dropped user/system prompt messages from child event persistence to avoid prompt/context leakage in agent event logs.
422
- - Tightened child event compaction with separate assistant/tool input/tool result caps and improved powerbar active/waiting/model/token summaries.
423
-
424
- ## 0.1.17
425
-
426
- - Fixed terminal/completed workers being incorrectly escalated as stale heartbeat blockers after all tasks completed.
427
- - Cleaned child-process result extraction so result artifacts prefer final assistant output and no longer include worker prompt/context.
428
- - Made `/team-dashboard` visibly render as a top-right sidebar by default with explicit right-sidebar title text.
429
- - Added per-subagent model and usage fields to agent records, status output, and dashboard fallbacks so model/token totals stay visible while and after workers run.
430
-
431
- ## 0.1.16
432
-
433
- - Added right-side `/team-dashboard` placement with model, token, and tool detail rows for subagents.
434
- - Added UI config for dashboard placement/width and model/token/tool visibility.
435
- - Foreground child-process runs now continue without blocking the interactive chat and remain tied to session shutdown.
436
- - Child-process observability now drops noisy `message_update`/encrypted thinking deltas and stores compact events to prevent massive JSONL/output logs from freezing sessions.
437
- - Cancel now syncs agent records and writes a foreground interrupt request so queued/running agents stop appearing stale.
438
-
439
- ## 0.1.15
440
-
441
- - Child-process model selection now uses Pi-configured/available models and auto-discovers provider/model entries from Pi settings/models config.
442
- - Added configured-model fallback chains for worker runs instead of forcing builtin provider hints.
443
- - Fixed skipped task agent records so they no longer appear queued.
444
-
445
- ## 0.1.0
446
-
447
- - Initial scaffold for `pi-crew`.
448
- - Added Pi package manifest, extension entry, minimal team tool, slash commands, builtin resources, and documentation placeholders.
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Added
6
+
7
+ - **Streaming progress for `team` and `Agent` foreground tool calls** — The Pi tool widget previously showed only the tool label "Agent" / "Team" while a foreground run was executing, then dumped the full result at completion. Both tools now wire the `onUpdate` callback and stream a compact 3-4 line progress block once per second (status, elapsed, active agent role, current tool, latest output snippet). Background subagents are unchanged. Files: `src/ui/tool-progress-formatter.ts` (new), `src/extension/registration/subagent-tools.ts`, `src/extension/registration/team-tool.ts`.
8
+
9
+ ### Fixed
10
+
11
+ - **Agent "stopped" + "No output." without explanation** — `SubagentManager.markStopped()` and the `start()` catch block previously set `status: "stopped"` but never wrote a reason into `record.error`, so the user only saw the generic "No output." fallback. Fix: `markStopped(record, reason?)` and `abortAll(reason?)` now persist the abort reason (e.g. "Session switching — foreground subagents cancelled."), and the `Agent` tool foreground result chain includes `record.error` before the "No output." fallback. Files: `src/runtime/subagent-manager.ts`, `src/extension/register.ts`, `src/extension/registration/subagent-tools.ts`.
12
+ - **Foreground crew_agent runs now use startForegroundRun** — Previously the `crew_agent` / `Agent` tool's runner did not pass `startForegroundRun` to `handleTeamTool`, causing it to use the blocking `executeTeamRun` path instead of the non-blocking foreground run path. The blocking path was vulnerable to Pi tool signal aborts (user cancel, session switch), causing premature "stopped" results. The runner now receives `startForegroundRun` from the registration layer, so `handleRun` starts the team run as a non-blocking foreground run and returns immediately, while the SubagentManager polls `pollRunToTerminal` until completion. This mirrors the `team` tool's foreground path and avoids signal-abort race conditions. File: `src/extension/registration/subagent-tools.ts`, `src/extension/register.ts`.
13
+ - **Pre-aborted signal detection** — Added a diagnostic check at the top of the `crew_agent` `execute` function: if the Pi tool signal is already aborted before the agent even starts, the tool returns an explicit error message instead of spawning a doomed subagent that would show "stopped + No output." File: `src/extension/registration/subagent-tools.ts`.
14
+
15
+ ### Tests
16
+
17
+ - Added `test/unit/tool-progress-formatter.test.ts` (5 cases covering empty run, run-only header, active agent with tool, long-output trimming + usage tokens fallback, spawn error).
18
+
19
+ ---
20
+
21
+ ## 0.2.3 — Bug Fixes & Hardening (2026-05-12)
22
+
23
+ ### Security
24
+
25
+ - **[MEDIUM] Event log append concurrency** — `appendFileSync` on Windows is not atomic; concurrent parent + background-runner writes could interleave JSONL lines. Fix: cross-process `withEventLogLockSync` using atomic `mkdirSync` + stale-lock detection via owner PID.
26
+ - **[MEDIUM] Subagent path traversal** — `persistedSubagentPath(cwd, id)` did not validate `id` before joining into a file path. Fix: `isValidSubagentId` regex guard (`^[a-z0-9_]+$`, max 128 chars).
27
+ - **[LOW] PEM redaction unbounded scan** — `PEM_PRIVATE_KEY_PATTERN` used `\s\S]*?` without length limit, causing full-file scan on truncated input. Fix: capped to 65,536 characters.
28
+ - **[LOW] Sleep utility `require()` in ESM** — `sleep.ts` used `require("node:child_process")` inside an ES module. Fix: top-level ESM `import { execFileSync }`.
29
+
30
+ ### Correctness
31
+
32
+ - **Async lock fail-fast** — `acquireLockWithRetryAsync` previously waited the full deadline (~60 s) when an active (non-stale) lock existed. Fix: throw immediately, matching sync behavior.
33
+ - **Atomic-write sync parity** — Async `atomicWriteFileAsync` had a "matches" fallback (read existing, compare content) for race conditions; sync path lacked it. Fix: added identical fallback to sync.
34
+ - **Sequence cache leak** — `sequenceCache` was an unbounded Map. Fix: `MAX_SEQUENCE_CACHE_ENTRIES = 256` with oldest-entry eviction.
35
+ - **Iteration hooks / post-checks env inconsistency** — `runSetupHook` used `sanitizeEnvSecrets(..., { allowList })` but `runIterationHook` and `runPostCheck` used hard-coded env whitelists. Fix: unified all three to `sanitizeEnvSecrets` with the same allow-list (includes Windows vars: `USERPROFILE`, `TEMP`, `ComSpec`, `SystemRoot`).
36
+ - **Worktree error parsing locale-dependent** — `git worktree add` error messages parsed with English regexes but `git()` helper did not force locale. Fix: `LANG: "C"`, `LC_ALL: "C"` injected into all `git()` calls in `worktree-manager.ts` and `cleanup.ts`.
37
+ - **Event log lock stale-detect** — `withEventLogLockSync` previously had no stale-lock recovery and always `rmdirSync`ed in `finally` even when lock was never acquired. Fix: PID-based stale detection + conditional cleanup only on `acquired=true`.
38
+
39
+ ### Portability
40
+
41
+ - **Windows `.cmd/.bat` spawn safety** — Node ≥ 20 CVE-2024-27980 blocks direct `.cmd/.bat` spawn. Fix: `.cmd`/`.bat` scripts on Windows now run via `cmd.exe /d /s /c scriptPath`.
42
+ - **Git Bash fallback on Windows** — `resolveShellForScript` now prefers Git Bash (`bash.exe` from `Git\bin`) when available, falling back to PowerShell/cmd only when absent.
43
+ - **Jiti loader resolution for hoisted installs** — `resolveJitiRegisterPath` used hard-coded `../../` candidates that failed when pi-crew was installed via local path or in a hoisted monorepo. Fix: ancestor walk upward from `packageRoot` plus fallback candidates `register.mjs` and `dist/register.mjs`.
44
+
45
+ ### Tests
46
+
47
+ - Added `test/unit/worktree-manager.test.ts` (branch recovery, reuse, clean leader, file node_modules skip).
48
+ - Added `test/unit/artifact-store.test.ts` (hash integrity, path traversal, nested dirs).
49
+ - Added `test/unit/locks-race.test.ts` tests (stale lock recovery sync+async, active lock fail-fast).
50
+ - Added `test/unit/redaction-transcript-roundtrip.test.ts`.
51
+ - Added `test/unit/env-filter.test.ts` and `test/unit/resolve-shell.test.ts`.
52
+ - Added `scripts/check-lazy-imports.mjs` with `npm run check:lazy-imports` CI gate.
53
+
54
+ ---
55
+
56
+ ## 0.2.0Security & Performance Hardening
57
+
58
+ ### Performance
59
+
60
+ - **Extension registration: 72% faster** — Lazy-loaded the entire runtime chain (team-tool, team-runner, runtime-resolver, etc.) from `register.ts`. Pi cold-start: 3,200ms → 780ms.
61
+ - **Commands UI: 65% faster** — Lazy-loaded RunDashboard (288ms), DurableTextViewer (658ms), and 5 overlay components that were statically imported but only used on demand.
62
+ - **Verifier: 80% faster** — 6-turn budget enforced at runtime via `maxTurns` agent config. Run-once + cache strategy (tee to `.crew/cache/`) eliminates repeated 3-minute test suite runs. Typical verifier runtime: 40+ min → ~8 min.
63
+ - **Transcript viewer: lazy-loaded** — DurableTranscriptViewer (658ms) only loaded when user runs `/crew transcript`.
64
+
65
+ ### Security
66
+
67
+ - **[HIGH] Path traversal in `handleImport`** Bundle paths were accepted without containment validation. Arbitrary file read was possible via absolute paths. Fix: `isContained` check validates paths stay within `cwd`, `userCrewRoot`, or `projectCrewRoot`.
68
+ - **[HIGH] Env variable leak in hooks** — Iteration hooks and post-checks passed the full `process.env` to user bash scripts, exposing API keys and tokens. Fix: minimal env with only `PATH`, `HOME`, `USER`, `LANG`.
69
+ - **[HIGH] Ownership check on `handleForget`** The most destructive action (recursive `fs.rmSync`) had no session ownership guard. Any Pi session could delete any other session's run data. Fix: `foreignRun` guard matching `handleCancel`/`handleRetry`.
70
+ - **[MEDIUM] TOCTOU on Windows `O_NOFOLLOW=0`** On Windows where `O_NOFOLLOW` is unsupported (0), a symlink race between validation and write was possible. Fix: post-open `fstat`/`fstatSync` verification in both sync and async atomic-write paths.
71
+ - **[MEDIUM] Ownership check on `handleCleanup`**Worktree cleanup had no cross-session guard. Any session could clean up another session's worktrees. Fix: `foreignRun` guard added.
72
+ - **[MEDIUM] `handleForget` scope detection** — Used `startsWith(userCrewRoot())` which could false-match `pi-crew-evil` against `pi-crew`. Fix: `startsWith(userCrewRoot() + path.sep)`.
73
+ - **[MEDIUM] `isSafeToPrune` always used `projectCrewRoot`**User-scoped runs could never be pruned, causing stale data accumulation. Fix: same scope detection as `handleForget`.
74
+ - **[MEDIUM] `readJsonFile` swallowed all errors silently** — Permission denied, corrupt JSON, and other errors were silently swallowed, preventing crash recovery. Fix: `logInternalError` for non-ENOENT/ENOTDIR errors.
75
+ - **[LOW] TOCTOU in `atomic-write mkdirSync`** — Between `isSymlinkSafePath` check and `mkdirSync`, an attacker could replace a directory with a symlink. Mitigated by `O_EXCL` on subsequent file open.
76
+ - **[LOW] `handlePrune` cross-session behavior documented** — Pruning all finished runs regardless of session is intentional maintenance behavior, now documented.
77
+ - **[INFO] `handleExport` intentionally cross-session** Read-only export deliberately allows cross-session access, documented with comment.
78
+
79
+
80
+ ### Correctness
81
+
82
+ - **Ghost run accumulation** — 73 deadletter runs were stuck as `queued` forever because their temp CWD directories had been cleaned by the OS. Fix: `collectRuns` now filters by CWD existence, `pruneUserLevelRuns` auto-cleans ghost runs.
83
+ - **Double-close file descriptor in `readTailLines`** — Giant-line fallback was calling `closeSync(fd)` then falling through to `finally { closeSync(fd) }` (double close). Fix: sentinel `GiantLineFallbackError` class caught in outer `catch`.
84
+ - **Race condition in lazy-load caches** — `ui()` and `handleTeamTool()` in `commands.ts` could trigger redundant parallel imports if multiple `/crew` commands fired before cache populated. Fix: promise-deduplication pattern (`_uiCachePromise` / `_handleTeamToolPromise`).
85
+ - **`handlePrune` hook only fired for first run** — Batch pruning fired `before_cleanup` hook for only the first run. Fix: fires once with `removedRunIds` in data payload.
86
+ - **`maxTurns` parsing accepted invalid values** — `parseInt("0")` → `0` (falsy → `undefined`) was accidental; `parseInt("-1")` → `-1` (truthy → passed through). Fix: explicit `Number.isFinite(n) && n > 0` check in both parsing and runtime override.
87
+ - **`GiantLineFallbackError` sentinel string** Using a magic string for control flow was fragile. Fix: dedicated error class.
88
+ - **Tail reader UTF-8 corruption** — Reading from middle of file could split a multibyte character at the boundary. Fix: search for first newline boundary before reading.
89
+ - **Tail reader empty result on giant line** — Single line >256KB with no newlines: `lines.shift()` removed ALL content. Fix: fallback to full file read when no newline found in tail chunk, with 2MB safety cap.
90
+ - **Stale JSDoc in hooks** — Security notes still said "full inherited environment" after minimal env change. Fix: updated to "minimal environment (PATH, HOME, USER, LANG)".
91
+ - **`readJsonFile` redundant `existsSync` check** TOCTOU guard was redundant since `catch` handles ENOENT anyway. Fix: removed redundant check.
92
+
93
+ ### Architecture
94
+
95
+ - **`maxTurns` agent frontmatter** — New `maxTurns` field in `AgentConfig` (parsed from `agents/*.md` frontmatter) enforces per-agent turn limits at runtime. Verifier uses `maxTurns: 6` for efficiency.
96
+ - **Verifier efficiency contract** — Complete rewrite of `agents/verifier.md`: 6-turn budget, run-once-cache strategy, targeted verification only, PASS/FAIL with evidence format.
97
+ - **Sensitive path detection expanded** — Added `.config/gh` (GitHub CLI tokens), `jwt.json`, `session.cookie`, `.token` to detection patterns.
98
+ - **Manifest goal sanitization** — `manifest.goal` in compaction summaries now collapsed (newlines → spaces) and truncated (500 chars) to prevent markdown injection.
99
+ - **`utils/atomic-write.ts` dead code removed** — This module had zero production imports; tests were testing the wrong (unsafe) version. Deleted; tests rewritten against `src/state/atomic-write.ts`.
100
+ - **Test coverage** — 17 new tests: `atomic-write.test.ts` (9 tests), `compaction-summary.test.ts` (8 tests, all pass).
101
+
102
+ ### Research (not in package)
103
+
104
+ - `docs/research/CAVEMAN-DEEP-RESEARCH.md` — Caveman output contract patterns, role-based compression, verification framework.
105
+ - `docs/research/LIVE-SESSION-PRODUCTION-READY-PLAN.md` — 9-phase plan for live-session reliability, all phases implemented.
106
+
107
+ ### Contributors
108
+
109
+ - 6 rounds of structured code review across 3 sessions
110
+ - 30+ issues found and fixed (0 CRITICAL remaining, 0 HIGH remaining)
111
+
112
+
113
+ ## 0.1.51
114
+
115
+ ### Fixed
116
+
117
+ - **Stale foreground spinner** — Working message/spinner now always clears when foreground run completes, even if session generation changed during the run.
118
+ - **Completed-run widget grace period (8s)** — Runs that just completed stay visible in the widget for 8 seconds so users can see results before the widget hides.
119
+
120
+ ## 0.1.50
121
+
122
+ ### Fixed
123
+
124
+ - **Parallel execution** — Raised default concurrency (implementation 2→4, review 2→3, research 2→3). Fixed `defaultWorkflowConcurrency()` routing bug where review/default both returned the implementation value.
125
+ - **Planner prompt** — Added explicit "MAXIMIZE PARALLELISM" instruction with examples, so planner models produce parallel phases instead of sequential.
126
+ - **20 review findings** — 6 CRITICAL (optional chaining crash, env leak, path redaction, RPC validation, hook JSON safety, temp dir security), 6 HIGH (unsafe casts, busy-wait CPU, timestamp merge guard, prompt injection delimiter, binary validation), 5 MEDIUM, 3 LOW.
127
+ - **Widget flicker** — Pinned preloaded manifests to widget component model to prevent manifestCache TTL race. Scoped snapshotCache invalidation to specific run instead of clearing all.
128
+ - **Delegation policy** — Rewritten as mandatory decision table with concrete thresholds (>3 files read or >2 files edit = must delegate). Injected into every session via system prompt.
129
+ - **ignoreMethod option** — New config to write ignore entries to `.git/info/exclude` instead of `.gitignore` (Closes #2).
130
+
131
+ ## 0.1.49
132
+
133
+ ### Added
134
+
135
+ - **Caveman output contracts** — Role-based output validation framework with `output-validator.ts`: regex-based format checking for explorer, executor, reviewer, verifier, security-reviewer roles. Non-blocking: validation failures emit `task.output_validation` events + set `needs_attention` but do NOT fail the task.
136
+ - **Prose compressor** — `prose-compressor.ts` compresses verbose worker output for token-sensitive contexts (role-aware compression levels).
137
+ - **Sensitive paths** — Word-boundary-aware token matching in `sensitive-paths.ts` prevents false positives (e.g. `secretary.ts` no longer flagged as `secret`).
138
+ - **Symlink-safe I/O** — Artifact and shared output paths reject traversal attempts and symlinked root escapes.
139
+ - **Output contract eval harness** — 19 unit tests covering three-arm evaluation (contract vs terse vs baseline), format compliance, token savings, regex safety (no `/g` lastIndex state leak).
140
+
141
+ ### Changed
142
+
143
+ - **Delegation policy rewritten** — Replaced advisory "you should consider" text with a mandatory decision table: concrete thresholds (>3 files read OR >2 files edit = MUST delegate), explicit YES/NO cases per task type, conflict-safe task splitting rules. Injected into every session via `before_agent_start` hook.
144
+ - **Powerbar dedup** — `powerbar-publisher.ts` now skips `powerbar:update` emit when segment data is unchanged (inspired by pi-powerbar's `segmentEquals` pattern). Combined with existing 200ms coalescing for minimal unnecessary renders.
145
+ - **UI responsiveness** — `task-runner.ts` now emits `streamBridge` event immediately after `task.started`, giving the widget agent status within ~100ms instead of 2-5s (child process startup delay).
146
+ - **"spawning…" indicator** — Widget shows "spawning…" for agents < 5 seconds old with no tool activity, distinguishing from "thinking…" for long-running agents.
147
+
148
+ ### Fixed
149
+
150
+ - **H1: MCP proxy fallback** — `mcp-proxy.ts` now falls back to `enableMcp: true` when `createMcpProxyTools()` returns empty, so child sessions self-discover MCP instead of losing all access.
151
+ - **H2: parallel-utils throw undefined** — `mapConcurrent` now throws the actual error instead of `throw undefined`.
152
+ - **H3: Semaphore over-release** — `release()` guard against `#current > 0` prevents over-release corruption.
153
+ - **M1: IRC tool TOCTOU** — `irc-tool.ts` wraps `sendIrcMessage`/`broadcastIrcMessage` in try-catch.
154
+ - **M2: submit-result ordering** — Builds response string before calling `onYield`, wrapped in try-catch.
155
+ - **M3: Sensitive paths false positives** — Word-boundary-aware token matching replaces substring matching.
156
+ - **M4: atomic-write sleepSync** — Added WARNING comment about blocking main thread.
157
+ - **M7: URL regex trailing punctuation** — Precise regex excludes trailing punctuation from URL matches.
158
+ - **L1: parent-guard comment** — Corrected misleading comment about `process.kill` on Windows.
159
+ - **Yield handler DRY** — Extracted `extractYieldDataFromArgs` helper, `isObjectRecord`/`isStringRecord` type guards, safe `find()` pattern.
160
+ - **Event-log-rotation TOCTOU** — `compactEventLog` re-reads file after initial read to merge concurrent appends; `readEvents` skips corrupt JSON lines.
161
+ - **Ghost agent dedup** — Fixed duplicate agent records in `crew-agent-records` after crash recovery.
162
+
163
+ ### Research
164
+
165
+ - `docs/research/AGENT-EXECUTION-ARCHITECTURE.md` Detailed comparison of 3 execution modes (oh-my-pi in-process, pi-crew child-process, pi-crew live-session).
166
+ - `docs/research/UI-RESPONSIVENESS-AUDIT.md` Root cause analysis for 2-5s agent spawn visibility delay, 5 proposed fixes with priority matrix.
167
+ - `docs/research/DEEP-RESEARCH-PI-POWERBAR.md` Deep analysis of pi-powerbar architecture (producer/consumer pattern, rendering, settings, comparison with pi-crew's powerbar publisher).
168
+
169
+ ## 0.1.48
170
+
171
+ ### Added
172
+
173
+ - **Yield-based completion contract** — Workers can call `submit_result` tool to return structured results; task-runner warns on workers that don't yield.
174
+ - **Typed event channels** — `RunEventBus` supports 5 channels (`worker:progress`, `worker:lifecycle`, `worker:stream`, `run:state`, `ui:invalidate`) with `onChannel`/`onChannelForRun` subscriptions and auto-classification.
175
+ - **Human-readable task names** — `generateTaskName()` produces AdjectiveNoun names (14,400 combinations); `displayName` field on `TeamTaskState`.
176
+ - **SubprocessToolRegistry** — Extensible tool event handling with `register`/`extractAll`/`shouldTerminate` pattern; wired into event-stream-bridge.
177
+ - **Event log rotation/compaction** Auto-compacts event logs over 5MB/50k events, keeping last 1000 events; atomic file replacement.
178
+ - **Incremental JSONL reader** — `readLinesSince`/`readJsonlSince` for seek-based file reading; wired into `readEventsCursor` with `fromByteOffset`.
179
+
180
+ ### Fixed
181
+
182
+ - Fixed `readBlob`/`readBlobMetadata` crash on missing files — now returns `undefined`.
183
+ - Fixed `readSseJson` crash on non-JSON SSE data — now skips malformed events.
184
+ - Fixed wrong value `"long_running"` → `"active_long_running"` in agent-control.
185
+ - Fixed `consecutiveFailures` type bypass — added to `CrewAgentProgress` interface.
186
+ - Fixed `streamBridge.dispose()` memory leak — now in try/finally.
187
+ - Fixed blob-store redundant ternary `typeof x === "string" ? x : x`.
188
+ - Fixed team-runner non-null assertion on potentially empty array.
189
+ - Fixed event-log silent error swallowing now logs via `logInternalError`.
190
+ - Fixed team-tool switch case indentation.
191
+ - Removed dead code `expandIcon` in agent-management-overlay.
192
+
193
+ ### Changed
194
+
195
+ - Moved 6 research .md files from repo root to `docs/research/`.
196
+ - `discoverAgents`/`discoverSkills` silent catches now log via `logInternalError`.
197
+ - `executeHook` accumulates non-blocking diagnostics instead of short-circuiting.
198
+ - `CancellationToken.heartbeat` wired into `collectRuns` and `pruneFinishedRuns`.
199
+ - `CapabilitySource` extended with `"git"` to match `ResourceSource`.
200
+
201
+ ## 0.1.47
202
+
203
+ ### Added
204
+
205
+ - **Typed hook lifecycle** — 8 of 9 hooks wired: `before_run_start`, `before_task_start`, `task_result`, `before_cancel`, `before_forget`, `before_cleanup`, `before_publish`, `run_recovery`. Hooks are opt-in, blocking/non-blocking, with audit events.
206
+ - **Event-first UI bus** — `RunEventBus` emits on every `appendEvent` call; dashboard, crew widget, sidebar, and snapshot cache subscribe for event-driven invalidation instead of polling.
207
+ - **Shared scan cache** `SharedScanCache` caches manifest reads and active-run entries with TTL, mtime/size invalidation, and LRU eviction.
208
+ - **Capability inventory** — `buildCapabilityInventory()` enumerates teams, workflows, agents, and skills with stable `kind:name` IDs; supports policy disable and shadowing detection.
209
+ - **Skills in capability inventory** — `discoverSkills()` reads SKILL.md frontmatter; skills appear with kind=`skill` and source=`package`/`project`.
210
+ - **Mailbox kind-separated breakdown** — `RunUiMailbox` tracks `steerUnread`/`followUpUnread`/`responseUnread`/`messageUnread`; mailbox pane shows urgency indicators.
211
+ - **Run recovery hook** — `applyRecoveryPlan` fires `run_recovery` hook; blocked recovery emits `crew.run.recovery_blocked` event.
212
+ - **Synthetic tool cancellation evidence** — Cancelled in-flight tasks receive `tool`-level terminal evidence alongside `worker`-level.
213
+ - **CancellationToken wired into production loops** — `collectRuns` and `pruneFinishedRuns` use `CancellationToken.heartbeat(stage)` for progress diagnostics.
214
+ - **Blob artifact store** SHA-256 content-addressed storage with metadata sidecars.
215
+ - **Run event provenance** Event metadata includes `parentEventId`, `attemptId`, `branchId`, `causationId`, `correlationId`.
216
+ - **Control channel reservation** `ControlReservation` before worker spawn with deterministic `controllerId`.
217
+ - **Release smoke test** — `npm run smoke:release` automates tarball install + version consistency check.
218
+ - **Width-safety tests** — Crew widget rendering verified at widths 1/40/200/empty/multiple.
219
+
220
+ ### Changed
221
+
222
+ - `handleCancel`, `handleForget`, `handleCleanup`, `handlePrune`, `handleExport` converted to async for hook execution.
223
+ - `before_cancel`/`before_forget`/`before_cleanup` hooks can block their respective operations.
224
+ - `before_publish` hook fires before run export.
225
+ - `task_result` hook fires before `task.completed`/`task.failed` events.
226
+ - Dashboard, widget, and sidebar auto-invalidate on `RunEventBus` events.
227
+
228
+ ## 0.1.45
229
+
230
+ ### Added
231
+
232
+ - Added `/team-respond <runId> <taskId|--all> <message>` for replying to interactive/waiting tasks from slash commands.
233
+ - Added runtime-extensible run ownership metadata (`ownerSessionId`) so destructive cancellation can be guarded by session ownership.
234
+ - Added async manifest and crew-agent readers used by snapshot preloading.
235
+
236
+ ### Fixed
237
+
238
+ - Fixed `respond` action to validate waiting-only tasks, write replies to task mailboxes, and reject non-waiting task responses instead of reporting false success.
239
+ - Fixed `cancel` ownership handling so runs created by another Pi session are not cancelled when `ownerSessionId` mismatches.
240
+ - Fixed `DeliveryCoordinator` to requeue payloads when active delivery callbacks throw, and to drop queued payloads from stale session generations.
241
+ - Fixed `OverflowRecoveryTracker` collisions by keying recovery state with `runId + taskId`, plus cleanup of terminal recovery states.
242
+ - Fixed stale reconciliation false positives for foreground/live no-PID runs by preserving runs with recent task heartbeat or agent progress evidence.
243
+ - Fixed UI waiting counts: snapshots, powerbar, and crew widget now include `waiting` tasks/agents where appropriate.
244
+ - Fixed team tool `cwd` override handling so valid overrides are applied consistently and invalid overrides return a clear error.
245
+ - Fixed session history pollution by only appending `crew:run-started` after a successful run with a real `runId`.
246
+ - Fixed async snapshot preload path to avoid synchronous manifest/agent reads.
247
+ - Fixed mailbox count semantics for large mailbox files by marking tail-derived counts as approximate when the file is larger than the bounded tail window.
248
+ - Fixed auto-retry freshness by reloading manifest/tasks before retry attempts and fallback task runs.
249
+
250
+ ### Changed
251
+
252
+ - Wired session snapshots into `session_before_switch` logging so active runs and pending deliveries are captured before session transitions.
253
+ - Dashboard mailbox pane now indicates when counts are approximate tail-derived values.
254
+
255
+ ## 0.1.43
256
+
257
+ ### Added
258
+
259
+ - `/team-settings` command: view and manage all pi-crew config from Pi CLI (`list`, `get`, `set`, `unset`, `path`, `scope`).
260
+ - `addTranslations(locale, bundle)` and `listLocales()` for runtime-extensible i18n.
261
+
262
+ ### Fixed
263
+
264
+ - **UI freeze crash**: replaced `setInterval` with recursive `setTimeout` in `RenderScheduler` and `HeartbeatWatcher` to prevent timer storms when renders exceed the interval.
265
+ - **Growing-file I/O bottleneck**: `safeRecentEvents`, `readMailboxCounts`, `readGroupJoinMailbox` now use tail-reading (last 32 KB) instead of reading entire `.jsonl` files that grow unbounded over long runs.
266
+ - **Snapshot cache TTL** increased from 250 ms to 500 ms, halving unnecessary I/O.
267
+ - **Heartbeat watcher memory leak**: stale keys are now cleaned after 10 minutes of inactivity instead of being held forever.
268
+ - **Dashboard crash guard**: `render()` is wrapped in `try/catch` with a fallback error display.
269
+ - **Dashboard selected-index mismatch**: reset `selected` to 0 when the selected run disappears from the manifest cache.
270
+ - **`live-run-sidebar.ts` crash**: fixed missing optional chaining on `agent.progress?.recentOutput?.at(-1)`.
271
+ - **`signatureFor` crash**: `JSON.stringify` in snapshot cache wrapped in `try/catch` with a timestamp fallback.
272
+ - **Render scheduler timer leak**: added a `disposed` guard after `schedule()` to prevent orphaned timers.
273
+ - **Render scheduler loop guard**: capped at 5 iterations per `flush()` to prevent infinite loops when `render()` re-enters `flush()`.
274
+ - **`powerbar-publisher.ts`**: replaced `.filter().length` with `.reduce()` counting to avoid temporary array allocations.
275
+
276
+ ### Changed
277
+
278
+ - **i18n module hardened**: locale validated at runtime (not hardcoded union type), `currentLocale` reset on dispose, missing-key guard (`fallback[key] ?? key`), `__test__resetI18n()` helper.
279
+
280
+ ## 0.1.42
281
+
282
+ ### Fixed
283
+
284
+ - Reduced atomic-write rename retries from 20 to 5 and added busy-wait fallback for `Atomics.wait` to avoid event-loop stalls on Windows with aggressive file-locking.
285
+ - Applied the same `sleepSync` fallback pattern to `locks.ts` for consistent lock-acquisition resilience.
286
+ - Removed dead `findReadyTask` function in team-runner.
287
+ - Eliminated a redundant `refreshTaskGraphQueues` O(n) call per batch iteration by reusing the already-computed `taskGraphSnapshot` for ready-task selection.
288
+ - Expanded `appendTaskAttentionEvent` dedup window from 100 to 200 events and switched to a computed dedup key.
289
+
290
+ ### Changed
291
+
292
+ - Extended `MUTATING_TOOLS` set in completion guard with `replace_in_file`, `insert`, `delete_files`, `create_file`, `overwrite`, and `patch`.
293
+ - Extended `MUTATING_COMMANDS` regex with `sed -i`, `tee`, `wget -O`, and `curl -o` patterns.
294
+ - Reordered bash-command mutation check so mutating patterns (`sed -i`) take priority over read-only patterns (`sed`).
295
+ - Unknown bash commands that don't match the read-only list are now treated as potentially mutating (conservative default).
296
+
297
+ ### Hardened
298
+
299
+ - Replaced `timer.unref?.()` with `timer.unref()` in `SubagentManager` blocked-poll and stuck-notify timers.
300
+ - Added session-liveness guard to `notifyOperator` fallback so it won't attempt `sendFollowUp` after extension cleanup.
301
+
302
+ ## 0.1.41
303
+
304
+ ### Added
305
+
306
+ - Added strict-provider-friendly team tool schema shapes and config schema coverage for result delivery controls.
307
+ - Added resilient result watcher fallback polling for resource-limit watch failures and partial JSON retry handling.
308
+ - Added `runtime.completionMutationGuard` (`off`/`warn`/`fail`) with structured `task.attention` events when implementation-style workers complete without observed mutations.
309
+ - Added group-join mailbox delivery metadata, request-id dedupe, ack observability, timeout events, and dashboard/status visibility.
310
+ - Expanded `team doctor` and `team status` with schema, async/result delivery, worktree/readiness, attention, transcript, and group-join diagnostics.
311
+
312
+ ### Fixed
313
+
314
+ - Recovered adaptive implementation planner output when compaction truncates the end marker but complete phase objects are still present.
315
+
316
+ ## 0.1.40
317
+
318
+ ### Added
319
+
320
+ - Added owner-session generation guards for background subagents, async run notifications, result watchers, and live-session callbacks so stale sessions do not receive completions.
321
+ - Added `runtime.requirePlanApproval` with approve/cancel API support to gate mutating adaptive implementation tasks behind an explicit planner artifact approval.
322
+ - Added shared secret redaction for event logs, mailbox persistence, artifacts, JSONL streams, agent records, notifications, metrics, and diagnostics.
323
+
324
+ ### Changed
325
+
326
+ - Project-local agents, teams, and workflows can no longer shadow builtin or user resources with the same name.
327
+ - Project-level sensitive config such as worker execution, runtime mode, autonomy, agent overrides, worktree setup hooks, and OTLP headers is ignored with warnings unless configured in trusted user scope.
328
+
329
+ ### Fixed
330
+
331
+ - Fixed lost async completion notifications after auto-compaction/session restart by continuing to track active runs across notifier restarts.
332
+ - Fixed stale background subagent wakeups after session switch/shutdown while preserving terminal results for explicit joins.
333
+ - Fixed resume bypasses in plan approval by re-gating persisted mutating adaptive tasks when approval state is missing or pending.
334
+ - Restricted plan approval and cancellation to non-read-only roles and rejected cancel/approve after the approval state is no longer pending.
335
+
336
+ ## 0.1.39
337
+
338
+ ### Fixed
339
+
340
+ - Made CI test execution deterministic across Node 22/macOS/Linux/Windows by running Node test files sequentially to avoid cross-file environment races.
341
+ - Fixed live-agent durable control symlink-file rejection to return an API error instead of throwing from the tool handler.
342
+ - Tightened symlink artifact security assertions so tests check leaked file contents rather than safe metadata paths.
343
+
344
+ ## 0.1.38
345
+
346
+ ### Added
347
+
348
+ - Added parent-session wake-up for completed background subagents so the main agent automatically joins results and continues the original task.
349
+ - Added stronger resource/parser coverage for team role metadata and workflow task-body headings.
350
+
351
+ ### Changed
352
+
353
+ - Clarified the current default worker execution model and local disable controls in project guidance.
354
+ - Aligned config schema constraints for UI settings with the published package schema.
355
+
356
+ ### Fixed
357
+
358
+ - Hardened subagent abort handling so stopped records are persisted and late runner completion does not regress them to completed/error.
359
+ - Fixed blocked subagent result joins, blocked duration persistence, and final wake-up after blocked runs resume to terminal status.
360
+ - Blocked path traversal through workflow shared artifacts, run ids, imported run bundles, task-scoped mailbox APIs, agent runtime files, and untrusted artifact/transcript paths; hardened reads/writes with realpath containment to prevent symlink escapes; bound live-agent control to the selected run.
361
+ - Documented actual project resource paths for `.crew/` and `.pi/teams/` layouts.
362
+
363
+ ## 0.1.31
364
+
365
+ ### Fixed
366
+
367
+ - Added required Agent Skills frontmatter (`name` and `description`) to built-in coding skills so Pi loads them without conflicts.
368
+ - Tightened built-in skill package coverage to require standards-compliant frontmatter.
369
+
370
+ ## 0.1.30
371
+
372
+ ### Added
373
+
374
+ - Added Phase 6 async hardening: jiti loader resolution/fail-fast, async startup marker files, and early background-runner exit detection.
375
+ - Added worker concurrency hard cap with explicit `limits.allowUnboundedConcurrency` opt-out and observability event.
376
+ - Added persisted model routing metadata on tasks and agent records: requested model, resolved model, fallback chain, reason, and used attempt.
377
+ - Added self-contained architecture/runtime-flow docs and five built-in coding skills.
378
+ - Added mailbox replay on resume for pending inbox messages, including task-scoped messages.
379
+ - Added task resume checkpoints and recovery for crash-after-final-stdout and crash-after-artifact-write child-process tasks.
380
+ - Added async notifier detection for quiet dead background runners with durable `async.died` events.
381
+ - Added adaptive planner repair for malformed JSON, oversized task plans, and common role aliases before blocking implementation runs.
382
+ - Added package snapshot coverage for Phase 6 docs, skills, Pi manifest entries, and the runtime `jiti` dependency.
383
+ - Added `src/subagents/*` consolidation entrypoints for child spawning, background runner commands, and subagent manager APIs.
384
+ - Split `team-tool.ts` actions into focused status, inspect, lifecycle, cancel, and plan modules while preserving public action names.
385
+ - Split `register.ts` lifecycle wiring into command, team-tool, subagent-tool, and artifact-cleanup registration modules.
386
+ - Added async restart recovery integration smoke coverage for stale background pids.
387
+ - Added explicit recursive subagent depth and read-only role spawn-denial tests.
388
+
389
+ ### Changed
390
+
391
+ - Async background runs now use an explicit jiti loader path and expose startup markers for recovery/health checks.
392
+ - Active batch selection now caps excessive user concurrency by default to protect local machines.
393
+ - Resume now emits mailbox replay metadata before restarting queued work.
394
+ - Child-process tasks now persist checkpoint phases (`started`, `child-spawned`, `child-stdout-final`, `artifact-written`) during execution.
395
+ - Split `task-runner.ts` prompt/progress/state/live helpers into focused modules while keeping `runTeamTask` as the public entrypoint.
396
+ - Moved live-session access behind `src/subagents/live/*` and dynamic task-runner imports so default child-process flow does not eagerly load live runtime code.
397
+
398
+ ### Fixed
399
+
400
+ - Background runner startup failures are reported earlier instead of silently leaving queued/running manifests stale.
401
+
402
+ ### Release prep notes
403
+
404
+ - Suggested next release grouping: `0.1.30` for Phase 6 runtime hardening, resume recovery, model observability, docs/skills, and internal refactors.
405
+ - Gate run locally: `npm run typecheck`, `npm test`, and `npm pack --dry-run`.
406
+ - No breaking public API changes: tool actions, slash commands, config schema, and package name remain stable.
407
+
408
+ ## 0.1.29
409
+
410
+ - Republished the child worker response timeout fix as a fresh npm version.
411
+
412
+ ## 0.1.28
413
+
414
+ - Fixed child-process workers being terminated after only 15 seconds of quiet provider/tool time by increasing the default response watchdog to five minutes and clarifying the timeout error message.
415
+
416
+ ## 0.1.20
417
+
418
+ - Reworked the implementation workflow into an adaptive planner-led orchestration flow that decides the number, roles, and phases of subagents from the task instead of using a fixed fanout template.
419
+ - Added dynamic adaptive task injection, persisted adaptive task metadata, and resume reconstruction for planner-selected subagent steps.
420
+ - Block implementation runs when the planner does not produce a valid adaptive plan, including missing/unreadable planner artifacts and malformed/oversized plans.
421
+ - Added tests for adaptive plan parsing, dynamic batch fanout, invalid-plan blocking, writer-role support, and adaptive resume recovery.
422
+ - Hardened subagent/runtime fixes from post-0.1.19 review: env-isolated depth tests, foreground failure status updates, generic tool conflict aliases, and max_turns propagation.
423
+
424
+ ## 0.1.19
425
+
426
+ - Added Claude-style `Agent`, `get_subagent_result`, and `steer_subagent` tools backed by pi-crew's durable worker runtime, plus conflict-safe `crew_agent`, `crew_agent_result`, and `crew_agent_steer` aliases.
427
+ - Added a durable subagent manager with background queueing, completion notifications, result joins, session-bound cleanup, and direct single-agent runs via `team run agent=...`.
428
+ - Disabled risky auto-opening of the right sidebar by default, added foreground completion notifications, and reduced duplicate widget/sidebar UI.
429
+ - Added progress coalescing and workflow concurrency helpers to keep foreground sessions responsive during busy worker output.
430
+ - Fixed live-session runs being classified as scaffold when workers are enabled and hardened session switch/shutdown cleanup for foreground child processes.
431
+
432
+ ## 0.1.18
433
+
434
+ - Added a built-in `parallel-research` team/workflow for map-reduce style source audits with dynamic `Source/pi-*` fanout and parallel explorer shards.
435
+ - Made the live right sidebar the default foreground UI: active foreground runs auto-open a top-right live sidebar when the terminal is wide enough.
436
+ - Added live sidebar sections for active agents, waiting tasks, completed agents, task graph, model, tool, and token/usage details.
437
+ - Stopped materializing queued dependency tasks as child-process agents; status now separates active agents, waiting tasks, and completed agents.
438
+ - Added workflow-aware default concurrency so research/parallel-research can use ready parallel work instead of always running one worker.
439
+ - Dropped user/system prompt messages from child event persistence to avoid prompt/context leakage in agent event logs.
440
+ - Tightened child event compaction with separate assistant/tool input/tool result caps and improved powerbar active/waiting/model/token summaries.
441
+
442
+ ## 0.1.17
443
+
444
+ - Fixed terminal/completed workers being incorrectly escalated as stale heartbeat blockers after all tasks completed.
445
+ - Cleaned child-process result extraction so result artifacts prefer final assistant output and no longer include worker prompt/context.
446
+ - Made `/team-dashboard` visibly render as a top-right sidebar by default with explicit right-sidebar title text.
447
+ - Added per-subagent model and usage fields to agent records, status output, and dashboard fallbacks so model/token totals stay visible while and after workers run.
448
+
449
+ ## 0.1.16
450
+
451
+ - Added right-side `/team-dashboard` placement with model, token, and tool detail rows for subagents.
452
+ - Added UI config for dashboard placement/width and model/token/tool visibility.
453
+ - Foreground child-process runs now continue without blocking the interactive chat and remain tied to session shutdown.
454
+ - Child-process observability now drops noisy `message_update`/encrypted thinking deltas and stores compact events to prevent massive JSONL/output logs from freezing sessions.
455
+ - Cancel now syncs agent records and writes a foreground interrupt request so queued/running agents stop appearing stale.
456
+
457
+ ## 0.1.15
458
+
459
+ - Child-process model selection now uses Pi-configured/available models and auto-discovers provider/model entries from Pi settings/models config.
460
+ - Added configured-model fallback chains for worker runs instead of forcing builtin provider hints.
461
+ - Fixed skipped task agent records so they no longer appear queued.
462
+
463
+ ## 0.1.0
464
+
465
+ - Initial scaffold for `pi-crew`.
466
+ - Added Pi package manifest, extension entry, minimal team tool, slash commands, builtin resources, and documentation placeholders.