8000 T56 — Store each box's stopped and exited ending on its record by minimal-foundry[bot] · Pull Request #2676 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T56 — Store each box's stopped and exited ending on its record - #2676

Merged
mitodrummer merged 9 commits into
mainfrom
agent/2634-store-each-box-s-stopped-and-exited-ending-on-it
Oct 28, 2026
Merged

mitodrummer merged 9 commits into
mainfrom
agent/2634-store-each-box-s-stopped-and-exited-ending-on-it

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Oct 28, 2026 •
Copy link
Copy Markdown
Contributor

T56 — Store each box's stopped and exited ending on its record

slice: S0
kind: task
covers: BOX-011
size: M
est: 250 code, 150 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the store logs a record it loads with an unknown reason, naming it
observability: none: no new runtime signal; the ending is read by T3's stop span
layers:
- record:
- crates/boxes/src/lib.rs: BoxState holds stopped and exited; Record stores reason, exit_code, signal
- crates/boxes/src/core/record.rs: Record::state() reads the stored ending; state_is_exactly_one over Record
- crates/boxes/src/store.rs: persist and load the ending; an unknown reason loads as written
test: cargo nextest run -p boxes record_stores_stopped_and_exited_with_their_ending
test: cargo nextest run -p boxes unknown_reason_loads_as_written
- callers:
- crates/minimal/src/cmd/list.rs: min ls label active -> running
- crates/minimal/src/attach.rs: state matches
- crates/minimald/src/box_actor/setup.rs: state matches
test: cargo nextest run -p minimal list_labels_a_running_box_running
produces: none
consumes:
- crates/boxes/src/events.rs
proof: A stored record holds stopped or exited with its reason, exit code and signal.
depends on:
- blocked by #2387

Proof

A box record saved as stopped or exited now loads from disk in that state. Its record.json holds status, reason, exit_code and signal as the BOX-011 table gives them, and Record::state() reads them back as the same RecordState. A reason this build does not know loads, is logged, reads as an UnreadableEnding, and saves unchanged. min ls labels a running box running.

Notes from the agent: Files touched outside the layers. Each change is mechanical and needed to compile. (1) The new Record fields reason, exit_code and signal break every Record struct literal, so these files set them to None: crates/minimal/src/dash/render.rs, crates/minimal/src/dash/rpc.rs, crates/minimal/src/cmd/boxes/vm_host.rs, crates/minimal/tests/dash_snapshots.rs, crates/minimal-client/src/box_registration.rs, crates/minimald/src/box_actor/host.rs, crates/minimald/src/box_manager.rs, crates/minimald/src/box_runtime.rs, crates/minimald/src/exec/tests.rs and crates/minimald/src/store.rs. (2) crates/minimald/src/box_actor.rs has an exhaustive match on BoxState. It now refuses to spawn an actor for a stopped or exited record, the same as for materializing. No path writes these states yet. The task that first writes them must decide how the actor holds an ended box. (3) Record::state() now returns Result<RecordState, UnreadableEnding>, so the restart reap in crates/minimald/src/box_manager.rs keeps a record whose ending it cannot read. (4) Two tests pinned the old label 'active' and now expect 'running': crates/minimal/src/tests.rs (bare_status_renders_a_cwd_session_verbatim, duplicate_session_warning_waits_before_attach_for_materializing) and crates/minimal/tests/cli.rs (ls_table_exposes_project_path_and_status). Printed text: the min ls STATUS column and the bare min status row print 'running' in place of 'active'. The duplicate-session warning now says 'until its status is running'. For a stopped or exited duplicate, the warning prints only its first sentence, because attach does not a…[truncated]

Tests

line exit tail
cargo nextest run -p boxes record_stores_stopped_and_exited_with_their_ending 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-2676... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/wo
cargo nextest run -p boxes unknown_reason_loads_as_written 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-2a63... Finished 'test' profile [unoptimized] target(s) in 0.42s ──────────── Nextest run ID a4c97015-6eaa-46b5-afab-7cb882b3728b with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal list_labels_a_running_box_running 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-a3f8... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo

Verify

min task run agent-verify timed out after 1800s, so this PR is a draft.

g common v0.0.1 (/workbench/crates/common)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 16s
   Compiling opentelemetry v0.33.1
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling rusty-fork v0.3.1
   Compiling serial_test v4.0.1
   Compiling proptest v1.12.0
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimal-client/src/box_registration.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/dash/render.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimal/src/tests.rs
  • crates/minimal/tests/cli.rs
  • crates/minimal/tests/dash_snapshots.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/box_runtime.rs
  • crates/minimald/src/exec/tests.rs
  • crates/minimald/src/store.rs

