8000 T65 — Run on_activate again when a box resumes, if its spec sets hooks_on_resume by minimal-foundry[bot] · Pull Request #3123 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T65 — Run on_activate again when a box resumes, if its spec sets hooks_on_resume - #3123

Open
minimal-foundry[bot] wants to merge 11 commits into
mainfrom
agent/3111-run-on-activate-again-when-a-box-resumes-if-its
Open

minimal-foundry[bot] wants to merge 11 commits into
mainfrom
agent/3111-run-on-activate-again-when-a-box-resumes-if-its

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T65 — Run on_activate again when a box resumes, if its spec sets hooks_on_resume

slice: S4
kind: task
covers: BOX-028
size: M
est: 120 code, 210 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: daemon log names each on_activate run on resume and its outcome; a failed hook refuses the resume naming the hook's source and status
observability: box.resume span records hooks_on_resume and the activation hooks run
layers:
- daemon:
- crates/minimald/src/box_actor.rs: resume_ended runs on_activate when the stored spec sets execution.hooks_on_resume; a failed hook restores the record and refuses
- crates/minimald/src/box_actor/tests.rs: tests
test: cargo nextest run -p minimald hooks_on_resume_reruns_on_activate
test: cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state
test: cargo nextest run -p minimald resume_runs_only_on_attach_hook
- config:
- crates/mfile/src/lib.rs: hooks_on_resume is not an unknown key
test: cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown
- docs:
- docs/reference/minimal-dot-toml.md: hooks_on_resume key under [session] and [tasks.*]
produces: none
consumes:
- crates/mfile/src/spec.rs
proof: A box whose spec sets hooks_on_resume = true runs on_activate again when it resumes; a box without the key runs only on_attach.
depends on:
- blocked by #2415

Proof

A box whose stored spec sets execution.hooks_on_resume = true runs its on_activate hooks again when an attach resumes it, before on_attach. If one of those hooks fails, the resume is refused with the hook's source and exit status, and the box stays stopped or exited. A box without the key still runs only on_attach on resume.

Notes from the agent: resume_runs_only_on_ 8000 attach_hook existed already and passes unchanged. On a failed on_activate the resume stops the host it launched for the hooks, writes back the record it read, marks the name stopped, and refuses with channel exit status 1. Status 1 is new: 2 stays the terminal and name refusals, and 3 stays the stored-spec refusal. The refusal reads: "session <name> cannot resume, and it stays . Its activation hook from ." with the captured hook output after it. The box.resume span now records hooks_on_resume and activate_hooks (the count that ran). Each rerun is logged with its source and status. Follow-up outside layers: the doc comment on BoxSpec::hooks_on_resume in crates/mfile/src/spec.rs (a consumes file) still says the daemon does not read the key yet. It needs a one-line update in a later change. just lint-prose did not run, because vale is not installed on this box. The whole-crate suites and just ci did not run.

Tests

