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,46 +1,46 @@
1
1
  # Follow-up Review — pi-crew (2026-05-12, round 2)
2
2
 
3
- Tác giả: Droid (Factory) | Liên quan: `docs/followup-plan-2026-05-12.md`, commit `926e6ee`.
3
+ Author: Droid (Factory) | Related: `docs/followup-plan-2026-05-12.md`, commit `926e6ee`.
4
4
 
5
- Review lại sau khi commit `926e6ee` đã apply các fix B1–B9 + A1–A2 từ `followup-plan-2026-05-12.md`.
5
+ Review after commit `926e6ee` applied the B1–B9 + A1–A2 fixes from `followup-plan-2026-05-12.md`.
6
6
 
7
- ## Tóm tắt kết quả
7
+ ## Result summary
8
8
 
9
9
  - `npm run typecheck` → Passed
10
- - `npm run test:unit` → **1411 tests / 1408 pass / 0 fail / 3 skip** (trước: 1389/1400 với 8 fail bash-on-Windows)
11
- - `npm run check:lazy-imports` → **FAIL trên Windows** (chi tiết bên dưới)
10
+ - `npm run test:unit` → **1411 tests / 1408 pass / 0 fail / 3 skip** (previously: 1389/1400 with 8 bash-on-Windows failures)
11
+ - `npm run check:lazy-imports` → **FAILS on Windows** (details below)
12
12
 
13
- ## Trạng thái từng item
13
+ ## Per-item status
14
14
 
15
- | # | Item | Trạng thái | Ghi chú |
15
+ | # | Item | Status | Notes |
16
16
  |---|---|---|---|
17
- | B1 | bash portability | ✅ Done | `resolveShellForScript` + `resolveBashCmd` trong `src/utils/resolve-shell.ts`. Áp dụng `post-checks.ts` + `iteration-hooks.ts`. 8 test fail trước đây pass. |
18
- | B2 | `worktree-manager.test.ts` | ⚠️ Partial | 3 test (branch recovery, reuse, clean leader). Thiếu test `linkNodeModulesIfPresent` reject file. |
17
+ | B1 | bash portability | ✅ Done | `resolveShellForScript` + `resolveBashCmd` in `src/utils/resolve-shell.ts`. Applied to `post-checks.ts` + `iteration-hooks.ts`. The 8 previously failing tests pass. |
18
+ | B2 | `worktree-manager.test.ts` | ⚠️ Partial | Has 3 tests (branch recovery, reuse, clean leader). Missing the `linkNodeModulesIfPresent` reject-file test. |
19
19
  | B3 | `artifact-store.test.ts` | ✅ Done | Hash integrity + path traversal + nested dirs. |
20
- | B4 | lock parity test | ✅ Done | 2 test mới: stale recovery sync+async, active lock throws. |
21
- | B5 | setup-hook env filter | ⚠️ Partial | `sanitizeEnvSecrets` đã apply. Dùng deny-list `SECRET_KEY_PATTERN` thay allow-list như plan đề xuất. |
20
+ | B4 | lock parity test | ✅ Done | 2 new tests: stale recovery sync+async, active lock throws. |
21
+ | B5 | setup-hook env filter | ⚠️ Partial | `sanitizeEnvSecrets` applied. Uses a deny-list `SECRET_KEY_PATTERN` instead of the allow-list proposed in the plan. |
22
22
  | B6 | worktree checked-out hint | ✅ Done | try/catch + actionable error message. |
