Skip to content

feat: T129 — The daemon stores the expanded spec with each hook's declarer, and composes from it - #3461

Merged
agent-137 merged 11 commits into
mainfrom
agent/3409-the-daemon-stores-the-expanded-spec-with-each-ho
Nov 17, 2026
Merged

agent-137 merged 11 commits into
mainfrom
agent/3409-the-daemon-stores-the-expanded-spec-with-each-ho

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

T129 — The daemon stores the expanded spec with each hook's declarer, and composes from it

slice: S6
kind: integration
covers: none
size: L
est: 300 code, 320 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the daemon log names the box and how many hooks it stored
observability: spec.json holds each hook with its declared_by
layers:
- spec:
- crates/mfile/src/spec.rs: the stored spec carries lifecycle_hooks with declared_by
- daemon:
- crates/minimald/src/box_manager.rs: store the received expanded spec as spec.json
- crates/minimald/src/box_manager/composables.rs: compose from the stored spec, not minimal.toml
- crates/minimald/src/box_manager/tests.rs: tests
test: cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json
test: cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml
- wire:
- crates/boxes/src/wire/request.rs: remove WireContribution::entry and WireBoxEntry
- client:
- crates/minimal/src/cmd/boxes/create.rs: send the expanded spec with each hook's declared_by
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer
produces: none
consumes:
- crates/mfile/src/expand.rs
proof: create a box with a project hook and a loadout hook, and read spec.json back with both declarers, while the daemon composes the box from that stored spec.
depends on:
- blocked by #3311
- blocked by #3387

When this task merges, the work #3282 and #3257 track is done. Close both by hand.

Residuals

Proof

A session box created from a project with a project hook and a selected loadout hook stores both hooks in its spec.json. Each hook has its declared_by: { kind = "project" } for one and { kind = "loadout", name = "rust" } for the other. min box spec reads that file through GetBoxSpec. The daemon composes the project's hooks from the project-declared hooks in that stored spec, and not from the [session] hooks in minimal.toml. The daemon log line "stored the box spec" names the box id and the lifecycle_hooks count.

Notes from the agent: Wire layer not done. The task says to remove WireContribution::entry and WireBoxEntry from crates/boxes/src/wire/request.rs. Code outside the layers still uses both types: crates/boxes/src/daemon/composer.rs (compose_entry and its tests) and crates/minimal/src/task.rs (the task create sets contribution.entry). The stored v0 BoxSpec also has no field for the entry's vars, vars_lenient or patches, so the daemon still needs the entry for those. Both types stay. The daemon now overrides only the entry's lifecycle_hooks with the stored spec's project hooks. A follow-up task needs those two files in its layers, and a spec that carries vars, vars_lenient and patches.

Design: BoxSpec gains lifecycle_hooks: Option<Vec<SpecHook>>, serialized as a top-level lifecycle_hooks list and omitted when None. Each hook is the LifecycleHook table with a declared_by table. None means the client sent no list: a task create (task.rs is outside the layers, so min task run still sends none), an older client, or an older stored spec. In that case the daemon composes hooks as before. The key is outside the projection, so the client and daemon digests stay equal (create_stores_client_digest_equal_to_daemon_digest passes).

Only hooks with declared_by kind = project replace the project hooks in the composition. Loadout hooks still come in on the client contribution with their loadout source, so the daemon does not add them twice. With --no-ho…[truncated]

Tests

line exit tail
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in bo
cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in bo
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-2 in bo

Verify

min task run agent-verify exited 101, so this PR is a draft.

