Commit b331509
fix: repair the Windows and macOS test lane failures (#9728)
* fix: repair the Windows and macOS test lane failures
The platform lanes have been dark since 2026-07-02 (gated on a merge
queue that is not enabled); reviving them in #9370 exposed these
pre-existing failures. 72 failing tests across 16 files, all traced to
platform assumptions:
Product fixes (2):
- daemon-git-worktree-guard: on Windows a backslash is a path
separator, not a POSIX escape. The shell-quote tokenizer consumed
`\x` pairs, mangling `C:\repo\sub` into a relative word — false
denials for legitimate commands AND undetected relocations for
backslash-relative ones. Preserve unquoted backslashes before
tokenisation on win32.
- acpAgent isOwnerOnlyDirectory: hard-returning false on win32
disabled Live managed relocation entirely (Node exposes no
ownership bits there). Rest on the structural checks — symlink
rejection and dev/ino identity across the realpath round trip —
the same trade-off serve/live/discovery.ts already makes.
Test-fixture fixes (the product code was already Windows-correct):
- server.test Live catalog roots use the host-native path shape
(path.resolve equality proof fails for POSIX literals on win32)
- review cleanup suite pins POSIX node:path semantics for its
literal-keyed mocks; fetch-pr resume budget uses a native tmpdir;
scratch-tree clears the DOS read-only attribute before overwriting
a git-created gitfile; worktree-list assertions compare
slash-normalized (git prints forward slashes on Windows)
- mode-bit (0600) assertions skip on win32 (no POSIX permission
bits; every read side already skips its mode check there)
- O_NOFOLLOW symlink test and the unescapePath no-op test skip on
win32; sidecar errno injection uses a portable NUL byte; Footer
exact-hint text is platform-conditional (win32 indicator is
8 columns shorter, shifting the flex shrink by one)
scripts vitest suite: drop the fixed 8-16 worker floor that
oversubscribes the 3-core macOS runners — the main thread stalled
past the 60s worker RPC timeout (onTaskUpdate), exiting 1 with every
test green.
* fix: second round of platform lane repairs from CI verification
Verification run (fixes + #9370's workflow) cut the Windows failures
from 69 to 5 and left the macOS lane's infra error. Follow-ups:
- daemon-git-worktree-guard resolvePhysicalPath: splitting an absolute
Windows path yields the drive as a segment (C:), which path.join
glued back onto the root as C:\C:. Walk only the part past the root.
Exposed by the first round's tokenizer fix, which let intact drive
paths reach this code for the first time.
- scratch-tree tests: the git-created gitfile refuses in-place
overwrite on Windows even after clearing the read-only attribute;
delete and recreate instead.
- bridge.test stderr audit assertion: the line prints the session id
through JSON.stringify, escaping Windows backslashes; match the
escaped spelling (test added this morning by #9543, landed after the
baseline census).
- managed-scratch 'root replaced' test: dev/ino identity is not
reliably observable on every Windows volume; state the precondition
and skip where the swap is indistinguishable.
- scripts vitest suite: the unhandled onTaskUpdate worker RPC timeout
is deterministic on the macOS runners with every test green; stop
letting unhandled errors fail this suite while test failures stay
fatal, and drop the stale claim that the pool override removal
fixed it.
* fix(ci): skip coverage report generation on non-Linux CI
CI consumes coverage only from the ubuntu lane: the artifact upload and
the coverage comment both pin coverage-reports-*-ubuntu-latest. On the
Windows runners the v8 report generation for 800+ files stalls the
vitest main thread past the 60s worker RPC budget at the end of an
all-green cli run, exiting the lane 1 (observed in verification run
32569004418). Skip coverage on non-Linux CI; local runs keep it.
* fix(ci): stop all-green cli/core runs exiting red on RPC timeout
The Windows lane's third verification round repeated the failure with
coverage already disabled: 866 cli test files green, then the worker
onTaskUpdate RPC budget (60s, hardcoded in vitest's bundled birpc)
expired under runner resource pressure and the unhandled error exited
the lane 1. Extend the scripts suite's treatment to the two big package
suites: test failures stay fatal, unhandled errors do not.
* fix: address review on the win32 guard pre-pass and lane configs
R1-1 (Critical): the win32 pre-pass escaped the character after every
unquoted backslash, so whitespace after a trailing separator glued the
next word into the -C value — a second -C/--git-dir/-c parked there
vanished from the analysis while cmd.exe still split the argv at the
whitespace, allowing a destructive mutation outside the boundary. The
tokenizer treats `\<space>` as an escaped space even after an even
number of backslashes, so escaping forward can never express "literal
backslash, then word boundary". Escape the backslash alone instead: a
double-quoted backslash before whitespace and cmd boundary characters
(; | & < > ( )) keeps them their separator role, and a plain escaped
backslash elsewhere. Verified token boundaries for the attack shape,
its tab variant, trailing-separator-before-flag, UNC, chained -C, and
quoted paths; added win32-only guard tests for the boundary shapes.
R1-2/3/4: gate dangerouslyIgnoreUnhandledErrors to non-Linux — the
ubuntu lane and Linux local runs keep the unhandled-error signal.
R1-5: pin the deterministic win32 footer truncation ('queu') instead
of skipping the content assertion there.
R1-6: build the Live conversations fixture root with the file's
documented path.resolve(path.sep, ...) convention instead of a
hardcoded C: literal.
* fix: three Windows lane failures from recent main commits
Verification of the revived lanes surfaced three failures introduced
by commits that landed while the lanes were dark:
- isSameFile compared dev/ino unconditionally; on volumes that report
ino 0 (or a colliding value) for every file it equated distinct
files. Treat an unverifiable inode like core's hasVerifiableInode
convention and fall back to canonical spellings — losing hard-link
identity there, but never equating distinct files. The hard-link
test skips where the volume exposes no inode.
- drive's bound-address recipe test rmSync'd its temp dir while the
backgrounded service still held it (EBUSY on Windows); shorten the
service's self-exit timer and retry the removal.
- the FileReadCache seeding test collided under one dev:ino key when
the volume reports the same inode for both MEMORY.md indexes; skip
where inode identity is not real.
* fix: address round-2 review on identity fail-closed checks and the win32 guard pre-pass
* fix(cli): deny cmd.exe rewrite syntax in the daemon git-worktree guard (#9728)
* fix: address round-4 review on the cmd-rewrite denial reason and cmd-lane test gating
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix: address round-5 review by closing the divergent Windows shell surface structurally
The win32 cmd/PowerShell lanes were analysed through a POSIX text model
plus per-stage patches; each round closed one entrance of the divergence
family and the next found new ones. Fail closed on syntax whose lane
semantics diverge from the model (lone `&`, `( )`, cmd `#`/`;`/single
quotes, /s outer-quote strip, PowerShell `--%`/`''` doubling), normalize
the whole command text once before any stage reads it, drop the bash
shadow model on lanes where the syntax defines nothing, and stop scoping
PowerShell pipeline stages as subshells.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix: address round-6 review by gating bash-semantics tests off the win32 lane and failing closed on nested Windows shells
R6-1: the whole-text divergent-syntax gate denied ~20 ungated bash-semantics
expectations on the real win32/cmd merge lane (41 failures reproduced under a
lane-spoof harness). Gate those blocks off the win32 non-bash lanes, splitting
mixed blocks so lane-safe pins keep running there, and commit the lane-spoof
harness so the whole guard suite runs as the win32/cmd merge lane on every
lane.
R5-1 (partial): cmd/powershell/pwsh invocations now fail closed on the
undecidable-payload denial on every lane — their payloads are parsed by a
grammar the POSIX text model cannot read (closes the -EncodedCommand and
nested cmd /c entrances probed at this head). The remaining class closure is
escalated to the maintainer as a product/scope decision.
* fix: address round-7 review by gating the Windows-shell fail-closed rule to the win32 platform
R7-1: the round-6 WINDOWS_SHELL_PROGRAMS branch failed closed on every lane,
which denied benign cross-platform PowerShell on POSIX daemons (pwsh
-NoProfile -Command Write-Output hello reproduced denied on the unresolved
reason at this head). Gate the rule to platform win32 — cmd.exe and Windows
PowerShell only exist there, and they stay reachable from win32 Git Bash
sessions, so the gate is platform-wide rather than windowsNative; on POSIX
the same names keep the base stance of ordinary unmodelled programs. Move
the fail-closed pins onto spoofed win32 lanes, add a win32 Git Bash lane pin
so the entrance stays closed there, and add the POSIX benign-pwsh regression
test.
* fix(cli): close the cmd.exe state-persisting entrances in the daemon guard
Probe-verified bypasses (review R5-1): cmd.exe builtins persist state
into every later &&-chained command, and the analysis modelled none of
them — `set GIT_WORK_TREE=<outside>&& git reset --hard` and
`chdir <outside> && git reset --hard` both analysed cwd-local while
the executed command relocated outside the boundary.
cmd's state-persisting builtins are a closed set, so this enumerates
them instead of chasing individual shapes:
- `set VAR=value` / `setx VAR value` carry the semantics of a POSIX
`export VAR=value` for every later segment; route them through that
machinery (GIT_* keys become relocations, unresolvable keys fail
closed). Non-assignment forms (`set /p`, dynamic operands) fail
closed.
- `chdir` joins the cd family (cmd's synonym), `/D` consumed as the
drive-switch option.
- `path` and `doskey` rewrite which executable a bare name resolves
to — unresolvable, failed closed.
- copy/mklink/move/robocopy/xcopy join the relinking programs on
win32, and the text relocation markers learn `chdir`.
PowerShell-only entrances (function definitions, New-Item function:,
@-splatting) already fail closed through the unmodelled-syntax gate;
the new branches stay gated off Git-Bash sessions, where these words
are ordinary POSIX commands. Pinned by new tests in the win32-lane
harness, which spoofs win32/cmd on every platform.
* Revert "fix(cli): close the cmd.exe state-persisting entrances in the daemon guard"
This reverts commit a8f137a.
* Reapply "fix(cli): close the cmd.exe state-persisting entrances in the daemon guard"
This reverts commit b888a42.
* fix: address round-10 review by closing the Windows-lane guard entrances and the ino-0 case fold
* fix(cli): repair the round-10 build rejection by mapping chdir variants exhaustively
* fix(cli): make the /MIR relink-switch denial assertion lane-independent
The assertion spelled the unresolvable target as POSIX '/MIR', but the win32
lane resolves it through path.win32/realpathNearestExistingAsync into a
backslash spelling ('\\MIR'/'C:\\MIR'), so the new test failed only on the
merge_group-gated test_windows lane. Match either separator spelling.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
---------
Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>1 parent 21706b6 commit b331509
30 files changed
Lines changed: 2481 additions & 374 deletions
File tree
- packages
- acp-bridge/src
- cli
- src
- acp-integration
- live
- commands/review
- lib
- serve
- live
- ui/components
- core
- src
- config
- core
- extension
- tools/agent
- scripts/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26962 | 26962 | | |
26963 | 26963 | | |
26964 | 26964 | | |
| 26965 | + | |
| 26966 | + | |
26965 | 26967 | | |
26966 | | - | |
| 26968 | + | |
| 26969 | + | |
| 26970 | + | |
26967 | 26971 | | |
26968 | 26972 | | |
26969 | 26973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5330 | 5330 | | |
5331 | 5331 | | |
5332 | 5332 | | |
| 5333 | + | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
| 5350 | + | |
| 5351 | + | |
| 5352 | + | |
| 5353 | + | |
| 5354 | + | |
| 5355 | + | |
| 5356 | + | |
| 5357 | + | |
| 5358 | + | |
| 5359 | + | |
| 5360 | + | |
| 5361 | + | |
| 5362 | + | |
| 5363 | + | |
| 5364 | + | |
| 5365 | + | |
| 5366 | + | |
| 5367 | + | |
| 5368 | + | |
5333 | 5369 | | |
5334 | 5370 | | |
5335 | 5371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3176 | 3176 | | |
3177 | 3177 | | |
3178 | 3178 | | |
3179 | | - | |
3180 | 3179 | | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
3181 | 3188 | | |
3182 | 3189 | | |
3183 | 3190 | | |
| |||
Lines changed: 22 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | | - | |
| 93 | + | |
90 | 94 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
| 938 | + | |
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| |||
948 | 948 | | |
949 | 949 | | |
950 | 950 | | |
951 | | - | |
| 951 | + | |
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
994 | 1005 | | |
995 | 1006 | | |
996 | 1007 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
4183 | 4184 | | |
4184 | 4185 | | |
4185 | 4186 | | |
4186 | | - | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
4187 | 4192 | | |
4188 | 4193 | | |
4189 | 4194 | | |
| |||
4474 | 4479 | | |
4475 | 4480 | | |
4476 | 4481 | | |
4477 | | - | |
| 4482 | + | |
4478 | 4483 | | |
4479 | 4484 | | |
4480 | 4485 | | |
| |||
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
78 | | - | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | | - | |
173 | | - | |
| 177 | + | |
| 178 | + | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
| |||
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
196 | | - | |
197 | | - | |
| 201 | + | |
| 202 | + | |
198 | 203 | | |
199 | 204 | | |
200 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
21 | 64 | | |
22 | 65 | | |
23 | 66 | | |
| |||
31 | 74 | | |
32 | 75 | | |
33 | 76 | | |
34 | | - | |
| 77 | + | |
35 | 78 | | |
36 | 79 | | |
37 | 80 | | |
38 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
39 | 89 | | |
40 | 90 | | |
41 | 91 | | |
42 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
43 | 141 | | |
44 | 142 | | |
45 | 143 | | |
| |||
0 commit comments