line exit tail
cargo nextest run -p minimald hooks_on_resume_reruns_on_activate 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... 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 (/workbench/crat
cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe
cargo nextest run -p minimald resume_runs_only_on_attach_hook 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe
cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown 0 Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... 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/crates/comm

Verify

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

ld tests::cli_instance_num_reads_run_args
        PASS [   0.006s] (1542/1549) minimald::bin/minimald tests::cli_listen_on_points_at_instance_ssh_sock
        PASS [   0.006s] (1543/1549) minimald::bin/minimald tests::cli_resolves_state_and_cache_overrides
        PASS [   0.007s] (1544/1549) minimald::bin/minimald tests::cli_ssh_args_proxy_targets_the_listen_socket
        PASS [   0.006s] (1545/1549) minimald::bin/minimald tests::egress_opt_out_falls_back_to_the_environment
        PASS [   0.007s] (1546/1549) minimald::bin/minimald tests::the_microvm_egress_runtime_is_built_up_front_and_torn_down_cleanly
        PASS [ 135.435s] (1547/1549) minimald exec::tests::end_to_end::exec_request_scrubs_credentials_from_log
        PASS [   5.163s] (1548/1549) minimald::otel_shutdown_integration a_connection_open_at_shutdown_still_exports_its_span
        SLOW [>240.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>300.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>360.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>420.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>480.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>540.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>600.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>660.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>720.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>780.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>840.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>900.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>960.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1020.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1080.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1140.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1200.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1260.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1320.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover
        SLOW [>1380.000s] (─────────) minimald box_manager::tests::reap_returns_after_teardown_and_handover

Base

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

Closes #3111

A box whose stored spec sets execution.hooks_on_resume runs its
on_activate hooks again when an attach resumes it (BOX-028). A hook
that fails stops the host, writes back the record the resume read, and
refuses the resume with the hook's source and status.
[session] and [tasks.*] entries carry hooks_on_resume for the box
spec (BOX-028). The unknown-field warning no longer names it.
@coderabbitai
coderabbitai Bot commented Nov 7, 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: e841a3a6-9983-473d-9158-93efea07d0a5

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

@agent-137
Copy link
Copy Markdown
Member

/review

@agent-137
agent-137 requested a review from a team as a code owner November 7, 2026 02:50
@minimal-foundry
minimal-foundry Bot commented Nov 7, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at a6087e653a4a.

Nothing to do.

Clobber: none seen in the touched code.

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

The rerun of on_activate on resume is in the correct place, and it refuses correctly when a hook fails. It does not fail closed when the composition sidecar is missing. Then has_hooks_for answers false, and the box resumes without its on_activate. Line 499 of architecture.md says a box with hooks_on_resume = true runs on_activate again on resume. C1 makes that path refuse. C2 updates the stale BoxSpec::hooks_on_resume doc comment in crates/mfile/src/spec.rs, because it still points to #3111 as open work.

Outside the diff

  • crates/mfile/src/spec.rs:77: C2 · This comment says the daemon does not read the key and points to #3111. This PR closes #3111. Say that minimald reads the key at resume in BoxActor::resume_ended, and remove the issue link.

Ruled at 9724a10 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimald/src/box_actor.rs Resolved
@agent-137
Copy link
Copy Markdown
Member
< 8000 table class="d-block user-select-contain" data-paste-markdown-skip>

/revise Three things on head 9724a10. The plan now also names crates/mfile/src/spec.rs, an owner-approved amendment for C2.

  1. Base merge. Merge main into this branch. It conflicts in docs/reference/minimal-dot-toml.md only, after T17 — Read the legacy tables for one release with a hint #3105 (T17, legacy tables) merged. Keep both sides: this PR's hooks_on_resume key, and main's entry-table and legacy-release text.

  2. Arch C1 (arch_rulings 1044). In crates/minimald/src/box_actor.rs rerun_activate_hooks():

    • Before the has_hooks_for(event) check, match self.inner.
    • When it is BoxInner::Active { composition: None, .. }, log tracing::info! with refusal = "hooks" and return Err(..).
    • The refusal says the session cannot resume because the daemon cannot read its hook settings. As the next step, it names min session destroy <name> and then min session activate. Follow AGENTS.md "User-facing text", and pin the exact text in the test.
    • Keep the Ok(()) / activate_hooks = 0 path only for a composition that is present and declares no on_activate.
    • Add a test in crates/minimald/src/box_actor/tests.rs. It removes the composition sidecar of a hooks_on_resume box, resumes the box, and asserts the refusal and the unchanged stopped state.
  3. Arch C2. In crates/mfile/src/spec.rs, in the doc comment on BoxSpec::hooks_on_resume (lines 77-79), replace "the daemon does not read this key yet. See T65 — Run on_activate again when a box resumes, if its spec sets hooks_on_resume #3111" with a sentence that says minimald reads the key at resume (BoxActor::resume_ended) and runs on_activate again. Remove the PR body's note that calls this an unfiled follow-up.

Change nothing else.

…ivate-again-when-a-box-resumes-if-its

# Conflicts:
#	docs/reference/minimal-dot-toml.md
Without its composition sidecar the daemon cannot see the box's
on_activate hooks, so the resume is refused and names the commands
that start the session over.
@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 two new commits close the open points from the ruling on 9724a100. A resume with hooks_on_resume set now refuses when the daemon cannot read the box's composition, so a hidden on_activate cannot be skipped. The BoxSpec::hooks_on_resume doc comment now says that minimald reads the key. The merge of #3105 is clean, and the docs now name [defaults.session]. The change conforms to architecture.md line 499. One note for later work: the mfile test uses only the legacy [session] table, which release 0.9 refuses.

Ruled at 373ffdd against gominimal/arch@7a86ec7bb3c0 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: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimald/src/box_actor.rs Resolved
@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Nov 7, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as 373ffdd87782.

Resolved conflicts in: docs/reference/minimal-dot-toml.md

line exit tail
cargo nextest run -p minimald hooks_on_resume_reruns_on_activate 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... 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 (/workbench/crat
cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p minimald resume_runs_only_on_attach_hook 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown 0 Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling version v0.8.0 (/workbench/crates/version) Compiling paths v0.0.1 (/workbench/crates/p

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_actor.rs:1569: rerun_activate_hooks now refuses the resume when the box is Active with no composition, before the has_hooks_for check, and a new test pins the refusal and the unchanged stopped state.

A box whose spec sets hooks_on_resume = true runs on_activate again when it resumes. A box without the key runs only on_attach. A hooks_on_resume box whose composition sidecar is missing does not resume. It stays stopped, and the refusal names min session destroy <name> and then min session activate.

Notes from the agent: Round 1. (1) Merged main and resolved the conflict in docs/reference/minimal-dot-toml.md. Both sides are kept: main's interactive-task text and entry tables, and this PR's [tasks.*] hooks_on_resume paragraph. That paragraph now links to [defaults.session] and not [session], because main renamed the table and lists [session] as a legacy spelling. (2) C1: rerun_activate_hooks takes the box name. It refuses with refusal = "hooks" when the box is Active with composition None. The full printed text is: "session <name> cannot resume, and it stays stopped. The daemon cannot read its hook settings. Destroy it with min session destroy <name>, then start a new one with min session activate." The exit status is 1, the same as a failed hook on resume. The new test hooks_on_resume_missing_composition_refuses_resume_keeps_state pins this text. It also checks that the state stays stopped and that no resumed event is written. (3) C2: the spec.rs doc comment now says minimald reads the key at resume (BoxActor::resume_ended). I cannot edit the PR body. The runner must remove the body's note that calls this an unfiled follow-up. I did not run just clippy-strict.

@agent-137
Copy link
Copy Markdown
Member

/revise Fix the finding on rerun_activate_hooks (thread PRRT_kwDOPdfcxM60xjN1): in crates/minimald/src/box_actor.rs, the resume awaits launch_host_for_hooks with no timeout, so a wedged sandbox build stalls the box actor and the resume forever. Both destroy callers (box_actor.rs about line 1116, host.rs about line 1909) wrap this call in HOOK_LAUNCH_TIMEOUT for that reason. Wrap this call the same way. On timeout, refuse the resume, write back the record the resume read (the box stays in its state), and log the timeout with the box id. The refusal text says the session cannot resume because its activation hooks did not start in time, and names the next step; follow AGENTS.md "User-facing text" and pin it in a test that makes the hook launch exceed a shortened timeout seam. Change nothing else.

A wedged sandbox build stalled the box actor and the resume forever.
The launch now uses HOOK_LAUNCH_TIMEOUT, as the destroy launches do.
On timeout the resume is refused and the record is written back.
@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 adds a deadline to the host launch that a hooks_on_resume resume needs. On the deadline, the resume is refused and the box stays stopped or exited. on_activate does not run. Line 499 of architecture.md permits only two results: the resume runs on_activate again, or it does not resume. This change keeps that rule, and the earlier PASS stands for the rest. Update the stale doc comment on HOOK_LAUNCH_TIMEOUT in a later change. It is not a design item.

Ruled at 0208fd9 against gominimal/arch@7a86ec7bb3c0 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: 2 of 3 personas ran (correctness, supply-chain); did not complete: security.

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

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

line exit tail
cargo nextest run -p minimald hooks_on_resume_reruns_on_activate 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... 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 (/workbench/crat
cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p minimald resume_runs_only_on_attach_hook 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown 0 Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling version v0.8.0 (/workbench/crates/version) Compiling paths v0.0.1 (/workbench/crates/p

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_actor.rs: Wrapped the resume's launch_host_for_hooks in HOOK_LAUNCH_TIMEOUT. On timeout the resume is refused, the record is written back, and the timeout is logged with the box id. The new test hooks_on_resume_launch_timeout_refuses_resume_keeps_state pins this behaviour.

A box whose spec sets hooks_on_resume = true runs on_activate again when it resumes, and a box without the key runs only on_attach. When the hook launch on resume does not start within HOOK_LAUNCH_TIMEOUT, the resume is refused, the box stays in the state it resumed from, and the refusal names min session attach <name> to try again.

Notes from the agent: Revise round 2: only the timeout finding is addressed. rerun_activate_hooks now wraps launch_host_for_hooks in HOOK_LAUNCH_TIMEOUT. On timeout it logs a warning with box_id and returns a refusal, and the existing resume_ended error path stops the host, writes back the record it read, and marks the name stopped. A new cfg(test) seam, resume_launch_seam, delays the launch and shortens the timeout for one box id. The new test hooks_on_resume_launch_timeout_refuses_resume_keeps_state pins the full refusal text: "session <name> cannot resume, and it stays stopped. Its activation hooks did not start in time. Run min session attach <name> to try the resume again." The retry is a fresh attempt on the same path, and it can time out again. A cancelled launch future is reaped by the launcher's drop guard, as for the destroy callers. just clippy-strict was not run.

A hooks_on_resume resume launches a host for on_activate before the
attach's launch. If that launch failed, finish_resume saw a host and
recorded the box as resumed. PendingResume now records that the resume
launched the host, and a failed launch stops it and restores the record.
@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 conforms to the design. At the earlier head, a failed attach launch after an on_activate rerun recorded resumed for a box that did not run. Now finish_resume stops the host that the resume launched, restores the record and marks the name stopped. Line 499 of architecture.md records resumed only for a box that resumes, so the fix is correct. No test covers the new branch, and minimal-review owns that gap.

Ruled at 74b5425 against gominimal/arch@7a86ec7bb3c0 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 — approval withheld

Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_actor.rs, minimal-foundry[bot] crates/minimald/src/box_actor.rs:1555. No findings.

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

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a failed check suite, pushed as 74b54256d7be.

line exit tail
cargo nextest run -p minimald hooks_on_resume_reruns_on_activate 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... 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 (/workbench/crat
cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p minimald resume_runs_only_on_attach_hook 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc
cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown 0 Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling version v0.8.0 (/workbench/crates/version) Compiling paths v0.0.1 (/workbench/crates/p

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_actor.rs:1555: PendingResume now records minted_host (the resume launched the host for on_activate). In finish_resume, a failed attach launch with that host still in the slot calls stop_running and then restores the record and the stopped name.

A box whose spec sets hooks_on_resume = true runs on_activate again when an attach resumes it. A box without the key runs only on_attach. If the attach launch fails after on_activate ran, the box stops and goes back to the state it resumed from. It does not stay running on the hook host.

Notes from the agent: Round 3. The test-kvm failure excerpt shows only the step scripts and the post-job cleanup. It does not show a failing test or step that this diff touches, so I could not find a cause in this change. The minimald, mfile and resume tests pass on this box (cargo nextest run -p minimald resume: 31 passed). If the KVM lane fails again, a person must read its full log. The new rollback path has no test. To make attach_launch fail after the hook host exists, a test seam in crates/minimald/src/box_actor/attach.rs is necessary, and that file is outside the task's layers.

@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; @agent-137 closed the last one. The review of 74b54256d7be 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 Nov 7, 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.

Approved.

@agent-137
agent-137 added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
…ivate-again-when-a-box-resumes-if-its

# Conflicts:
#	crates/mfile/src/lib.rs
@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 is only a merge of main. The daemon change for BOX-028 is the same as on 74b54256, and that head had a PASS. The merge rebuilds BoxSpec::build so that hooks_on_resume and the new timeout both come from the entry's table. Both serialize under execution, as architecture.md line 1099 says. The change still conforms to line 499. No conditions.

Ruled at a6087e6 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 4, not counted against the cap (1 of 3), pushed as a6087e653a4a.

Resolved conflicts in: crates/mfile/src/lib.rs

line exit tail
cargo nextest run -p minimald hooks_on_resume_reruns_on_activate 101 warning: unknown fields in [defaults] section of minimal.toml: session,task help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimald hooks_on_resume_failing_on_activate_refuses_resume_keeps_state 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimald resume_runs_only_on_attach_hook 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p mfile hooks_on_resume_entry_key_is_not_reported_unknown 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... error: no such command: 'nextest' help: a command with a simil

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

king getrandom v0.2.17
    Checking compression-core v0.4.33
    Checking tagptr v0.2.0
    Checking argon2 v0.6.0-rc.8
    Checking compression-codecs v0.4.45
    Checking moka v0.12.16
    Checking ring v0.17.14
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking bcrypt-pbkdf v0.11.0
    Checking ed25519-dalek v3.0.0
    Checking ssh-cipher v0.3.0
    Checking generic-array v0.14.7
    Checking sha3 v0.11.0
    Checking p384 v0.14.0
    Checking p521 v0.14.0
    Checking yasna v0.6.0
    Checking nickel-lang-core v0.19.0
    Checking pem v4.0.0
    Checking kem v0.3.0
    Checking module-lattice v0.2.3
    Checking object v0.40.0
    Checking hashbrown v0.14.5
    Checking sponge-cursor v0.1.0
    Checking dashmap v6.2.1
    Checking sha3 v0.12.0
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ml-kem v0.3.2
    Checking rcgen v0.14.10
    Checking common v0.0.1 (/workbench/crates/common)
    Checking generic-array v1.4.4
    Checking async-compression v0.4.50
    Checking ssh-key v0.7.0-rc.11
    Checking russh-cryptovec v0.62.0
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking async-tar v0.6.1
    Checking num-bigint v0.5.1
    Checking russh-util v0.52.0
    Checking wait-timeout v0.2.1
    Checking serde_bytes v0.11.19
    Checking hex-literal v1.1.0
    Checking constcat v0.6.1
    Checking russh v0.65.0
    Checking russh-sftp v2.4.0
    Checking rusty-fork v0.3.1
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking vt100 v0.16.2 (https://github.com/gominimal/vt100-rust.git?rev=9b8cce5a6798daf061948259ebcb073bb1ea54a6#9b8cce5a)
    Checking tokio-vsock v0.7.2
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking clap_complete v4.6.11
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking sysinfo v0.39.6
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking proptest v1.12.0
    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)
    Finished `dev` profile [unoptimized] target(s) in 3m 11s
error: no such command: `nextest`

help: a command with a similar name exists: `test`

help: view all installed commands with `cargo --list`
help: find a package to install `nextest` with `cargo search cargo-nextest`

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

A box whose spec sets hooks_on_resume = true runs on_activate again when it resumes. A box without the key runs only on_attach. The branch now merges cleanly with main.

Notes from the agent: This round resolved the merge conflict in crates/mfile/src/lib.rs. Main changed the [tasks.*] unknown-key check to use unknown_entry_keys, which drops the timeout key. The resolution keeps that helper and also drops hooks_on_resume, as the [session] check does. The other merged paths came from main without conflicts. cargo-nextest is not installed on this box, so each test line ran with cargo test and the same package and test name. cargo clippy -p mfile --all-targets printed no warnings.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 7, 2026 18:21
@agent-137
agent-137 marked this pull request as ready for review November 7, 2026 19:42

This branch has not been deployed

No deployments
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.

T65 — Run on_activate again when a box resumes, if its spec sets hooks_on_resume

2 participants

0