8000 fix(minimald): drop the PTY line on attach takeover and shutdown · gominimal/minimal@452c7ce · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald): drop the PTY line on attach takeover and shutdown

Minimal Arch / arch-review failed Nov 18, 2026 in 0s

CONDITIONS

Baseline. This re-reviews 452c7ce1 against the CONDITIONS on 48528f7a (this PR), on the same arch 327e1b57. The checkout has no arch-map.md, so I found the sections by search, as the earlier ruling did. No findings.json is staged. since-conditions.json holds C1 and C2. since.diff is one commit, 452c7ce1 fix(minimald): drop the PTY line on attach takeover and shutdown, in binding.rs and box_runtime/tests.rs only. The ruling on 48528f7a stands for everything else.

Governs: architecture.md Exit codes line 376 (254 is an attach ended from the other side: a stop, a removal or a PTY takeover) and min box attach line 492 (254 after a one-line notice on stderr).

The compare conforms. render_farewell no longer writes 'Disconnecting - …' for Farewell::Superceded and Farewell::DaemonShutdown. Both still end with DAEMON_ENDED_EXIT_STATUS. The client's attach_ending() (crates/minimal/src/cmd/boxes/attach.rs:1983) prints the one stderr line for each cause: a takeover reads the box as running, and a shutdown reads as HostSilent or Unread. So the PTY line was a second notice, and line 492 allows one. The new test takeover_and_shutdown_write_no_disconnecting_line and the edited expose_ask_superseded_mid_dialog_is_the_daemons_refusal test the binding output directly. HOST_GONE_NOTICE and the slow-terminal shed line stay; the compare does not touch those paths.

Conditions. C1 is open: rg attach_ended_by_stop_on_real_daemon_exit254 crates/ finds nothing, and the PR body lists no residual or issue link. C2 is open: BoxEnd in binding.rs:201 still has only Stop and Removal, stop_box_inner (host.rs:2411) still announces Stop for a restart, and the PR body states no restart residual. Both carry forward unchanged.

Not checked: I did not run the tests (no build, by contract).

Conditions

  • C1: Add attach_ended_by_stop_on_real_daemon_exit254 to crates/minimal/src/tests.rs as the task's client layer states: attach through a real minimald binding, stop the box, and assert one cause line on stderr, exit 254 and no prompt text. If the minimal test-support harness cannot launch a shell box (the 'no such package' launch the PR body names), do not leave the test line unmatched. Open an issue for that harness gap and the unproved end-to-end leg, and list it in the PR body as a residual with the issue link. The daemon test stop_while_attached_ends_binding_without_shell_exit_prompt calls announce_end itself, so no test fails if BoxActor stops calling it.
  • C2: A restart of an attached box now ends the attach with 254 (stop_box_inner -> announce_end(BoxEnd::Stop), reached from restart_named in crates/minimald/src/box_actor.rs). Then attach_ending() in crates/minimal/src/cmd/boxes/attach.rs reads the box as running and prints 'Detached: another terminal attached to .' That cause is false. Open an issue for this: the client cannot tell a restart from a PTY takeover, because BoxListingEntry carries no field for it. List the issue as a residual in the PR body, and state the restart behaviour there. Alternatively, add BoxEnd::Restart and carry it to the client so that attach_ending() names the restart.

Ruled at 452c7ce against gominimal/arch@327e1b57d16b by claude-opus-5-5; arch_rulings 1379, job e9f5b755-fc07-47fc-bd31-fbca5bac22a0.

0