8000 T61 — A stop racing a box's natural end gives one honest ending · Issue #2862 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T61 — A stop racing a box's natural end gives one honest ending #2862

Closed

Description

@mitodrummer

Task

slice size difficulty model who estimated lines
Tasks leave exited boxes S known ground strongest an agent 240 (100 code, 140 tests)

A stop that races a box's natural end gives one honest answer and one honest ending.

Covers:

  • BOX-013
  • BOX-038

Layers:

  • daemon:
    • crates/minimald/src/box_manager.rs: stop_box treats an exited record as an answer to a racing stop ("already exited, nothing to stop"), not an error
    • crates/minimald/src/box_manager/tests.rs: tests
    • crates/minimald/src/rpc.rs: serve_stop_box answers an already-exited box
    • cargo nextest run -p minimald stop_racing_natural_end_answers_already_exited
  • runtime:
    • crates/minimald/src/box_runtime.rs: a daemon-initiated kill (shutdown included, with no queued Stop) that loses the try_wait race is not read as the entrypoint returning on its own
    • crates/minimald/src/box_runtime/tests.rs: tests
    • cargo nextest run -p minimald daemon_kill_racing_reap_is_not_a_natural_exit
  • wire:
    • crates/minimald-rpc/src/lib.rs: the StopBox answer can say the box had already exited (its exit code), additive on the wire

Found in the review of T9 (#2401, PR #2850):

  1. stop_box's fallback (box_manager.rs ~2355-2371) accepts only RecordState::Stopped. A StopBox that loses the race with the entrypoint returning gets "the session ended before its stop finished", though the box did end. stop_box returns StopEnding, which can't express an exited box, so the return type, the RPC answer and its readers change together.
  2. In Host::run (box_runtime.rs ~1455), requested is hard-coded false when try_wait reaps the process first, and it is pending.is_none() on the step-error branch. A daemon kill without a queued Stop (for example on shutdown) that loses that race is read as the entrypoint returning, so the box can be recorded exited instead of left for the stop path (BOX-154 sets it stopped on restart).

Waits on:

Plan block
### T61 — A stop racing a box's natural end gives one honest ending
  slice: S2
  kind: task
  covers: BOX-013, BOX-038
  size: S
  est: 100 code, 140 tests
  executor: agent
  difficulty: known ground
  model: strongest
  diagnostics: daemon log names the race outcome (stopped, or already exited with code)
  observability: stop span records outcome = stopped | already_exited
  layers:
    - daemon:
      - crates/minimald/src/box_manager.rs: stop answers an already-exited box
      - crates/minimald/src/box_manager/tests.rs: tests
      - crates/minimald/src/rpc.rs: serve_stop_box answers already-exited
      test: cargo nextest run -p minimald stop_racing_natural_end_answers_already_exited
    - runtime:
      - crates/minimald/src/box_runtime.rs: daemon kill losing the reap race is not a natural exit
      - crates/minimald/src/box_runtime/tests.rs: tests
      test: cargo nextest run -p minimald daemon_kill_racing_reap_is_not_a_natural_exit
    - wire:
      - crates/minimald-rpc/src/lib.rs: StopBox answer can say already exited
  produces: none
  consumes: none
  proof: A stop that loses the race to the entrypoint's return answers "already exited" with the code, and a daemon kill that wins it is never recorded as the entrypoint's own exit.
  depends on:
    - blocked by #2401

Activity

  1. added
    kind:taskA task the plan skill rendered; the body carries ## Task
    size:SUnder 200 net lines; one PR
    model:strongestThe strongest model available: unknown ground, or large work that needs care
    on Nov 3, 2026
  2. minimal-foundry commented on Nov 3, 2026

    @minimal-foundry
    Contributor

    Done. #2863 merged.

    branch agent/2862-a-stop-racing-a-box-s-natural-end-gives-one-hone · epic #2236 · PR #2863

    round outcome job
    1 changed nothing: Noop on purpose. The failed 'tests' job log excerpt does not name the failing test: it stops at test 1167 of 5057, in the decode crate, and the rest is cleanup. 'ci-linux-native-success' only aggregat d59725d5
    2 pushed c5307b7e

    Updated 2026-11-03T18:49:26.879Z.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:taskA task the plan skill rendered; the body carries ## Taskmodel:strongestThe strongest model available: unknown ground, or large work that needs caresize:SUnder 200 net lines; one PR

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0