23
- | B7 | LAZY marker | ✅ Done | Marker tại `team-tool.ts:58`. |
24
- | B8 | redaction roundtrip | ✅ Done | 3 test (api_key, bearer, on-disk). |
25
- | B9 | CI grep-check | ❌ Broken on Windows | Script dùng `sed`, fail trên Windows. |
26
- | A1 | branchExists remote-tracking | ✅ Done | Trả `{ local, remoteOnly }`. |
23
+ | B7 | LAZY marker | ✅ Done | Marker at `team-tool.ts:58`. |
24
+ | B8 | redaction roundtrip | ✅ Done | 3 tests (api_key, bearer, on-disk). |
25
+ | B9 | CI grep-check | ❌ Broken on Windows | Script uses `sed`, fails on Windows. |
26
+ | A1 | branchExists remote-tracking | ✅ Done | Returns `{ local, remoteOnly }`. |
27
27
  | A2 | jiti fallback robust | ✅ Done | 3 candidates: `lib/jiti-register.mjs`, `register.mjs`, `dist/register.mjs`. |
28
- | A3 | test alias cleanup | ⏭️ Skipped | Plan ghi "không khẩn cấp". |
28
+ | A3 | test alias cleanup | ⏭️ Skipped | Plan noted "not urgent". |
29
29
 
30
30
  ---
31
31
 
32
- ## Vấn đề cần xử lý tiếp
32
+ ## Issues to address next
33
33
 
34
- ### C1 — (Medium, ~10 phút) `scripts/check-lazy-imports.mjs` không chạy được trên Windows
34
+ ### C1 — (Medium, ~10 minutes) `scripts/check-lazy-imports.mjs` doesn't run on Windows
35
35
 
36
36
  **File:** `scripts/check-lazy-imports.mjs`
37
37
 
38
- **Vấn đề:**
39
- - Script dùng `execSync("sed -n '...' ...")` để đọc dòng trước → `sed` không trên Windows mặc định.
40
- - Khi sed fail, mỗi line đi vào `catch` block → `bad.push(line)` → false positive 13 mục.
41
- - `npm run ci` sẽ luôn fail trên Windows dev local.
38
+ **Problem:**
39
+ - The script uses `execSync("sed -n '...' ...")` to read the preceding line → `sed` isn't available on Windows by default.
40
+ - When sed fails, every line falls into the `catch` block → `bad.push(line)` → 13 false positives.
41
+ - `npm run ci` will always fail on a Windows dev machine.
42
42
 
43
- **Fix đề xuất:** dùng Node thuần thay sed.
43
+ **Proposed fix:** use plain Node instead of sed.
44
44
 
45
45
  ```js
46
46
  import { execSync } from "node:child_process";
@@ -68,15 +68,15 @@ if (bad.length) {
68
68
  console.log("All dynamic imports have `// LAZY:` marker.");
69
69
  ```
70
70
 
71
- **Test:** chạy `npm run check:lazy-imports` trên cả Linux Windows → cả 2 expect "All dynamic imports have `// LAZY:` marker."
71
+ **Test:** run `npm run check:lazy-imports` on both Linux and Windows → both should print "All dynamic imports have `// LAZY:` marker."
72
72
 
73
73
  ---
74
74
 
75
- ### C2 — (Medium, ~20 phút) `sanitizeEnvSecrets` dùng deny-list, không đạt mục tiêu defense-in-depth của plan B5
75
+ ### C2 — (Medium, ~20 minutes) `sanitizeEnvSecrets` uses a deny-list, not meeting the defense-in-depth goal of plan B5
76
76
 
77
77
  **File:** `src/utils/env-filter.ts`
78
78
 
79
- **Hiện trạng:**
79
+ **Current state:**
80
80
  ```ts
81
81
  export function sanitizeEnvSecrets(env: NodeJS.ProcessEnv): Record<string, string> {
82
82
  const filtered: Record<string, string> = {};
@@ -87,15 +87,15 @@ export function sanitizeEnvSecrets(env: NodeJS.ProcessEnv): Record<string, strin
87
87
  }
88
88
  ```
89
89
 