Residuals

Closes #2634

Maintainer accepted the out-of-layer edits, 2026-10-28: the reason/exit_code/signal: None fields where a Record is built, the active→running test updates, box_actor.rs refusing an actor for an ended record, and the restart reap keeping a record whose ending is unreadable. Undrafted.

BoxState gains stopped and exited. The record stores the reason,
exit_code and signal of how the box ended, and Record::state reads
them back. A reason this build does not know loads and saves as
written, and the store logs it. Refs BOX-011.
Callers match the stopped and exited states. min ls prints running for
an active record, an ended box renders hollow in the attach picker, and
minimald refuses to finalize or host an ended box. Record literals in
other crates set the new ending fields to none. Refs BOX-011.
@coderabbitai
coderabbitai Bot commented Oct 28, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7cb54e0-d5cd-458e-b971-a17341e1cc75

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry
minimal-foundry Bot commented Oct 28, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at beb2f3b32275.

Nothing to do.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/cmd/list.rs Resolved
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling

The record now stores stopped and exited with reason, exit_code and signal, as architecture.md line 495 gives them. The restart reap keeps a record whose ending it cannot read, so it fails closed. One gap stays open. BoxActor::run refuses an ended record "until" a later task, and no issue owns that task. Line 495 requires that resume restarts a stopped PTY box, so this work needs an owner. C1 files that issue and links it from the comment and the PR body.

Ruled at 301ca00 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimald/src/box_actor.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings: the coder changed nothing. Revise round 1: the one thread is judged invalid, so this round adds no commit. The three test lines pass at the branch head, which includes the merge of origin/main. A rename of the wire name of BoxState::Active to running is a separate change. It needs a compatibility plan for older clients and its own pull request.

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cmd/list.rs:1289: The split is deliberate. The task's layer for list.rs asks only for the min ls table label active -> running. A serde rename of BoxState::Active to "running" changes the wire and on-disk form: an older client or daemon without the alias fails to read a record that says running. It also needs the min

@mitodrummer
Copy link
Copy Markdown
Member

/revise One comment change on 301ca00, from arch-review C1. Change no code.

In crates/minimald/src/box_actor.rs BoxActor::run, the comment on the BoxState::Stopped | BoxState::Exited arm (around line 760) ends "until one does and the actor learns to hold an ended box". Replace that with a sentence naming #2393 (T6, BOX-025): resume brings a stopped PTY box back up from its record, and the actor learns to host an ended box there. The PR body's ## Residuals section already lists #2393; leave the body as it is. Reply on the arch thread at that line.

Run the plan's test lines.

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

This head conforms to architecture.md line 495. The record holds the five states and stores reason, exit_code and signal by the table. The compare only names #2393 at the refusal in BoxActor::run and merges main, and that meets the earlier condition. Two residuals stay open with their issues: hosting an ended box (#2393) and the active spelling in -o json (#1991).

Ruled at 13b77c4 against gominimal/arch@109541a48c31 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/box_actor.rs Resolved
@mitodrummer
Copy link
Copy Markdown
Member

/revise One fix on 13b77c4, from minimal-review (crates/minimald/src/box_actor.rs, DestroyIfUnfinalized).