uild/debug/deps/libot-f7d366bdf87c04c2.rlib --extern p256=/work/build-cache/cargo-home/build/debug/deps/libp256-ec3d90cc52488749.rlib --extern paths=/work/build-cache/cargo-home/build/debug/deps/libpaths-38d338f2d2882e54.rlib --extern proptest=/work/build-cache/cargo-home/build/debug/deps/libproptest-44d491d1a8aa49a0.rlib --extern ratatui=/work/build-cache/cargo-home/build/debug/deps/libratatui-1fc20dde22a8a62b.rlib --extern reqwest=/work/build-cache/cargo-home/build/debug/deps/libreqwest-5de86acda4cea8f4.rlib --extern russh=/work/build-cache/cargo-home/build/debug/deps/librussh-ed15d7ff509bfc78.rlib --extern serde=/work/build-cache/cargo-home/build/debug/deps/libserde-a2d31a39ef0e3ca2.rlib --extern serde_json_lenient=/work/build-cache/cargo-home/build/debug/deps/libserde_json_lenient-d40e6f0e7b3e9eef.rlib --extern sha2=/work/build-cache/cargo-home/build/debug/deps/libsha2-c9bcb32104c3d8ae.rlib --extern switch=/work/build-cache/cargo-home/build/debug/deps/libswitch-6c812704e5da955c.rlib --extern tempfile=/work/build-cache/cargo-home/build/debug/deps/libtempfile-a0e916d9301e1bc8.rlib --extern tokio=/work/build-cache/cargo-home/build/debug/deps/libtokio-13fd64194b408f82.rlib --extern tokio_stream=/work/build-cache/cargo-home/build/debug/deps/libtokio_stream-f2be74d61837d3fa.rlib --extern toml=/work/build-cache/cargo-home/build/debug/deps/libtoml-2aea33601fef026d.rlib --extern toml_edit=/work/build-cache/cargo-home/build/debug/deps/libtoml_edit-c70767a08866b85f.rlib --extern tracing=/work/build-cache/cargo-home/build/debug/deps/libtracing-83feaaf26e80a884.rlib --extern tracing_subscriber=/work/build-cache/cargo-home/build/debug/deps/libtracing_subscriber-b9d261067ec6d0c0.rlib --extern unicode_width=/work/build-cache/cargo-home/build/debug/deps/libunicode_width-b88ae913615e5a0f.rlib --extern url=/work/build-cache/cargo-home/build/debug/deps/liburl-7dfaaabb254cca5f.rlib --extern uuid=/work/build-cache/cargo-home/build/debug/deps/libuuid-2ad4c678aa627cb6.rlib --extern version=/work/build-cache/cargo-home/build/debug/deps/libversion-26aec4f378b53f65.rlib --extern zeroize=/work/build-cache/cargo-home/build/debug/deps/libzeroize-839e2912eb255706.rlib -L native=/work/build-cache/cargo-home/build/debug/build/zstd-sys-0d91391d9ed43bde/out -L native=/work/build-cache/cargo-home/build/debug/build/ring-43aedddb25fbb121/out -L native=/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-467e076f78a0a3c4/out -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-6abcf750100a3ada/out -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-4d55240ed02e956b/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out` (exit status: 101)
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package mfile --package minimal --package minimald --locked` exited with code 101

Closes #3409

BoxSpec carries the expanded spec's lifecycle hooks, each with the
declared_by table that names its declarer (BOX-068, BOX-179). A spec
with no hook list writes no key.
The daemon composes the project's lifecycle hooks from the hooks with a
project declared_by in spec.json, in place of the [session] hooks of
minimal.toml and the hooks of the expanded entry (BOX-068, BOX-179).
A loadout hook still arrives on the contribution with its loadout.

The log line that stores the spec names how many hooks it carries.
A session create puts the expanded spec's lifecycle_hooks, each with
its declared_by, into the box spec it sends. The daemon stores them in
spec.json and composes the project's hooks from them (BOX-068,
BOX-179).
@coderabbitai

coderabbitai Bot commented Nov 16, 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: 12efbc36-1a29-45ff-9a4b-c7ca518793f7

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Every failing check on f594dabda30e matches an open known-flake issue, so the failed suite started no revise round:

Re-run the failed jobs. If the same checks go red again on this head, the next failed suite starts a round; if this red is not the flake, /revise <note> starts one now.

@agent-137
agent-137 marked this pull request as ready for review November 16, 2026 06:51
@agent-137
agent-137 requested a review from a team as a code owner November 16, 2026 06:51
@minimal-foundry

minimal-foundry Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 3 threads unresolved at 717988e3b16e.

APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/tests.rs:7749. Resolving the last thread releases the approval on this head.

Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

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

Comment on lines +569 to +600
/// directory (BOX-068). `None` when the box stores no spec, or when the
/// stored spec does not read as a Box Spec.
fn stored_spec_beside(project_path: &DaemonAbsPath) -> Option<mfile::spec::BoxSpec> {
let path = project_path
.as_utf8_path()
.parent()?
.join(boxes::store::SPEC_FILE);
let bytes = match std::fs::read(&path) {
Ok(bytes) => bytes,
Err(e) if e.kind() == std::io::ErrorKind::NotFound => return None,
Err(e) => {
tracing::warn!(spec_path = %path, error = %e, "could not read the stored box spec");
return None;
}
};
match serde_json_lenient::from_slice(&bytes) {
Ok(spec) => Some(spec),
Err(e) => {
tracing::warn!(
spec_path = %path,
error = %e,
"the stored box spec does not read as a box spec; \
the project's hooks compose from the project as before"
);
None
}
}
}

/// Composes the project's lifecycle hooks from the stored spec `spec`, not
/// from the project's `minimal.toml` (BOX-068, BOX-179). The hooks whose
/// `declared_by` names the project replace every project hook: the ones

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.

LOW · correctness · confidence 0.50 · in stored_spec_beside

When spec.json cannot be read or parsed, stored_spec_beside logs a warning and returns None. The daemon then composes the project's hooks from the project's minimal.toml and the client entry. The PR says the daemon composes from the stored spec and not from minimal.toml. A corrupt or unreadable spec.json therefore changes which hooks run, with no error. A NotFound for a box that should have a spec is also silent. Consider failing the compose in the read-error and parse-error cases.

