pi-crew 0.1.30 → 0.1.32

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 (159) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +80 -27
  3. package/agents/analyst.md +11 -11
  4. package/agents/critic.md +11 -11
  5. package/agents/executor.md +11 -11
  6. package/agents/explorer.md +11 -11
  7. package/agents/planner.md +11 -11
  8. package/agents/reviewer.md +11 -11
  9. package/agents/security-reviewer.md +11 -11
  10. package/agents/test-engineer.md +11 -11
  11. package/agents/verifier.md +11 -11
  12. package/agents/writer.md +11 -11
  13. package/docs/architecture.md +173 -164
  14. package/docs/refactor-tasks-phase3.md +394 -394
  15. package/docs/refactor-tasks-phase4.md +564 -564
  16. package/docs/refactor-tasks-phase5.md +402 -402
  17. package/docs/refactor-tasks-phase6.md +662 -662
  18. package/docs/research-extension-examples.md +297 -0
  19. package/docs/research-extension-system.md +324 -0
  20. package/docs/research-optimization-plan.md +548 -0
  21. package/docs/research-pi-coding-agent.md +357 -0
  22. package/docs/resource-formats.md +4 -3
  23. package/docs/runtime-flow.md +148 -148
  24. package/docs/source-runtime-refactor-map.md +83 -83
  25. package/docs/usage.md +3 -3
  26. package/index.ts +6 -6
  27. package/package.json +1 -1
  28. package/schema.json +53 -1
  29. package/skills/git-master/SKILL.md +24 -19
  30. package/skills/read-only-explorer/SKILL.md +26 -21
  31. package/skills/safe-bash/SKILL.md +21 -16
  32. package/skills/task-packet/SKILL.md +28 -23
  33. package/skills/verify-evidence/SKILL.md +27 -22
  34. package/src/agents/agent-serializer.ts +34 -34
  35. package/src/agents/discover-agents.ts +102 -102
  36. package/src/config/config.ts +14 -1
  37. package/src/config/defaults.ts +3 -2
  38. package/src/extension/cross-extension-rpc.ts +82 -82
  39. package/src/extension/import-index.ts +4 -3
  40. package/src/extension/management.ts +2 -2
  41. package/src/extension/project-init.ts +9 -7
  42. package/src/extension/register.ts +63 -0
  43. package/src/extension/registration/artifact-cleanup.ts +15 -14
  44. package/src/extension/registration/commands.ts +208 -208
  45. package/src/extension/registration/compaction-guard.ts +125 -0
  46. package/src/extension/registration/subagent-tools.ts +27 -8
  47. package/src/extension/registration/team-tool.ts +61 -44
  48. package/src/extension/result-watcher.ts +98 -98
  49. package/src/extension/run-import.ts +4 -4
  50. package/src/extension/run-index.ts +14 -14
  51. package/src/extension/run-maintenance.ts +24 -24
  52. package/src/extension/team-tool/api.ts +3 -0
  53. package/src/extension/team-tool/cancel.ts +31 -31
  54. package/src/extension/team-tool/doctor.ts +179 -178
  55. package/src/extension/team-tool/inspect.ts +41 -41
  56. package/src/extension/team-tool/lifecycle-actions.ts +79 -79
  57. package/src/extension/team-tool/plan.ts +19 -19
  58. package/src/extension/team-tool/status.ts +73 -73
  59. package/src/prompt/prompt-runtime.ts +68 -68
  60. package/src/runtime/agent-control.ts +64 -64
  61. package/src/runtime/agent-memory.ts +72 -72
  62. package/src/runtime/agent-observability.ts +113 -113
  63. package/src/runtime/async-marker.ts +26 -26
  64. package/src/runtime/background-runner.ts +53 -53
  65. package/src/runtime/crew-agent-runtime.ts +58 -58
  66. package/src/runtime/direct-run.ts +35 -35
  67. package/src/runtime/foreground-control.ts +82 -82
  68. package/src/runtime/green-contract.ts +46 -46
  69. package/src/runtime/group-join.ts +88 -88
  70. package/src/runtime/live-agent-control.ts +78 -78
  71. package/src/runtime/live-agent-manager.ts +85 -85
  72. package/src/runtime/live-control-realtime.ts +36 -36
  73. package/src/runtime/live-session-runtime.ts +299 -299
  74. package/src/runtime/manifest-cache.ts +212 -214
  75. package/src/runtime/model-fallback.ts +261 -261
  76. package/src/runtime/parallel-research.ts +44 -44
  77. package/src/runtime/parallel-utils.ts +99 -99
  78. package/src/runtime/pi-json-output.ts +111 -111
  79. package/src/runtime/pi-spawn.ts +96 -96
  80. package/src/runtime/policy-engine.ts +78 -78
  81. package/src/runtime/post-exit-stdio-guard.ts +86 -86
  82. package/src/runtime/process-status.ts +56 -56
  83. package/src/runtime/progress-event-coalescer.ts +43 -43
  84. package/src/runtime/recovery-recipes.ts +74 -74
  85. package/src/runtime/role-permission.ts +39 -39
  86. package/src/runtime/session-usage.ts +79 -79
  87. package/src/runtime/sidechain-output.ts +28 -28
  88. package/src/runtime/subagent-manager.ts +29 -2
  89. package/src/runtime/task-display.ts +38 -38
  90. package/src/runtime/task-output-context.ts +106 -106
  91. package/src/runtime/task-packet.ts +84 -84
  92. package/src/runtime/task-runner/live-executor.ts +98 -98
  93. package/src/runtime/task-runner/progress.ts +111 -111
  94. package/src/runtime/task-runner/prompt-builder.ts +72 -72
  95. package/src/runtime/task-runner/result-utils.ts +14 -14
  96. package/src/runtime/task-runner/state-helpers.ts +22 -22
  97. package/src/runtime/worker-heartbeat.ts +21 -21
  98. package/src/runtime/worker-startup.ts +57 -57
  99. package/src/schema/config-schema.ts +12 -0
  100. package/src/schema/team-tool-schema.ts +100 -100
  101. package/src/state/artifact-store.ts +108 -108
  102. package/src/state/contracts.ts +105 -105
  103. package/src/state/jsonl-writer.ts +77 -77
  104. package/src/state/state-store.ts +8 -9
  105. package/src/state/task-claims.ts +42 -42
  106. package/src/state/types.ts +180 -180
  107. package/src/state/usage.ts +29 -29
  108. package/src/subagents/async-entry.ts +1 -1
  109. package/src/subagents/index.ts +3 -3
  110. package/src/subagents/live/control.ts +1 -1
  111. package/src/subagents/live/manager.ts +1 -1
  112. package/src/subagents/live/realtime.ts +1 -1
  113. package/src/subagents/live/session-runtime.ts +1 -1
  114. package/src/subagents/manager.ts +1 -1
  115. package/src/subagents/spawn.ts +1 -1
  116. package/src/teams/discover-teams.ts +2 -2
  117. package/src/teams/team-serializer.ts +36 -36
  118. package/src/types/diff.d.ts +18 -0
  119. package/src/ui/crew-footer.ts +101 -101
  120. package/src/ui/crew-select-list.ts +111 -111
  121. package/src/ui/crew-widget.ts +285 -285
  122. package/src/ui/dynamic-border.ts +25 -25
  123. package/src/ui/layout-primitives.ts +106 -106
  124. package/src/ui/loaders.ts +158 -158
  125. package/src/ui/mascot.ts +441 -441
  126. package/src/ui/powerbar-publisher.ts +94 -94
  127. package/src/ui/render-diff.ts +119 -119
  128. package/src/ui/run-dashboard.ts +372 -372
  129. package/src/ui/status-colors.ts +54 -54
  130. package/src/ui/syntax-highlight.ts +116 -116
  131. package/src/ui/transcript-viewer.ts +302 -302
  132. package/src/utils/completion-dedupe.ts +63 -63
  133. package/src/utils/file-coalescer.ts +84 -84
  134. package/src/utils/frontmatter.ts +36 -36
  135. package/src/utils/fs-watch.ts +31 -31
  136. package/src/utils/git.ts +262 -262
  137. package/src/utils/ids.ts +12 -12
  138. package/src/utils/names.ts +26 -26
  139. package/src/utils/paths.ts +34 -7
  140. package/src/utils/sleep.ts +32 -32
  141. package/src/utils/timings.ts +31 -31
  142. package/src/utils/visual.ts +159 -159
  143. package/src/workflows/discover-workflows.ts +2 -2
  144. package/src/workflows/validate-workflow.ts +40 -40
  145. package/src/worktree/branch-freshness.ts +45 -45
  146. package/src/worktree/cleanup.ts +71 -69
  147. package/src/worktree/worktree-manager.ts +3 -1
  148. package/teams/default.team.md +12 -12
  149. package/teams/fast-fix.team.md +11 -11
  150. package/teams/implementation.team.md +18 -18
  151. package/teams/parallel-research.team.md +14 -14
  152. package/teams/research.team.md +11 -11
  153. package/teams/review.team.md +12 -12
  154. package/workflows/default.workflow.md +29 -29
  155. package/workflows/fast-fix.workflow.md +22 -22
  156. package/workflows/implementation.workflow.md +38 -38
  157. package/workflows/parallel-research.workflow.md +46 -46
  158. package/workflows/research.workflow.md +22 -22
  159. package/workflows/review.workflow.md +30 -30
@@ -1,164 +1,173 @@
1
- # pi-crew Architecture
2
-
3
- `pi-crew` is a Pi package for coordinated multi-agent work. It is intentionally durable-first: every run is represented on disk, every task has a state record, and child workers stream progress into JSONL/status files so foreground sessions, background jobs, dashboards, and later restarts all read the same source of truth.
4
-
5
- ## Layers
6
-
7
- ```text
8
- Pi extension layer
9
- register tools, slash commands, widget/dashboard, notifier, lifecycle cleanup
10
-
11
- Runtime layer
12
- team runner, task graph scheduler, child Pi process runner, async runner,
13
- model fallback, policy engine, worktree manager, live-session experimental path
14
-
15
- State layer
16
- .pi/teams/state/runs/{runId}/manifest.json
17
- .pi/teams/state/runs/{runId}/tasks.json
18
- .pi/teams/state/runs/{runId}/events.jsonl
19
- .pi/teams/state/runs/{runId}/agents/{taskId}/status.json
20
- .pi/teams/artifacts/{runId}/...
21
- ```
22
-
23
- ## Run flow
24
-
25
- ```text
26
- user/team tool
27
-
28
-
29
- handleTeamTool(action=run)
30
- ├─ discover agents/teams/workflows
31
- ├─ validate team/workflow refs
32
- ├─ create run manifest + task graph
33
- ├─ write goal artifact
34
- └─ choose foreground/session-bound or async/background mode
35
-
36
- ├─ foreground: startForegroundRun() schedules executeTeamRun()
37
-
38
- └─ async: spawnBackgroundTeamRun()
39
- ├─ node --import jiti-register.mjs background-runner.ts
40
- ├─ background-runner writes async.started + async.pid marker
41
- └─ executeTeamRun()
42
- ├─ resolve ready task batch
43
- ├─ resolveBatchConcurrency() with hard cap
44
- ├─ runTeamTask() per task
45
- ├─ build prompt + dependency context
46
- ├─ choose configured Pi model candidates
47
- │ ├─ spawn child `pi` worker
48
- │ ├─ observe JSONL/stdout progress
49
- │ ├─ persist agent status/events/output
50
- └─ write result/log/transcript artifacts
51
- ├─ merge task updates monotonically
52
- ├─ write progress artifacts
53
- └─ synthesize policy closeout
54
- ```
55
-
56
- ## Extension layer
57
-
58
- `src/extension/register.ts` wires the package into Pi:
59
-
60
- - `team` tool and management actions.
61
- - Conflict-safe subagent tools: `crew_agent`, `crew_agent_result`, `crew_agent_steer`.
62
- - Claude-style aliases: `Agent`, `get_subagent_result`, `steer_subagent` when available.
63
- - Slash commands including `/team-run`, `/team-status`, `/team-dashboard`, `/team-doctor`, `/team-config`, `/team-summary`.
64
- - Active-only widget and optional dashboard/sidebar UI.
65
- - Foreground run scheduling and shutdown cleanup.
66
- - Async completion notifier and session-start active-run summary.
67
-
68
- The extension layer should remain thin: user input is normalized into tool parameters, then delegated to runtime/state modules.
69
-
70
- ## Runtime layer
71
-
72
- ### Team runner
73
-
74
- `src/runtime/team-runner.ts` drives workflow execution. It reads queued tasks, computes the ready set from the task graph, applies concurrency limits, runs a batch, then merges results back into the latest task state. Terminal task states are monotonic: stale parallel snapshots must not regress completed/failed/cancelled/skipped tasks back to queued/running.
75
-
76
- ### Task runner
77
-
78
- `src/runtime/task-runner.ts` executes one task. It prepares workspace/worktree context, renders a task prompt, chooses model candidates from Pi configuration, launches a child Pi process by default, and writes result artifacts. Scaffold mode is explicit dry-run only.
79
-
80
- ### Child Pi runtime
81
-
82
- `src/runtime/child-pi.ts` is the default worker runtime. It:
83
-
84
- - launches real `pi` child processes,
85
- - hides Windows console windows with `windowsHide: true`,
86
- - streams JSONL output into transcripts,
87
- - compacts noisy message updates,
88
- - isolates observer callback failures so progress persistence cannot kill orchestration,
89
- - applies post-exit stdio guards for late output.
90
-
91
- ### Async background runner
92
-
93
- `src/runtime/async-runner.ts` spawns detached background runs. Installed packages use an absolute `jiti-register.mjs` loader path because Node strip-types refuses TypeScript under `node_modules`. The runner fail-fasts if jiti is missing, and writes `async.pid` once startup begins so the parent can distinguish a healthy start from an early import crash.
94
-
95
- ### Concurrency and policy
96
-
97
- `src/runtime/concurrency.ts` picks batch size from explicit limits, team settings, workflow settings, or built-in defaults. User-provided `limits.maxConcurrentWorkers` is hard-capped by default to prevent local DoS; `limits.allowUnboundedConcurrency=true` is an explicit opt-out and emits an observability event.
98
-
99
- `src/runtime/policy-engine.ts` applies closeout and safety policy decisions such as limit exceeded, failed task blocking, stale workers, and green-contract failures.
100
-
101
- ### Model routing
102
-
103
- Model choice is based on Pi's current configuration/model registry, not hardcoded providers. Task and agent records persist model attempts and routing metadata so dashboards/status can show requested model, selected model, fallback chain, and fallback reason.
104
-
105
- ## State layer
106
-
107
- Run state is under:
108
-
109
- ```text
110
- .pi/teams/state/runs/{runId}/
111
- manifest.json run metadata/status/artifacts/async pid
112
- tasks.json task graph and per-task status
113
- events.jsonl append-only run events
114
- events.jsonl.seq event sequence cache
115
- agents.json aggregate agent cache
116
- async.pid background startup marker
117
- agents/{taskId}/
118
- status.json per-agent status source
119
- events.jsonl per-agent event stream
120
- output.log compact worker output
121
- sidechain.output.jsonl
122
- live-control.jsonl
123
- ```
124
-
125
- Artifacts are under:
126
-
127
- ```text
128
- .pi/teams/artifacts/{runId}/
129
- goal.md
130
- prompts/{taskId}.md
131
- results/{taskId}.txt
132
- logs/{taskId}.log
133
- transcripts/{taskId}.jsonl
134
- metadata/*.json
135
- progress.md
136
- summary.md
137
- ```
138
-
139
- Atomic writes use temp-file replace with retry for transient Windows `EPERM`/`EBUSY`/`EACCES`. JSONL append paths are best-effort where used for observers/progress; write failures must not crash child output parsing.
140
-
141
- ## UI and observability
142
-
143
- - The persistent widget shows active runs only.
144
- - Stale async runs with dead background pids are hidden from the active widget.
145
- - `/team-status` is the canonical detailed state view and can mark stale active async runs failed.
146
- - `/team-dashboard` provides history and details.
147
- - Powerbar publishing is optional and event-compatible.
148
- - Transcript viewer is file-backed so it works for foreground and async runs.
149
-
150
- ## Lifecycle and cleanup
151
-
152
- Foreground runs are session-bound and should be interrupted on session shutdown or session switch. Only explicit `async: true` runs are allowed to survive the Pi session. Runtime cleanup is registered through Pi lifecycle hooks and a global reload cleanup guard.
153
-
154
- ## Configuration
155
-
156
- Key config sections:
157
-
158
- - `runtime`: `auto`, `child-process`, `scaffold`, experimental `live-session`.
159
- - `limits`: concurrency/task/depth safety controls.
160
- - `ui`: widget/dashboard/powerbar/model-token display settings.
161
- - `agents`: builtin overrides for models/fallbacks/tools.
162
- - `autonomous`: policy injection/profile for proactive team delegation.
163
-
164
- See `usage.md`, `resource-formats.md`, `runtime-flow.md`, and `live-mailbox-runtime.md` for operational details.
1
+ # pi-crew Architecture
2
+
3
+ `pi-crew` is a Pi package for coordinated multi-agent work. It is intentionally durable-first: every run is represented on disk, every task has a state record, and child workers stream progress into JSONL/status files so foreground sessions, background jobs, dashboards, and later restarts all read the same source of truth.
4
+
5
+ ## Layers
6
+
7
+ ```text
8
+ Pi extension layer
9
+ register tools, slash commands, widget/dashboard, notifier, lifecycle cleanup
10
+
11
+ Runtime layer
12
+ team runner, task graph scheduler, child Pi process runner, async runner,
13
+ model fallback, policy engine, worktree manager, live-session experimental path
14
+
15
+ State layer (project root resolves to <crewRoot>:
16
+ - .crew/ when no .pi/ exists in the repo (default)
17
+ - .pi/teams/ when the repo already has .pi/ (legacy reuse))
18
+ <crewRoot>/state/runs/{runId}/manifest.json
19
+ <crewRoot>/state/runs/{runId}/tasks.json
20
+ <crewRoot>/state/runs/{runId}/events.jsonl
21
+ <crewRoot>/state/runs/{runId}/agents/{taskId}/status.json
22
+ <crewRoot>/artifacts/{runId}/...
23
+ ```
24
+
25
+ ## Run flow
26
+
27
+ ```text
28
+ user/team tool
29
+
30
+
31
+ handleTeamTool(action=run)
32
+ ├─ discover agents/teams/workflows
33
+ ├─ validate team/workflow refs
34
+ ├─ create run manifest + task graph
35
+ ├─ write goal artifact
36
+ └─ choose foreground/session-bound or async/background mode
37
+
38
+ ├─ foreground: startForegroundRun() schedules executeTeamRun()
39
+
40
+ └─ async: spawnBackgroundTeamRun()
41
+ ├─ node --import jiti-register.mjs background-runner.ts
42
+ ├─ background-runner writes async.started + async.pid marker
43
+ └─ executeTeamRun()
44
+ ├─ resolve ready task batch
45
+ ├─ resolveBatchConcurrency() with hard cap
46
+ ├─ runTeamTask() per task
47
+ │ ├─ build prompt + dependency context
48
+ │ ├─ choose configured Pi model candidates
49
+ │ ├─ spawn child `pi` worker
50
+ ├─ observe JSONL/stdout progress
51
+ ├─ persist agent status/events/output
52
+ │ └─ write result/log/transcript artifacts
53
+ ├─ merge task updates monotonically
54
+ ├─ write progress artifacts
55
+ └─ synthesize policy closeout
56
+ ```
57
+
58
+ ## Extension layer
59
+
60
+ `src/extension/register.ts` wires the package into Pi:
61
+
62
+ - `team` tool and management actions.
63
+ - Conflict-safe subagent tools: `crew_agent`, `crew_agent_result`, `crew_agent_steer`.
64
+ - Claude-style aliases: `Agent`, `get_subagent_result`, `steer_subagent` when available.
65
+ - Slash commands including `/team-run`, `/team-status`, `/team-dashboard`, `/team-doctor`, `/team-config`, `/team-summary`.
66
+ - Active-only widget and optional dashboard/sidebar UI.
67
+ - Foreground run scheduling and shutdown cleanup.
68
+ - Async completion notifier and session-start active-run summary.
69
+
70
+ The extension layer should remain thin: user input is normalized into tool parameters, then delegated to runtime/state modules.
71
+
72
+ ## Runtime layer
73
+
74
+ ### Team runner
75
+
76
+ `src/runtime/team-runner.ts` drives workflow execution. It reads queued tasks, computes the ready set from the task graph, applies concurrency limits, runs a batch, then merges results back into the latest task state. Terminal task states are monotonic: stale parallel snapshots must not regress completed/failed/cancelled/skipped tasks back to queued/running.
77
+
78
+ ### Task runner
79
+
80
+ `src/runtime/task-runner.ts` executes one task. It prepares workspace/worktree context, renders a task prompt, chooses model candidates from Pi configuration, launches a child Pi process by default, and writes result artifacts. Scaffold mode is explicit dry-run only.
81
+
82
+ ### Child Pi runtime
83
+
84
+ `src/runtime/child-pi.ts` is the default worker runtime. It:
85
+
86
+ - launches real `pi` child processes,
87
+ - hides Windows console windows with `windowsHide: true`,
88
+ - streams JSONL output into transcripts,
89
+ - compacts noisy message updates,
90
+ - isolates observer callback failures so progress persistence cannot kill orchestration,
91
+ - applies post-exit stdio guards for late output.
92
+
93
+ ### Async background runner
94
+
95
+ `src/runtime/async-runner.ts` spawns detached background runs. Installed packages use an absolute `jiti-register.mjs` loader path because Node strip-types refuses TypeScript under `node_modules`. The runner fail-fasts if jiti is missing, and writes `async.pid` once startup begins so the parent can distinguish a healthy start from an early import crash.
96
+
97
+ ### Concurrency and policy
98
+
99
+ `src/runtime/concurrency.ts` picks batch size from explicit limits, team settings, workflow settings, or built-in defaults. User-provided `limits.maxConcurrentWorkers` is hard-capped by default to prevent local DoS; `limits.allowUnboundedConcurrency=true` is an explicit opt-out and emits an observability event.
100
+
101
+ `src/runtime/policy-engine.ts` applies closeout and safety policy decisions such as limit exceeded, failed task blocking, stale workers, and green-contract failures.
102
+
103
+ ### Model routing
104
+
105
+ Model choice is based on Pi's current configuration/model registry, not hardcoded providers. Task and agent records persist model attempts and routing metadata so dashboards/status can show requested model, selected model, fallback chain, and fallback reason.
106
+
107
+ ## State layer
108
+
109
+ Run state is under `<crewRoot>` (`.crew/` for new projects, or `.pi/teams/` when the repo already has `.pi/`):
110
+
111
+ ```text
112
+ <crewRoot>/state/runs/{runId}/
113
+ manifest.json run metadata/status/artifacts/async pid
114
+ tasks.json task graph and per-task status
115
+ events.jsonl append-only run events
116
+ events.jsonl.seq event sequence cache
117
+ agents.json aggregate agent cache
118
+ async.pid background startup marker
119
+ agents/{taskId}/
120
+ status.json per-agent status source
121
+ events.jsonl per-agent event stream
122
+ output.log compact worker output
123
+ sidechain.output.jsonl
124
+ live-control.jsonl
125
+ ```
126
+
127
+ Artifacts are under:
128
+
129
+ ```text
130
+ <crewRoot>/artifacts/{runId}/
131
+ goal.md
132
+ prompts/{taskId}.md
133
+ results/{taskId}.txt
134
+ logs/{taskId}.log
135
+ transcripts/{taskId}.jsonl
136
+ metadata/*.json
137
+ progress.md
138
+ summary.md
139
+ ```
140
+
141
+ `<crewRoot>` resolution is centralised in `src/utils/paths.ts#projectCrewRoot()`:
142
+
143
+ - if `<repoRoot>/.pi/` already exists, return `<repoRoot>/.pi/teams/` (legacy reuse, no parallel `.crew/`)
144
+ - otherwise return `<repoRoot>/.crew/` (default for fresh projects)
145
+
146
+ User-global fallback (when no project root is detected) lives under `~/.pi/agent/extensions/pi-crew/`.
147
+
148
+ Atomic writes use temp-file replace with retry for transient Windows `EPERM`/`EBUSY`/`EACCES`. JSONL append paths are best-effort where used for observers/progress; write failures must not crash child output parsing.
149
+
150
+ ## UI and observability
151
+
152
+ - The persistent widget shows active runs only.
153
+ - Stale async runs with dead background pids are hidden from the active widget.
154
+ - `/team-status` is the canonical detailed state view and can mark stale active async runs failed.
155
+ - `/team-dashboard` provides history and details.
156
+ - Powerbar publishing is optional and event-compatible.
157
+ - Transcript viewer is file-backed so it works for foreground and async runs.
158
+
159
+ ## Lifecycle and cleanup
160
+
161
+ Foreground runs are session-bound and should be interrupted on session shutdown or session switch. Only explicit `async: true` runs are allowed to survive the Pi session. Runtime cleanup is registered through Pi lifecycle hooks and a global reload cleanup guard.
162
+
163
+ ## Configuration
164
+
165
+ Key config sections:
166
+
167
+ - `runtime`: `auto`, `child-process`, `scaffold`, experimental `live-session`.
168
+ - `limits`: concurrency/task/depth safety controls.
169
+ - `ui`: widget/dashboard/powerbar/model-token display settings.
170
+ - `agents`: builtin overrides for models/fallbacks/tools.
171
+ - `autonomous`: policy injection/profile for proactive team delegation.
172
+
173
+ See `usage.md`, `resource-formats.md`, `runtime-flow.md`, and `live-mailbox-runtime.md` for operational details.