pi-crew 0.8.13 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +296 -0
  2. package/README.md +118 -2
  3. package/docs/FEATURE_INTAKE.md +1 -1
  4. package/docs/HARNESS.md +20 -19
  5. package/docs/PROJECT_REVIEW.md +132 -133
  6. package/docs/PROJECT_REVIEW_FIXES.md +130 -131
  7. package/docs/actions-reference.md +127 -121
  8. package/docs/architecture.md +1 -1
  9. package/docs/code-review-2026-05-11.md +134 -134
  10. package/docs/commands-reference.md +108 -106
  11. package/docs/comparison-pi-subagents-vs-pi-crew.md +105 -105
  12. package/docs/deep-review-report.md +1 -1
  13. package/docs/dynamic-workflows.md +90 -0
  14. package/docs/fixes/BATCH_A_H1_H2.md +17 -17
  15. package/docs/fixes/bug-007-async-notifier-stale-ctx.md +23 -23
  16. package/docs/followup-plan-2026-05-12.md +135 -135
  17. package/docs/followup-review-2026-05-12.md +86 -86
  18. package/docs/followup-review-round3-2026-05-12.md +123 -123
  19. package/docs/goals.md +59 -0
  20. package/docs/implementation-plan-top3.md +4 -4
  21. package/docs/issue-29-analysis.md +2 -2
  22. package/docs/oh-my-pi-research.md +154 -154
  23. package/docs/optimization-plan.md +2 -0
  24. package/docs/perf/baseline-2026-05.md +9 -9
  25. package/docs/perf/final-report-2026-05.md +2 -2
  26. package/docs/perf/sprint-1-report.md +2 -2
  27. package/docs/perf/sprint-2-report.md +1 -1
  28. package/docs/perf/upgrade-plan-2026-05.md +72 -72
  29. package/docs/pi-crew-bugs.md +230 -230
  30. package/docs/pi-crew-investigation-report.md +102 -102
  31. package/docs/pi-crew-test-round5.md +4 -4
  32. package/docs/runtime-analysis-child-vs-live.md +57 -57
  33. package/docs/runtime-migration-in-process-analysis.md +97 -97
  34. package/install.mjs +3 -2
  35. package/package.json +2 -4
  36. package/skills/orchestration/SKILL.md +11 -11
  37. package/src/agents/agent-config.ts +4 -0
  38. package/src/config/config.ts +39 -0
  39. package/src/config/types.ts +11 -0
  40. package/src/extension/action-suggestions.ts +2 -1
  41. package/src/extension/async-notifier.ts +10 -0
  42. package/src/extension/help.ts +14 -0
  43. package/src/extension/project-init.ts +7 -20
  44. package/src/extension/registration/commands.ts +27 -0
  45. package/src/extension/team-tool/destructive-gate.ts +1 -1
  46. package/src/extension/team-tool/goal-wrap.ts +288 -0
  47. package/src/extension/team-tool/goal.ts +405 -0
  48. package/src/extension/team-tool/run.ts +103 -4
  49. package/src/extension/team-tool/workflow-manage.ts +194 -0
  50. package/src/extension/team-tool.ts +20 -0
  51. package/src/hooks/types.ts +3 -1
  52. package/src/runtime/async-runner.ts +24 -2
  53. package/src/runtime/background-runner.ts +68 -19
  54. package/src/runtime/child-pi.ts +6 -1
  55. package/src/runtime/completion-guard.ts +1 -1
  56. package/src/runtime/dynamic-workflow-context.ts +450 -0
  57. package/src/runtime/dynamic-workflow-runner.ts +180 -0
  58. package/src/runtime/global-worker-cap.ts +96 -0
  59. package/src/runtime/goal-evaluator.ts +294 -0
  60. package/src/runtime/goal-loop-runner.ts +612 -0
  61. package/src/runtime/goal-state-store.ts +209 -0
  62. package/src/runtime/pi-args.ts +10 -2
  63. package/src/runtime/result-extractor.ts +32 -0
  64. package/src/runtime/team-runner.ts +11 -1
  65. package/src/runtime/verification-gates.ts +85 -5
  66. package/src/runtime/verification-integrity.ts +110 -0
  67. package/src/runtime/verification-worktree.ts +136 -0
  68. package/src/runtime/workspace-lock.ts +448 -0
  69. package/src/schema/config-schema.ts +26 -0
  70. package/src/schema/team-tool-schema.ts +39 -4
  71. package/src/state/atomic-write.ts +9 -0
  72. package/src/state/contracts.ts +14 -0
  73. package/src/state/crew-init.ts +18 -5
  74. package/src/state/event-log.ts +7 -1
  75. package/src/state/state-store.ts +2 -0
  76. package/src/state/types.ts +82 -0
  77. package/src/state/worker-atomic-writer.ts +176 -0
  78. package/src/utils/redaction.ts +104 -24
  79. package/src/workflows/discover-workflows.ts +25 -1
  80. package/src/workflows/workflow-config.ts +13 -0
  81. package/teams/parallel-research.team.md +1 -1
  82. package/workflows/examples/hello.dwf.ts +24 -0
