Repository navigation
Description
Task
| slice | size | difficulty | model | who | estimated lines |
|---|---|---|---|---|---|
| Projection and digest | L | needs care | strongest | an agent | 620 (300 code, 320 tests) |
The daemon stores the expanded spec that the client sends, with each lifecycle hook and its
declared_by, and composes the box's project items from that stored spec. Thenspec.jsonholds each hook with its declarer, and the daemon no longer reads[stack]and[session]fromminimal.tomlitself.
Covers: none. BOX-068 (T5) and BOX-179 (T127) own the behaviour. This task makes the stored spec carry it.
This task does the work #3282 and #3257 track:
- BOX-179: the stored spec keeps each lifecycle hook with its declared_by (implementation) #3282: the stored spec keeps each hook with its
declared_by. T127 (T127 — Each lifecycle hook in the stored spec names its declarer, and the selected loadouts reach the expansion #3311, PR feat: T127 — Each lifecycle hook in the stored spec names its declarer, and the selected loadouts reach the expansion #3388) builds the declarers in the client's expansion, but it strips them before the entry reaches the daemon, and the storedmfile::spec::BoxSpechas no hooks. BCLI's T41 (T41 — Box spec lists a box's hooks with their declarer #3283), which renders a box's hooks with their declarers, waits on this. - boxes: compose a box from the stored expanded spec, not a five-list contribution and the daemon's own [stack] read (BOX-068) #3257: the daemon composes from a five-list contribution and its own read of
[stack], not from the expanded spec that BOX-068 says it receives.
Layers:
- spec:
- crates/mfile/src/spec.rs: the stored spec carries
lifecycle_hooks, each with itsdeclared_bytable (kind, andnamefor a loadout)
- crates/mfile/src/spec.rs: the stored spec carries
- daemon:
- crates/minimald/src/box_manager.rs: the create stores the expanded spec it receives, hooks and declarers included, as
spec.json - crates/minimald/src/box_manager/composables.rs:
build_composablescomposes the project's items from the stored expanded spec, and stops reading[stack]and[session]fromminimal.toml - crates/minimald/src/box_man 8000 ager/tests.rs: tests
cargo nextest run -p minimald stored_spec_keeps_each_hook_with_its_declarer_in_spec_jsoncargo nextest run -p minimald composes_from_stored_expanded_spec_not_minimal_toml
- crates/minimald/src/box_manager.rs: the create stores the expanded spec it receives, hooks and declarers included, as
- wire:
- crates/boxes/src/wire/request.rs: remove
WireContribution::entryandWireBoxEntry, which the expanded spec replaces
- crates/boxes/src/wire/request.rs: remove
- client:
- crates/minimal/src/cmd/boxes/create.rs: send the expanded spec with each hook's
declared_by, in place of the five-list entry - crates/minimal/src/tests.rs: tests
cargo nextest run -p minimal created_box_spec_json_names_each_hook_declarer
- crates/minimal/src/cmd/boxes/create.rs: send the expanded spec with each hook's
created_box_spec_json_names_each_hook_declarer creates a box whose entry declares one hook and whose loadout dev declares another. It reads the box's spec.json back through the in-process daemon, and checks one hook with { kind = "project" } and one with { kind = "loadout", name = "dev" }.
User-facing text. This task adds no message.
Observability. The daemon log names the box and the number of hooks it stored at creation.
Owner decisions this task follows:
- In-session on 2026-11-13: feat: T127 — Each lifecycle hook in the stored spec names its declarer, and the selected loadouts reach the expansion #3388 merges with BOX-179: the stored spec keeps each lifecycle hook with its declared_by (implementation) #3282 open, and this task under S6 finishes the work BOX-179: the stored spec keeps each lifecycle hook with its declared_by (implementation) #3282 and boxes: compose a box from the stored expanded spec, not a five-list contribution and the daemon's own [stack] read (BOX-068) #3257 track, after T128 (T128 — A real create sends the client's projection digest and store rules #3387), which also changes the create path. BCLI T41 waits on it.
Plan block
### 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.
Activity
docs(minimal): name the issue that removes the spec field allow
agent-137 commentedon Nov 14, 2026
Scope addition from arch_rulings 1302 C1 on #3441 (T128): the expanded spec this task sends and stores must include
[secrets], with eachsource = "store"reference'supstreamandinjectwritten from the client's[secret-store-rules]. That needscrates/mfile/src/spec.rs(SpecDocandBoxSpecaccept[secrets]), the creation path inminimald, andsession_box_entry/task_box_entry. Then the projection digest binds the secret grants. Until this lands, T128's client digest binds no secret grants.minimal-foundry commentedon Nov 16, 2026
Revising #3461: round 1 of 10, on the runtime's review findings.
branch
agent/3409-the-daemon-stores-the-expanded-spec-with-each-ho· epic #2236Updated 2026-11-16T06:54:45.749Z.