90
- **Vấn đề:**
91
- - Deny-list chỉ chặn key matching `SECRET_KEY_PATTERN`. Biến tên không khớp (vd. `DB_PASS`, `MY_KEY_FOO`, `INTERNAL_TOKEN_LEGACY`) sẽ sang setup hook.
92
- - Plan B5 nguyên thuỷ đề xuất allow-list `["PATH", "HOME", "USERPROFILE", "TEMP", "TMP", "LANG", "PI_*"]` → an toàn hơn nhiều cho user-provided hooks.
90
+ **Problem:**
91
+ - The deny-list only blocks keys matching `SECRET_KEY_PATTERN`. Variables whose names don't match (e.g. `DB_PASS`, `MY_KEY_FOO`, `INTERNAL_TOKEN_LEGACY`) will leak into the setup hook.
92
+ - The original plan B5 proposed an allow-list `["PATH", "HOME", "USERPROFILE", "TEMP", "TMP", "LANG", "PI_*"]` → much safer for user-provided hooks.
93
93
 
94
- **Fix đề xuất:** thêm overload với allow-list, giữ deny-list mặc định cho `buildChildPiSpawnOptions` (backward-compat).
94
+ **Proposed fix:** add an overload with an allow-list, keeping the deny-list as the default for `buildChildPiSpawnOptions` (backward-compat).
95
95
 
96
96
  ```ts
97
97
  export interface SanitizeOptions {
98
- allowList?: string[]; // glob-like, hỗ trợ * cuối (vd. "PI_*")
98
+ allowList?: string[]; // glob-like, supports trailing * (e.g. "PI_*")
99
99
  }
100
100
 
101
101
  export function sanitizeEnvSecrets(env: NodeJS.ProcessEnv, options?: SanitizeOptions): Record<string, string> {
@@ -117,7 +117,7 @@ export function sanitizeEnvSecrets(env: NodeJS.ProcessEnv, options?: SanitizeOpt
117
117
  }
118
118
  ```
119
119
 
120
- **Apply tại `worktree-manager.ts:runSetupHook`:**
120
+ **Apply at `worktree-manager.ts:runSetupHook`:**
121
121
 
122
122
  ```ts
123
123
  env: sanitizeEnvSecrets(process.env, {
@@ -125,50 +125,50 @@ env: sanitizeEnvSecrets(process.env, {
125
125
  }),
126
126
  ```
127
127
 
128
- **Test cần thêm:** `test/unit/env-filter.test.ts`:
129
- - Allow-list pass-through cho key match + reject còn lại.
130
- - Glob `PI_*` match `PI_HOME`, `PI_CREW_X` nhưng không match `PIPELINE`.
131
- - Default deny-list giữ behaviour cũ.
128
+ **Tests to add:** `test/unit/env-filter.test.ts`:
129
+ - Allow-list pass-through for matching keys + reject the rest.
130
+ - Glob `PI_*` matches `PI_HOME`, `PI_CREW_X` but not `PIPELINE`.
131
+ - Default deny-list keeps old behavior.
132
132
 
133
133
  ---
134
134
 
135
- ### C3 — (Low, ~10 phút) `resolveShellForScript` chưa xử lý đúng `.cmd/.bat` trên Windows
135
+ ### C3 — (Low, ~10 minutes) `resolveShellForScript` doesn't handle `.cmd/.bat` correctly on Windows
136
136
 
137
137
  **File:** `src/utils/resolve-shell.ts`
138
138
 
139
- **Hiện trạng:**
139
+ **Current state:**
140
140
  ```ts
141
141
  if (scriptPath.endsWith(".cmd") || scriptPath.endsWith(".bat")) {
142
142
  return { command: scriptPath, args: [] };
143
143
  }
144
144
  ```
145
145
 
146
- **Vấn đề:**
147
- - Node ≥ 20 chặn spawn trực tiếp `.bat/.cmd` không `shell: true` (CVE-2024-27980). Đường code `execFileSync/spawn` sẽ throw `EINVAL` hoặc `ENOENT`.
148
- - Hệ quả: post-check / iteration-hook viết bằng `.cmd/.bat` sẽ fail âm thầm trên Node 20+.
146
+ **Problem:**
147
+ - Node ≥ 20 blocks spawning `.bat/.cmd` directly without `shell: true` (CVE-2024-27980). The `execFileSync/spawn` code path will throw `EINVAL` or `ENOENT`.
148
+ - Consequence: post-check / iteration-hook written as `.cmd/.bat` will fail silently on Node 20+.
149
149
 
