Skip to content

Plan hotfix drivability, and a tool to test the VS Code half - #211

Merged
gilesknap merged 9 commits into
mainfrom
plan-and-bridge
Aug 23, 2026
Merged

gilesknap merged 9 commits into
mainfrom
plan-and-bridge

Conversation

@gilesknap

Copy link
Copy Markdown
Member

The plan for making hotfix mode easy to drive, the tool that makes its VS Code
half testable, and one test fix. Split out of #208 so that the plan's
execution can be reviewed on its own.

The plan

.claude/plans/hotfix-becomes-easy-to-drive.md. Hotfix mode is correct and,
since #189-#192, adoptable — the four-step workflow is settled and proved. What
it is not is drivable under pressure, which is the only condition it is ever
used in. Collects #205's seven usability findings, #203's three-beat output rule
and #204, and is written to be executed by a fresh session as a workflow, so it
carries the environment that is not derivable from the repo.

Two governing decisions, both Giles': prune rather than deprecate (this is a
new tool, so compatibility with a surface nobody has learned is a cost with no
payer — --print-values goes outright, no alias), and the 33-constant string
audit may rewrite all of them, the bar being a consistent intelligible set
rather than a minimal diff.

Three things the survey found that no issue covered

  • Five call sites bypass console.paragraph/emit. TARGET_HAS_NO_PROJECT
    is 728 characters on three physical lines; two warnings are 459 and 474 on one.
  • There is no docs/how-to/ page for hotfix — which is why the mechanism
    ended up inside the error strings, since the terminal-reports rule sends it
    to a how-to and hotfix has none.
  • --claim-venv is a silent correctness bug, now hotfix: --claim-venv is a contract nothing records and apply cannot honour #209 and filed separately
    so descoping the plan cannot take it along.

Testing the tool also turned up #210: a resourceVersion conflict fails an
attach outright with no retry, and the kubelet writes pod status continuously,
so it is close to a coin toss rather than exotic.

The bridge (tools/vscode-bridge/)

podbench vscode ends at code --remote … and nothing after that is
observable — the Phase 5 live run could not open a window at all, because code
was an argv-recording stub. This drives a real window from a terminal: commands,
editor state, breakpoints, debug sessions, stopped-frame locals.

A development tool and staying one — not shipped, not imported by src/, not run
by CI, because cluster access in CI means storing credentials that are not going
in a repo. testpaths already excludes tools/; pyright checks it, added to both
the justfile and the tox env CI runs.

Proven against a real seat (bl47p-ea-simdet-01/02 on the p47 test beamline),
which settled the three assumptions it rests on: the UI-kind extension drives a
Remote-SSH window, a bare path resolves into the seat rather than to a same-named
file on the laptop, and startDebugging resolves an adapter living in the seat.

Four silent failure modes were found by running it, every one of which looked
like success from the terminal: the CLI handing off to an already-running VS Code
and dropping --extensionDevelopmentPath; a fresh profile with none of the
user's settings; workspace trust, which leaves extensions restricted so the
bridge never starts while the window sits there looking fine; and
startDebugging returning true for a session that was already dying.

The test fix

test_a_seat_the_extrausers_floors_reject_takes_etc_passwd_instead hard-coded
uid 1000 while FakePasswd seeds a record for the running euid — passes as root
in the devcontainer and in CI, fails on a developer host at uid 1000. Found by
the first run of the suite on the host.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17

gilesknap and others added 9 commits August 23, 2026 18:04
FakePasswd seeds its fake /etc/passwd with a record for the *running* euid,
so a test that hard-codes uid 1000 is asserting "this uid has no NSS entry"
about the uid Ubuntu gives its first user. As root in the devcontainer and in
CI that holds and the test passes; run on a developer host at uid 1000 the
fixture's own seed answers, ensure_passwd_entry takes its early return False,
and the test fails.

Use the file's existing UNKNOWN_UID, which is above the MINUID 500 floor and
so carries the same case: a uid the floors accept beside a gid they reject.

This is the failure FakePasswd's own docstring says it exists to prevent -
"a test that asked the real platform would pass or fail on whichever uid the
suite happens to run as" - reintroduced by keying the seed to geteuid() while
the test named a constant.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
Hotfix mode works and, since #189-#192, is adoptable. What it is not is
drivable under pressure, which is the only condition it is ever used in:
`podbench hotfix --help` is 88 lines of which 14 flags belong to one flag,
two more flags ask for values the pod could answer, every prerequisite is
discovered one redeploy at a time, and retirement is a printed checklist
nothing tracks.

The plan collects #205's seven findings, #203's three-beat output rule and
#204, and adds three things the survey for it turned up that no issue covers:
five call sites that bypass console wrapping entirely (one string is 728
characters on three physical lines), the absence of any docs/how-to page for
hotfix - which is *why* the mechanism ended up inside the error strings - and
a silent correctness bug where --claim-venv is recorded nowhere, so apply's
reinstall lands in .venv while the supervisor looks in the directory init was
told about.

It also names the two failures Giles hit running `podbench vscode` for real,
so that a plan about polish does not walk past two functional defects.

