Skip to content

T35 — Break session activation into named steps - #2464

Merged
mitodrummer merged 2 commits into
mainfrom
agent/2380-break-session-activation-into-named-steps
Oct 21, 2026
Merged

mitodrummer merged 2 commits into
mainfrom
agent/2380-break-session-activation-into-named-steps

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T35 — Break session activation into named steps

slice: S0
kind: enablement
covers: none
size: M
est: 300 code, 120 tests
executor: agent
difficulty: routine
model: standard
diagnostics: error names failed step
observability: one span per activation step
layers:
- cli:
- crates/minimal/src/cmd/boxes/create.rs: activation split into named steps
test: cargo nextest run -p minimal activation_steps_run_in_order_and_name_the_failing_step
produces: none
consumes:
- crates/minimal/src/cmd/boxes/create.rs
proof: Activation prints the same, with one span per step.
depends on:
- blocked by #2375

Proof

A run of min session activate prints the same lines and exits with the same codes as before. Under RUST_LOG=info, the log now shows one activation_step span for each of the 13 steps, in order (check_arguments through hold_name). When a step fails, the log shows an 'activation step failed' record with the step name and the error.

Notes from the agent: Each step body stays inline in activate_session, wrapped in ActivationStep::.run(async { ... }). The source-scanning tests in src/tests.rs (every_create_session_asserts_the_daemon_build, the_activation_path_makes_no_version_round_trip, both_creators_share_the_composition_failure_message, daemon_refusals_print_without_rpc_names) read the activate_session body. Separate step functions would break them, and tests.rs is outside the layers. Those tests and the create:: and vm_host:: tests still pass (37 passed). The error values are not wrapped, so the downcasts in main.rs (ProjectFileInvalid, ActivationRefused, HostUnreachable and the others) and the printed text do not change. The step name is only in the span and in an info-level log record, never in printed output. The diff is large (+1185/-836) because rustfmt re-indented the wrapped blocks. The logic is unchanged. The test checks the step order in activate_session's source against ActivationStep::ORDER. It also runs the steps through ActivationStep::run with a capture layer, to check one span per step and the failing step name. I did not run just ci or a whole-crate test run.

Tests

line exit tail
cargo nextest run -p minimal activation_steps_run_in_order_and_name_the_failing_step 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-54a5... 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.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-75d5...
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking args v0.0.1 (/workbench/crates/args)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    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 checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Closes #2380

Each part of activate_session now runs through ActivationStep::run,
which opens one activation_step span per step and logs the failing
step's name at info level. Errors pass through unchanged, so the
printed text and the exit codes main.rs downcasts stay the same.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b85efb5-b00a-483a-baaa-99e05b0c4222

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

Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 6cebf91b221c.

@mitodrummer resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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 design does not govern the internal structure of activate_session or the spans that the min client writes to its log. This is a PASS by absence, as #2452 was for the same file. The printed output, the exit codes and the error values do not change, because each wrapped return is an Err that .await? propagates. The UploadFiles wrapper at lines 1133 to 1242 is not in rustfmt shape. CI fmt can flag it. That is not a design condition.

Ruled at c9a38dd 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/minimal/src/cmd/boxes/create.rs Resolved
The step test now also runs the real activate_session with a missing
project path. It checks the check_arguments span, the failure record,
and that the error text passes through unchanged. The source scan
skips comment 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

The design of record does not govern how min splits session activation into steps or spans. This ruling is a PASS by absence, the same as the ruling on c9a38dd1. The new commit adds tests only. One test drives the real activate_session to a named failure at check_arguments. That test makes the proof stronger. No conditions.

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 6cebf91b221c.

line exit tail
cargo nextest run -p minimal activation_steps_run_in_order_and_name_the_failing_step 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7dbc... 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.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-6052...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    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 graph v0.0.1 (/workbench/crates/graph)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs:2015: Added a test that runs the real activate_session with a missing project path. It checks the check_arguments span, the failure record and the unchanged error text. The source scan now skips comment lines.

Activation prints the same text as before. Under RUST_LOG=info, each activation step shows as one activation_step span. A failed activation logs the name of the step that ended it. A test now runs the real activate_session to show this for the check_arguments step.

Notes from the agent: Revise round 1. I added activation_steps_run_in_order_and_name_the_failing_step_in_activate_session. Its name contains the test: filter, so the planned line runs it. The test calls activate_session with a project path that does not exist. The activation stops in check_arguments, before a daemon starts. The test checks the one span, the failure record and the unchanged error text. Steps after check_arguments need a running daemon, so the test cannot exercise them. The source-order scan now skips comment lines. cargo clippy -p minimal --all-targets and cargo fmt --check report nothing in create.rs.

@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 20, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +1226/-836 (2062 lines), past 3x the plan's estimate of 420 lines (est: 300 code, 120 tests), at round 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #2380 by hand.

@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: 1 unresolved thread — minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:2015. No findings.

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

@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 — every review thread is resolved; @mitodrummer closed the last one. The review of 6cebf91b221c withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 20, 2026
@norrietaylor
norrietaylor disabled auto-merge October 20, 2026 22:47
@mitodrummer mitodrummer removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 21, 2026

@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.

Babysit review on 6cebf91 against T35's plan block. activate_session now runs as 13 named ActivationSteps (CheckArguments … HoldName), each in an activation_step span that logs the failing step's name. The rest is existing code re-indented into the step blocks. Every early exit inside a block is return Err(..), which the step's .await? propagates unchanged, and the cleanup before those returns (withdraw_box_row, best_effort_destroy) is kept. One note: the version-skew refusal changed from bail!("{error}") to return Err(error). That keeps the original error rather than a re-wrapped message, so the top-level text is unchanged. activation_steps_run_in_order_and_name_the_failing_step_in_activate_session drives the real activate_session through the first step. arch-review PASS on this head.

@mitodrummer
mitodrummer added this pull request to the merge queue Oct 21, 2026
@mitodrummer
mitodrummer removed this pull request from the merge queue due to a manual request Oct 21, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit cb34c44 Oct 21, 2026
42 of 44 checks passed
@mitodrummer
mitodrummer deleted the agent/2380-break-session-activation-into-named-steps branch October 21, 2026 15:57
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.

T35 — Break session activation into named steps

1 participant