Skip to content

T52 — Hold every record in one of five states, migrated once, and reaped only when unfinished - #2632

Merged
mitodrummer merged 12 commits into
mainfrom
agent/2387-hold-every-record-in-one-of-five-states-migrated
Oct 27, 2026
Merged

mitodrummer merged 12 commits into
mainfrom
agent/2387-hold-every-record-in-one-of-five-states-migrated

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

T52 — Hold every record in one of five states, migrated once, and reaped only when unfinished

slice: S0
kind: task
covers: BOX-001, BOX-003, BOX-011, BOX-012
size: L
est: 410 code, 460 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: daemon log names each migrated record
observability: one log line per migrated record
layers:
- state-model:
- crates/boxes/src/core/record.rs (new): state model, reap decision, harnesses
- crates/boxes/src/core/mod.rs: mod line
- crates/boxes/src/lib.rs: running, stopped, exited
- scripts/kani.sh: two more harnesses
test: cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason
test (deferred: kani): cargo nextest run -p boxes state_is_exactly_one
test: cargo nextest run -p boxes restart_reaps_only_pending_and_materializing
test (deferred: kani): cargo nextest run -p boxes restart_reaps_only_pending_or_materializing
- migration:
- crates/boxes/src/store.rs: one-time migration
test: cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once
- create-path:
- crates/minimald/src/box_manager.rs: verb type; pure reap at start
- crates/minimald/src/box_manager/tests.rs: tests
- crates/minimal/src/task.rs: marks the task verb
test: cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb
produces:
- crates/boxes/src/core/record.rs
consumes: none
proof: After restart, old sessions are running boxes; only unfinished records reaped.
depends on:
- blocked by #2386

Proof

Partly delivered. After a daemon restart, a record written before box types loads as a session box with no parent. A nil id gets a fresh id. The daemon log has one line for each migrated record, and a later start leaves the record unchanged. Stored active records read as running through Record::state(), and the start-up reap deletes only pending and materializing records. A box record cannot yet be stored as stopped or exited. The five-state model, with its reason, exit_code and signal, exists only as the RecordState type in crates/boxes/src/core/record.rs.

Notes from the agent: Scope gap (BOX-011): the stored BoxState still has only Pending, Materializing and Active. To add Stopped and Exited, or to rename Active to Running, I must change exhaustive matches and Record struct literals in files outside the layers: crates/minimal/src/cmd/list.rs (the min ls label prints active), crates/minimal/src/attach.rs, crates/minimald/src/box_actor.rs, crates/minimald/src/box_actor/setup.rs, and several test fixtures. Because of this, record.rs holds the five-state model as a typed RecordState (endings are typed, so only the BOX-011 table rows can be represented). Record::state() projects the stored status onto it (Active -> running). BoxState::Active also accepts the spelling running on load. A later task must store an ending on the record and own those files, and it must change the min ls label from active to running.