Written to be executed by a fresh session as a workflow, so it carries the
environment - host-side venv, the p47 tunnel, ArgoCD's 2-minute refresh in
another cluster, the VS Code bridge - that is not derivable from the repo.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
`podbench vscode` ends at `code --remote ssh-remote+<alias> <folder>` and
nothing after that is observable, so the half of the workflow a user actually
looks at has never been tested: the Phase 5 live run could not open a window
at all, because `code` was an argv-recording stub.

This is a control socket for one window - run any command, open files, set
breakpoints, start a debug session, read the frames and locals where it
stopped - which is enough to drive that half from a terminal.

It is a development tool and stays one: not shipped, not imported by anything
under src/, and not run by CI, because wiring a real cluster into CI would
mean storing credentials that are not going in a repo. `testpaths` already
excludes tools/, so pytest does not collect it; pyright does check it, added
here in both the justfile and the tox env that CI runs, because a tool nobody
type-checks is a tool that rots.

The extension is `extensionKind: ["ui"]` deliberately. In a Remote-SSH window
the workspace extension host runs inside the seat, which is ephemeral and
unreachable from the laptop; a UI extension runs where the driving agent
already is and still sees the remote workspace. The same asymmetry is why it
resolves a bare path against the workspace folder rather than with Uri.file(),
which in a remote window would silently open a same-named file on the laptop.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
The environment section named ~/.local/share, which is where the bridge lived
for the hour before it went into tools/. A fresh session executing this plan
would have followed it to a path that is no longer the canonical copy.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
Three decisions from Giles, 2026-08-23, all resting on the same point: hotfix
mode is a new tool nobody outside this repo drives yet, so compatibility with a
surface no user has learned is a cost with no payer.

--print-values goes outright - no alias, no deprecation - and the same licence
covers --no-from-pod, --liveness and the dead --author. The 33-constant audit
may rewrite all of them: the bar is a consistent, intelligible set rather than
a minimal diff, because a half-rewritten set is the worse outcome.

The --claim-venv defect is promoted to #209 so that descoping this plan cannot
take a correctness bug with it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
…proved

Testing against bl47p-ea-simdet-01-0 found the shim silently doing nothing:
`code` with no --user-data-dir hands the request to an already-running VS
Code over its IPC socket, and that process was started without
--extensionDevelopmentPath. The window opens, Remote-SSH connects, podbench
prints [ok] because the CLI exited 0, and the bridge is not in it.

With its own instance the three design bets all held: the UI-kind extension
drives a Remote-SSH window, a bare path resolves into the seat rather than to a
same-named file on the laptop, and startDebugging resolves an adapter living in
the seat. The plan's Phase 7 no longer has to establish any of them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
A separate --user-data-dir is a separate profile: Giles' first driven window
carried his colours because it was handed to his running VS Code, and the
second - the one that actually carried the bridge - came up default, with a
welcome tab he had to close before it could be connected to.

That matters beyond looks. Driving this window is how the VS Code half of
podbench gets seen the way a user sees it, and a default profile is not what
any user has. Seed settings, keybindings and snippets once, turn the welcome
tab off, then leave the profile alone so its accumulated state survives.

settings.json is JSONC and Giles' has comments, so a strict parse is tried
first and a text insert after the opening brace is the fallback - it cannot
reorder or drop anything already there.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
…d delete proved

Workspace trust is what actually stopped the from-scratch run: a fresh profile
trusts no folder, so opening the seat's home raises a modal, and until it is
clicked extensions run restricted - so the bridge never starts and `vsc.py ls`
reports nothing while the window is plainly on screen. 1.124 has no
--disable-workspace-trust flag, so the setting is written into the profile, on
every run rather than once: it and the startup editor are the harness's
requirements, not the user's preference. With it, the window reached `vsc.py ls`
6 seconds after launch with no interaction.

Separately, deleting every pod settled the contradiction the plan asked the
next session to establish. It is not a stale pod: ArgoCD recreated fastcs from
git and it came back still hotfix-wired, because `enabled: false` disables only
the claim subchart while the volumes, volumeMounts, args and podSecurityContext
live in the target's own values - and the PVC carries Prune=false so it
outlives its chart. That is #205 item 4's prediction with a live specimen, and
the state it leaves is worse than either end: a pod wired to a claim whose
chart no longer declares it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
VS Code's error dialogs cannot be read - showErrorMessage is write-only and
there is no onDidShowNotification - so a tool that drives debugging has to
catch the traffic the dialog is rendering instead. The tracker now records
failed DAP responses, the debug console including stderr, and the adapter
failing to start or dying, alongside the stopped/terminated events it already
had.

Measured against a launch config naming a file that does not exist, that is
more than the dialog gives: the events carry the whole traceback down to the
FileNotFoundError and the path it could not open.

The same measurement found the trap. startDebugging resolved *true* for that
doomed session, and the failure arrived over the following two seconds as
dap.terminated, dap.adapterError and stderr. Anything asserting that debugging
works must read the events rather than the boolean, so `debug` now returns the
event watermark taken before the session starts - pass it to `events` and get
that session's traffic and nothing earlier.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b4e06b9a-b2be-42f5-ae33-a39dba4c8097

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gilesknap
gilesknap merged commit 98f672c into main Aug 23, 2026
60 checks passed
@gilesknap
gilesknap deleted the plan-and-bridge branch August 23, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant