Context
PR #11764 narrowed #10684 by making Antigravity CLI path resolution portable and verifying the Linux executable path with the existing mock-executable harness pattern. During cross-family review, @neo-opus-ada identified the remaining Windows-specific execution gap: the Windows resolver naturally finds antigravity.cmd, but the shared spawnAsync() helper currently calls spawn(cmd, args, { stdio: 'ignore' }) without a Windows shell strategy.
This ticket preserves that remaining work as a focused Windows follow-up instead of letting PR #11764 claim full Windows execution before a safe .cmd/.bat execution strategy exists.
The Problem
On Windows, Node cannot execute .cmd or .bat files through plain child_process.spawn(file, args) without a shell/cmd.exe execution layer. If resumeHarness.mjs routes @neo-gemini-pro into the antigravity-cli adapter and resolves antigravity.cmd, the current executor can fail with EINVAL rather than producing the controlled Antigravity diagnostic used for missing executables.
The obvious fix, shell: true, is not a free win: the boot-grounding payload flows through the command arguments and can contain shell-significant characters. The Windows path needs a deliberate command-line construction/quoting strategy or an equivalent safer execution substrate, plus test coverage that proves the win32 resolution branch is exercised.
The Architectural Reality
ai/scripts/resumeHarness.mjs owns the fresh-session harness recovery adapters.
resolveAntigravityCliPath() in PR #11764 owns env-var, platform-candidate, and PATH lookup resolution for Antigravity.
spawnAsync() is the shared execution helper for harness adapter process launch.
- The current unit suite lives in
test/playwright/unit/ai/scripts/resumeHarness.spec.mjs and can mock executable dispatch in-sandbox, but cannot provide full L4 proof of a real Windows Antigravity host launch.
The Fix
Implement a Windows-safe .cmd/.bat execution path for the Antigravity CLI adapter:
- Decide the execution primitive for Windows batch wrappers: scoped
shell: true, explicit cmd.exe /d /s /c, or a safer equivalent.
- Quote/escape the
chat -n <payload> command deliberately so boot-grounding payload content cannot become shell syntax.
- Add focused unit coverage for the win32 resolution/execution branch using mock process-platform and mock executable patterns where possible.
- Preserve Linux and macOS behavior from PR #11764.
- Record the evidence ceiling clearly: unit coverage can prove resolution/dispatch shape; real Windows Antigravity host launch remains L4 post-merge validation.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
antigravity-cli Windows execution |
#10684, PR #11764 review cycle 1 |
Windows can execute the resolved Antigravity .cmd/.bat CLI without EINVAL and without shell-injection drift |
Missing CLI still emits actionable ANTIGRAVITY_CLI_PATH / PATH diagnostic |
PR body + harness JSDoc |
Unit coverage for win32 branch; L4 real-host probe post-merge |
spawnAsync() command construction |
Node child_process Windows batch-file behavior |
Windows batch wrappers get a dedicated safe path; POSIX executable spawn remains unchanged |
Payload containing shell-significant characters is treated as data |
Inline comments/JSDoc only where needed |
Mock dispatch and payload quoting tests |
Acceptance Criteria
Out of Scope
- Reworking the Codex or Claude non-macOS adapters.
- Replacing the Antigravity CLI adapter with a different transport.
- Adding a Windows CI runner.
Avoided Traps
| Trap |
Why rejected |
Blanket shell: true everywhere |
Expands command-injection surface and may trip CodeQL without being necessary for POSIX paths |
| Claiming Windows is solved by path resolution alone |
The resolved .cmd still needs a Windows-specific execution strategy |
| Hardcoding a single Antigravity install path |
Windows install layouts can drift; env override + PATH lookup remains the right resolver shape |
Related
- #10684 — original cross-platform Antigravity CLI portability ticket
- PR #11764 — path-resolution + Linux execution scope
- PR #10680 — introduced the Antigravity CLI adapter
- Node
child_process Windows batch-file execution behavior
Origin Session ID
2741c4bd-92b2-428b-92d3-ab718d9a7c41
Handoff Retrieval Hints
query_raw_memories(query="PR 11764 Antigravity Windows cmd spawnAsync shell true")
query_raw_memories(query="Antigravity CLI .cmd EINVAL Windows resumeHarness")
- Review anchor: PR #11764 review cycle 1 by @neo-opus-ada,
PRR_kwDODSospM8AAAABAwwbQA.
Context
PR #11764 narrowed #10684 by making Antigravity CLI path resolution portable and verifying the Linux executable path with the existing mock-executable harness pattern. During cross-family review, @neo-opus-ada identified the remaining Windows-specific execution gap: the Windows resolver naturally finds
antigravity.cmd, but the sharedspawnAsync()helper currently callsspawn(cmd, args, { stdio: 'ignore' })without a Windows shell strategy.This ticket preserves that remaining work as a focused Windows follow-up instead of letting PR #11764 claim full Windows execution before a safe
.cmd/.batexecution strategy exists.The Problem
On Windows, Node cannot execute
.cmdor.batfiles through plainchild_process.spawn(file, args)without a shell/cmd.exe execution layer. IfresumeHarness.mjsroutes@neo-gemini-prointo theantigravity-cliadapter and resolvesantigravity.cmd, the current executor can fail withEINVALrather than producing the controlled Antigravity diagnostic used for missing executables.The obvious fix,
shell: true, is not a free win: the boot-grounding payload flows through the command arguments and can contain shell-significant characters. The Windows path needs a deliberate command-line construction/quoting strategy or an equivalent safer execution substrate, plus test coverage that proves the win32 resolution branch is exercised.The Architectural Reality
ai/scripts/resumeHarness.mjsowns the fresh-session harness recovery adapters.resolveAntigravityCliPath()in PR #11764 owns env-var, platform-candidate, and PATH lookup resolution for Antigravity.spawnAsync()is the shared execution helper for harness adapter process launch.test/playwright/unit/ai/scripts/resumeHarness.spec.mjsand can mock executable dispatch in-sandbox, but cannot provide full L4 proof of a real Windows Antigravity host launch.The Fix
Implement a Windows-safe
.cmd/.batexecution path for the Antigravity CLI adapter:shell: true, explicitcmd.exe /d /s /c, or a safer equivalent.chat -n <payload>command deliberately so boot-grounding payload content cannot become shell syntax.Contract Ledger
antigravity-cliWindows execution.cmd/.batCLI withoutEINVALand without shell-injection driftANTIGRAVITY_CLI_PATH/ PATH diagnosticspawnAsync()command constructionchild_processWindows batch-file behaviorAcceptance Criteria
.cmd/.batAntigravity CLI execution no longer fails through plainspawn()EINVAL.Out of Scope
Avoided Traps
shell: trueeverywhere.cmdstill needs a Windows-specific execution strategyRelated
child_processWindows batch-file execution behaviorOrigin Session ID
2741c4bd-92b2-428b-92d3-ab718d9a7c41Handoff Retrieval Hints
query_raw_memories(query="PR 11764 Antigravity Windows cmd spawnAsync shell true")query_raw_memories(query="Antigravity CLI .cmd EINVAL Windows resumeHarness")PRR_kwDODSospM8AAAABAwwbQA.