@@ -1,19 +1,19 @@
1
- # pi-crew v0.2.20 — Kết quả khảo sát và phân tích
1
+ # pi-crew v0.2.20 — Investigation Results and Analysis
2
2
 
3
- **Ngày:** 2026-05-19
4
- **Môi trường:** linux/x64, Node v22.22.0, Pi CLI v0.75.3
5
- **Model:** zai/glm-5.1 (planner, executor, test-engineer), minimax/MiniMax-M2.7-highspeed (explorer, analyst, reviewer, verifier, writer, critic)
3
+ **Date:** 2026-05-19
4
+ **Environment:** linux/x64, Node v22.22.0, Pi CLI v0.75.3
5
+ **Models:** zai/glm-5.1 (planner, executor, test-engineer), minimax/MiniMax-M2.7-highspeed (explorer, analyst, reviewer, verifier, writer, critic)
6
6
  **pi-crew version:** 0.2.20
7
7
 
8
8
  ---
9
9
 
10
- ## 1. Tổng quan kiến trúc pi-crew
10
+ ## 1. pi-crew architecture overview
11
11
 
12
- ### 1.1 Cấu trúc source code
12
+ ### 1.1 Source code structure
13
13
 
14
14
  ```
15
15
  pi-crew/src/
16
- ├── adapters/ — Adapter cho các bên ngoài
16
+ ├── adapters/ — Adapters for external systems
17
17
  ├── agents/ — Agent discovery & config (10 agents)
18
18
  ├── config/ — Configuration, defaults, drift detection
19
19
  ├── extension/ — Pi extension registration
@@ -21,16 +21,16 @@ pi-crew/src/
21
21
  ├── observability/ — Metrics, correlation, exporters (OTLP, Prometheus)
22
22
  ├── prompt/ — Prompt runtime & pipeline
23
23
  ├── runtime/ — Core runtime (~30+ files)
24
- │ ├── async-runner.ts — Background process spawning với jiti loader
24
+ │ ├── async-runner.ts — Background process spawning with jiti loader
25
25
  │ ├── background-runner.ts — Background entry point, team execution
26
26
  │ ├── child-pi.ts — Child Pi process lifecycle, stdout capture, timeout
27
27
  │ ├── child-pi-pool.ts — Warm pool skeleton (disabled, size=0)
28
- │ ├── live-session-runtime.ts — Live-session (tái sử dụng parent Pi)
28
+ │ ├── live-session-runtime.ts — Live-session (reuses the parent Pi)
29
29
  │ ├── team-runner.ts — Main team run orchestrator
30
30
  │ ├── worker-heartbeat.ts — Heartbeat state tracking
31
31
  │ ├── worker-startup.ts — Startup failure classification
32
32
  │ ├── pi-spawn.ts — Pi binary resolution & spawn command
33
- │ ├── pi-args.ts — Build args cho child Pi workers
33
+ │ ├── pi-args.ts — Build args for child Pi workers
34
34
  │ ├── runtime-resolver.ts — Resolve live-session vs child-process
35
35
  │ ├── crash-recovery.ts — Crash recovery logic
36
36
  │ ├── deadletter.ts — Dead letter queue
@@ -49,7 +49,7 @@ pi-crew/src/
49
49
 
50
50
  ### 1.2 Resource inventory
51
51
 
52
- | Resource | Count | Chi tiết |
52
+ | Resource | Count | Details |
53
53
  |---|---|---|
54
54
  | **Teams** | 6 | default, fast-fix, implementation, parallel-research, research, review |
55
55
  | **Workflows** | 6 | default, fast-fix, implementation, parallel-research, research, review |
@@ -59,12 +59,12 @@ pi-crew/src/
59
59
 
60
60
  ### 1.3 Runtime modes
61
61
 
62
- pi-crew hỗ trợ 2 runtime modes:
62
+ pi-crew supports 2 runtime modes:
63
63
 
64
- | Mode | tả | Ưu điểm | Nhược điểm |
64
+ | Mode | Description | Pros | Cons |
65
65
  |---|---|---|---|
66
- | **live-session** | Tái sử dụng Pi session hiện tại | Nhanh, share provider connection | Không chạy được async/background |
67
- | **child-process** | Spawn Pi process mới | Chạy được background/async | Cần provider connection riêng |
66
+ | **live-session** | Reuses the current Pi session | Fast, shares the provider connection | Cannot run async/background |
67
+ | **child-process** | Spawns a new Pi process | Can run background/async | Needs its own provider connection |
68
68
 
69
69
  **Runtime resolution flow:**
70
70
  ```