Create path: T1 (#2521) already stamps box_type from the creating verb, and crates/minimal/src/task.rs already sends CreatingVerb::Task. So task.rs needs no change. The test legacy_create_path_records_type_from_creating_verb already exists inline in box_manager.rs (create_stamp_tests) and passes. In box_manager.rs, the change is that reap_unresumable_records now calls RecordState::reaped_at_restart(). I added restart_keeps_running_records_and_reaps_pending_ones to box_manager/tests.rs.

Migration (BOX-003): the spec says migrate a record…[truncated]

Tests

line exit tail
cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-efd8... 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 common v0.0.1 (/workbench
cargo nextest run -p boxes restart_reaps_only_pending_and_materializing 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-174b... Finished 'test' profile [unoptimized] target(s) in 0.45s ──────────── Nextest run ID 0b76165d-66d9-4bce-866e-5c0d5b615d96 with nextest profile: default Starting 1 test across 3
cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-c9d7... Finished 'test' profile [unoptimized] target(s) in 0.43s ──────────── Nextest run ID 232cfe86-2324-493b-9c16-940918a34132 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-2008... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify

min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

nformation visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `boxes` (lib test) due to 6 previous errors

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Deferred

The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.

line lane
cargo nextest run -p boxes state_is_exactly_one kani
cargo nextest run -p boxes restart_reaps_only_pending_or_materializing kani

Residuals

Kani

  • Kani (arch-review C2): state_is_exactly_one and restart_reaps_only_pending_or_materializing verified in the kani lane on c8ced457 (expect boxes 12, ci-kani-success green).

Closes #2387

Maintainer accepted the out-of-layer edit to crates/minimald/src/store.rs (the collision test seeds its record with a box type), 2026-10-26. Undrafted.

Maintainer accepted the out-of-layer amendment of BOX-003 in docs/specs/29-spec-box-local-first/29-spec-box-local-first.md (arch-review C1), 2026-10-26.

The record module gives each state its reason, exit code and signal,
and decides which records a daemon restart reaps: pending and
materializing only. Two Kani harnesses prove both properties.
At store open, a record written before the two fields becomes a session
box with no parent. A nil id is replaced with a fresh one. Each
migration logs one line, and a later start leaves the record as it is.
The start-up reap asks the boxes crate which states a restart reaps,
so only pending and materializing records go and running ones stay.
@coderabbitai

coderabbitai Bot commented Oct 26, 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: 78e27e36-d0f6-4d0c-85b9-a8c462890af1

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 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at c8ced45798db.

Address the comments on the diff.

Clobber: none seen in the store and manager hunks.

@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: CONDITIONS · 2 conditions · the full ruling

The reap at restart and the one-time migration conform to architecture.md line 495 and line 499. BOX-011 does not. The five states exist only as the RecordState type, and no stored record can be stopped or exited. The PR still closes #2387. C1 changes that to Part of #2387 and files an issue for the stored endings. C2 removes a test assertion that keeps a record with no process running across a restart. Line 495 says that record becomes stopped.

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

Comment thread crates/boxes/src/core/record.rs Resolved
Comment thread crates/boxes/src/core/record.rs Resolved

@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/boxes/src/store.rs Resolved
The BOX-012 Kani harness ran restart_reap into Vecs over a symbolic
length and CBMC ran out of time. restart_reap now takes any Default +
Extend output, so the harness runs it into a four-slot buffer with no
heap. The minimald restart test now checks only that the running record
is kept, since the mock launcher starts no process.
@mitodrummer

Copy link
Copy Markdown
Member

/revise Four fixes on 9945fa3. Two are CI failures and two come from review.

1. tests: store::tests::colliding_box_id_refuses_creation fails (crates/minimald/src/store.rs:508). held is read before the reopen. The BOX-003 migration then runs in Store::init_with_mint and sets the seeded record's box_type from None to Some("session"), so after != held. The test is about the refused create leaving the retained record alone, not about the migration. After Store::init_with_mint, read the held record from the new store as before, and compare after with before instead of held. Keep the HELD id from the first store.

2. kani: the harness core::record::kani_proofs::restart_reaps_only_pending_or_materializing is killed at the lane's 14G memory ceiling ("Terminated" after 41 s). The lane then fails with expected 12 verified harnesses in boxes. The Vec that reaps_exactly_the_unfinished collects, and the two that restart_reap's partition builds over four symbolic states, are what blow up in CBMC. Rewrite the harness to prove the per-record decision with no collection: for one kani::any::<RecordState>(), assert state.reaped_at_restart() == matches!(state, RecordState::Pending | RecordState::Materializing), and drop #[kani::unwind(5)]. restart_reap is a partition on that predicate, and the unit test of the same name already checks every store of at most 4 records. Say that in the harness's doc comment. Keep the harness name, so expect boxes 12 in scripts/kani.sh still holds.

3. arch-review C2 (crates/minimald/src/box_manager/tests.rs:2285). In restart_keeps_running_records_and_reaps_pending_ones, delete assert_eq!(kept.state(), boxes::core::record::RecordState::Running);. Keep only the .expect("the restart keeps a running record") check. The mock launcher starts no process, and a restart turns such a record into stopped (architecture.md line 495). #2634 now tracks that.

4. minimal-review, crates/boxes/src/store.rs:558. The finding holds. record_predates_box_types is true for a record that has a box_type but no parent key, and the migration then overwrites that box_type with session. Set box_type only when it is absent or null, and add parent: null when the key is absent. Add a unit test where a stored record with "box_type": "task" and no parent key comes out as task with parent null.

arch-review C1 (the issue and the PR body) is done outside this round: #2634 holds the rest of BOX-011, and the body will say Part of #2387. Do not edit the body for it.

Run the plan's test lines plus cargo nextest run -p minimald colliding_box_id_refuses_creation restart_keeps_running_records_and_reaps_pending_ones and cargo nextest run -p boxes heal_migrate.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #2387. 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.

The store reopen now runs the one-time migration, which stamps box_type
on a record that lacks it. Seed the held record with its type, so the
test still proves the retained record is unchanged.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite, pushed as 278c40eeff68.

line exit tail
cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-00c9... 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 common v0.0.1 (/workbench
cargo nextest run -p boxes restart_reaps_only_pending_and_materializing 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-4201... Finished 'test' profile [unoptimized] target(s) in 0.43s ──────────── Nextest run ID 603b6dfa-c05e-43ec-a08e-3c6362f50304 with nextest profile: default Starting 1 test across 3
cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-1189... Finished 'test' profile [unoptimized] target(s) in 0.45s ──────────── Nextest run ID 07372f7a-812f-4dec-ad49-4aee2f15b6b9 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-5de4... 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 stdlib v0.0.22 (/workbenc

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

nformation visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `boxes` (lib test) due to 6 previous errors

Outside the task's layers::

  • crates/minimald/src/store.rs

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

Review threads the coder judged:

After a daemon restart, a stored session that was active loads as a running box and the restart keeps it. The restart deletes only pending and materializing records. A record without box_type or parent is migrated once, with one log line for each record.

Notes from the agent: Revise round 1. (1) Kani lane: the restart_reaps_only_pending_or_materializing harness ran restart_reap into Vecs over a symbolic length, and CBMC ran out of time. restart_reap is now generic over a Default + Extend output. The harness runs it into a fixed four-slot buffer with no heap. It also checks store order. Kani is not on this box, so the new harness is not run here. Both Kani harnesses stay deferred to the kani lane. (2) tests lane: minimald store::tests::colliding_box_id_refuses_creation failed because the store reopen now runs the one-time migration, which stamps box_type on the seeded record. I changed crates/minimald/src/store.rs, which is OUTSIDE the task's layers, to seed that record with box_type = session. No other code changed in that file. (3) Threads C1 and C2 are judged below. C1 asks for a new issue and a PR body change from 'Closes #2387' to 'Part of #2387'. I have no credential for either, so a person must do both. The runner writes the PR body, and the commits carry no closing keyword. Deferred lines, not run: cargo nextest run -p boxes state_is_exactly_one (kani), cargo nextest run -p boxes restart_reaps_only_pending_or_materializing (kani). The unit tests with those names pass locally.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 26, 2026 19:31

@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/boxes/src/core/record.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: CONDITIONS · 1 condition · the full ruling

BOX-011 still does not conform to architecture.md line 495. A record must be in one of five states, and a stopped or exited record must store its reason, exit_code and signal. The stored BoxState still holds only Pending, Materializing and Active, and the five states exist only in memory as RecordState. The new commits fix the Kani harness and two tests, but they do not change this. The migration (BOX-003) and the restart reap (BOX-012) conform. Do C1: store the ending, or file an issue for it and name that issue in the PR body and in the two doc comments.

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

Comment thread crates/boxes/src/core/record.rs Resolved
Comment thread crates/boxes/src/lib.rs Resolved
@mitodrummer

Copy link
Copy Markdown
Member

/revise One fix on 278c40e, item 4 of the last directive, which round 1 left out.

minimal-review, crates/boxes/src/store.rs:557. The finding holds. record_predates_box_types is true for a record that has a box_type but no parent key, and the migration then overwrites that box_type with session. In the migration, set record.box_type only when it is None. record.parent = None stays as it is. Add a unit test beside restart_migrates_records_missing_type_or_parent_once: a stored record with "box_type": "task" and no parent key comes out as task with parent null. Reply on the minimal-review thread with the fix.

arch-review C1 is done: #2634 is filed, and the body says Part of #2387.

Run the plan's test lines plus cargo nextest run -p boxes restart_migrates.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #2387. 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.

The BOX-003 migration now sets session only on a record with no
box_type. A typed record with no parent key keeps its type and gets
parent null. The BOX-012 Kani harness now proves the per-record reap
decision with no collection, so it stays inside the lane's memory.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Revise round 1 ran against ci-kani-success, kani and left it red; a coder round cannot clear it, a person should look. No round was started for the failed suite on 278c40eeff68.

@mitodrummer
mitodrummer marked this pull request as ready for review October 26, 2026 19:53
@mitodrummer

Copy link
Copy Markdown
Member

/revise Two fixes on 278c40e. The first clears the kani lane; the second is the held item from the last /revise.

1. kani: core::record::kani_proofs::state_is_exactly_one fails with unwinding assertion loop 0 under #[kani::unwind(1)]. holds_one_state_with_its_ending matches on state.name(), a &str. Comparing string literals is a byte loop, so CBMC needs an unwind bound longer than "materializing". Match on the variant instead: RecordState::Pending | RecordState::Materializing | RecordState::Running => …, RecordState::Stopped(_) => …, RecordState::Exited(_) => …, and drop the _ => false arm. Keep #[kani::unwind(1)] and the arms' bodies as they are. In this round's run, restart_reaps_only_pending_or_materializing verified in 13 s, so leave that harness alone.

2. minimal-review, crates/boxes/src/store.rs:557. In the migration, set record.box_type only when it is None. Leave record.parent = None as it is. Add a unit test beside restart_migrates_records_missing_type_or_parent_once: a stored record with "box_type": "task" and no parent key comes out as task with parent null. Reply on the minimal-review thread.

Leave the PR body's ## Residuals section and its Part of #2387 line as they are (arch-review C1).

Run the plan's test lines plus cargo nextest run -p boxes restart_migrates record_state.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #2387. 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.

The BOX-003 migration runs when the store reopens. The test now reads
the held record from the reopened store, so it checks only that the
refused create leaves that record unchanged.

@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 — approval withheld

Verdict COMMENT — APPROVE withheld: 6 unresolved threads — minimal-arch[bot] crates/boxes/src/core/record.rs:9, minimal-arch[bot] crates/boxes/src/core/record.rs:414, minimal-arch[bot] crates/minimald/src/box_manager/tests.rs, minimal-foundry[bot] crates/boxes/src/core/record.rs, minimal-arch[bot] crates/boxes/src/core/record.rs:9, …. No findings.

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

@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 · 2 conditions · the full ruling

The compare closes the open points of the last ruling. The migration now keeps a stored box_type, as glossary line 21 requires. The Kani harness proves the reap predicate that the daemon calls. The BOX-003 spec text still says that each such record becomes session, so amend the spec (C1). The two Kani legs are still not run, and C2 records them. The stored-ending gap for BOX-011 stays residual #2634.

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

Comment thread crates/boxes/src/store.rs Resolved
Comment thread crates/boxes/src/core/record.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-3261... 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 common v0.0.1 (/workbench
cargo nextest run -p boxes restart_reaps_only_pending_and_materializing 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-653c... Finished 'test' profile [unoptimized] target(s) in 1.39s ──────────── Nextest run ID e31439f7-df2f-4ae3-b98e-09f4a1798a50 with nextest profile: default Starting 1 test across 3
cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-ed3d... Finished 'test' profile [unoptimized] target(s) in 1.33s ──────────── Nextest run ID 4a2a62cb-c5b3-49d0-8151-d4f6ac714753 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-41e9... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

nformation visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `boxes` (lib test) due to 6 previous errors

Outside the task's layers::

  • crates/minimald/src/store.rs

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

Review threads the coder judged:

  • 👍 valid — PRRT_kwDOPdfcxM6wahmX: The migration now sets box_type = session only when box_type is absent or null. A typed record with no parent key keeps its type and gets parent null. Test: heal_migrate_keeps_box_type_of_record_without_parent_key. (not posted on the thread: not an open thread on the pull request)

1 outdated runtime thread(s) were not judged: PRRT_kwDOPdfcxM6wa7yq

After a daemon restart, a session record from before box types is a running session box with no parent, and it migrates only once. A record that already has a box_type (for example task) keeps it. The restart reaps only pending and materializing records.

Notes from the agent: Fix 1: colliding_box_id_refuses_creation now reads the held record from the reopened store as before and compares after with it. The HELD id still comes from the first store. Fix 2: the Kani harness restart_reaps_only_pending_or_materializing now proves the per-record decision over one kani::any::() with no collection and no unwind bound. Its name is the same, so expect boxes 12 in scripts/kani.sh still holds. The fixed-buffer generic on restart_reap existed only for the old harness, so restart_reap returns Vecs again. Fix 3: the assertion on kept.state() was already removed in commit 0adb901, so this round changes nothing for it. Fix 4: the migration sets box_type to session only when box_type is absent or null. In that case it also clears parent, as BOX-003 says and the existing test expects. A typed record with no parent key keeps its type and gets parent null. The new test heal_migrate_keeps_box_type_of_record_without_parent_key covers this. Deferred (lane kani): cargo nextest run -p boxes state_is_exactly_one and cargo nextest run -p boxes restart_reaps_only_pending_or_materializing. Their unit-test twins passed here. The Kani harnesses were not run on this box. clippy -p boxes shows warnings only in compose.rs and primitives.rs. This task does not touch those files.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 26, 2026 20:04
state_is_exactly_one compared state names as strings. A string compare
is a byte loop, so it failed under #[kani::unwind(1)].
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 20b0960213be.

line exit tail
cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7456... 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 common v0.0.1 (/workbench
cargo nextest run -p boxes restart_reaps_only_pending_and_materializing 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-ffcd... Finished 'test' profile [unoptimized] target(s) in 0.44s ──────────── Nextest run ID 36470b4c-7ae7-4d30-bafb-34286a962fa8 with nextest profile: default Starting 1 test across 3
cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-091b... Finished 'test' profile [unoptimized] target(s) in 0.46s ──────────── Nextest run ID 7d173166-909c-4c3e-a368-6a31418aee51 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-f6ef... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

    Checking kem v0.3.0
error: could not compile `boxes` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...

Outside the task's layers::

  • crates/minimald/src/store.rs

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

Review threads the coder judged:

  • 👎 invalid — crates/boxes/src/core/record.rs: This is already so on this branch. The Kani harness restart_reaps_only_pending_or_materializing proves RecordState::reaped_at_restart, which is the predicate that reap_unresumable_records in box_manager.rs calls for each record. The unit test also checks restart_reap over every store of at most 4 re
  • 👍 valid — crates/boxes/src/core/record.rs:9: The record.rs module doc now names issue T56 — Store each box's stopped and exited ending on its record #2634 as the owner of the stored ending and of moving the harness to Record.
  • 👍 valid — crates/boxes/src/lib.rs:1500: The Record::state() doc comment now names issue T56 — Store each box's stopped and exited ending on its record #2634 as the owner of storing reason, exit_code and signal.
  • 👎 invalid — crates/boxes/src/store.rs:561: The spec amendment is outside this task's layers. It needs a change to the BOX-003 line in docs/specs/29-spec-box-local-first/29-spec-box-local-first.md, in a separate docs change. The code stays as it is.
  • 👍 valid — crates/boxes/src/core/record.rs:428: The kani lane on 278c40e verified restart_reaps_only_pending_or_materializing in 13 s and failed state_is_exactly_one on an unwinding assertion. That helper now matches on the variant and does no string compare. This box has no Kani, so the next kani lane run gives the result for this head.

After a daemon restart, old session records stay on as running boxes, and the restart reaps only pending and materializing records. A record that already has a box_type and has no parent key keeps its type and gets a null parent.

Notes from the agent: Directive item 1: holds_one_state_with_its_ending now matches on the RecordState variant, not on name(). The outer _ => false arm is removed. The inner _ => false on the reason match stays, because it matches an Option. #[kani::unwind(1)] did not change. Directive item 2 was already on the branch in 784f7c3: the migration sets box_type only when it is None, and the test heal_migrate_keeps_box_type_of_record_without_parent_key covers a stored task record with no parent key. That test passes. This round adds no change for item 2. Deferred to the kani lane: cargo nextest run -p boxes state_is_exactly_one and cargo nextest run -p boxes restart_reaps_only_pending_or_materializing. This box has no cargo-kani, so I did not run either harness. clippy -p boxes shows 8 warnings both before and after this round. They are in compose.rs and primitives.rs, which this task does not change.

@mitodrummer
mitodrummer marked this pull request as ready for review October 26, 2026 20:33
@mitodrummer

Copy link
Copy Markdown
Member

/revise One edit on 20b0960: arch-review C1 (ruling on f5881fc), the BOX-003 spec amendment.

A maintainer accepted this out-of-layer edit to docs/specs/29-spec-box-local-first/29-spec-box-local-first.md. Make it, and change no code.

Rewrite the BOX-003 requirement (line 65) to the behaviour of heal_migrate_untyped_records on this branch, in the same EARS form:

WHEN the daemon starts and finds a record without box_type or without a parent key THE SYSTEM SHALL migrate it once: a record without box_type takes box_type = "session", a record that has a box_type keeps it, both record no parent, a fresh id is assigned only when the stored id is nil, and the record is left unchanged on any later start.

Keep its tier: and verify: lines. Make sure the verify: test covers the kept-box_type case. If it does not, name the unit test that does on a second verify: line. Run just lint-prose docs/specs/29-spec-box-local-first/29-spec-box-local-first.md and drive it to zero for the lines you changed. Reply on the arch thread at crates/boxes/src/store.rs:561.

Leave the Kani legs (arch C2) to the kani CI lane on this head, and leave the PR body's ## Residuals and Part of #2387 lines as they are.

@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 · 2 conditions · the full ruling

The compare since f5881fcd is sound. The Kani check now matches on the variant and proves the same rule, and the code names #2634 for the stored ending. The record still stores only three of the five states that line 495 of architecture.md requires. C1 keeps that work open under #2634, and the change can merge with it open. C2 asks you to amend the BOX-003 spec line, so that it agrees with the migration that the code does.

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

Comment thread crates/boxes/src/lib.rs Resolved
Comment thread crates/boxes/src/store.rs Resolved
The migration in heal_migrate_untyped_records keeps the box_type of a
record that has one and lacks only the parent key. BOX-003 now says so,
and a second verify: line names the unit test for that case.

@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 — approval withheld

Verdict COMMENT — APPROVE withheld: 10 unresolved threads — minimal-arch[bot] crates/boxes/src/core/record.rs:9, minimal-arch[bot] crates/boxes/src/core/record.rs:417, minimal-arch[bot] crates/minimald/src/box_manager/tests.rs, minimal-foundry[bot] crates/boxes/src/core/record.rs, minimal-arch[bot] crates/boxes/src/core/record.rs:9, …. No findings.

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

@github-actions

Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/29-spec-box-local-first/29-spec-box-local-first.md — 67 finding(s)

docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:62: P004 BOX-002 names test 'vm_host_mints_box_id_before_in_vm_create', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:72: P004 BOX-004 names test 'name_unique_among_running_on_host_reusable_after_stop', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:77: P004 BOX-163 names test 'create_names_box_from_box_name_else_entry', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:87: P004 BOX-005 names test 'unqualified_name_resolves_running_else_latest', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:98: P004 BOX-007 names test 'self_as_name_is_exit3', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:102: P004 BOX-010 names test 'rename_changes_only_alias_and_records_event', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:131: P004 BOX-154 names test 'restart_sets_orphaned_running_record_stopped_without_signal', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:135: P004 BOX-013 names test 'stop_sends_term_then_kill_and_records_exited_stopped_with_signal', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:142: P004 BOX-015 names test 'daemon_never_stops_for_idle_or_client_loss', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:146: P004 BOX-016 names test 'pty_client_loss_records_detach', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:150: P004 BOX-017 names test 'stopped_box_filesystem_served_by_cp', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:154: P004 BOX-018 names test 'stopped_box_record_readable_until_reaped', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:158: P004 BOX-019 names test 'rm_deletes_record_and_filesystem', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:168: P004 BOX-021 names test 'prune_selectors_reap_and_print', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:172: P004 BOX-024 names test 'no_automatic_reaper_runs', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:176: P004 BOX-025 names test 'resume_restarts_from_stored_spec_same_id_and_name', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:186: P004 BOX-027 names test 'resume_runs_only_on_attach_hook', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:190: P004 BOX-028 names test 'hooks_on_resume_reruns_on_activate', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:194: P004 BOX-030 names test 'pty_box_resumes_from_stopped_and_exited', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:201: P004 BOX-037 names test 'until_complete_timeout_terms_then_kills_box_and_execs_reason_timeout', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:205: P004 BOX-038 names test 'until_complete_ends_on_entrypoint_return_without_client', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:209: P004 BOX-155 names test 'box_output_logged_from_start_complete_after_disconnect', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:213: P004 BOX-040 names test 'events_written_outside_box_filesystem_with_box_parent_ts_type', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:217: P004 BOX-041 names test 'in_box_root_cannot_append_events', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:221: P004 BOX-164 names test 'in_box_root_cannot_write_record_or_log', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:225: P004 BOX-045 names test 'events_survive_stop_deleted_on_rm', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:229: P004 BOX-162 names test 'events_read_returns_full_retained_stream_in_order', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:236: P004 BOX-158 names test 'list_returns_every_retained_record_with_state', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:243: P004 BOX-159 names test 'show_returns_record_state_identity_and_live_execs', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:250: P004 BOX-046 names test 'type_noun_tables_are_boxes_sugar', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:257: P004 BOX-048 names test 'defaults_merge_lists_union_scalars_replace', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:262: P004 BOX-049 names test 'flat_per_entry_keys_and_legacy_keys_keep_meaning', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:266: P004 BOX-050 names test 'legacy_session_table_reads_as_defaults_session_with_hint', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:273: P004 BOX-165 names test 'no_session_entry_expands_implicit_default_session', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:280: P004 BOX-051 names test 'legacy_defaults_task_keys_with_hint', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:284: P004 BOX-052 names test 'legacy_params_reads_as_args_with_hint', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:288: P004 BOX-054 names test 'interactive_task_exit3_names_session', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:292: P004 BOX-059 names test 'box_type_resolves_to_builtin_root', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:301: P004 BOX-061 names test 'expanded_spec_violating_constraint_exit3_names_type_and_layer', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:306: P004 BOX-156 names test 'derived_type_loosening_constraint_exit3_names_type_key_parent', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:311: P004 BOX-160 names test 'admission_refuses_spec_breaching_builtin_root_constraint_exit3', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:315: P004 BOX-062 names test 'constraint_never_adds_package_port_or_egress', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:320: P004 BOX-063 names test 'session_and_task_entries_expand_and_validate', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:327: P004 BOX-064 names test 'expansion_order_and_merge_rules', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:332: P004 BOX-065 names test 'expansion_is_byte_identical_across_runs', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:337: P004 BOX-066 names test 'invalid_key_exit3_names_key_and_layer', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:341: P004 BOX-161 names test 'expansion_reports_layer_and_type_per_value_outside_spec_bytes', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:348: P004 BOX-068 names test 'create_sends_expanded_spec_and_stores_it', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:352: P004 BOX-071 names test 'projection_is_the_6_3_2_field_set', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:366: P004 BOX-072 names test 'projection_digest_mismatch_refuses_create', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:371: P004 BOX-073 names test 'unenrolled_evaluates_no_policy', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:375: P004 BOX-074 names test 'get_version_reports_expander_version', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:382: P004 BOX-145 names test 'example_expansion_matches_golden_vectors', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:386: P004 BOX-076 names test 'sections_follow_box_toml_with_nested_egress', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:408: P004 BOX-079 names test 'network_mode_legacy_spelling_hint_and_canonical_value', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:412: P004 BOX-157 names test 'flat_egress_keys_hint_and_canonical_nested_keys', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:416: P004 BOX-080 names test 'network_bep_secrets_passed_unchanged', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:423: P004 BOX-081 names test 'broker_secret_unenrolled_exit5', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:427: P004 BOX-085 names test 'params_accepted_and_rendered', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:439: P004 BOX-149 names test 'exec_runs_argv_unshelled_in_box_namespaces_and_cgroup', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:467: P004 BOX-151 names test 'stop_exec_ends_process_group', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:472: P004 BOX-152 names test 'exec_events_carry_principal_argv_pty_code', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:477: P004 BOX-153 names test 'exec_disabled_refuses_exit5', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:484: P004 BOX-140 names test 'unenrolled_operations_over_file_mode_trust', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:488: P004 BOX-141 names test 'store_secret_passed_through_unenrolled', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:492: P004 BOX-142 names test 'enrolled_and_unenrolled_expansion_identical', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:497: P004 BOX-143 names test 'nothing_keys_on_box_name', which was not found in the repository

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@fb5932b8, spec format: How Minimal Writes Specs.

@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 new commit amends BOX-003 so that the spec matches the migration code. A stored box_type is kept, and only a missing one becomes session. The design is silent on migration, so the amendment conforms. The stored stopped and exited states that line 495 requires are still absent. C1 keeps that open, and issue #2634 owns it. The change can merge with C1 open.

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

Comment thread crates/minimald/src/box_manager.rs Resolved

@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/boxes/src/store.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note, pushed as c8ced45798db.

line exit tail
cargo nextest run -p boxes record_state_is_one_of_five_with_exit_reason 0 ing saphyr-parser v0.0.6 Compiling num-bigint v0.4.8 Compiling malachite v0.9.2 Compiling rayon v1.12.0 Compiling logos v0.16.1 Compiling nickel-lang-vector v0.2.0 Compiling codespan v0.13.1 Compiling toml_edit v0.25.15+spec-1.1.0 Compiling prettydiff v0.8.1 Compiling topi
cargo nextest run -p boxes restart_reaps_only_pending_and_materializing 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-74fd... Finished 'test' profile [unoptimized] target(s) in 0.48s ──────────── Nextest run ID 5c556427-7a29-4379-b7b6-4f6c21c273e5 with nextest profile: default Starting 1 test across 3
cargo nextest run -p boxes restart_migrates_records_missing_type_or_parent_once 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-3a9d... Finished 'test' profile [unoptimized] target(s) in 0.50s ──────────── Nextest run ID aad8c87f-baba-4047-b5b0-06a68d654270 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimald legacy_create_path_records_type_from_creating_verb 0 piling graph v0.0.1 (/workbench/crates/graph) Compiling primeorder v0.14.0 Compiling sendfd v0.4.4 Compiling caps v0.5.6 Compiling close_fds v0.3.2 Compiling crossbeam-channel v0.5.16 Compiling lcache v0.0.1 (/workbench/crates/lcache) Compiling curve25519-dalek v5.0.0 Compili

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

toredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...

Outside the task's layers::

  • crates/minimald/src/store.rs
  • docs/specs/29-spec-box-local-first/29-spec-box-local-first.md

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

Review threads the coder judged:

  • 👍 valid — crates/boxes/src/store.rs:561: Amended BOX-003 in docs/specs/29-spec-box-local-first to match heal_migrate_untyped_records: a stored box_type is kept, and only a record without one takes session. Added a second verify: line, heal_migrate_keeps_box_type_of_record_without_parent_key, for the kept-type case. No code changed.

Spec BOX-003 now states what the migration on this branch does: a record without box_type takes session, a record with a box_type keeps it, both get no parent, a fresh id only for a nil id, and no change on a later start. After restart, old sessions are running boxes, and the daemon reaps only unfinished records.

Notes from the agent: Revise round 4 changed only the spec, as the maintainer directed. This file is outside the task layers, and the maintainer accepted the edit. I changed no code. The first verify: test (restart_migrates_records_missing_type_or_parent_once) does not cover the kept-box_type case. Its typed record already has both keys. So a second verify: line names heal_migrate_keeps_box_type_of_record_without_parent_key in crates/boxes/src/store.rs. just lint-prose did not run, because vale is not installed on this box. The prose lane must lint the changed lines. The Kani legs stay deferred to the kani CI lane: state_is_exactly_one and restart_reaps_only_pending_or_materializing. I did not touch the PR body.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 26, 2026 20:43
@mitodrummer
mitodrummer marked this pull request as ready for review October 26, 2026 20:48

@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 c8ced45. The restart reap keys on RecordState::reaped_at_restart, the predicate both Kani harnesses verify on this head. The BOX-003 migration keeps a stored box_type, matching the amended spec line. The stored stopped/exited endings are residual #2634.

@mitodrummer
mitodrummer added this pull request to the merge queue Oct 26, 2026
@mitodrummer
mitodrummer removed this pull request from the merge queue due to a manual request Oct 26, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Oct 26, 2026
@mitodrummer
mitodrummer removed this pull request from the merge queue due to a manual request Oct 26, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Oct 26, 2026
@mitodrummer
mitodrummer removed this pull request from the merge queue due to a manual request Oct 26, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 994cabc Oct 27, 2026
38 checks passed
@mitodrummer
mitodrummer deleted the agent/2387-hold-every-record-in-one-of-five-states-migrated branch October 27, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T52 — Hold every record in one of five states, migrated once, and reaped only when unfinished

1 participant