Skip to content

fix: findings of the reviews before 0.51.0 (node state in WSL, GPU annotations, share setup) - #594

Merged
7schmiede merged 1 commit into
mainfrom
fix/review-0.51
Nov 19, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/review-0.51

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

The code and security reviews of 82ff69b..main before 0.51.0 (internal reports, devstack / Reviews) found, besides two findings fixed in #592 and #593:

Review Nr What Fix
Code 1 (serious, since 0.50.0) Each stop of the WSL node agent ran rm -rf on its membership folder, where the agent keeps node/ (leases, kept slots, node secret): switching off with guests, a cap change, a crash or a hub update dropped the guests' lanes only the copied membership files go (find -maxdepth 1 -type f)
Code 3 A forget held the daemon stop's 90 s and was cut off down_all no longer waits; the daemon waits after the stop, up to 10 min
Code 4 An earlier hub's agent was "seen" at the first look even when it ended blocked; unknown guests read as none, so a fresh hub without the coordinator stopped an agent with guests seen once acted on; agent ended before the copy; unknown guests count as some (decide takes Option)
Code 6 UTF-16 output of wsl.exe cut into lines one byte off WSL_UTF8=1 on every wsl.exe
Code 7 Setup dialog showed an earlier, slower check request counter, findings cleared on a distribution change
Code 8 Test name renamed
Security 1 (medium) annotations with cdi.k8s.io/… handed a container all GPUs under the NVIDIA runtime as default (CDI) refused with cdi.k8s.io/ or nvidia.com/ keys
Security 2 Probe output into the coding agent's prompt plain characters, at most 80
Security 3 Distro from node-host.json not validated on the stop path validated on every path
Security 5 Install command fetched releases/latest the release's own install.sh

Not changed: Security 4 (on Linux a guest's build may outlive the agent's stop: switching off drains, the guests' lanes go on by design) and the firewall rule's missing -RemoteAddress in Security 5 (members reach the node from anywhere in the pool; older than this range).

No review card: these restore what ADR-0112/0113 already decided.

Proof

Each fix has a test that was red before it (red run noted per finding):

  • nodehost::removing_the_membership_keeps_the_agents_state: red at "the state stays" (run under sh; Git's sh here, Linux/macOS in CI)
  • lanes::a_lane_being_forgotten_keeps_only_the_daemon: red with the old wait in down_all ("the lanes' stop waited for the forget")
  • confine::a_gpu_reaches_a_container_only_through_the_lease: red, the CDI annotation passed check
  • nodehost::a_distribution_is_judged_by_what_the_agent_needs: red without the filter (x<script>)
  • ShareSwitch.test.ts "shows the check of the distribution chosen last…": red, the earlier verdict stayed
  • nodehost::an_earlier_hubs_agent_is_ended_or_kept_for_its_guests, the_switch_and_what_runs_give_the_step, words_for_sh_and_lines_of_wsl_exe: new cases (finding 4's old semantics: guests_or(None, 0) == 0 → Stop)

Local: clippy (workspace), fmt, unit tests compose 22, daemon 229, hub 176, node 129; ui typecheck, 295 tests, build. WSL_UTF8=1 checked against this machine's wsl.exe (UTF-8 instead of UTF-16).

Not checked: a WSL node agent end to end (no distribution with an agent here), a node with the NVIDIA runtime in CDI mode.

🤖 Generated with Claude Code

…notations, share setup)

Code review:
1. A stop of the node agent in WSL ran `rm -rf` on its membership folder,
   where the agent keeps its state (`node/`: leases, kept slots, its
   secret): every stop (switch off with guests, a changed cap, a crash, a
   hub update) dropped the guests' lanes. Only the copied files go now.
3. A lane being forgotten held the daemon's stop for up to the services'
   90 s and was then cut off. `down_all` no longer waits; the daemon waits
   for the forget afterwards, with a budget of its own (10 min).
4. An earlier hub's agent counted as dealt with at the first look, even
   when that round ended blocked; and an unknown guest count read as none,
   so a fresh hub without the coordinator stopped an agent with guests.
   The pool counts as seen once something was done, the agent is ended
   before the membership is copied, and an unknown count counts as some.
6. `wsl.exe` is asked for UTF-8 (`WSL_UTF8=1`): its UTF-16 lines were cut
   one byte off, so non-ASCII read as U+FFFD.
7. The setup dialog drops the answer of an earlier, slower check and does
   not show one distribution's findings as another's.
8. The forget test is named after what it checks.

Security review:
1. A lane's `annotations` with a `cdi.k8s.io/` or `nvidia.com/` key are
   refused on a node: under the NVIDIA runtime as Docker's default (CDI
   mode) they handed a container every GPU past the lease (ADR-0112).
2. What the distribution prints reaches the coding agent's prompt as a
   short line of plain characters.
3. A distribution name from `node-host.json` is validated on every path,
   a stop's too.
5. The install command fetches the install script of that release.

Bug-Class: state-removed-with-its-copy
Bug-Class: unknown-read-as-none
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 22babe6 into main Nov 19, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/review-0.51 branch November 19, 2026 12:34
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