@@ -77,9 +77,9 @@ team action='run' + async=true
77
77
 
78
78
  ---
79
79
 
80
- ## 2. Kết quả test toàn diện
80
+ ## 2. Comprehensive test results
81
81
 
82
- ### 2.1 Bảng tổng hợp
82
+ ### 2.1 Summary table
83
83
 
84
84
  | Category | Tests | Pass | Fail | Partial |
85
85
  |---|---|---|---|---|
@@ -91,13 +91,13 @@ team action='run' + async=true
91
91
  | Diagnostics (doctor, validate, help) | 3 | ✅ 3 | 0 | 0 |
92
92
  | Portability (export, import) | 2 | ✅ 2 | 0 | 0 |
93
93
  | Configuration (settings, autonomy) | 2 | ✅ 2 | 0 | 0 |
94
- | **Tổng** | **27** | **20** | **6** | **1** |
94
+ | **Total** | **27** | **20** | **6** | **1** |
95
95
 
96
- ### 2.2 Chi tiết từng test
96
+ ### 2.2 Per-test details
97
97
 
98
98
  #### ✅ Resource Discovery — 5/5 PASS
99
99
 
100
- | Test | Input | Output | Kết quả |
100
+ | Test | Input | Output | Result |
101
101
  |---|---|---|---|
102
102
  | `team list` | List all resources | 6 teams, 6 workflows, 10 agents | ✅ |
103
103
  | `team get` team | Get team=default | 4 roles (explorer→planner→executor→verifier) | ✅ |
@@ -107,13 +107,13 @@ team action='run' + async=true
107
107
 
108
108
  #### ✅ Diagnostics — 3/3 PASS
109
109
 
110
- | Test | Input | Output | Kết quả |
110
+ | Test | Input | Output | Result |
111
111
  |---|---|---|---|
112
112
  | `team doctor` | Full diagnostics | 17/17 checks OK (runtime, filesystem, discovery, validation, drift, schema, async, worktrees) | ✅ |
113
113
  | `team validate` | Validate all resources | 10 agents, 6 teams, 6 workflows, 0 issues | ✅ |
114
114
  | `team help` | Show help | Full command reference (core, inspection, maintenance, portability, diagnostics) | ✅ |
115
115
 
116
- Doctor checks chi tiết:
116
+ Detailed doctor checks:
117
117
  - Runtime: cwd, platform, node, pi, git, config, model — all OK
118
118
  - Filesystem: user state, project state, artifacts — all OK
119
119
  - Discovery: 10 agents, 6 teams, 6 workflows, 10 model hints — all OK
@@ -124,10 +124,10 @@ Doctor checks chi tiết:
124
124
 
125
125
  #### ✅ State Management — 6/6 PASS
126
126
 
127
- | Test | Input | Output | Kết quả |
127
+ | Test | Input | Output | Result |
128
128
  |---|---|---|---|
129
129
  | `team status` | Check run state | Detailed: task graph, events, artifacts, policy decisions | ✅ |
130
- | `team events` | Get event log | 20+ events từ run.created → task.failed với timestamps | ✅ |
130
+ | `team events` | Get event log | 20+ events from run.created → task.failed with timestamps | ✅ |
131
131
  | `team artifacts` | List artifacts | 14 artifacts (prompts, results, metadata, logs, shared) | ✅ |
132
132
  | `team summary` | Run overview | Status, goal, tasks, usage summary | ✅ |
133
133
  | `team prune` | keep=2, confirm=true | 9 runs pruned, 2 kept, audit trail in prune.jsonl | ✅ |
@@ -135,38 +135,38 @@ Doctor checks chi tiết:
135
135
 
136
136
  #### ✅ Portability — 2/2 PASS
137
137
 
138
- | Test | Input | Output | Kết quả |
138
+ | Test | Input | Output | Result |
139
139
  |---|---|---|---|
140
140
  | `team export` | Export completed run | run-export.json + run-export.md created | ✅ |
141
141
  | `team import` | Import exported bundle | Bundle imported to .crew/imports/ with README.md | ✅ |
142
142
 
143
143
  #### ✅ Configuration — 2/2 PASS
144
144
 
145
- | Test | Input | Output | Kết quả |
145
+ | Test | Input | Output | Result |
146
146
  |---|---|---|---|
147
147
  | `team settings` | Show effective settings | Complete: agent overrides, UI config, autonomous mode | ✅ |
148
148
  | `team autonomy` | Show autonomy profile | Profile=suggested, enabled=true, inject policy=true | ✅ |
149
149
 
150
150
  #### ✅ Planning — 1/1 PASS
151
151
 
152
- | Test | Input | Output | Kết quả |
152
+ | Test | Input | Output | Result |
153
153
  |---|---|---|---|
154
154
  | `team plan` | goal="Add health-check endpoint" | 4-step plan: explore → plan → execute → verify | ✅ |
155
155
 
156
156
  #### ❌ Subagent Lifecycle — 0/4 FAIL
157
157
 
158
- | Test | Agent ID | Type | Duration | Output | Kết quả |
158
+ | Test | Agent ID | Type | Duration | Output | Result |
159
159
  |---|---|---|---|---|---|
160
160
  | Agent(explorer) | agent_mpc423rq_1 | explorer | 305s | Empty | ❌ |
161
161
  | Agent(planner) | agent_mpc423rv_2 | planner | 305s | Empty | ❌ |
162
162
  | Agent(analyst) | agent_mpc423rw_3 | analyst | 305s | Empty | ❌ |
163
163
  | crew_agent(explorer) | agent_mpc423rw_4 | explorer | 305s | Empty | ❌ |
164
164
 
165
- Tất cả đều: spawn thành công (PID tồn tại) → zero output → 305s heartbeat timeout → failed.
165
+ All of them: spawn successfully (PID exists) → zero output → 305s heartbeat timeout → failed.
166
166
 
167
167
  #### ❌ Team Run Lifecycle — 1 PASS, 2 FAIL, 1 PARTIAL
168
168
 
169
- | Test | Team | Runtime | Kết quả | Chi tiết |
169
+ | Test | Team | Runtime | Result | Details |
170
170
  |---|---|---|---|---|
171
171
  | implementation async | implementation | child-process | ❌ FAIL | 01_assess heartbeat dead after 300s |
172
172
  | `team retry` | — | — | ✅ PASS | Task re-queued successfully |
@@ -175,11 +175,11 @@ Tất cả đều: spawn thành công (PID tồn tại) → zero output → 305s
175
175
 
176
176
  ---
177
177
 
178
- ## 3. Vấn đề nghiêm trọng: `pi --print` bị treo
178
+ ## 3. Critical issue: `pi --print` hangs
179
179
 
180
- ### 3.1 Mô tả
180
+ ### 3.1 Description
181
181
 
182
- **Tất cả 6 background worker failures đều cùng root cause:** `pi --print` (non-interactive mode) bị treo vô thời hạn.
182
+ **All 6 background worker failures share the same root cause:** `pi --print` (non-interactive mode) hangs indefinitely.
183
183
 
184
184
  ### 3.2 Reproduce
185
185
 
@@ -190,7 +190,7 @@ $ timeout 10 pi --print "say hi"
190
190
  EXIT_CODE: 124 (timeout)
191
191
  ```
192
192
 
193
- Kết quả: **100% reproducible**. Pi CLI khởi động (in context-mode warning) nhưng block trên provider/model call.
193
+ Result: **100% reproducible**. The Pi CLI starts (prints the context-mode warning) but blocks on the provider/model call.
194
194
 
195
195
  ### 3.3 Chain of failure
196
196
 
@@ -200,36 +200,36 @@ pi-crew background run
200
200
  → async-runner.ts: resolve jiti-register.mjs
201
201
  → spawn("pi", [...args], { cwd, env })
202
202
  → Pi CLI starts, prints "[pi-crew] background loader=jiti"
203
- → Pi tries to connect to model provider
203
+ → Pi tries to connect to the model provider
204
204
  → BLOCKS INDEFINITELY — no stdout, no stderr, no error
205
205
  → 300,000ms (5 min) heartbeat timeout
206
206
  → worker.response_timeout: "No output for 300000ms"
207
207
  → task.failed → run.failed
208
208
  ```
209
209
 
210
- ### 3.4 Tại sao live-session vẫn hoạt động?
210
+ ### 3.4 Why does live-session still work?
211
211
 
212
212
  | Aspect | Live-session | Child-process |
213
213
  |---|---|---|
214
- | Provider connection | **Reuse** parent Pi's connection | Tạo connection mới |
215
- | Auth context | Share với parent | Phải tự thiết lập |
216
- | Startup time | Nhanh (no new process) | Chậm (spawn + init) |
217
- | Background capable | ❌ Không | ✅ (nếu provider hoạt động) |
214
+ | Provider connection | **Reuses** the parent Pi's connection | Creates a new connection |
215
+ | Auth context | Shared with parent | Must set up itself |
216
+ | Startup time | Fast (no new process) | Slow (spawn + init) |
217
+ | Background capable | ❌ No | ✅ Yes (if the provider works) |
218
218
 
219
- ### 3.5 Nguyên nhân có thể
219
+ ### 3.5 Possible causes
220
220
 
221
- | # | Nguyên nhân | Khả năng | Cách verify |
221
+ | # | Cause | Likelihood | How to verify |
222
222
  |---|---|---|---|
223
- | 1 | **API key không inherit** bởi child process env | Cao | Check `sanitizeEnvSecrets()` filter quá aggressive không |
224
- | 2 | **Provider endpoint unreachable** từ child process | Trung bình | `curl` đến provider API từ child env |
225
- | 3 | **Provider rate limiting** (parent + child concurrent) | Trung bình | Check provider response headers |
226
- | 4 | **jiti loader stall** — TS compilation hangs | Thấp | jiti import thành công (log confirmed) |
223
+ | 1 | **API key not inherited** by the child process env | High | Check whether `sanitizeEnvSecrets()` filters too aggressively |
224
+ | 2 | **Provider endpoint unreachable** from the child process | Medium | `curl` to the provider API from the child env |
225
+ | 3 | **Provider rate limiting** (parent + child concurrent) | Medium | Check provider response headers |
226
+ | 4 | **jiti loader stall** — TS compilation hangs | Low | jiti import succeeded (log confirmed) |
227
227
 
228
- ### 3.6 Key files liên quan
228
+ ### 3.6 Related key files
229
229
 
230
230
  ```
231
231
  pi-crew/src/runtime/
232
- ├── async-runner.ts — resolveTypeScriptLoader(), spawn args với --import jiti-register.mjs
232
+ ├── async-runner.ts — resolveTypeScriptLoader(), spawn args with --import jiti-register.mjs
233
233
  ├── child-pi.ts — runChildPi(), response timeout, stdout capture
234
234
  │ buildChildPiSpawnOptions() → { cwd, env: sanitizeEnvSecrets(env) }
235
235
  ├── background-runner.ts — Background entry point
@@ -241,54 +241,54 @@ pi-crew/src/config/defaults.ts
241
241
  └── DEFAULT_CHILD_PI.responseTimeoutMs = 5 * 60_000 (300s)
242
242
 
243
243
  pi-crew/src/utils/env-filter.ts
244
- └── sanitizeEnvSecrets() — Filter secret env vars ( thể quá aggressive?)
244
+ └── sanitizeEnvSecrets() — Filter secret env vars (possibly too aggressive?)
245
245
  ```
246
246
 
247
- ### 3.7 Khuyến nghị fix
247
+ ### 3.7 Recommended fix
248
248
 
249
- 1. **Immediate:** Chạy `pi --print "test"` trên terminal để confirm provider connection issue
250
- 2. **Check `sanitizeEnvSecrets()`:** Verify API keys (GOOGLE_API_KEY, MINIMAX_API_KEY, ZAI_API_KEY, etc.) không bị filter
251
- 3. **Thêm error logging:** Capture stderr từ child Pi process vào background.log
252
- 4. **Thêm connection timeout:** Pi CLI nên timeout sau ~30s nếu provider không respond, thay block vô hạn
253
- 5. **Test workaround:** Set `PI_TEAMS_MOCK_CHILD_PI=success` để bypass provider call, verify pi-crew logic riêng
249
+ 1. **Immediate:** Run `pi --print "test"` in a terminal to confirm the provider connection issue
250
+ 2. **Check `sanitizeEnvSecrets()`:** Verify that API keys (GOOGLE_API_KEY, MINIMAX_API_KEY, ZAI_API_KEY, etc.) are not filtered out
251
+ 3. **Add error logging:** Capture stderr from the child Pi process into background.log
252
+ 4. **Add a connection timeout:** The Pi CLI should time out after ~30s if the provider does not respond, instead of blocking indefinitely
253
+ 5. **Test workaround:** Set `PI_TEAMS_MOCK_CHILD_PI=success` to bypass the provider call and verify pi-crew logic in isolation
254
254
 
255
255
  ---
256
256
 
257
- ## 4. Vấn đề phụ: Stale heartbeat notifications sau prune
257
+ ## 4. Secondary issue: Stale heartbeat notifications after prune
258
258
 
259
- ### 4.1 Mô tả
259
+ ### 4.1 Description
260
260
 
261
- Sau khi chạy `team prune`, background watcher vẫn emit "Task heartbeat dead" notifications cho runs đã bị xóa.
261
+ After running `team prune`, the background watcher still emits "Task heartbeat dead" notifications for removed runs.
262
262
 
263
263
  ### 4.2 Pattern
264
264
 
265
265
  ```
266
266
  team prune --keep=0 --confirm=true → 9 runs removed
267
- → Notification: "agent_mpc423rq_1 heartbeat dead" (run đã prune)
268
- → Notification: "agent_mpc423rv_2 heartbeat dead" (run đã prune)
269
- → Notification: "agent_mpc423rw_3 heartbeat dead" (run đã prune)
270
- → Notification: "agent_mpc423rw_4 heartbeat dead" (run đã prune)
271
- → ... (tổng cộng 6+ stale notifications)
267
+ → Notification: "agent_mpc423rq_1 heartbeat dead" (pruned run)
268
+ → Notification: "agent_mpc423rv_2 heartbeat dead" (pruned run)
269
+ → Notification: "agent_mpc423rw_3 heartbeat dead" (pruned run)
270
+ → Notification: "agent_mpc423rw_4 heartbeat dead" (pruned run)
271
+ → ... (6+ stale notifications total)
272
272
  ```
273
273
 
274
- ### 4.3 Nguyên nhân
274
+ ### 4.3 Cause
275
275
 
276
- Background watcher duy trì queue của worker health checks. Khi runs bị prune, watcher không deregister ngay — notifications đã trong queue vẫn được emit.
276
+ The background watcher maintains a queue of worker health checks. When runs are pruned, the watcher does not deregister immediately — notifications already in the queue are still emitted.
277
277
 
278
278
  ### 4.4 Severity: LOW (cosmetic)
279
279
 
280
- ### 4.5 Khuyến nghị
280
+ ### 4.5 Recommendation
281
281
 
282
- - Background watcher nên check run existence trước khi emit heartbeat alerts
283
- - Hoặc: watcher nên deregister workers khi runs bị prune
282
+ - The background watcher should check run existence before emitting heartbeat alerts
283
+ - Or: the watcher should deregister workers when runs are pruned
284
284
 
285
285
  ---
286
286
 
287
- ## 5. Vấn đề phụ: Live-session run bị cancel giữa chừng
287
+ ## 5. Secondary issue: Live-session run cancelled mid-execution
288
288
 
289
- ### 5.1 Mô tả
289
+ ### 5.1 Description
290
290
 
291
- Fast-fix team chạy live-session, task `01_explore` hoàn thành thành công nhưng run bị cancelled trước khi `02_execute` bắt đầu.
291
+ A fast-fix team ran in a live-session; task `01_explore` completed successfully but the run was cancelled before `02_execute` started.
292
292
 
293
293
  ### 5.2 Events
294
294
 
@@ -300,55 +300,55 @@ Fast-fix team chạy live-session, task `01_explore` hoàn thành thành công n
300
300
  04:12:51 run.cancelled: "This operation was aborted"
301
301
  ```
302
302
 
303
- ### 5.3 Nguyên nhân có thể
303
+ ### 5.3 Possible causes
304
304
 
305
- - Session concurrency limit (chỉ 1 live-session active)
305
+ - Session concurrency limit (only 1 active live-session)
306
306
  - User-initiated cancellation
307
- - Conflict với concurrent test operations
307
+ - Conflict with concurrent test operations
308
308
 
309
309
  ### 5.4 Severity: MEDIUM
310
310
 
311
311
  ---
312
312
 
313
- ## 6. Tính năng hoạt động ổn định
313
+ ## 6. Features working stably
314
314
 
315
- Danh sách các tính năng đã test hoạt động chính xác:
315
+ A list of features that have been tested and work correctly:
316
316
 
317
317
  ### Resource Discovery
318
- - ✅ `team list` — Liệt teams, workflows, agents, recent runs
319
- - ✅ `team get` — Chi tiết team/workflow/agent
320
- - ✅ `team recommend` — Gợi ý team phù hợp dựa trên goal
321
- - ✅ `team validate` — Validate tất cả resources
318
+ - ✅ `team list` — Lists teams, workflows, agents, recent runs
319
+ - ✅ `team get` — Details of team/workflow/agent
320
+ - ✅ `team recommend` — Suggests a suitable team based on a goal
321
+ - ✅ `team validate` — Validates all resources
322
322
 
323
323
  ### Diagnostics
324
324
  - ✅ `team doctor` — 17 checks (runtime, filesystem, discovery, drift, schema, async, worktrees)
325
325
  - ✅ `team help` — Full command reference
326
326
 
327
327
  ### State Management
328
- - ✅ `team status` — Run state với task graph, events, policy decisions
329
- - ✅ `team events` — Chronological event log chi tiết
330
- - ✅ `team artifacts` — Liệt artifact files (prompts, results, metadata, logs)
328
+ - ✅ `team status` — Run state with task graph, events, policy decisions
329
+ - ✅ `team events` — Detailed chronological event log
330
+ - ✅ `team artifacts` — Lists artifact files (prompts, results, metadata, logs)
331
331
  - ✅ `team summary` — Concise run overview
332
- - ✅ `team prune` — Cleanup runs với audit trail (prune.jsonl)
332
+ - ✅ `team prune` — Cleanup runs with audit trail (prune.jsonl)
333
333
  - ✅ `team cancel` — Cancel running/queued runs
334
334
 
335
335
  ### Portability
336
- - ✅ `team export` — Export run thành JSON + Markdown
337
- - ✅ `team import` — Import run bundle, tạo README.md summary
336
+ - ✅ `team export` — Export a run to JSON + Markdown
337
+ - ✅ `team import` — Import a run bundle, create a README.md summary
338
338
 
339
339
  ### Configuration
340
340
  - ✅ `team settings` — Show effective settings (agent overrides, UI, autonomous)
341
- - ✅ `team autonomy` — Show/set autonomous mode profile
341
+ - ✅ `team autonomy` — Show/set the autonomous mode profile
342
342
 
343
343
  ### Planning
344
- - ✅ `team plan` — Tạo execution plan với structured steps
344
+ - ✅ `team plan` — Create an execution plan with structured steps
345
345
 
346
346
  ### Retry
347
347
  - ✅ `team retry` — Re-queue failed tasks
348
348
 
349
349
  ---
350
350
 
351
- ## 7. Configuration hiện tại
351
+ ## 7. Current configuration
352
352
 
353
353
  ### Autonomous Mode
354
354
  ```
@@ -381,11 +381,11 @@ DEFAULT_LIVE_SESSION.responseTimeoutMs = 600,000 (10 min)
381
381
 
382
382
  ---
383
383
 
384
- ## 8. Files liên quan
384
+ ## 8. Related files
385
385
 
386
- | File | tả |
386
+ | File | Description |
387
387
  |---|---|
388
- | `/home/bom/source/my_pi/pi-crew-test-results.md` | Báo cáo test chi tiết |
388
+ | `/home/bom/source/my_pi/pi-crew-test-results.md` | Detailed test report |
389
389
  | `/home/bom/.pi/agent/pi-crew.json` | pi-crew config |
390
390
  | `/home/bom/.pi/agent/agents/explorer.md` | Explorer agent config |
391
391
  | `/home/bom/.pi/agent/agents/security-reviewer.md` | Security reviewer config |
@@ -397,15 +397,15 @@ DEFAULT_LIVE_SESSION.responseTimeoutMs = 600,000 (10 min)
397
397
 
398
398
  ## 9. Next Steps
399
399
 
400
- ### Ưu tiên cao
401
- 1. **Fix `pi --print` hangs:** Investigate provider connection trong child process
402
- 2. **Check `sanitizeEnvSecrets()`:** Verify không filter API keys cần thiết
403
- 3. **Thêm stderr logging:** Background.log nên capture stderr từ child Pi
400
+ ### High priority
401
+ 1. **Fix `pi --print` hangs:** Investigate the provider connection in the child process
402
+ 2. **Check `sanitizeEnvSecrets()`:** Verify it does not filter out necessary API keys
403
+ 3. **Add stderr logging:** background.log should capture stderr from the child Pi
404
404
 
405
- ### Ưu tiên trung bình
406
- 4. **Test foreground team to completion:** Verify full workflow lifecycle (explore→plan→execute→verify)
407
- 5. **Stale notification fix:** Background watcher deregister trên prune
405
+ ### Medium priority
406
+ 4. **Test a foreground team to completion:** Verify the full workflow lifecycle (explore→plan→execute→verify)
407
+ 5. **Stale notification fix:** Background watcher deregister on prune
408
408
 
409
- ### Ưu tiên thấp
410
- 6. **Configurable heartbeat timeout:** Thay hardcode 300s bằng config value
411
- 7. **Warm pool implementation:** Hiện tại disabled (size=0), cần Pi-side support
409
+ ### Low priority
410
+ 6. **Configurable heartbeat timeout:** Replace the hardcoded 300s with a config value
411
+ 7. **Warm pool implementation:** Currently disabled (size=0), needs Pi-side support
@@ -22,11 +22,11 @@ Error: Failed to run npm root -g: undefined
22
22
  at DefaultPackageManager.getNpmInstallPath
23
23
  ```
24
24
 
25
- **Root cause identified:** Bug #12 — Fix của Bug #10 đã tình strip mất essential env vars!
25
+ **Root cause identified:** Bug #12 — The fix for Bug #10 accidentally stripped out essential env vars!
26
26
 
27
- `buildChildPiSpawnOptions()` dùng `sanitizeEnvSecrets(env, { allowList: [model API keys] })`. Trong allow-list mode, CHỈ những key matching allow-list được giữ lại. Tất cả other keys (PATH, HOME, USER, etc.) bị strip.
27
+ `buildChildPiSpawnOptions()` uses `sanitizeEnvSecrets(env, { allowList: [model API keys] })`. In allow-list mode, ONLY keys matching the allow-list are kept. All other keys (PATH, HOME, USER, etc.) are stripped.
28
28
 
29
- Child Pi process không PATH → không tìm được npm → crash ngay lập tức
29
+ The child Pi process has no PATH → cannot find npm → crashes immediately
30
30
 
31
31
  **Workers spawned successfully (Bug #11 verified ✅):**
32
32
  - `worker.spawned: pid=339071, pid=339077` — spawn OK
@@ -65,6 +65,6 @@ Error: Failed to run npm root -g: undefined
65
65
 
66
66
  ## Next Step
67
67
 
68
- **Restart Pi** để reload với Bug #12 fix. Sau đó test:
68
+ **Restart Pi** to reload with the Bug #12 fix. Then test:
69
69
  1. Background async team — verify workers produce output within 60s (not 300s timeout)
70
70
  2. Foreground fast-fix team — verify all phases complete