8000 fix(minimal): name no cause when a restart count is unread · gominimal/minimal@a2f89eb · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): name no cause when a restart count is unread

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

CONDITIONS

Inputs. This re-reviews a2f89ebc against the CONDITIONS on b7b93c11 (this PR), on the same arch 327e1b57. The checkout has no arch-map.md, so I found the sections by search. No findings.json is staged. since.diff is one commit, a2f89ebc fix(minimal): name no cause when a restart count is unread. since-conditions.json holds C1.

Governs: architecture.md Exit codes line 376 and min box attach line 492: 254 is an attach ended from the other side, after one stderr line. Spec docs/specs/28-spec-box-cli BCLI-068 line 493 at the head requires that line to name the cause.

Ruling. The compare replaces the bool restart flag with BoxRestart { Restarted, NotRestarted, Unread }. An unread count before or after the attach now gives the existing BoxAfterAttach::Unread line (attach_ending, attach.rs line 2108). Before, it gave the takeover line, which claimed a cause that nothing proved. This is the fail-closed direction (rubric rule 7), and the behaviour conforms to lines 376 and 492. The compare does not touch the open condition.

Conditions. C1 is open. No test named attach_ended_by_restart_names_restart_exit254_through_the_host exists at this head. No test in crates/minimal/src joins box_attach_on_hosts with restart_box_on_hosts. The only BCLI-068 restart proof is still the pure-function test attach_ended_by_restart_names_restart_exit254. The PR body still names the stop/start window as a known gap, without an issue. C1 carries forward with only its line reference updated (1555-1557 becomes 1556-1562).

Not checked. The PR body reports that agent-verify exited 100 on otel_cli::exec_run_attach_and_task_run_share_the_commands_trace. That test looks up one daemon request span under each cmd span, and it has a timing-flake history (#3398, #3401). I did not find a path from this change to that failure, but only a run can settle it, and this review does not build.

Conditions

  • C1: crates/minimal/src/tests.rs: add #[tokio::test] async fn attach_ended_by_restart_names_restart_exit254_through_the_host. Model it on attach_ended_from_other_side_notice_exit254_before_the_record (tests.rs line 11321). Start an AttachHost, and create web with create_with and a restart_spec(mfile::spec::Lifetime::UntilStopped) that sets pty_enabled. Drive box_attach_on_hosts with a closure that returns 254 after the channel closes. Join it with cmd::restart_box_on_hosts(vec![alpha.host.clone()], &mut out, "web"). Assert AttachEnding { code: 254, notice: Some("Detached: web was restarted. Run min box attach web to attach again.") }. This proves the restarted expression in box_attach_on_hosts (attach.rs lines 1556-1562) and the second box_end_count read against a real restart, which the pure-function test does not reach. If the record can read stopped during the restart (the PR body's known gap), make the test pin that case too, and name the issue that owns the gap in the PR body.

Ruled at a2f89eb against gominimal/arch@327e1b57d16b by claude-opus-5-5; arch_rulings 1382, job f41a3156-0817-4d81-8084-d2e4871ab66b.

0