8000 Merge remote-tracking branch 'origin/main' into agent/3526-a-stop-or-removal-ends-an-attach-with-one-cause · gominimal/minimal@48528f7 · GitHub
[go: up one dir, main page]

Skip to content

Merge remote-tracking branch 'origin/main' into agent/3526-a-stop-or-…

Minimal Arch / arch-review failed Nov 18, 2026

CONDITIONS

Governs (arch 327e1b57. The checkout has no arch-map.md, so I found the sections by search, as earlier rulings did): architecture.md Exit codes line 376 (254 is an attach ended from the other side: a stop, a removal or a PTY takeover. A detach or the entrypoint's own exit is 0). min box attach line 492 (254 after a one-line notice on stderr that names the cause). Spec docs/specs/28-spec-box-cli BCLI-068, the leg 'IF the daemon ends an attach from the other side'. No findings.json or since.diff is staged, so this is a first review of the full diff.

Ruling. The daemon half conforms and is in the right owner: box_runtime owns the host and binding messages, and box_actor tells the host before it signals the box (rule 8). I read stop_box_inner, stop_running, destroy_now (it cancels destroying immediately before stop_running), notify_remote_teardown, the Kill arm and the binding's exit path. A stop or removal ends the binding with 254, with no prompt, no 'Disconnecting' line and no detached event. The client side already names 'was stopped' and 'was removed' in attach_ending. Two items are open and have no issue (rule 6). C1: the task's client-layer proof attach_ended_by_stop_on_real_daemon_exit254 is not written, and the PR body says its test line matches nothing (rule 4). C2: a restart now also ends the attach with 254, but the client then reads running and prints 'another terminal attached'. That is a false cause against line 492. The fix needs a wire change outside this task's layers, so an issue and a declared residual are enough.

Noted, not a condition. Line 173 says stop --force 'kills immediately'. announce_end now runs before the kill and can wait up to two HOST_PROBE_TIMEOUT bounds (2 s each) on a wedged host. A healthy host answers in one round trip, and the existing probe_host already waited one bound. I do not rule this a deviation. Precedent: no entry in the ledger decides an attach end or an unwritten proof. Not checked: the runtime behaviour, because no build is allowed. The PR reports that the daemon test passed.

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 48528f7 against gominimal/arch@327e1b57d16b by claude-opus-5-5; arch_rulings 1378, job bcbdf42e-af08-4fa4-a941-30f71018a638.

0