150
- **Fix đề xuất:**
150
+ **Proposed fix:**
151
151
  ```ts
152
152
  if (scriptPath.endsWith(".cmd") || scriptPath.endsWith(".bat")) {
153
153
  return { command: process.env.ComSpec ?? "cmd.exe", args: ["/d", "/s", "/c", scriptPath] };
154
154
  }
155
155
  ```
156
156
 
157
- **Test cần thêm:** trong `test/unit/resolve-shell.test.ts` (tạo mới):
157
+ **Tests to add:** in `test/unit/resolve-shell.test.ts` (create new):
158
158
  - Linux: `.sh` → `{ bash, [path] }`.
159
159
  - Windows + `.ps1` → `{ powershell, ["-File", path] }`.
160
160
  - Windows + `.cmd` → `{ cmd.exe, ["/d", "/s", "/c", path] }`.
161
161
 
162
162
  ---
163
163
 
164
- ### C4 — (Low, ~15 phút) Thiếu test `linkNodeModulesIfPresent` reject file source (BUG-006 regression guard)
164
+ ### C4 — (Low, ~15 minutes) Missing test for `linkNodeModulesIfPresent` rejecting a file source (BUG-006 regression guard)
165
165
 
166
166
  **File:** `test/unit/worktree-manager.test.ts`
167
167
 
168
- **Vấn đề:**
169
- - Plan B2 yêu cầu test này nhưng commit chưa thêm. Nếu ai sửa lại `linkNodeModulesIfPresent` bỏ check `isDirectory()`, BUG-006 sẽ regression không bị test bắt.
168
+ **Problem:**
169
+ - Plan B2 required this test but the commit didn't add it. If someone modifies `linkNodeModulesIfPresent` and removes the `isDirectory()` check, BUG-006 will regress without a test catching it.
170
170
 
171
- **Fix đề xuất:** thêm 1 test (giả định `linkNodeModulesIfPresent` được export hoặc test gián tiếp qua `prepareTaskWorkspace` với `worktree.linkNodeModules=true`):
171
+ **Proposed fix:** add one test (assuming `linkNodeModulesIfPresent` is exported or tested indirectly via `prepareTaskWorkspace` with `worktree.linkNodeModules=true`):
172
172
 
173
173
  ```ts
174
174
  test("prepareTaskWorkspace skips linkNodeModules when source is a file", () => {
@@ -192,21 +192,21 @@ test("prepareTaskWorkspace skips linkNodeModules when source is a file", () => {
192
192
 
193
193
  ---
194
194
 
195
- ### C5 — (Low, ~5 phút) `prepareTaskWorkspace` error message bị ảnh hưởng locale
195
+ ### C5 — (Low, ~5 minutes) `prepareTaskWorkspace` error message affected by locale
196
196
 
197
- **File:** `src/worktree/worktree-manager.ts:127-140` (try/catch quanh `worktree add`)
197
+ **File:** `src/worktree/worktree-manager.ts:127-140` (try/catch around `worktree add`)
198
198
 
199
- **Vấn đề:**
200
- - Regex `/already checked out/` chỉ match khi git chạy với English locale. Trên máy user `LANG=vi_VN` hoặc Git for Windows với locale khác, message gốc khác fallback throw error raw.
199
+ **Problem:**
200
+ - The regex `/already checked out/` only matches when git runs with an English locale. On a user machine with `LANG=vi_VN` or Git for Windows with a different locale, the original message differsfalls back to throwing the raw error.
201
201
 
202
- **Fix đề xuất:** force English locale cho git command nội bộ, hoặc mở rộng regex.
202
+ **Proposed fix:** force an English locale for the internal git command, or broaden the regex.
203
203
 
204
- Option A (đơn giản hơn): mở rộng regex
204
+ Option A (simpler): broaden the regex
205
205
  ```ts
