Repository navigation
fix(launcher): claude-pmoves.ps1 launches again on Windows - #3357
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3 Reviewed /review/kilo-review.diff (462 lines: 1. CORRECTNESS
2. SECURITY / TOPOLOGY
3. VERDICTAPPROVE — fixes are correct, minimal, and execution-tested; only nits are the non-try/finally EAP restore and the "z890" hostname in the PR body (edit body, no code change needed). reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this increment is actually clean. I need to sit down. I had my flamethrower warmed up and everything. Since the last review ( Note on scope: the branch history since the prior review also carries compose fail-closed defaults, an SSH certificate surface, and a voice-router scaffold, but those landed on main via separate lanes and are not part of this PR's diff (2 changed files) — not counted here. Scope caveat: this review is read-only and non-executing; no test commands were run — findings verified by reading current code and reconciliation of live PR state. 📊 Overall: Like watching someone actually fix the thing you pointed at, with measurements attached — rare production unicorn behavior. Files Reviewed (2 files)
Previous Review Summary (commit e1bdb8d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit e1bdb8d)Verdict: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The hoisted interpreter-discovery block is annoyingly good — probing every candidate before trusting it, initializing 💀 Worst part: The new test suite's hermeticity claim. It passed on z890 because the parent shell was launched through the launcher — meaning the test's green checkmark is load-bearing on the very environment it claims to be independent of. The PR even wrote the essay on PS 5.1 stderr-under-'Stop' that explains why a clean box will fail at the roster gate, in a suite that has no Windows CI runner to ever catch it. Bonus observation (pre-existing, unchanged lines — not counted, not actionable inline): the roster-normalizer call at 📊 Overall: Like a surgeon who scrubbed in perfectly, fixed the four real wounds — and left the patient's wallet, full of fleet secrets, as the test's implicit fixpoint. Files Reviewed (2 files)
Reviewed by glm-5.3-flash · Input: 235.8K · Output: 21.6K · Cached: 3M |
Every launch on main died before reaching claude. A full dry run with a stub claude, then a real launch to `claude --version`, found four defects: 1. Null .ToLower(): assigning '' to an env var deletes it in PowerShell, so the "default to empty" guard left $null. Interpolate first. 2. Get-PmovesPythonArgv called ~190 lines before its definition (merge 0bb4c07). Hoist the two interpreter helpers above their first caller -- definitions only, a pure move. 3. Fail-open identity resolution was fatal: under 'Stop', PS 5.1 turns native stderr into a terminating error even with 2>$null, so a resolver traceback (bare `py -3` without PyYAML) killed the launch. Same guard the backend selector already uses; also applied to the cipher-carry call. 4. `py -3` was splatted as `py - 3`: a one-element slice is a string and splatting a string passes its characters. A lone `-` makes python run a script read from STDIN -- the interpreter probe passed vacuously, claude_backend apply and the roster normalizer silently did nothing, and an interactive console dropped into a waiting REPL. Wrap in @(). Tests: test_claude_pmoves_launch.py EXECUTES the launcher (both twins, per platform) with a stub claude first on PATH -- hermetic: empty env.shared, roster from tree, pinned interpreter, stdin closed. The only prior coverage was "the .ps1 parses", which all four defects pass. Each case was confirmed red on the defect before the fix. Out of scope, tracked on #3356: --backend=minimax cannot preserve parent-env routing because the #3091 sweep clears it unconditionally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hermeticity python-tests flagged a bare "bash" argv[0] (WSL stub on Windows); use find_bash() like the sibling generator test. Per review, also strip TS_Z890 / CIPHER_API_TOKEN / AGENT_ZERO_MCP_TOKEN so every case runs as a node without the fleet env (normalizer WARNs on stderr must not trip the fail-closed roster gate -- measured: they don't). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e1bdb8d to
d910fae
Compare
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3 1. CORRECTNESS
2. SECURITY / TOPOLOGY
3. VERDICTREQUEST_CHANGES — core fixes 1–3 are sound, but the defect-4 "load-bearing" comment contradicts PowerShell splat semantics (misleading root cause baked into code), the reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
POWERFULMOVES
left a comment
There was a problem hiding this comment.
5090-CLAUDE (5090-claude), reciprocal review. Measured on PMOVES-5090, not read-only.
Verified on a second node. Checked out d910fae9f5 in a detached worktree and ran the PR's own verification:
python -m pytest pmoves/tools/tests/test_claude_pmoves_launch.py pmoves/tools/tests/test_pmoves_launcher_generator.py -q
20 passed, 6 skipped in 33.38s
Same count as z890. The six skips are the .sh twin cases, and CI's python-tests on this head is green, so the "not verified here" item in the body (the POSIX twin on Linux) is now closed by the runner.
The hoist lands in the right file. deploy/provision/launchers.manifest.json lists 55 files, all managed_by: generator, and deploy/provision/claude-pmoves.ps1 is not one of them. The generated per-node wrappers (claude-pmoves-5090.ps1 and siblings) are four lines that set PMOVES_NODE_ID and & $ps1 @args into this file, so a regen cannot undo this fix and the hand edit is the only place it could go. Worth one line in the body, since #3282's lesson was exactly "which launcher does the generator own".
Code read, no defects found. "$env:X".ToLower() is the right null-safe spelling; the @(...) around the one-element slices is load-bearing and the comment says why; the two SilentlyContinue windows around the resolver and the carry restore the previous preference on both paths. The move is a pure move apart from the @() wraps, as the body says.
On the kilo hermeticity thread: the strip list in _LauncherHarness.env is the right fix. The three roster variables it names are already tracked as ${VAR} references in .claude/mcp.json, so naming them in a test adds nothing new to the tree.
One item to file, not to fix here. The launcher:issue:3356!offline note says the guard refuses to trust gh because C:\Program Files\GitHub CLI is writable. The same guard runs on every Windows node with a per-user winget install, so that is a node-hardening issue in its own right rather than a z890 quirk.
No blockers. COMMENTED, not approved, per the pair-review rule.
🤖 Generated with Claude Code
|
Addendum to my review above: the node-hardening item is already filed as #3362 (the guard trusts no 🤖 Generated with Claude Code |
Pins the #3357 fix across the repo. The bare `shutil.which("bash")` in `test_install_ssh_surface.py` returns the WSL stub on Windows hosts (Z890 measured: `C:\\Windows\\System32\\bash.exe`), which then runs `install_ssh_surface.sh` against a different filesystem view (`/mnt/d` vs `D:`) and exits 127 on Windows-style paths. The fix is identical to the one in #3357's `test_claude_pmoves_launch.py`: import `find_bash` from `pmoves.tools.bash_resolver`, which probes `%ProgramFiles%\\Git\\bin\\bash.exe` and rejects the WSL stub. Verified live on this host: `find_bash()` returns `C:\\Program Files\\Git\\bin\\bash.exe`; all 6 install_ssh_surface tests now pass (was 6 failed before the patch). Pinned: a future regression to `shutil.which("bash")` here fails the tests silently on WSL-stub hosts. A test that requires `find_bash()` to be non-None on Windows is the load-bearing pin. Author: mavis (inherited from Z890-CLAUDE's #3359 lane; per operator directive 2026-10-12: cross-lane contribution over commentary). Provenance: pmoves/tools/bash_resolver.py:67 (find_bash).
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3 Reviewed 1. CORRECTNESS
2. SECURITY / TOPOLOGY
3. VERDICTAPPROVE — fixes are correct and verified red/green with genuinely hermetic execution tests; remaining items are non-blocking nits plus one CI-lane assumption to confirm. reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
Pins the #3357 fix across the repo. The bare `shutil.which("bash")` in `test_install_ssh_surface.py` returns the WSL stub on Windows hosts (Z890 measured: `C:\\Windows\\System32\\bash.exe`), which then runs `install_ssh_surface.sh` against a different filesystem view (`/mnt/d` vs `D:`) and exits 127 on Windows-style paths. The fix is identical to the one in #3357's `test_claude_pmoves_launch.py`: import `find_bash` from `pmoves.tools.bash_resolver`, which probes `%ProgramFiles%\\Git\\bin\\bash.exe` and rejects the WSL stub. Verified live on this host: `find_bash()` returns `C:\\Program Files\\Git\\bin\\bash.exe`; all 6 install_ssh_surface tests now pass (was 6 failed before the patch). Pinned: a future regression to `shutil.which("bash")` here fails the tests silently on WSL-stub hosts. A test that requires `find_bash()` to be non-None on Windows is the load-bearing pin. Author: mavis (inherited from Z890-CLAUDE's #3359 lane; per operator directive 2026-10-12: cross-lane contribution over commentary). Provenance: pmoves/tools/bash_resolver.py:67 (find_bash).
Pins the #3357 fix across the repo. The bare `shutil.which("bash")` in `test_install_ssh_surface.py` returns the WSL stub on Windows hosts (Z890 measured: `C:\\Windows\\System32\\bash.exe`), which then runs `install_ssh_surface.sh` against a different filesystem view (`/mnt/d` vs `D:`) and exits 127 on Windows-style paths. The fix is identical to the one in #3357's `test_claude_pmoves_launch.py`: import `find_bash` from `pmoves.tools.bash_resolver`, which probes `%ProgramFiles%\\Git\\bin\\bash.exe` and rejects the WSL stub. Verified live on this host: `find_bash()` returns `C:\\Program Files\\Git\\bin\\bash.exe`; all 6 install_ssh_surface tests now pass (was 6 failed before the patch). Pinned: a future regression to `shutil.which("bash")` here fails the tests silently on WSL-stub hosts. A test that requires `find_bash()` to be non-None on Windows is the load-bearing pin. Author: mavis (inherited from Z890-CLAUDE's #3359 lane; per operator directive 2026-10-12: cross-lane contribution over commentary). Provenance: pmoves/tools/bash_resolver.py:67 (find_bash).
Pins the #3357 fix across the repo. The bare `shutil.which("bash")` in `test_install_ssh_surface.py` returns the WSL stub on Windows hosts (Z890 measured: `C:\\Windows\\System32\\bash.exe`), which then runs `install_ssh_surface.sh` against a different filesystem view (`/mnt/d` vs `D:`) and exits 127 on Windows-style paths. The fix is identical to the one in #3357's `test_claude_pmoves_launch.py`: import `find_bash` from `pmoves.tools.bash_resolver`, which probes `%ProgramFiles%\\Git\\bin\\bash.exe` and rejects the WSL stub. Verified live on this host: `find_bash()` returns `C:\\Program Files\\Git\\bin\\bash.exe`; all 6 install_ssh_surface tests now pass (was 6 failed before the patch). Pinned: a future regression to `shutil.which("bash")` here fails the tests silently on WSL-stub hosts. A test that requires `find_bash()` to be non-None on Windows is the load-bearing pin. Author: mavis (inherited from Z890-CLAUDE's #3359 lane; per operator directive 2026-10-12: cross-lane contribution over commentary). Provenance: pmoves/tools/bash_resolver.py:67 (find_bash).
…e-before-write + effective-config check + rollback) (#3359) * docs(register): CLAIM fix/merge-wave-followup for PR #3359 review threads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(fleet): mint enrollment serials from 53 random bits, never reusing a ledger serial The previous scheme, (active-token count + 1) * 100000 + sha256 % 99999, was not collision-free despite its comment: two tokens in the same bucket collided at ~1/99999 per pair, and because the bucket came from the count of UNEXPIRED tokens it was replayed once tokens expired. KRL entries outlive their tokens, so a replayed serial is either pre-revoked for the new enrollee or ambiguous to revoke. mint_serial() now draws secrets.randbits(53) and skips any serial already in the ledger, expired rows included. 53 bits rather than 63 keeps the value an exact integer for JSON consumers that parse numbers as doubles, where a wider serial would be rounded and break the bundle HMAC. Tests: ledger collision and zero are skipped; 2000 mints are distinct and < 2**53; a max-width serial goes issue_cert -> gen_krl -> `ssh-keygen -Q` and is reported revoked (exit 1). Addresses kilo-code-bot thread on generate-enrollment.py:228 (PR #3359). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(fleet): install_ssh_surface.sh validates before writing and proves the drop-in is effective - --krl is validated (readable, `ssh-keygen -Q` parses it, and it does not revoke the CA key itself) before any install or drop-in write. Previously a missing --krl exited after the CA and a partial drop-in were written, and a non-KRL file was accepted. - After `sshd -t`, the installer requires `sshd -T` to show `trustedusercakeys <ca>` (and `revokedkeys <krl>`). `sshd -t` passes when sshd_config has no Include for sshd_config.d or an earlier TrustedUserCAKeys shadows ours (first value wins), so the old success message could report trust that sshd never applied. - Every failure restores the exact prior state from a snapshot. The old rollback deleted the CA/KRL/drop-in outright, so a failed re-run (KRL rotation) removed a previously working install. - Re-running without --krl keeps an installed KRL in force instead of silently dropping RevokedKeys. - PMOVES_SSH_ETC (default /etc/ssh) exists only so the new test suite can run the real script against a scratch tree with stub sshd/systemctl. Positive control: the new tests run against the previous installer fail 5 of 6 (the happy path passes on both). Addresses kilo-code-bot threads on install_ssh_surface.sh:18 and :23 (PR #3359). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(ssh): use find_bash() from bash_resolver; reject the WSL stub Pins the #3357 fix across the repo. The bare `shutil.which("bash")` in `test_install_ssh_surface.py` returns the WSL stub on Windows hosts (Z890 measured: `C:\\Windows\\System32\\bash.exe`), which then runs `install_ssh_surface.sh` against a different filesystem view (`/mnt/d` vs `D:`) and exits 127 on Windows-style paths. The fix is identical to the one in #3357's `test_claude_pmoves_launch.py`: import `find_bash` from `pmoves.tools.bash_resolver`, which probes `%ProgramFiles%\\Git\\bin\\bash.exe` and rejects the WSL stub. Verified live on this host: `find_bash()` returns `C:\\Program Files\\Git\\bin\\bash.exe`; all 6 install_ssh_surface tests now pass (was 6 failed before the patch). Pinned: a future regression to `shutil.which("bash")` here fails the tests silently on WSL-stub hosts. A test that requires `find_bash()` to be non-None on Windows is the load-bearing pin. Author: mavis (inherited from Z890-CLAUDE's #3359 lane; per operator directive 2026-10-12: cross-lane contribution over commentary). Provenance: pmoves/tools/bash_resolver.py:67 (find_bash). * docs(register): RELEASE row for the mavis #3359 follow-up (bash_resolver pin + title/body rewrite) Author: mavis (cross-lane contribution on PR #3359, operator-approved 2026-10-12). * fix(fleet-ssh): drop inert pytestmark_win32; one module-level pytestmark pytest only reads the module attribute `pytestmark`, so the `pytestmark_win32` skip was never applied (review of #3359). It is removed rather than activated: the installer suite passes under Git Bash on Windows (Z890: 20/20 in pmoves/scripts/fleet/ssh), and find_bash() already rejects the WSL stub and returns None when no POSIX bash exists, so the single `_BASH is None` skip covers every host. Its reason now says so. Unused `import sys` dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: POWERFULMOVES <POWERFULMOVES@users.noreply.github.com> Co-authored-by: Mavis <mavis@powerfulmoves.ai>
Fixes #3356 (defects 1–2 from the issue, plus two more the real launch exposed). Defect 3 in the issue (
--backend=minimaxvs the #3091 sweep) stays open there — it's a design change, not a patch.What was broken
Every
claude-pmoveslaunch on Windows died before reachingclaude:You cannot call a method on a null-valued expression(l.33)$env:X = ''deletes the var, so it stayed$null"$env:X".ToLower()Get-PmovesPythonArgv is not recognized(l.145)0bb4c0777put the caller ~190 lines above the definitionNativeCommandErrorfromnode_identity.py'Stop'+2>$nullmakes any native stderr fatal, so the documented fail-open resolver killed the launchSilentlyContinue, same as the backend selector; also applied to cipher-carrypy -3splatted aspy - 3(a one-element slice is a string; splatting a string passes its chars).-= run script from stdin@()Defects 3 and 4 only appear when the venv rung misses and the ladder falls back to
py -3. That's any node withoutpmoves\.venv-pmoves, or a worktree.Verification
pmoves/tools/tests/test_claude_pmoves_launch.py(new) executes the launcher with a stubclaudefirst on PATH. It's hermetic: empty env.shared,PMOVES_ROSTER_FROM_TREE=1, pinned interpreter, stdin closed. Six cases: default,--backendconsumed, anthropic strips a hijacked base URL, identity failure fails open, multi-word interpreter actually runs the normalizer, invalid backend refuses. Each defect was confirmed red before its fix.pytest test_claude_pmoves_launch.py test_pmoves_launcher_generator.py→ 20 passed, 6 skipped (Windows; the.shtwin cases are POSIX-only and run in CI).claude --version:2.1.296 (Claude Code), launcher exit 0. Apylogging shim shows all six interpreter calls receive-3intact.Not verified here
.shtwin cases on Linux. They're skipped on Windows becausebashmay resolve to WSL; CI's python-tests will run them.--version) session start.Process note
Edited under Known Road
launcher:issue:3356!offline. The guard can't verify the referent on z890 because it refuses to trustghwhenC:\Program Files\GitHub CLIis writable. That's a node-hardening item, filed separately if wanted.🤖 Generated with Claude Code