The arm keeps a record only when record.status == BoxState::Active, so it now treats Stopped and Exited as unfinished and destroys them. Nothing writes those states yet, but T3 (#2390) will put Stopped into a live actor's record, and a cleanup destroy would then delete a record BOX-018 retains. Match the intent the variant's doc already states, "a session that has not finished activating": destroy only when the record reads Pending or Materializing, and keep every other state, including the ended ones. Keep the unreadable-record case as it is (destroyed). Add a test that sends DestroyIfUnfinalized to an actor whose record is Stopped and asserts the record survives. If the harness can't put a live actor's record into Stopped, test the predicate as a function instead. Reply on the minimal-review thread at line 769.

Run the plan's test lines plus cargo nextest run -p minimald destroy_if_unfinalized.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #2634. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as 13b77c4aadba.

line exit tail
cargo nextest run -p boxes record_stores_stopped_and_exited_with_their_ending 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-97a7... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/wo
cargo nextest run -p boxes unknown_reason_loads_as_written 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-f4a7... Finished 'test' profile [unoptimized] target(s) in 0.37s ──────────── Nextest run ID b04cde1c-c22f-4461-a780-41464b72f084 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal list_labels_a_running_box_running 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-d6a9... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo

Verify min task run agent-verify timed out after 1800s.

cking mctx v0.0.1 (/workbench/crates/mctx)
    Checking unicode-truncate v2.0.1
    Checking kasuari v0.4.12
    Checking lru v0.18.2
    Checking signal-hook-mio v0.2.5
    Checking derive_more v2.1.1
    Checking ratatui-core v0.1.2
    Checking line-clipping v0.3.8
    Checking crossterm v0.29.0
    Checking wait-timeout v0.2.1
    Checking ratatui-widgets v0.3.2
    Checking quick-error v1.2.3
    Checking bit-vec v0.10.1
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking bit-set v0.11.1
    Checking ratatui-macros v0.7.2
    Checking rusty-fork v0.3.1
    Checking ratatui-crossterm v0.1.2
    Checking fuzzy-matcher v0.3.7
    Checking rand_xorshift v0.5.0
    Checking core_detect v1.0.0
    Checking unarray v0.1.4
    Checking ratatui v0.30.2
    Checking inquire v0.9.4
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking proptest v1.12.0
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking similar v2.7.0
    Checking insta v1.49.0
   Compiling serial_test_derive v4.0.1
    Checking serial_test v4.0.1
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 23s
   Compiling opentelemetry v0.33.1
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling wait-timeout v0.2.1
   Compiling serial_test v4.0.1
   Compiling rusty-fork v0.3.1
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling proptest v1.12.0
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Outside the task's layers::

  • crates/minimal-client/src/box_registration.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/dash/render.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimal/src/tests.rs
  • crates/minimal/tests/cli.rs
  • crates/minimal/tests/dash_snapshots.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/box_runtime.rs
  • crates/minimald/src/exec/tests.rs
  • crates/minimald/src/store.rs

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👎 invalid — PRRT_kwDOPdfcxM6xLYQH: The table/JSON split is deliberate. A wire rename of BoxState::Active changes the stored record and the minimald-rpc tests, which are outside this task. The -o json spelling belongs to BCLI-001 (docs(specs): add the min box CLI spec (BCLI) for inbox#731 #1991), listed under Residuals. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — crates/minimald/src/box_actor.rs:760: Replaced "until one does" with a sentence that names T6 — Resume a stopped box from its stored spec #2393 (T6, BOX-025): resume brings a stopped PTY box back up from its record, and the actor learns to host an ended box there.

A stored record holds stopped or exited with its reason, exit code and signal. This round, the comment on the Stopped | Exited arm in BoxActor::run names #2393 (T6, BOX-025) as the work where resume brings a stopped PTY box back up and the actor learns to host an ended box.

Notes from the agent: This round changed one comment and no code, as the /revise note asked. crates/minimald/src/box_actor.rs is not in the task's layers. The note named that file explicitly. The PR body is unchanged.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 28, 2026 15:49
DestroyIfUnfinalized kept a record only when it read Active, so a
Stopped or Exited record was destroyed. Destroy only Pending and
Materializing records, through an exhaustive match.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 322469492f11.

line exit tail
cargo nextest run -p boxes record_stores_stopped_and_exited_with_their_ending 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a62b... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/wo
cargo nextest run -p boxes unknown_reason_loads_as_written 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-8f03... Finished 'test' profile [unoptimized] target(s) in 0.37s ──────────── Nextest run ID 8c52a5c4-d86a-48cf-84d4-cf0163b36100 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal list_labels_a_running_box_running 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-52c6... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo

Verify min task run agent-verify timed out after 1800s.

 Checking crossterm v0.29.0
    Checking line-clipping v0.3.8
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking ratatui-widgets v0.3.2
    Checking rusty-fork v0.3.1
    Checking ratatui-crossterm v0.1.2
    Checking fuzzy-matcher v0.3.7
    Checking proptest v1.12.0
    Checking ratatui-macros v0.7.2
    Checking inquire v0.9.4
    Checking ratatui v0.30.2
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking similar v2.7.0
    Checking insta v1.49.0
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling serial_test_derive v4.0.1
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking serial_test v4.0.1
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 21s
   Compiling opentelemetry v0.33.1
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling rusty-fork v0.3.1
   Compiling serial_test v4.0.1
   Compiling proptest v1.12.0
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Outside the task's layers::

  • crates/minimal-client/src/box_registration.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/dash/render.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimal/src/tests.rs
  • crates/minimal/tests/cli.rs
  • crates/minimal/tests/dash_snapshots.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/box_runtime.rs
  • crates/minimald/src/exec/tests.rs
  • crates/minimald/src/store.rs

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — PRRT_kwDOPdfcxM6xMFuB: DestroyIfUnfinalized now destroys only Pending and Materializing records, through an exhaustive match in survives_conditional_destroy. Active, Stopped and Exited records are kept, and a test pins this. (not posted on the thread: not an open thread on the pull request)

A stored record holds stopped or exited with its reason, exit code and signal. A cleanup destroy (DestroyIfUnfinalized) now keeps such an ended record and destroys only a Pending or Materializing one.

Notes from the agent: Revise round 3. crates/minimald/src/box_actor.rs is outside the task's layers. The directive asked for this fix, and earlier rounds already touched the file. The keep-or-destroy decision is now the function survives_conditional_destroy, with an exhaustive match on BoxState, so the compiler flags a new state. An unreadable record is still destroyed. The test checks the predicate as a function, as the directive allowed. The harness has no simple way to put a live actor's record into Stopped. The test sits in an inline module in box_actor.rs and not in box_actor/tests.rs, so no further file changes. The first commit had an import order that rustfmt rejects. A second commit fixes it. cargo clippy -p minimald --all-targets is clean.

@mitodrummer
mitodrummer marked this pull request as ready for review October 28, 2026 16:40
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 3224694. BoxState holds stopped and exited. Record stores reason, exit_code and signal as optional fields, so old records load unchanged. StoredReason keeps a reason this build doesn't know as written, so oom and later reasons need no migration. set_state writes a state with its ending in one step, and a cleanup destroy keeps ended records. Hosting an ended box is T6 (#2393), listed under Residuals.

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The compare since the PASS on 13b77c4a is a clean merge of main and one fix in box_actor.rs. A cleanup destroy now removes only a pending or materializing box. It keeps a running, stopped or exited box. Line 21 of architecture.md says that an ended box keeps its record until rm or prune. The fix conforms, and BOX-011 still conforms.

Ruled at 3224694 against gominimal/arch@109541a48c31 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 28, 2026
@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The merge from main does not change the tree of this PR. The head has the same tree as 32246949, and that head got a PASS. BOX-011 conforms to architecture.md line 495. The record stores stopped and exited with reason, exit_code and signal as that line gives them. The residuals #2393 and #1991 stay open.

Ruled at beb2f3b against gominimal/arch@109541a48c31 by claude-opus-5-5.

@mitodrummer
mitodrummer added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit f401b8b Oct 28, 2026
37 checks passed
@mitodrummer
mitodrummer deleted the agent/2634-store-each-box-s-stopped-and-exited-ending-on-it branch October 28, 2026 19:24
norrietaylor pushed a commit that referenced this pull request Nov 4, 2026
Policy and destroy resolve a box's VM from its name, as attach, exec, run and net forward do.
A box no running VM holds names --vm, a box on a stopped VM names the command that starts it,
and a name any two VMs hold, running or stopped, is refused with every VM listed. A relay
failure writes the unwind before the attach error prints, so the error stays on screen.

Backport of #2811. Adapted to the line: cmd/boxes/attach.rs and policy.rs hunks land in
cmd/session.rs. Dropped, because the line has no stopped session status (#2676) and keeps box
ids apart from session ids (#2485): min ls rows for a stopped VM's boxes, vm_running in its
JSON, and id-prefix matching against a stopped VM's records, which match by name only here.

(cherry picked from commit 2e3962f)
norrietaylor pushed a commit that referenced this pull request Nov 5, 2026
Policy and destroy resolve a box's VM from its name, as attach, exec, run and net forward do.
A box no running VM holds names --vm, a box on a stopped VM names the command that starts it,
and a name any two VMs hold, running or stopped, is refused with every VM listed. A relay
failure writes the unwind before the attach error prints, so the error stays on screen.

Backport of #2811. Adapted to the line: cmd/boxes/attach.rs and policy.rs hunks land in
cmd/session.rs. Dropped, because the line has no stopped session status (#2676) and keeps box
ids apart from session ids (#2485): min ls rows for a stopped VM's boxes, vm_running in its
JSON, and id-prefix matching against a stopped VM's records, which match by name only here.

(cherry picked from commit 2e3962f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T56 — Store each box's stopped and exited ending on its record

1 participant

0