206
- if (/already checked out|is already used by worktree|đã được/i.test(msg)) { ... }
206
+ if (/already checked out|is already used by worktree/i.test(msg)) { ... }
207
207
  ```
208
208
 
209
- Option B (kiến nghị): force LANG=C trong helper `git()`:
209
+ Option B (recommended): force `LANG=C` in the `git()` helper:
210
210
  ```ts
211
211
  function git(cwd: string, args: string[]): string {
212
212
  return execFileSync("git", args, {
@@ -216,29 +216,29 @@ function git(cwd: string, args: string[]): string {
216
216
  }
217
217
  ```
218
218
 
219
- Option B chuẩn hoá toàn bộ output git cải thiện cả debugging.
219
+ Option B standardizes all git output → also improves debugging.
220
220
 
221
221
  ---
222
222
 
223
- ### C6 — (Info, ~5 phút) `branchExists` remote-only tạo local từ HEAD, thể "mất" commits của remote
223
+ ### C6 — (Info, ~5 minutes) `branchExists` remote-only creates local from HEAD, may "lose" the remote's commits
224
224
 
225
225
  **File:** `src/worktree/worktree-manager.ts:prepareTaskWorkspace`
226
226
 
227
- **Hiện trạng:**
227
+ **Current state:**
228
228
  ```ts
229
229
  if (exists.local) {
230
230
  git(repoRoot, ["worktree", "add", worktreePath, branch]);
231
231
  } else {
232
- git(repoRoot, ["worktree", "add", "-b", branch, worktreePath, "HEAD"]); // ← cả remoteOnly "không tồn tại" đều rơi vào đây
232
+ git(repoRoot, ["worktree", "add", "-b", branch, worktreePath, "HEAD"]); // ← both remoteOnly and "doesn't exist" fall here
233
233
  }
234
234
  ```
235
235
 
236
- **Vấn đề:**
237
- - Khi `remoteOnly === true`, plan A1 đề xuất tạo local từ HEAD để tránh divergent tracking. Code hiện tại làm đúng vậy, nhưng:
238
- - Người dùng push branch từ máy khácexpect worktree chứa code đó.
239
- - Không log/warning → silent drop.
236
+ **Problem:**
237
+ - When `remoteOnly === true`, plan A1 proposed creating local from HEAD to avoid divergent tracking. The current code does exactly that, but:
238
+ - The user pushed the branch from another machineexpects the worktree to contain that code.
239
+ - There's no log/warning → silent drop.
240
240
 
241
- **Fix đề xuất:** emit info event/log khi rơi vào nhánh remoteOnly:
241
+ **Proposed fix:** emit an info event/log when hitting the remoteOnly branch:
242
242
  ```ts
243
243
  } else {
244
244
  if (exists.remoteOnly) {
@@ -248,42 +248,42 @@ if (exists.local) {
248
248
  }
249
249
  ```
250
250
 
251
- (Hoặc đẩy lên qua run event nếu event bus thuận tiện.)
251
+ (Or push it out via a run event if there's a convenient event bus.)
252
252
 
253
253
  ---
254
254
 
255
- ## Ưu tiên thực hiện
255
+ ## Implementation priority
256
256
 
257
- | # | Item | Severity | Effort | Khuyến nghị |
257
+ | # | Item | Severity | Effort | Recommendation |
258
258
  |---|---|---|---|---|
259
- | 1 | C1 (lazy-imports cross-platform) | Medium | 10 phút | Sprint hiện tại chặn CI fail trên Windows |
260
- | 2 | C2 (allow-list env filter) | Medium | 20 phút | Sprint hiện tại — defense-in-depth |
261
- | 3 | C3 (.cmd/.bat trên Node 20+) | Low | 10 phút | Sprint hiện tại đảm bảo B1 thực sự portable |
262
- | 4 | C4 (test linkNodeModules file source) | Low | 15 phút | Sprint hiện tại đóng gap regression của B2 |
263
- | 5 | C5 (git locale-safe error parsing) | Low | 5 phút | Sprint kế tiếp |
264
- | 6 | C6 (warn khi remote-only branch) | Info | 5 phút | Sprint kế tiếp |
259
+ | 1 | C1 (lazy-imports cross-platform) | Medium | 10 minutes | Current sprintblock CI failure on Windows |
260
+ | 2 | C2 (allow-list env filter) | Medium | 20 minutes | Current sprint — defense-in-depth |
261
+ | 3 | C3 (.cmd/.bat on Node 20+) | Low | 10 minutes | Current sprintensure B1 is truly portable |
262
+ | 4 | C4 (test linkNodeModules file source) | Low | 15 minutes | Current sprintclose B2's regression gap |
263
+ | 5 | C5 (git locale-safe error parsing) | Low | 5 minutes | Next sprint |
264
+ | 6 | C6 (warn on remote-only branch) | Info | 5 minutes | Next sprint |
265
265
 
266
- **Tổng effort:** ~65 phút cho batch hardening.
266
+ **Total effort:** ~65 minutes for the hardening batch.
267
267
 
268
268
  ---
269
269
 
270
- ## Đề xuất commit batches
270
+ ## Proposed commit batches
271
271
 
272
- - **Batch 1 (must-fix CI):** C1 + C3 → 1 PR "scripts/cmd portability fix" (~20 phút).
273
- - **Batch 2 (security/test):** C2 + C4 → 1 PR "env allow-list + worktree regression test" (~35 phút).
274
- - **Batch 3 (polish):** C5 + C6 → 1 PR "git locale + remote-only branch hint" (~10 phút).
272
+ - **Batch 1 (must-fix CI):** C1 + C3 → 1 PR "scripts/cmd portability fix" (~20 minutes).
273
+ - **Batch 2 (security/test):** C2 + C4 → 1 PR "env allow-list + worktree regression test" (~35 minutes).
274
+ - **Batch 3 (polish):** C5 + C6 → 1 PR "git locale + remote-only branch hint" (~10 minutes).
275
275
 
276
276
  ---
277
277
 
278
- ## Điểm tích cực sau review lần 3
278
+ ## Positive notes after round 3 review
279
279
 
280
- - 8 bash-on-Windows test fail trước đây giờ pass 100%.
281
- - DRY refactor `sanitizeEnvSecrets` (extract từ `child-pi.ts`) tốt.
282
- - `worktree-manager` resume logic + actionable error rất hữu ích cho UX.
283
- - Lock parity test cover cả 2 path sync/async (chính xác mục tiêu BUG-004).
284
- - Artifact hash test verify đúng invariant `sha256(file) == contentHash`.
285
- - `resolveJitiRegisterPath` giờ chịu được nhiều packaging layout của jiti.
286
- - `branchExists` upgrade `{local, remoteOnly}` chính xác theo plan A1.
280
+ - The 8 previously failing bash-on-Windows tests now pass 100%.
281
+ - The DRY refactor of `sanitizeEnvSecrets` (extracted from `child-pi.ts`) is good.
282
+ - The `worktree-manager` resume logic + actionable error is very helpful for UX.
283
+ - The lock parity test covers both sync/async paths (exactly the BUG-004 goal).
284
+ - The artifact hash test correctly verifies the invariant `sha256(file) == contentHash`.
285
+ - `resolveJitiRegisterPath` now tolerates various jiti packaging layouts.
286
+ - The `branchExists` upgrade to `{local, remoteOnly}` is accurate per plan A1.
287
287
 
288
288
  ---
289
289