What the reviewer checked

Err(e) => { tracing::warn!(... "could not read the stored box spec"); return None; }

Hand this to an agent
Act on a code-review finding.

File:       crates/minimald/src/box_manager/composables.rs
Lines:      569-600
Category:   correctness
Severity:   low (reviewer confidence 0.50)

Finding:
When spec.json cannot be read or parsed, `stored_spec_beside` logs a warning and returns None. The daemon then composes the project's hooks from the project's `minimal.toml` and the client entry. The PR says the daemon composes from the stored spec and not from `minimal.toml`. A corrupt or unreadable spec.json therefore changes which hooks run, with no error. A NotFound for a box that should have a spec is also silent. Consider failing the compose in the read-error and parse-error cases.

First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.

👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.

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.

Addressed in 714cfc15af56: An unreadable spec.json now fails the compose instead of falling back to minimal.toml, with a test. A parse failure still falls back, because the daemon stores any spec with a whole v (spec_bytes), so a spec of another version is accepted by design. NotFound stays silent: a box created without a spec stores no spec.json.

A box that stores spec.json no longer falls back to the hooks in
minimal.toml when the file exists but cannot be read.
@agent-137

Copy link
Copy Markdown
Member

/revise Merge origin/main into this branch, and change nothing else. The arch review on f594dab did not run: its check run finished the second it started, with the title "Not posted" and no ruling. A new head starts a fresh arch review. Main is one commit ahead (#3433). Do not rewrite history and do not force-push. Add a merge commit. The three tests this task names must still pass.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 714cfc15af56.

line exit tail
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in bo
cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in bo
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-2 in bo

Verify min task run agent-verify exited 100.

               "span_id": "a77f1e3570be7da4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "e354a81dccb09eba",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "c2a85d9b984cf60d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "c2a85d9b984cf60d",
                "queued_behind": "0",
                "span_id": "fc5c4ab4f509ecb3",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "c2a85d9b984cf60d",
                "queued_behind": "0",
                "span_id": "69dcb4ed51e4964f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "69dcb4ed51e4964f",
                "span_id": "948a9592b694aeaf",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "69dcb4ed51e4964f",
                "queued_behind": "0",
                "span_id": "30b4dd147405cb71",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.289s] (1356/2829) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.261s] (1357/2829) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.300s] (1358/2829) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
────────────
     Summary [  69.153s] 1358/2829 tests run: 1357 passed, 1 failed, 29 skipped
        FAIL [   2.925s] (1355/2829) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1471/2829 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

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

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_manager/composables.rs:612: An unreadable spec.json now fails the compose instead of falling back to minimal.toml, with a test. A parse failure still falls back, because the daemon stores any spec with a whole v (spec_bytes), so a spec of another version is accepted by design. NotFound stays silent: a box created without a s

A box created with a project hook and a loadout hook stores spec.json with both hooks and their declared_by values. The daemon composes the project's hooks from that stored spec, not from minimal.toml. A stored spec that exists but cannot be read now fails the compose and does not fall back to minimal.toml.

Notes from the agent: Revise round 1. stored_spec_beside now returns Result. A read error other than NotFound fails run_compose with 'reading the stored box spec at : ' and logs at error level. A parse error still falls back to the project, on purpose: spec_bytes in box_manager.rs stores any spec with a whole v, and creation_name also treats a spec that does not read as v0 as naming nothing. NotFound stays silent, because a box created without a spec (the first-slice path) stores no spec.json. composes_from_stored_expanded_spec_not_minimal_toml now also checks the unreadable case. cargo clippy -p minimald --all-targets is clean.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 16, 2026 07:27

@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/minimald/src/box_manager/composables.rs:612. No findings.

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note: the coder changed nothing. No-op. The directive asks for a merge of origin/main. That merge is already on the branch: merge commit 192c820 brought in f7b6e36 (#3433), and origin/main has no commits that HEAD does not have. A fresh fetch was not possible because the remote refused the connection, so I checked the local origin/main only. A new merge commit with no change is an empty commit, so I made none. The branch head stays 714cfc1. That head already differs from f594dab, the head where the arch review did not run, so a review of 714cfc1 can run without a new commit. All three test lines pass.

@agent-137
agent-137 marked this pull request as ready for review November 16, 2026 15:57
…-stores-the-expanded-spec-with-each-ho

# Conflicts:
#	crates/minimald/src/box_manager/tests.rs
@agent-137

Copy link
Copy Markdown
Member

/revise The arch ruling on 714cfc1 is CONDITIONS. The runtime withheld its text, and Karl read it and passed it on. C2 is done: #3467 owns the leftover work, and the PR body names it under Residuals. Do C1, in full:

C1 — crates/minimald/src/box_manager/composables.rs, stored_spec_beside() (line 605): when serde_json_lenient::from_slice fails, return Ok(None) only when the stored v is a whole number that is not mfile::spec::BOX_SPEC_VERSION. For a v0 spec that does not parse, or a spec with no readable v, return Err ("reading the stored box spec at {path}: ...") the same way as the read error, and log at error!. Add a case to composes_from_stored_expanded_spec_not_minimal_toml that writes a v0 spec.json with a hook that has no declared_by, and assert that run_compose fails, not that the from-toml hook composes. Reason: admission (spec_bytes) stores any spec with a whole v, so a v0 spec with a bad hook list is stored, and the box then runs hooks from minimal.toml that the record does not show (architecture.md line 500).

The three tests this task names must still pass. Do not rewrite history and do not force-push.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

Resolved conflicts in: crates/minimald/src/box_manager/tests.rs

line exit tail
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in bo
cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in bo
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-2 in bo

Verify min task run agent-verify exited 100.

               "span_id": "3133a17e1ca12e4e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "7bee72fc61fd187b",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "347d86d2e2a41fa4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "347d86d2e2a41fa4",
                "queued_behind": "0",
                "span_id": "7d49d00b2841f333",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "347d86d2e2a41fa4",
                "queued_behind": "0",
                "span_id": "019ce7cebd1a309d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "019ce7cebd1a309d",
                "span_id": "8f912ef50db4d26a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "019ce7cebd1a309d",
                "queued_behind": "0",
                "span_id": "c6d281314592fd6a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.372s] (1356/2830) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.353s] (1357/2830) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.363s] (1358/2830) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
────────────
     Summary [  79.016s] 1358/2830 tests run: 1357 passed, 1 failed, 29 skipped
        FAIL [   3.245s] (1355/2830) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1472/2830 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

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

A box created with a project hook and a loadout hook has a spec.json that lists both hooks, each with its declared_by. The daemon composes the box from that stored spec, not from minimal.toml. The branch now merges cleanly with main.

Notes from the agent: This round resolved the merge conflict with main in crates/minimald/src/box_manager/tests.rs. Both sides appended tests at the end of the file. I kept the branch's declarer tests and main's client_and_daemon_digests_match_vectors_and_mismatch_refused test, and committed the merge. cargo clippy -p minimald --all-targets is clean. The merged main test also passes. No code change was necessary this round. The wire layer is still open on this branch: crates/boxes/src/wire/request.rs still has WireContribution::entry and WireBoxEntry. This round's directive asked only for the conflict resolution, so I did not change it. A person must decide if a later round removes them.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 16, 2026 18:42

@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

The daemon now stores each hook with its declarer, and the client and daemon digests stay equal. One path fails open. When spec.json exists but is not a v0 spec, stored_spec_beside logs a warning. The compose then takes the project hooks from minimal.toml. Line 500 of architecture.md says a box restarts from the spec stored in its record. The launch path already refuses that spec through box_runtime::stored_spec. Make the change in C1. Then the change conforms, and #3467 tracks the loadout hooks.

Ruled at dd09b1e against gominimal/arch@327e1b57d16b by claude-opus-5-5.

));
}
};
match serde_json_lenient::from_slice(&bytes) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · A parse failure here returns Ok(None). The compose then takes the project hooks from minimal.toml. That fails open. Line 500 says the box restarts from the spec stored in its record. Call crate::box_runtime::stored_spec(&bytes).map(Some) here. Then a spec that is not v0, or a hook with no declared_by, fails the compose. held_spec refuses the same spec at launch.

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.

Addressed in 8bdcefe0f769: stored_spec_beside now calls crate::box_runtime::stored_spec(&bytes).map(Some), so a stored spec that is not v0, or has a hook with no declared_by, fails the compose with InvalidInput.

};
assert!(composition.lifecycle_hooks().is_empty());

// A stored spec that cannot be read fails the compose: the hooks never

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · This case covers a read error only. Add a case that writes a spec.json with "v": 0 and a hook with no declared_by. Assert that run_compose(..., true) returns Err.

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.

Addressed in 8bdcefe0f769: composes_from_stored_expanded_spec_not_minimal_toml now writes a v0 spec.json with a hook that has no declared_by, and asserts that run_compose(..., true) returns an InvalidInput Err.

@agent-137

Copy link
Copy Markdown
Member

/revise Arch ruling 1328 on dd09b1e replaces the C1 in my earlier note with a more specific one. Where the two differ, follow this one. In full:

  • C1: crates/minimald/src/box_manager/composables.rs stored_spec_beside(): replace the serde_json_lenient::from_slice(&bytes) match (the warn! that returns Ok(None)) with crate::box_runtime::stored_spec(&bytes).map(Some). A spec.json that exists but is not a v0 spec, or has a hook with no valid declared_by, then fails the compose with the same InvalidInput refusal that BoxActor::held_spec gives at launch. Update the doc comment of stored_spec_beside: remove the sentence that says another version composes from the project. In crates/minimald/src/box_manager/tests.rs composes_from_stored_expanded_spec_not_minimal_toml, add a case that writes a spec.json with "v": 0 and a hook with no declared_by, and asserts run_compose(..., true) returns Err.

C2 from the earlier ruling stays done: #3467 owns the leftover wire work. The three tests this task names must still pass. Do not rewrite history and do not force-push.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

A spec.json that is not a v0 spec, or has a hook with no valid
declared_by, now fails the compose with the InvalidInput refusal that
held_spec gives at launch, in place of a fall back to minimal.toml.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in bo
cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in bo
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-2 in bo

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

2.7.0
    Checking ratatui-macros v0.7.2
    Checking inquire v0.9.4
    Checking ratatui v0.30.2
    Checking insta v1.49.0
   Compiling serial_test_derive v4.0.1
    Checking nickel-lang-core v0.19.0
    Checking serial_test v4.0.1
    Checking args v0.0.1 (/workbench/crates/args)
    Checking common v0.0.1 (/workbench/crates/common)
    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 minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 4m 04s
   Compiling opentelemetry v0.33.1
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling serial_test v4.0.1
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

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

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_manager/composables.rs:596: stored_spec_beside now calls crate::box_runtime::stored_spec(&bytes).map(Some), so a stored spec that is not v0, or has a hook with no declared_by, fails the compose with InvalidInput.
  • 👍 valid — crates/minimald/src/box_manager/tests.rs:7719: composes_from_stored_expanded_spec_not_minimal_toml now writes a v0 spec.json with a hook that has no declared_by, and asserts that run_compose(..., true) returns an InvalidInput Err.

A box created with a project hook and a loadout hook stores spec.json with both declarers. The daemon composes the box's hooks from that stored spec. A stored spec that is not v0, or has a hook with no declared_by, now fails the compose and does not fall back to minimal.toml.

Notes from the agent: Round 4 does the C1 ruling. stored_spec_beside now calls crate::box_runtime::stored_spec(&bytes).map(Some) and logs the refusal at error level. Its doc comment no longer says that another version composes from the project. The compose test has a new case: a v0 spec.json with a hook that has no declared_by makes run_compose(..., true) return an InvalidInput Err. cargo clippy -p minimald --all-targets is clean. C2 stays with #3467.

@agent-137
agent-137 marked this pull request as ready for review November 16, 2026 23:07
@agent-137

Copy link
Copy Markdown
Member

/revise The tests job on 8bdcefe (run 43972068157) fails 47 tests in crates/minimal/src/tests.rs. Each panics at crates/minimald-rpc/src/lib.rs:76:

unwrap of error value: The settings it was created with cannot be read: missing field `entry` at line 1 column 33.

Main's native CI is green, so this comes from this branch: its stored-spec read now requires entry, and specs the tests' daemon is given have none. Some of the failing tests came from main with #3448 (T130), such as attached_run_from_subfolder_copies_exports_to_project_root. Find where entry became required, and fix the cause: either the client sends entry in every create, or the fixtures build their spec through the same path a real create uses. Do not make entry optional just to pass the tests if the stored spec needs it. The failing tests, in full:

  • tests::attach_and_resume_verbs_resume_stopped_pty_box
  • tests::attach_connection_failure_exit7
  • tests::attach_detach_or_entrypoint_exit_returns_0
  • tests::attach_ended_from_other_side_notice_exit254
  • tests::attach_ended_from_other_side_notice_exit254_before_the_record
  • tests::attached_run_from_subfolder_copies_exports_to_project_root
  • tests::box_attach_exec_box_stopped_exit254_names_stop
  • tests::box_attach_exec_ended_exit4_names_logs_and_wait
  • tests::box_attach_exec_late_stop_record_exit254_names_stop
  • tests::box_attach_exec_non_pty_exit2_names_logs
  • tests::box_attach_exec_own_end_code7_exits_0
  • tests::box_attach_exec_reattaches_live_pty_exec
  • tests::box_attach_exec_unknown_id_exit4_names_id
  • tests::box_attach_reattaches_pty_box
  • tests::box_attach_running_non_pty_box_exit2_names_logs
  • tests::box_attach_without_address_ambiguous_exit2_lists
  • tests::box_attach_without_address_none_exit4_hints_start
  • tests::box_attach_without_address_picks_running_else_sole_retained
  • tests::box_attach_without_address_unreachable_host_exit7
  • tests::box_attach_without_tty_exit2
  • tests::box_exec_runs_command_and_exits_with_its_code
  • tests::box_exec_show_logs_wait_stop_end_to_end
  • tests::box_exec_t_attach_sends_configured_session_keys
  • tests::box_exec_t_invalid_session_keys_starts_no_exec
  • tests::box_exec_tty_refuses_without_a_terminal
  • tests::box_logs_exec_prints_exec_output
  • tests::box_logs_piped_pty_transcript_has_no_control_codes
  • tests::box_logs_raw_keeps_control_codes
  • tests::box_show_lists_live_execs
  • tests::box_show_output_json_writes_box_with_execs
  • tests::box_show_output_yaml_matches_json
  • tests::box_stop_exec_stops_that_exec
  • tests::box_wait_exec_returns_exec_code
  • tests::detached_start_or_stop_copies_no_exports
  • tests::exec_attach_detach_key_returns_0_exec_keeps_running
  • tests::exec_mode_is_one_word_in_show_and_events
  • tests::exports_not_copied_from_another_project
  • tests::resume_name_conflict_exit2_names_holder
  • tests::resume_non_pty_box_exit2_hint_by_lifetime
  • tests::session_attach_is_box_attach_filtered_to_sessions
  • tests::session_attach_non_pty_reports_box_attach_refusal
  • tests::session_attach_without_address_ambiguous_exit2_lists
  • tests::session_attach_without_address_none_exit4_hints_start
  • tests::session_attach_without_address_picks_project_else_sole
  • tests::session_attach_without_address_unreachable_host_exit7
  • tests::start_attach_resume_end_to_end
  • tests::waiting_command_copies_file_exports_after_box_ends

The three tests this task names must still pass. Do not rewrite history and do not force-push.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

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

@minimal-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 change conforms to the design. The stored spec keeps each hook with its declared_by, and --no-hooks stores an empty list (architecture.md lines 1170-1172). The daemon composes the project's hooks from that stored spec, and project hooks still run before loadout hooks (line 1253). The new commit makes the compose refuse a stored spec that a launch refuses, so the hooks never fall back to minimal.toml. The work that stays open, the entry fields and the task create's hooks, is filed as #3467.

Ruled at 8bdcefe against gominimal/arch@327e1b57d16b 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: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/tests.rs:7719. No findings.

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

@agent-137

Copy link
Copy Markdown
Member

/revise The tests job on 8bdcefe (run 43972068157) fails 47 tests in crates/minimal/src/tests.rs. Each panics at crates/minimald-rpc/src/lib.rs:76:

unwrap of error value: The settings it was created with cannot be read: missing field `entry` at line 1 column 33.

Main's native CI is green, so this comes from this branch: its stored-spec read now requires entry, and specs the tests' daemon is given have none. Some of the failing tests came from main with #3448 (T130), such as attached_run_from_subfolder_copies_exports_to_project_root. Find where entry became required, and fix the cause: either the client sends entry in every create, or the fixtures build their spec through the same path a real create uses. Do not make entry optional just to pass the tests if the stored spec needs it. The failing tests, in full:

  • tests::attach_and_resume_verbs_resume_stopped_pty_box
  • tests::attach_connection_failure_exit7
  • tests::attach_detach_or_entrypoint_exit_returns_0
  • tests::attach_ended_from_other_side_notice_exit254
  • tests::attach_ended_from_other_side_notice_exit254_before_the_record
  • tests::attached_run_from_subfolder_copies_exports_to_project_root
  • tests::box_attach_exec_box_stopped_exit254_names_stop
  • tests::box_attach_exec_ended_exit4_names_logs_and_wait
  • tests::box_attach_exec_late_stop_record_exit254_names_stop
  • tests::box_attach_exec_non_pty_exit2_names_logs
  • tests::box_attach_exec_own_end_code7_exits_0
  • tests::box_attach_exec_reattaches_live_pty_exec
  • tests::box_attach_exec_unknown_id_exit4_names_id
  • tests::box_attach_reattaches_pty_box
  • tests::box_attach_running_non_pty_box_exit2_names_logs
  • tests::box_attach_without_address_ambiguous_exit2_lists
  • tests::box_attach_without_address_none_exit4_hints_start
  • tests::box_attach_without_address_picks_running_else_sole_retained
  • tests::box_attach_without_address_unreachable_host_exit7
  • tests::box_attach_without_tty_exit2
  • tests::box_exec_runs_command_and_exits_with_its_code
  • tests::box_exec_show_logs_wait_stop_end_to_end
  • tests::box_exec_t_attach_sends_configured_session_keys
  • tests::box_exec_t_invalid_session_keys_starts_no_exec
  • tests::box_exec_tty_refuses_without_a_terminal
  • tests::box_logs_exec_prints_exec_output
  • tests::box_logs_piped_pty_transcript_has_no_control_codes
  • tests::box_logs_raw_keeps_control_codes
  • tests::box_show_lists_live_execs
  • tests::box_show_output_json_writes_box_with_execs
  • tests::box_show_output_yaml_matches_json
  • tests::box_stop_exec_stops_that_exec
  • tests::box_wait_exec_returns_exec_code
  • tests::detached_start_or_stop_copies_no_exports
  • tests::exec_attach_detach_key_returns_0_exec_keeps_running
  • tests::exec_mode_is_one_word_in_show_and_events
  • tests::exports_not_copied_from_another_project
  • tests::resume_name_conflict_exit2_names_holder
  • tests::resume_non_pty_box_exit2_hint_by_lifetime
  • tests::session_attach_is_box_attach_filtered_to_sessions
  • tests::session_attach_non_pty_reports_box_attach_refusal
  • tests::session_attach_without_address_ambiguous_exit2_lists
  • tests::session_attach_without_address_none_exit4_hints_start
  • tests::session_attach_without_address_picks_project_else_sole
  • tests::session_attach_without_address_unreachable_host_exit7
  • tests::start_attach_resume_end_to_end
  • tests::waiting_command_copies_file_exports_after_box_ends

The three tests this task names must still pass. Do not rewrite history and do not force-push.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

@agent-137

Copy link
Copy Markdown
Member

/revise The tests job on 8bdcefe (run 43972068157) fails 47 tests in crates/minimal/src/tests.rs. Each panics at crates/minimald-rpc/src/lib.rs:76:

unwrap of error value: The settings it was created with cannot be read: missing field `entry` at line 1 column 33.

Main's native CI is green, so this comes from this branch: its stored-spec read now requires entry, and specs the tests' daemon is given have none. Some of the failing tests came from main with #3448 (T130), such as attached_run_from_subfolder_copies_exports_to_project_root. Find where entry became required, and fix the cause: either the client sends entry in every create, or the fixtures build their spec through the same path a real create uses. Do not make entry optional just to pass the tests if the stored spec needs it. The failing tests, in full:

  • tests::attach_and_resume_verbs_resume_stopped_pty_box
  • tests::attach_connection_failure_exit7
  • tests::attach_detach_or_entrypoint_exit_returns_0
  • tests::attach_ended_from_other_side_notice_exit254
  • tests::attach_ended_from_other_side_notice_exit254_before_the_record
  • tests::attached_run_from_subfolder_copies_exports_to_project_root
  • tests::box_attach_exec_box_stopped_exit254_names_stop
  • tests::box_attach_exec_ended_exit4_names_logs_and_wait
  • tests::box_attach_exec_late_stop_record_exit254_names_stop
  • tests::box_attach_exec_non_pty_exit2_names_logs
  • tests::box_attach_exec_own_end_code7_exits_0
  • tests::box_attach_exec_reattaches_live_pty_exec
  • tests::box_attach_exec_unknown_id_exit4_names_id
  • tests::box_attach_reattaches_pty_box
  • tests::box_attach_running_non_pty_box_exit2_names_logs
  • tests::box_attach_without_address_ambiguous_exit2_lists
  • tests::box_attach_without_address_none_exit4_hints_start
  • tests::box_attach_without_address_picks_running_else_sole_retained
  • tests::box_attach_without_address_unreachable_host_exit7
  • tests::box_attach_without_tty_exit2
  • tests::box_exec_runs_command_and_exits_with_its_code
  • tests::box_exec_show_logs_wait_stop_end_to_end
  • tests::box_exec_t_attach_sends_configured_session_keys
  • tests::box_exec_t_invalid_session_keys_starts_no_exec
  • tests::box_exec_tty_refuses_without_a_terminal
  • tests::box_logs_exec_prints_exec_output
  • tests::box_logs_piped_pty_transcript_has_no_control_codes
  • tests::box_logs_raw_keeps_control_codes
  • tests::box_show_lists_live_execs
  • tests::box_show_output_json_writes_box_with_execs
  • tests::box_show_output_yaml_matches_json
  • tests::box_stop_exec_stops_that_exec
  • tests::box_wait_exec_returns_exec_code
  • tests::detached_start_or_stop_copies_no_exports
  • tests::exec_attach_detach_key_returns_0_exec_keeps_running
  • tests::exec_mode_is_one_word_in_show_and_events
  • tests::exports_not_copied_from_another_project
  • tests::resume_name_conflict_exit2_names_holder
  • tests::resume_non_pty_box_exit2_hint_by_lifetime
  • tests::session_attach_is_box_attach_filtered_to_sessions
  • tests::session_attach_non_pty_reports_box_attach_refusal
  • tests::session_attach_without_address_ambiguous_exit2_lists
  • tests::session_attach_without_address_none_exit4_hints_start
  • tests::session_attach_without_address_picks_project_else_sole
  • tests::session_attach_without_address_unreachable_host_exit7
  • tests::start_attach_resume_end_to_end
  • tests::waiting_command_copies_file_exports_after_box_ends

The three tests this task names must still pass. Do not rewrite history and do not force-push.

The compose parsed the whole spec.json as a v0 Box Spec. A stored spec
can carry keys that parse refuses, such as io.exec_enabled,
file_exports and network.vpn_network_names, and partial specs. The
compose now reads v, entry, box.type and lifecycle_hooks, and refuses
only a spec that is not JSON or a hook list it cannot use.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 7 of 10 on a /revise note, pushed as 717988e3b16e.

line exit tail
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_json 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in bo
cargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in bo
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-2 in bo

Verify min task run agent-verify exited 100.

f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "9c5ac8612e97cf5e",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "67968547ab5c5700",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "67968547ab5c5700",
                "queued_behind": "0",
                "span_id": "d587e0b17b2090f0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "67968547ab5c5700",
                "queued_behind": "0",
                "span_id": "061500e6b455e838",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "061500e6b455e838",
                "span_id": "3508ad13a8b94be3",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "061500e6b455e838",
                "queued_behind": "0",
                "span_id": "03bf552c72e8f65a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.314s] (1384/2854) minimald box_actor::tests::a_handed_box_pending_at_finalize_publishes_the_interim_when_the_verdict_lands_absent
        PASS [   4.531s] (1385/2854) minimald box_actor::tests::a_hand_over_bind_the_switch_refuses_leaves_the_election_standing
        PASS [   6.817s] (1386/2854) minimald box_actor::tests::a_handed_reserved_address_waits_for_the_verdict_before_it_publishes
────────────
     Summary [  86.811s] 1386/2854 tests run: 1385 passed, 1 failed, 29 skipped
        FAIL [  13.054s] (1383/2854) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1468/2854 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

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

A box created with a project hook and a loadout hook stores spec.json with both hooks and their declared_by tables. The daemon composes the project's hooks from that stored spec. A stored spec that also carries keys such as io.exec_enabled, file_exports or network.vpn_network_names still composes, and the 47 minimal tests from the directive pass again.

Notes from the agent: Cause: commit 8bdcefe made the compose parse the whole spec.json through crate::box_runtime::stored_spec, the strict v0 BoxSpec parse. That parse needs entry and refuses unknown keys. A stored spec is not only a BoxSpec. A real create with --vpn-network-names adds network.vpn_network_names. The daemon also reads io.exec_enabled and file_exports from the same file, one key at a time. So the strict parse at compose broke real creates too, not only the test fixtures. The fix does not make BoxSpec.entry optional, and it does not rewrite the fixtures. Compose now reads only v, entry, box.type and lifecycle_hooks. A spec with no lifecycle_hooks key leaves the compose as before. A spec that is not JSON, or an unreadable file, still fails the compose, as the earlier valid thread PRRT_kwDOPdfcxM63z9zx asked. A hook list in a spec that is not v0, that has no entry or box.type, or that has a hook with no valid declared_by fails with InvalidInput. So entry is still required where the stored spec needs it: when it carries hooks to compose. composes_from_stored_expanded_spec_not_minimal_toml now also pins that a spec with those extra keys composes, and that a spec with no hook list keeps the minimal.toml hooks. The verdict on the answered thread does not change. I did not run just clippy-strict.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 17, 2026 04:23

@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

Since 8bdcefe0, this PR adds a clean merge of main and one commit. That commit makes the compose read only the v, entry, box.type and lifecycle_hooks keys of spec.json. It still refuses bytes that are not JSON and a hook list it cannot use, and the resume path still refuses a spec that is not v0. The PASS on 8bdcefe0 stands, and residual #3467 stays open. The PR body reports that the verify build exited 101. Fix that build before you merge.

Ruled at 717988e against gominimal/arch@327e1b57d16b 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: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/composables.rs, minimal-arch[bot] crates/minimald/src/box_manager/tests.rs:7749. No findings.

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 8 of 10 on a failed check suite: the coder changed nothing. No code change this round. The directive gives only the failed test-kvm job and its ci-linux-kvm-success aggregator. The log excerpt holds no failing test or step output: it holds only the source lines of the workflow's error echoes, and the post-job cleanup. The whole test-kvm job ran from 04:31:00 to 04:32:08, about 70 seconds. The second materialize step started at 04:31:11. A cold guest boot alone takes 40 to 70 s, so the job ended in the materialize steps or at the first VM harness, before the session e2e ran. The same session-e2e.sh ran on the native Linux lane at this head and the directive does not list it as failed. I found no VM-only path in this branch's change (stored spec read in run_compose, hooks on the create spec) that can fail that early. This box has no /dev/kvm, so I could not run the VM harnesses or just e2e with E2E_VM=1. Recommendation: re-run test-kvm. If it fails again, the full job log (the failing step) is necessary to act on it. The branch head…[truncated]

@agent-137
agent-137 marked this pull request as ready for review November 17, 2026 05:50
@agent-137
agent-137 added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 5c8c4e8 Nov 17, 2026
41 of 43 checks passed
@agent-137
agent-137 deleted the agent/3409-the-daemon-stores-the-expanded-spec-with-each-ho branch November 17, 2026 07:08
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.

T129 — The daemon stores the expanded spec with each hook's declarer, and composes from it

2 participants