pi-crew 0.9.68 → 0.10.2

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 (253) hide show
  1. package/CHANGELOG.md +222 -0
  2. package/NOTICE.md +21 -0
  3. package/README.md +44 -2
  4. package/agents/analyst.md +1 -1
  5. package/agents/cold-verifier.md +3 -1
  6. package/agents/critic.md +1 -1
  7. package/agents/executor.md +1 -1
  8. package/agents/explorer.md +1 -1
  9. package/agents/planner.md +1 -1
  10. package/agents/reviewer.md +1 -1
  11. package/agents/security-reviewer.md +1 -1
  12. package/agents/test-engineer.md +1 -1
  13. package/agents/verifier.md +1 -1
  14. package/agents/writer.md +1 -1
  15. package/dist/index.mjs +68113 -60774
  16. package/docs/README.md +2 -0
  17. package/docs/actions-reference.md +31 -0
  18. package/docs/commands-reference.md +17 -6
  19. package/docs/resource-formats.md +13 -0
  20. package/package.json +4 -2
  21. package/schema.json +503 -91
  22. package/scripts/resource-sampler.mjs +36 -2
  23. package/skills/requirements-to-task-packet/SKILL.md +26 -0
  24. package/skills/widget-rendering/SKILL.md +7 -7
  25. package/src/agents/agent-config.ts +2 -1
  26. package/src/agents/discover-agents.ts +23 -14
  27. package/src/config/config-merge.ts +183 -0
  28. package/src/config/config-validation.ts +687 -0
  29. package/src/config/config.ts +22 -864
  30. package/src/config/defaults.ts +43 -2
  31. package/src/config/drift-detector.ts +1 -1
  32. package/src/config/env-vars.ts +691 -0
  33. package/src/config/role-tools.ts +11 -9
  34. package/src/config/sanitize-project-config.ts +172 -0
  35. package/src/config/types.ts +49 -1
  36. package/src/extension/async-notifier.ts +25 -2
  37. package/src/extension/crew-cleanup.ts +13 -0
  38. package/src/extension/crew-vibes/config.ts +2 -1
  39. package/src/extension/crew-vibes/footer.ts +19 -0
  40. package/src/extension/crew-vibes/index.ts +11 -1
  41. package/src/extension/plan-orchestrate.ts +132 -0
  42. package/src/extension/register.ts +8 -0
  43. package/src/extension/registration/command-registration.ts +1 -0
  44. package/src/extension/registration/commands/dashboard.ts +158 -0
  45. package/src/extension/registration/commands/index.ts +35 -0
  46. package/src/extension/registration/commands/manage.ts +303 -0
  47. package/src/extension/registration/commands/run.ts +228 -0
  48. package/src/extension/registration/commands/shared.ts +639 -0
  49. package/src/extension/registration/commands/status.ts +60 -0
  50. package/src/extension/registration/commands.ts +13 -1224
  51. package/src/extension/registration/foreground-run-controller.ts +10 -2
  52. package/src/extension/registration/lifecycle-handlers.ts +178 -17
  53. package/src/extension/registration/runtime-cleanup.ts +23 -5
  54. package/src/extension/registration/subagent-tools.ts +218 -9
  55. package/src/extension/registration/team-tool.ts +5 -1
  56. package/src/extension/registration/ui.ts +5 -4
  57. package/src/extension/rpc-hmac.ts +5 -3
  58. package/src/extension/team-tool/api/heartbeat.ts +47 -10
  59. package/src/extension/team-tool/api/plan-approval.ts +9 -0
  60. package/src/extension/team-tool/api/task-claims.ts +109 -40
  61. package/src/extension/team-tool/cancel.ts +84 -50
  62. package/src/extension/team-tool/dispatch/index.ts +1 -0
  63. package/src/extension/team-tool/dispatch/run.ts +4 -1
  64. package/src/extension/team-tool/doctor.ts +103 -1
  65. package/src/extension/team-tool/orchestrate.ts +66 -1
  66. package/src/extension/team-tool/plans.ts +192 -0
  67. package/src/extension/team-tool/respond.ts +197 -65
  68. package/src/extension/team-tool/run-deadline.ts +35 -3
  69. package/src/extension/team-tool/run-intent.ts +63 -0
  70. package/src/extension/team-tool/run.ts +74 -20
  71. package/src/extension/team-tool/status.ts +84 -26
  72. package/src/extension/team-tool.ts +11 -2
  73. package/src/hooks/registry.ts +1 -6
  74. package/src/i18n.ts +9 -0
  75. package/src/prompt/prompt-runtime.ts +521 -2
  76. package/src/prompt/worker-events-channel.ts +173 -0
  77. package/src/runtime/README.md +8 -8
  78. package/src/runtime/async-runner.ts +7 -3
  79. package/src/runtime/background-runner.ts +42 -14
  80. package/src/runtime/broker/broker-issuer.ts +9 -2
  81. package/src/runtime/broker/crew-broker-tokens.ts +43 -6
  82. package/src/runtime/broker/crew-broker.ts +838 -10
  83. package/src/runtime/broker/wait-status-cache.ts +157 -0
  84. package/src/runtime/budget-enforcement.ts +281 -0
  85. package/src/runtime/child-pi/child-pi-constants.ts +8 -0
  86. package/src/runtime/child-pi/child-pi-spawn.ts +60 -14
  87. package/src/runtime/child-pi/child-pi-streams.ts +21 -1
  88. package/src/runtime/child-pi/child-pi-timers.ts +324 -0
  89. package/src/runtime/child-pi/child-pi.ts +97 -201
  90. package/src/runtime/child-pi/mock-fixtures.ts +16 -2
  91. package/src/runtime/crew-agent-records.ts +259 -14
  92. package/src/runtime/delegate-spawn.ts +148 -0
  93. package/src/runtime/detached-run-results.ts +90 -0
  94. package/src/runtime/deterministic-ast.ts +2 -1
  95. package/src/runtime/dispatch-batch.ts +945 -0
  96. package/src/runtime/finalize-run.ts +557 -0
  97. package/src/runtime/goal-workflow/adaptive-plan.ts +116 -15
  98. package/src/runtime/goal-workflow/dynamic-workflow-runner.ts +8 -3
  99. package/src/runtime/goal-workflow/goal-state-store.ts +1 -1
  100. package/src/runtime/group-join.ts +11 -125
  101. package/src/runtime/live-session/live-session-runtime.ts +26 -1
  102. package/src/runtime/merge-gate.ts +32 -10
  103. package/src/runtime/merge-loop.ts +130 -0
  104. package/src/runtime/model/model-budget-summary.ts +53 -0
  105. package/src/runtime/model/model-fallback.ts +36 -2
  106. package/src/runtime/model/pi-args.ts +10 -0
  107. package/src/runtime/model/provider-extensions.ts +10 -0
  108. package/src/runtime/orphan-worker-registry.ts +1 -1
  109. package/src/runtime/output/output-validator.ts +45 -0
  110. package/src/runtime/parent-guard.ts +3 -1
  111. package/src/runtime/peer-dep.ts +2 -1
  112. package/src/runtime/per-write-validator.ts +0 -5
  113. package/src/runtime/pi-spawn.ts +61 -15
  114. package/src/runtime/plan-approval.ts +125 -0
  115. package/src/runtime/plan-replan.ts +151 -0
  116. package/src/runtime/process-status.ts +16 -1
  117. package/src/runtime/recovery/checkpoint.ts +0 -18
  118. package/src/runtime/recovery/crash-recovery.ts +111 -46
  119. package/src/runtime/run-tracker.ts +77 -10
  120. package/src/runtime/scheduler-context.ts +98 -0
  121. package/src/runtime/scheduling/coalesce-tasks.ts +5 -0
  122. package/src/runtime/scheduling/global-worker-cap.ts +2 -1
  123. package/src/runtime/scheduling/nested-slots.ts +70 -0
  124. package/src/runtime/scheduling/run-coalesced-task-group.ts +64 -13
  125. package/src/runtime/scheduling/task-graph-scheduler.ts +0 -10
  126. package/src/runtime/settings-store.ts +219 -0
  127. package/src/runtime/spawn-policy.ts +217 -0
  128. package/src/runtime/stale-reconciler.ts +87 -6
  129. package/src/runtime/subagent-manager.ts +25 -1
  130. package/src/runtime/task-output-context.ts +230 -9
  131. package/src/runtime/task-packet.ts +23 -1
  132. package/src/runtime/task-runner/child-executor.ts +106 -7
  133. package/src/runtime/task-runner/post-execution.ts +125 -1
  134. package/src/runtime/task-runner/pre-execution.ts +39 -1
  135. package/src/runtime/task-runner/prompt-builder.ts +51 -1
  136. package/src/runtime/task-runner/retrieval-orchestrator.ts +72 -18
  137. package/src/runtime/task-runner/spec-evidence.ts +403 -0
  138. package/src/runtime/task-runner/state-helpers.ts +26 -24
  139. package/src/runtime/task-runner.ts +11 -0
  140. package/src/runtime/team-runner.ts +132 -1673
  141. package/src/runtime/verification/spec-sandbox.ts +255 -0
  142. package/src/runtime/verification/verification-gates.ts +3 -2
  143. package/src/runtime/verification/verification-worktree.ts +2 -1
  144. package/src/runtime/workflow-phase-advance.ts +100 -0
  145. package/src/runtime/workspace-tree.ts +9 -0
  146. package/src/schema/config-schema.ts +66 -26
  147. package/src/schema/sensitive-config-paths.ts +64 -0
  148. package/src/schema/team-tool-schema.ts +13 -3
  149. package/src/state/README.md +4 -10
  150. package/src/state/atomic-write.ts +20 -3
  151. package/src/state/contracts.ts +38 -0
  152. package/src/state/coordination/mailbox.ts +12 -2
  153. package/src/state/event-log/cursor.ts +223 -0
  154. package/src/state/event-log/event-log-rotation.ts +12 -4
  155. package/src/state/event-log/event-log.ts +152 -369
  156. package/src/state/event-log/sequence-cache.ts +373 -0
  157. package/src/state/event-log/worker-atomic-writer.ts +2 -1
  158. package/src/state/stores/active-run-registry.ts +3 -2
  159. package/src/state/stores/manifest-io.ts +237 -0
  160. package/src/state/stores/ownership-map.ts +162 -0
  161. package/src/state/stores/plan-store.ts +241 -0
  162. package/src/state/stores/run-cache.ts +0 -90
  163. package/src/state/stores/spec-store.ts +189 -0
  164. package/src/state/stores/state-store.ts +139 -232
  165. package/src/state/types.ts +199 -0
  166. package/src/ui/dashboard-panes/plan-pane.ts +136 -0
  167. package/src/ui/dashboard-panes/progress-pane.ts +6 -0
  168. package/src/ui/dashboard-panes/transcript-pane.ts +31 -0
  169. package/src/ui/dock-footer.ts +49 -0
  170. package/src/ui/heartbeat-aggregator.ts +9 -1
  171. package/src/ui/inline-panel/agent-pane.ts +375 -0
  172. package/src/ui/inline-panel/agent-transcript.ts +338 -0
  173. package/src/ui/inline-panel/agent-view-overlay.ts +225 -0
  174. package/src/ui/inline-panel/crew-editor.ts +192 -0
  175. package/src/ui/inline-panel/index.ts +290 -0
  176. package/src/ui/inline-panel/panel-rows.ts +37 -0
  177. package/src/ui/inline-panel/panel-selection.ts +157 -0
  178. package/src/ui/inline-panel/panel-store.ts +111 -0
  179. package/src/ui/inline-panel/view-session-store.ts +36 -0
  180. package/src/ui/keybinding-map.ts +54 -13
  181. package/src/ui/pi-ui-compat.ts +9 -0
  182. package/src/ui/powerbar-publisher.ts +52 -1
  183. package/src/ui/run-dashboard.ts +31 -5
  184. package/src/ui/run-snapshot-cache.ts +57 -30
  185. package/src/ui/snapshot-types.ts +6 -1
  186. package/src/ui/widget/index.ts +176 -22
  187. package/src/ui/widget/task-list.ts +198 -0
  188. package/src/ui/widget/widget-formatters.ts +240 -4
  189. package/src/ui/widget/widget-renderer.ts +243 -38
  190. package/src/ui/widget/widget-types.ts +11 -0
  191. package/src/utils/child-process-shield.ts +106 -0
  192. package/src/utils/file-coalescer.ts +0 -4
  193. package/src/utils/fs-errno.ts +66 -0
  194. package/src/utils/fs-watch.ts +1 -1
  195. package/src/utils/internal-error.ts +3 -1
  196. package/src/utils/paths.ts +11 -3
  197. package/src/utils/redaction.ts +7 -0
  198. package/src/utils/safe-abort.ts +45 -0
  199. package/src/utils/task-name-generator.ts +1 -8
  200. package/src/workflows/discover-workflows.ts +20 -2
  201. package/src/workflows/validate-workflow.ts +7 -1
  202. package/src/workflows/workflow-config.ts +17 -0
  203. package/src/workflows/workflow-serializer.ts +3 -0
  204. package/src/worktree/worktree-manager.ts +22 -0
  205. package/workflows/default.workflow.md +36 -26
  206. package/workflows/strict-fast-fix.workflow.md +26 -0
  207. package/src/agents/agent-search.ts +0 -98
  208. package/src/benchmark/benchmark-runner.ts +0 -313
  209. package/src/benchmark/feedback-loop.ts +0 -73
  210. package/src/config/resilient-parser.ts +0 -117
  211. package/src/extension/crew-vibes/cat-frames.ts +0 -18
  212. package/src/extension/result-watcher.ts +0 -139
  213. package/src/observability/exporters/prometheus-exporter.ts +0 -54
  214. package/src/observability/metric-retention.ts +0 -64
  215. package/src/runtime/compaction/compaction-summary.ts +0 -278
  216. package/src/runtime/errors/crew-errors.ts +0 -162
  217. package/src/runtime/live-session/intercom-bridge.ts +0 -187
  218. package/src/runtime/loop-gates.ts +0 -128
  219. package/src/runtime/metric-parser.ts +0 -36
  220. package/src/runtime/output/stream-preview.ts +0 -184
  221. package/src/runtime/output/tool-progress.ts +0 -278
  222. package/src/runtime/phase-tracker.ts +0 -385
  223. package/src/runtime/pipeline-runner.ts +0 -523
  224. package/src/runtime/process/process-lifecycle.ts +0 -491
  225. package/src/runtime/recovery/retry-runner.ts +0 -330
  226. package/src/runtime/run-drift.ts +0 -219
  227. package/src/runtime/task-quality.ts +0 -199
  228. package/src/runtime/task-runner/run-projection.ts +0 -128
  229. package/src/runtime/verification/post-checks.ts +0 -142
  230. package/src/state/coordination/schedule.ts +0 -166
  231. package/src/state/event-log/jsonl-writer.ts +0 -115
  232. package/src/state/hook-instinct-bridge.ts +0 -94
  233. package/src/state/hook-integrations.ts +0 -51
  234. package/src/state/session-state-map.ts +0 -51
  235. package/src/state/stores/blob-store.ts +0 -308
  236. package/src/state/stores/instinct-store.ts +0 -275
  237. package/src/state/stores/observation-store.ts +0 -176
  238. package/src/state/tiered-eval.ts +0 -480
  239. package/src/state/types-eval.ts +0 -58
  240. package/src/tools/safe-bash-extension.ts +0 -54
  241. package/src/tools/safe-bash.ts +0 -505
  242. package/src/ui/agent-management-overlay.ts +0 -160
  243. package/src/ui/crew-footer.ts +0 -102
  244. package/src/ui/crew-select-list.ts +0 -114
  245. package/src/ui/dashboard-panes/capability-pane.ts +0 -77
  246. package/src/ui/transcript-entries.ts +0 -256
  247. package/src/utils/conflict-detect.ts +0 -721
  248. package/src/utils/fingerprint.ts +0 -180
  249. package/src/utils/gh-protocol.ts +0 -556
  250. package/src/utils/project-detector.ts +0 -160
  251. package/src/utils/sse-parser.ts +0 -131
  252. package/src/workflows/cost-estimator.ts +0 -34
  253. package/src/workflows/intermediate-store.ts +0 -166
