Commit 9a14756
committed
Restore CI coverage for hook argv expansion and preflight blocking
The hook escaping regression came from asserting a literal `node` prefix even
though installed hooks may be patched to an absolute node binary. The test now
captures argv after shell expansion instead of accidentally invoking the real
runner, and the pre-tool enforcer now sanitizes malformed threshold env input so
agent-heavy exhausted-context preflight keeps blocking deterministically. The
remaining CI flakes came from host config leakage in the pre-tool harness and a
tmux-availability assumption in the duplicate-worker dispatch test, so those
assertions are now hermetic and environment-agnostic.
Constraint: Installed hooks may start with an absolute quoted node path after plugin setup
Constraint: Pre-tool tests must not inherit CLAUDE config from the host, CI runner, or repo-root cwd
Constraint: Duplicate-worker dispatch coverage must not require tmux to be available
Rejected: Keep assuming a literal `node` prefix in hook tests | no longer matches shipped hook shape
Rejected: Leave malformed threshold env unchecked | comparison against NaN silently disables blocking
Rejected: Assert immediate `notified` dispatch state in the duplicate-pane test | depends on tmux availability outside the test contract
Confidence: high
Scope-risk: narrow
Directive: Keep hook argv assertions focused on post-shell tokenization, not a specific node binary spelling
Directive: Keep shell-spawned hook tests pinned to isolated HOME/CLAUDE_CONFIG_DIR values and an isolated child cwd so host routing config cannot leak in
Tested: npm test -- --run src/__tests__/pre-tool-enforcer.test.ts src/team/__tests__/api-interop.dispatch.test.ts src/__tests__/hooks-command-escaping.test.ts
Tested: npm test -- --run
Tested: npm run build
Tested: npm run lint
Not-tested: PR CI rerun on GitHub after push1 parent 85b12bd commit 9a14756
File tree
4 files changed
+61
-20
lines changed- scripts
- src
- __tests__
- team/__tests__
4 files changed
+61
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | 94 | | |
96 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
12 | 29 | | |
13 | 30 | | |
14 | 31 | | |
| |||
31 | 48 | | |
32 | 49 | | |
33 | 50 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
380 | 408 | | |
381 | 409 | | |
382 | 410 | | |
| |||
392 | 420 | | |
393 | 421 | | |
394 | 422 | | |
395 | | - | |
396 | 423 | | |
397 | 424 | | |
398 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
0 commit comments