package/CHANGELOG.md CHANGED
@@ -2,6 +2,228 @@
2
2
 
3
3
  > **Note:** `atomic-write-v2.ts` / `AtomicWriter` mentioned in historical entries below was consolidated into `atomic-write.ts` as of v0.9.42. This changelog is preserved as historical record — the migration was completed (the v2 class was never adopted; v1 won on simplicity + symlink-safety + link+unlink atomicity). See `docs/migration/atomic-write-v2-migration.md` for the decision rationale.
4
4
 
5
+ ## [0.10.2] — UI rewrite + adaptive default team (2026-08-24)
6
+
7
+ 40 commits after `v0.10.1` (≈3,500 LOC, 54 files). Headline: the UI surface
8
+ goes from "two modal overlays + status widget" to a proper in-document
9
+ panel — task list above the editor, dock at the very bottom, and an inline
10
+ agent transcript that opens with `↓` from the empty prompt. The default
11
+ team also moves from a fixed 4-step chain to a single adaptive `assess` →
12
+ parallel-execute → verify DAG.
13
+
14
+ ### UI: task list above the editor (`src/ui/widget/task-list.ts`)
15
+
16
+ - **Pi-tasks style plan rows** (commits `3d930579`, `7434afd7`, `f37619c0`,
17
+ `54e638ef`). One numbered row per task painted in plan order: `#1`, `#2`,
18
+ … — no more `01_explore` style technical ids leaking into the user view.
19
+ Completed rows dim and strike through; the running row carries a spinner
20
+ frame with elapsed time and live token counts; queued rows name the open
21
+ dependencies they wait on (`› blocked by #2`).
22
+ - **Header is Claude-Code style**: `● 4 tasks (1 done, 1 in progress, 2 open)` —
23
+ plain counts, no agent/role identity (those belong to the dock).
24
+ - **Role/agent/model visibility removed from the row** — they live in the dock
25
+ below the editor. The list above the editor is the *plan*, not a worker
26
+ report.
27
+ - **10-row cap with `… and N more`** — unfinished work never falls out of the
28
+ cap; finished rows collapse behind the overflow marker.
29
+ - **Templated titles / descriptions** (commit `f51f7095`) — the task packet
30
+ emits `title` + `description` fields, `{goal}` substitution lands in the
31
+ persisted task record (not the run goal), so the list reflects what was
32
+ actually scoped per phase.
33
+
34
+ ### UI: inline agent panel (`src/ui/inline-panel/`)
35
+
36
+ A new module (1,761 LOC across 10 files) that replaces the modal-only agent
37
+ surface with an in-document path. Design rationale: `docs/design/2026-08-20-inline-agent-panel.md`.
38
+ Attribution: `NOTICE.md` §"Inline agent panel" — adapted from `pi-subtask`
39
+ v0.7.4 (Victor Mustar, MIT); no code copied verbatim; steering rides
40
+ pi-crew's existing `team steer` channel rather than pi-subtask's stdin pipe.
41
+
42
+ - **`↓` from the empty prompt opens the dock** (commits `cfcad621`, `cf4895e8`,
43
+ `bff74c4f`). Static-icon flat rows, footer usage meter, `belowEditor`
44
+ placement. Enter on a row drops you into the worker's transcript.
45
+ - **Worker view is an in-document pane, never a session switch** (commits
46
+ `11c6649a`, `21ff211d`, `87497bd5`, `de3d44a0`, `50f41f30`, `5526c279`,
47
+ `402bb2a5`, `3dd68cc8`, `2b3e899d`, `9ee89866`, `ec8efd0a`, `e1708b20`,
48
+ `27c5c402`, `56279b00`, `c16cb332`). A sequence of fixes that landed
49
+ together: a) the `/crew-view` dispatch was routed through pi's immediate
50
+ command path (not a custom overlay), b) the agent view is a *byte-copy*
51
+ of the worker's own session log via a derived sessions ROOT, c) live
52
+ refresh polls the worker transcript and re-renders, d) `Enter` always
53
+ opens a real Pi session (no broken overlay), e) the worker-143 kill on
54
+ switches is root-caused (stale `ctx` was being passed around) and the
55
+ `AbortError` post-exit crash is fixed (`9db66cda`).
56
+ - **Dock survives until the run is done** (commit `67fa202a`) — rows no
57
+ longer disappear at "completed", the 3-row scroll window keeps the
58
+ in-progress task visible, and each row remembers its model.
59
+ - **Full-screen overlay still works for end-of-run review** (commit `c16cb332`)
60
+ — transcripts are complete; `Escape` returns to the dock.
61
+
62
+ ### Workflow: default is now adaptive (BREAKING for templates)
63
+
64
+ `workflows/default.workflow.md` was rewritten (commit `fff4b98d`) — old
65
+ sequential `explore → plan → execute → verify` was too rigid for the
66
+ common case of "small goal, fast turnaround". The new default is a
67
+ single-`assess` adaptive plan:
68
+
69
+ - Topology: `complex-dag` (was `sequential`).
70
+ - Frontmatter: `adaptive: true`.
71
+ - The `assess` step (planner role) inspects the repo and emits an
72
+ `ADAPTIVE_PLAN_JSON` block with the concrete phases + tasks. Independent
73
+ tasks go into the SAME phase so they run in parallel; the verifier still
74
+ closes the loop at the end of any implementation plan.
75
+ - Hard cap: 12 tasks per phase. A simple goal may produce 1-2 phases with
76
+ 1-2 tasks; broader goals fan out.
77
+ - Workflow file is **runtime data** (no rebuild needed) — the change is live
78
+ the next time a worker loads it.
79
+ - Migration: anyone pinning the old `explore/plan/execute/verify` chain
80
+ should switch to `workflow='plan-execute'` (still ships the fixed DAG).
81
+
82
+ ### Misc
83
+
84
+ - **Model-routing transparency**: `console.warn` per-model passthrough
85
+ muted (`273c4f83`) + test pins the muted behaviour (`b019e645`).
86
+ - **Biome 2.5.3 lint + format sync** (commit `69a0460e`, no logic changes).
87
+ - 5 `docs/real-test/reports/real-test-2026-08-2{0..4}-*.md` reports landed
88
+ alongside the B5 real-test battery (the subagent-v2 release was
89
+ end-to-end verified before this UI batch).
90
+ - Real-test re-run on the released bundle (`b0cf3a3a` onward): test:critical
91
+ 102/102, typecheck clean, 9a 10/10, 9b 5/5, chain 306.8s observation;
92
+ opportunistic finding #5 (SPEC-EVIDENCE marker format mismatch `===` vs
93
+ `:`) filed separately.
94
+
95
+ ### See also
96
+ - `NOTICE.md` §"Inline agent panel" — pi-subtask attribution.
97
+ - `NOTICE.md` §"Source inspiration" — pi-tasks attribution for task list rendering.
98
+ - `docs/design/2026-08-20-inline-agent-panel.md` — inline panel design rationale.
99
+ - `workflows/default.workflow.md` — adaptive default workflow (runtime data).
100
+ - `docs/real-test/reports/real-test-2026-08-11-full-battery.md` — full 9-tier
101
+ battery on the post-v0.10.1 HEAD (`54e638ef`).
102
+
103
+ ## [0.10.1] — subagent v2: governed delegation, plan objects, spec system, transparency (2026-08-20)
104
+
105
+ The full subagent-v2 effort (design `docs/design/subagent-v2-design.md`, plan
106
+ `docs/design/subagent-v2-implementation-plan.md`) shipped as ONE release.
107
+ Trains T1-T5 merged as internal phases (PRs #47-#51); batteries B1-B5 in
108
+ `docs/real-test/reports/`. ADRs: governed-nesting, plan-object,
109
+ waiting-producer-ask, spec-system (+ round-1 errata).
110
+
111
+ ### T1 — waiting/ask producer + session surface
112
+ - Ask tool (worker→leader blocking questions; parked `waiting` tasks,
113
+ structured events `ask.requested/answered/timedout`), follow-up
114
+ notifications, session-ownership map.
115
+
116
+ ### T2 — plan object (ADR-4)
117
+ - PlanRecord revisions (append-only, stable item ids, carried linkage),
118
+ `plans approve/reject` dual-write, scheduler linkage, adaptive re-plan
119
+ (revision switch, dropped-item soft-cancel advisory).
120
+
121
+ ### T3 — governed nesting (ADR-5)
122
+ - delegate tool for executor-class roles at depth 1 (dormant flag;
123
+ `nesting.enabled` USER-only sensitive), nested-slot budget (fail-fast,
124
+ max(1,⌊sem/2⌋)), depth-capped broker credentials (grandchild tokens
125
+ subId-scoped + shadow task records — unbounded chains terminate),
126
+ read-only grandchild roles, usage roll-up, fenced results via mailbox.
127
+
128
+ ### T4 — spec system (ADR-6 + erratum §11)
129
+ - SpecRecord store: workspace `state/specs/` (generated-only) + USER store
130
+ `~/.pi/agent/specs/` with DIGEST-BOUND trust sidecar — workers can never
131
+ mint re-executable specs (provenance v2; content-swap + TOCTOU closed).
132
+ - SPEC-EVIDENCE footer contract + mechanical coverage gate (default:
133
+ `unverified` badge on gaps, never blocks); strict mode = coverage AND
134
+ machine-check in a hardened sandbox (`unshare -rn`, ulimit, env scrub,
135
+ digest-only outcomes, fail-closed everywhere); verifier-role reject-start.
136
+ - Freeze at dispatch: snapshots immutable; later spec edits never rewrite
137
+ what a running task was held to. Mint CLI: `scripts/spec-import.mjs`.
138
+
139
+ ### T5 — P2 transparency + hygiene
140
+ - R7 Plan UI (`PI_CREW_PLAN_UI=1`): plans snapshot slice, dashboard pane 7
141
+ (tree, progress, depth badges, approval keys, revision diff), powerbar
142
+ plan phases.
143
+ - R8 model-routing transparency: pre-run budget summary (chain +
144
+ worst-case spawns/task), deduped unvalidated-passthrough warnings,
145
+ per-attempt models in the output pane.
146
+ - R9 worker self-reporting channel: bounded `worker.*` append channel
147
+ (schema tag, sliding-window rate limit, FIFO cap, partial-line
148
+ quarantine); `PI_CREW_EVENTS_PATH` unconditional (read-only roles too).
149
+ - R10 docs hygiene (phantom commands removed, real ones documented,
150
+ widget TTL corrected).
151
+
152
+ ### Fixes surfaced by the batteries
153
+ - bug-029: symlinked-TMPDIR repo-root escape (macOS `/var`↔`/private/var`)
154
+ — deterministic `getCacheStats` CI failures; canonicalized boundaries.
155
+ - dwf-setresult determinism (ambient `PI_CREW_TRUST_PROJECT_DWF` leak).
156
+ - B2/B3 live catches: hang-class timeout group-kill gaps, delegate
157
+ deadline precedence, double-save clobber on plan revision switch.
158
+
159
+ **Full suites at release tree: 6977 unit + 188 integration, 0 fail; CI 3-OS green on every train PR.**
160
+
161
+ ## [0.10.0] — maintainability refactor: full remediation + reliability (2026-08-16)
162
+
163
+ Branch `refactor/maintainability`: 16-round audit → 5-phase refactor →
164
+ finding-by-finding sweep → full remediation of every open finding (Waves
165
+ 1A/1B/2A/2B/B/C). Full execution log with commit map:
166
+ `docs/refactor-plan.md`. Audit inventory: `docs/refactor-plan.review.md`.
167
+
168
+ ### Security (config tiering)
169
+ - Schema-driven project-config sanitize: `sensitive:true` drop-list +
170
+ CONDITIONAL drops — project config may only TIGHTEN (guards `off`/
171
+ loosening dropped). goalWrap subtree + magicKeywords user-only.
172
+ ADR: `docs/decisions/2026-08-15-schema-driven-sanitize.md`.
173
+ - P1 fix: project-tier `.pi/crew-settings.json` no longer bypasses sanitize
174
+ (tiers API; legacy flat fns JSDoc'd user-tier-only).
175
+ - scheduledJobs user-tier opt-in gate (both `schedulingEnabled:true` AND
176
+ `allowProjectScheduledJobs:true` required for project jobs).
177
+
178
+ ### Performance
179
+ - R10-1 O(B²) batch closeout → per-run `ResultArtifactReadCache`
180
+ (bench b10: −50% fs reads, byte-identical outputs; b11 extends to
181
+ dependency-context path).
182
+ - R10-2 path-scoped flush; R10-3 broker mtime-gated manifest parse cache
183
+ (N waiters ≤2 parses); R10-4 sync/async snapshot parity; R10-5
184
+ child-executor fs batching (≤250ms documented window).
185
+
186
+ ### Hygiene / dead code
187
+ - FIFO caps on all unbounded collections (10 sites); named+removed abort
188
+ listeners; dead GroupJoinManager + 7 dead fns removed; security telemetry
189
+ wired into doctor; parser/schema bounds aligned (schema wins).
190
+
191
+ ### Runner reliability (bug-026)
192
+ - Sub-A: stderr-only result artifacts now FAIL the task
193
+ (`empty-or-stderr-only-result`) instead of persisting noise as completed.
194
+ - Sub-B: fatal-fs errno classifier — ENOSPC/EDQUOT/EMFILE surfaced as
195
+ `failed (disk full)`-style failureCause in task/run/status/doctor.
196
+ - Sub-C: terminal runs evicted from in-memory preloaded manifests +
197
+ heartbeat aggregator terminal-task defense (kills phantom dead-worker
198
+ alerts on long-lived sessions).
199
+
200
+ ### Runner reliability (bug-027 / bug-028 — post-Wave-D, found via real-test + CI)
201
+ - bug-027 (`f6e605ef`): `finalizeRun` heals stale non-terminal in-memory
202
+ snapshots from disk (in-flight guard) — a run whose disk manifest is
203
+ terminal but whose preloaded snapshot says "running" no longer blocks
204
+ finalize with a misleading in-flight error.
205
+ - bug-028 (`e9586aca`): fan-out stale-fallback resurrection —
206
+ `persistSingleTaskUpdate` previously wrote the dispatch-time
207
+ `fallbackTasks` array (the O(1) "F4" shortcut), which could resurrect
208
+ disk-terminal sibling tasks back to "running". It now always re-reads
209
+ the latest manifest from disk inside the run lock. Deterministic
210
+ regression test:
211
+ `test/unit/runtime/task-runner/state-helpers-bug028-stale-fallback.test.ts`
212
+ (verified fail-before-fix via git stash).
213
+
214
+ ### Verification (real-test 9-tier, v0.10.0 premerge)
215
+ - Full 9-tier real-test battery incl. the live mid-run battery: steer into
216
+ a running task, live cancel (cross-session ownership guard + force),
217
+ plan-approval waiting flow, and respond handler — run via a second pi
218
+ session in tmux. Report:
219
+ `docs/real-test/reports/real-test-2026-08-16-v0.10.0-premerge.md`.
220
+ - macOS CI teardown hardening (`8197f054`): retry recursive rmSync against
221
+ the worker-write/rmdir ENOTEMPTY race in `resume-cancel.test.ts`.
222
+
223
+ ### Repo hygiene
224
+ - bench suite b1–b11 tracked; per-run perf reports + bench results
225
+ gitignored; package.json-referenced scripts committed (fresh-clone fix).
226
+
5
227
  ## [0.9.68] — RLM fixes after deep-review verification (2026-08-12)
6
228
 
7
229
  Fixes from `docs/rlm-deep-review-2026-08-12.md` (verified) +
package/NOTICE.md CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  - Primary design and Pi-extension implementation inspiration: `pi-subagents` by Nico Bailon, MIT license.
8
8
  - Team orchestration, state, and worktree contract inspiration: `oh-my-claudecode` by Yeachan Heo, MIT license.
9
+ - Task-list-above-the-editor rendering (numbered plan rows, dependency hints, one-line-per-task) draws on `pi-tasks` (tintinweb, MIT) and Claude Code's plan header convention; no code copied — the pi-crew implementation lives in `src/ui/widget/task-list.ts` and is original work informed by those surfaces.
9
10
  - Conceptual inspiration only: `oh-my-openagent` / `oh-my-opencode`, SUL-1.0. No source code from this project should be copied into `pi-crew` unless explicitly reviewed for license compatibility and documented here.
10
11
  - Built-in skill topics are original pi-crew guidance informed by common agent-skill patterns in `Source/awesome-agent-skills`, `Source/oh-my-claudecode`, and related local references; no verbatim skill text was copied.
11
12
 
@@ -13,6 +14,26 @@
13
14
 
14
15
  When code is copied or substantially adapted from an MIT source, add the source path and license note here.
15
16
 
17
+ ### Inline agent panel (2026-08-20)
18
+
19
+ The inline agent panel (`src/ui/inline-panel/`) adapts the display architecture
20
+ of `pi-subtask` v0.7.4 by Victor Mustar (MIT,
21
+ https://github.com/gary149/pi-subtask):
22
+
23
+ - width-budgeted single-line agent rows (compact widget row style),
24
+ - identity-tracked panel cursor (`panel-selection.ts` matches its
25
+ `panelSelId` state machine),
26
+ - in-document `aboveEditor` transcript pane reusing pi's native transcript
27
+ components instead of a viewport overlay,
28
+ - `CustomEditor` wrapper with `↓`/`↑`/`enter`/`x`/`escape` panel navigation
29
+ and the `@agent` editor-border label, and the
30
+ `!ctx.ui.getEditorComponent()` yield rule for editor ownership.
31
+
32
+ No code was copied verbatim; the pi-crew implementation is a fresh port onto
33
+ pi-crew's own widget/store/event architecture (steering rides pi-crew's
34
+ existing `team steer` steering-file channel rather than pi-subtask's stdin
35
+ pipe).
36
+
16
37
  Current scaffold status: no substantial source files have been copied verbatim; implementation is a fresh scaffold based on documented design lessons.
17
38
 
18
39
  ## crew-vibes font assets
package/README.md CHANGED
@@ -53,7 +53,9 @@ repo: https://github.com/baphuongna/pi-crew
53
53
  - **Durable state** — manifest, tasks, events, artifacts all persisted to disk
54
54
  - **Async/background runs** — detached runs survive session switches with completion notifications
55
55
  - **Worktree isolation** — opt-in git worktrees per task for safe parallel edits
56
- - **Rich UI** — live widget, dashboard, progress tracking, model/token display
56
+ - **Rich UI** — task list above the editor (pi-tasks style: numbered plan rows, dependency hints, `… and N more` overflow), dock at the very bottom (static icons, per-row model, footer usage), and an inline agent panel (open a worker's transcript with `↓` from the empty prompt — never a session switch). Live widget, dashboard, and progress tracking unchanged.
57
+ - **Inline agent panel** (`src/ui/inline-panel/`) — status rows at the bottom, transcript in-document with pi's native components, `CustomEditor` overlay for steering (rides the existing `team steer` channel). Adapted from `pi-subtask` v0.7.4 (MIT) — attribution `NOTICE.md` §"Inline agent panel"; no code copied verbatim.
58
+ - **Adaptive default team** (`workflows/default.workflow.md`) — the built-in default is now a single `assess` → adaptive-DAG step instead of a fixed `explore → plan → execute → verify` chain. The planner inspects the repo and emits a JSON plan; independent tasks run in parallel; the verifier closes the loop. Workflow files are runtime data — the change is live without a rebuild. Pin to `workflow='plan-execute'` if you need the old fixed DAG.
57
59
  - **Observability** — metrics registry, Prometheus/OTLP exporters, heartbeat watching, deadletter queue
58
60
  - **Resource management** — create/update/delete agents, teams, workflows with validation
59
61
  - **Import/export** — portable run bundles for sharing and archiving
@@ -212,7 +214,7 @@ When unsure which team/workflow fits:
212
214
 
213
215
  | Team | Workflow | Purpose |
214
216
  |------|----------|----------|
215
- | `default` | explore → plan → execute → verify | Balanced, general-purpose |
217
+ | `default` | adaptive: planner derives concrete tasks from the goal, parallel phases, verify | Balanced, general-purpose |
216
218
  | `fast-fix` | explore → execute → verify | Quick bug fixes |
217
219
  | `implementation` | Adaptive planner decides fanout | Multi-file implementation |
218
220
  | `review` | explore → code-review → security-review → verify | Code review + security audit |
@@ -289,6 +291,46 @@ The advisory is **informational only** — there is no `force:true` flag needed
289
291
 
290
292
  ## Recent changes
291
293
 
294
+ ### v0.10.2: UI rewrite + adaptive default team (2026-08-24)
295
+
296
+ 40 commits after `v0.10.1` (≈3,500 LOC, 54 files). Headline: the UI surface
297
+ goes from "two modal overlays + status widget" to a proper in-document
298
+ panel — task list above the editor, dock at the very bottom, and an inline
299
+ agent transcript that opens with `↓` from the empty prompt. The default
300
+ team also moves from a fixed 4-step chain to a single adaptive `assess` →
301
+ parallel-execute → verify DAG.
302
+
303
+ - **Task list above the editor** — pi-tasks style numbered plan rows
304
+ (`#1`, `#2`, …) instead of `01_explore` ids; completed rows dim and
305
+ strike through; running row shows spinner + elapsed time + token
306
+ counts; queued rows name dependencies (`› blocked by #2`). Header
307
+ is Claude-Code style (`● 4 tasks (1 done, 1 in progress, 2 open)`).
308
+ Role/agent/model identity moved to the dock — the list is the *plan*,
309
+ not a worker report. 10-row cap with `… and N more` overflow.
310
+ - **Inline agent panel** (`src/ui/inline-panel/`, ~1,761 LOC, 10 files) —
311
+ `↓` from the empty prompt opens the dock; Enter drops into the worker's
312
+ full transcript rendered in-document with pi's native components;
313
+ steering rides the existing `team steer` channel (no stdin pipe).
314
+ Worker view is a *byte-copy* of the worker's own session log, polled
315
+ for live refresh, and Enter on the dock row always opens a real Pi
316
+ session (the worker-143 kill on switches and the `AbortError`
317
+ post-exit crash are both fixed). Full-screen overlay preserved for
318
+ end-of-run review.
319
+ - **Dock survives until the run is done** — rows no longer disappear at
320
+ "completed"; 3-row scroll window keeps the in-progress task visible;
321
+ per-row model display.
322
+ - **Adaptive default team** (`workflows/default.workflow.md`, runtime
323
+ data — no rebuild needed) — old fixed `explore → plan → execute →
324
+ verify` replaced by a single `assess` step (planner role) that emits
325
+ an `ADAPTIVE_PLAN_JSON` block. Independent tasks go into the SAME
326
+ phase so they run in parallel; verifier still closes the loop.
327
+ **Pin to `workflow='plan-execute'` if you need the old fixed DAG.**
328
+ - **Model-routing passthrough muted** + Biome 2.5.3 lint/format sync.
329
+ - Real-test re-run on the released v0.10.1 bundle: test:critical 102/102,
330
+ typecheck clean, 9a 10/10, 9b 5/5, chain 306.8s observation.
331
+ See `CHANGELOG.md` §Unreleased for full notes and `NOTICE.md` for
332
+ pi-subtask / pi-tasks attributions.
333
+
292
334
  ### v0.9.65: team-tool schema empty-string guard + effectiveness empty-result guard (2026-08-10)
293
335
 
294
336
  - **`budgetTotal` empty-string unset marker accepted**: `budgetTotal` was the only numeric `TeamToolParams` field missing the `Literal("")` union branch its siblings had. Calling models that emit every schema key with defaults were rejected by pi-ai's pre-handler validation → `Validation failed for tool "team"` on every action. The `MISCONFIGURATION GUARD` (rejects 1-999) is preserved. Caught by the Tier 9 feature battery — Tiers 1-8 stayed green while the team tool was broken for emitting models.
package/agents/analyst.md CHANGED
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls
8
+ tools: read, grep, find, ls, ask
9
9
  ---
10
10
 
11
11
  You are a requirements analyst. Identify what is known, unknown, risky, ambiguous, or underspecified. Produce clarifying assumptions and acceptance criteria.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, bash
8
+ tools: read, grep, find, ls, bash, ask
9
9
  maxTurns: 12
10
10
  ---
11
11
 
@@ -64,3 +64,5 @@ EVIDENCE: file:line references + your own test output
64
64
  ```
65
65
 
66
66
  If you cannot refute a claim after honest effort, that is itself evidence the claim is solid — say so explicitly rather than inventing doubt.
67
+
68
+ Intentionally unreferenced by builtin teams (CLI/custom use).
package/agents/critic.md CHANGED
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, glob
8
+ tools: read, grep, find, ls, glob, ask
9
9
  ---
10
10
 
11
11
  You are a critical reviewer. Find flaws, missing steps, unsafe assumptions, overengineering, underengineering, and verification gaps. Return concrete fixes to the plan.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, bash, edit, write, scratchpad
8
+ tools: read, grep, find, ls, glob, bash, edit, write, scratchpad, ask, delegate
9
9
  ---
10
10
 
11
11
  You are an implementation specialist. Follow the provided plan, make targeted changes, keep edits minimal, and report changed files plus validation status. Do not broaden scope without explaining why.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, glob, bash
8
+ tools: read, grep, find, ls, glob, bash, ask
9
9
  ---
10
10
 
11
11
  You are a fast codebase explorer. Map relevant files, symbols, data flow, and constraints. Do not modify files. Return concise findings with paths and evidence.
package/agents/planner.md CHANGED
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, glob
8
+ tools: read, grep, find, ls, glob, ask
9
9
  ---
10
10
 
11
11
  You are a planning specialist. Convert the goal and discovery notes into a concrete, ordered plan. Identify dependencies, risks, validation steps, and handoff instructions for implementers.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, glob, bash
8
+ tools: read, grep, find, ls, glob, bash, ask
9
9
  ---
10
10
 
11
11
  You are a code reviewer. Review the implementation for bugs, regressions, maintainability issues, missing tests, and project-rule violations. Return prioritized findings with evidence.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find
8
+ tools: read, grep, find, ask
9
9
  ---
10
10
 
11
11
  You are a security reviewer. Look for injection, authn/authz flaws, insecure defaults, secret exposure, unsafe filesystem/network behavior, and dependency risks. Return severity and remediation.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, edit, write, bash, ls, scratchpad
8
+ tools: read, edit, write, bash, ls, glob, grep, find, scratchpad, ask, delegate
9
9
  ---
10
10
 
11
11
  You are a test engineer. Identify the right test level, add or adjust tests when asked, detect flaky assumptions, and report exact validation commands and results.
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, grep, find, ls, bash, scratchpad
8
+ tools: read, grep, find, ls, bash, scratchpad, ask
9
9
  maxTurns: 15
10
10
  ---
11
11
 
package/agents/writer.md CHANGED
@@ -5,7 +5,7 @@ model: false
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- tools: read, edit, write, ls
8
+ tools: read, edit, write, ls, ask
9
9
  ---
10
10
 
11
11
  You are a documentation specialist. Produce clear, concise, maintainable docs and summaries. Preserve technical accuracy and avoid marketing fluff.