Repository navigation
feat: T127 — Each lifecycle hook in the stored spec names its declarer, and the selected loadouts reach the expansion - #3388
Conversation
Each selected loadout is now a layer of its own, with its name. The fold writes a declared_by table into each hook: the loadout for a loadout hook, the project for any other layer (BOX-179). The report and the BOX-183 and BOX-172 refusals name the loadout.
The start path passes each gated loadout, with its name, to the entry's expansion. A loadout var that conflicts with the project refuses the start with exit 3 before the create request. The daemon still gets only the project's items, with declared_by removed from each hook (BOX-179, BOX-183).
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Round 1 of 10 on a failed check suite: the coder changed nothing. every commit this round put on the branch above 529a45f is a merge of the base branch, so it carries no work of its own |
|
Reviewed: no findings; approval withheld, 13 threads unresolved at APPROVE withheld: 13 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3915, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs:1837, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3914, …. 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. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The fold conforms to the expansion order in architecture.md line 1234. Each selected loadout is its own layer after the entry, and each hook names its declarer. Two edits remain in create.rs. C1: min task run still skips the BOX-183 check for an open task. The PR closes #3302, which tracks that gap. Pass the task's loadouts, or name a filed issue and keep #3302 open. C2: under --no-hooks, BoxEntryExpansion::spec still carries every hook. Line 1153 says that the stored spec carries none. Remove the hooks from that spec when hooks are off.
Ruled at 529a45f against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| return Ok(None); | ||
| }; | ||
| box_entry(project, &bytes, entry, hooks_enabled).map(Some) | ||
| // `min task run` does not pass its loadouts yet, and a task is sealed |
There was a problem hiding this comment.
C1 · An open task gets its default loadouts on the contribution from task_activation_inputs. This call passes none, so BOX-183 does not run before the task box exists. This PR deletes the only comment that names an issue for this gap, and the PR body closes #3302. Pass the gated loadouts here, or name a filed issue in this comment and keep #3302 open.
| whole.loadouts = selected.layers()?; | ||
| (whole.type_defaults, whole.type_constraints) = entry_type_layers(&doc, &entry); | ||
| whole.host_vars = host_vars(&whole); | ||
| let full = 8000 |
There was a problem hiding this comment.
C2 · This expansion ignores hooks_enabled. Under --no-hooks, BoxEntryExpansion::spec keeps every project and loadout hook. Architecture line 1153 says that --no-hooks empties the hooks, so the stored spec carries none. Remove lifecycle_hooks from full.spec when hooks_enabled is false, and add a test for it.
There was a problem hiding this comment.
Addressed in 804ea4a5303f: box_entry removes lifecycle_hooks from the whole expanded spec when hooks_enabled is false. stored_spec_keeps_each_hook_with_its_declarer now checks this case.
| // selected-loadouts layer of the entry's expansion. The read | ||
| // above already refused a missing or malformed one. | ||
| let selected = SelectedLoadouts { | ||
| loadouts: loadouts::resolve_active_loadouts(selection, &cfg, global)?.loadouts, | ||
| ignore: Some(inputs.user_policy.vars().ignore().clone()), | ||
| }; |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50 · in activate_box
activate_box resolves the loadouts twice: once inside prepare_activation_inputs_with_config and again with resolve_active_loadouts. Each call reads the loadout files from disk. If a file changes between the two reads, the composed contribution and the selected layer describe different loadouts. The conflict check then runs on loadouts that the box does not take. Resolve once and reuse the result.
What the reviewer checked
prepare_activation_inputs_with_config calls resolve_active_loadouts(selection, cfg, global) at loadouts.rs:~735, and create.rs calls it again with selection.clone()
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/cmd/boxes/create.rs
Lines: 3631-3636
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
`activate_box` resolves the loadouts twice: once inside `prepare_activation_inputs_with_config` and again with `resolve_active_loadouts`. Each call reads the loadout files from disk. If a file changes between the two reads, the composed contribution and the `selected` layer describe different loadouts. The conflict check then runs on loadouts that the box does not take. Resolve once and reuse the result.
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.
There was a problem hiding this comment.
Disputed — not addressed: The double read is real, but the fix is outside this task's layers. prepare_activation_inputs_with_config does not return the loadouts it resolves. To reuse them, ActivationInputs in crates/minimal/src/loadouts.rs must expose them.
…ycle-hook-in-the-stored-spec-names-its
Also restore the comment that names issue #3302 for the task loadout gap.
|
Round 2 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A session box with a project hook and a loadout hook keeps both hooks in its expanded spec. The project hook has declared_by = { kind = "project" } and the loadout hook has { kind = "loadout", name = "rust" }. Under --no-hooks the spec keeps no hook. A loadout var that conflicts with the project refuses the start with exit 3 before the create request goes out, so no record exists. Notes from the agent: Revise round 2. In create.rs the expanded spec now drops lifecycle_hooks when hooks are off. stored_spec_keeps_each_hook_with_its_declarer now checks this case too. The task path still passes no loadouts to task_box_entry. The fix needs crates/minimal/src/task.rs, which is outside this task's layers. I restored the gap comment that names #3302, so #3302 must stay open: the pull request body must not close it. activate_box still resolves the loadouts twice. To resolve them once, ActivationInputs in crates/minimal/src/loadouts.rs must expose the resolved loadouts, and that file is outside the layers. I did not run the full suite, just ci or clippy-strict. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The change conforms to the expansion order and to the hook rules of the design. Each hook now names its declarer. Project hooks come first, then each selected loadout's (architecture.md lines 1231 and 1234). --no-hooks now empties the expanded spec, as lines 1151–1153 require. One condition remains. The PR body says to close #3302 on merge, but min task run still has the gap that #3302 tracks. Keep #3302 open, as C1 says.
Ruled at 804ea4a against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| return Ok(None); | ||
| }; | ||
| box_entry(project, &bytes, entry, hooks_enabled).map(Some) | ||
| // Gap (BOX-183, issue #3302): `min task run` does not pass its gated |
There was a problem hiding this comment.
There was a problem hiding this comment.
Disputed — not addressed: The comment in create.rs is correct: the min task run gap is still open. The defect is the close line in the PR body, and the runner writes that body, not this coder. A person must drop #3302 from the close line, or file a new issue for the task gap. I cannot do either from this session, so the code stays as it is.
| // BOX-064, BOX-179: the gated loadouts again, whole, for the | ||
| // selected-loadouts layer of the entry's expansion. The read | ||
| // above already refused a missing or malformed one. | ||
| let selected = SelectedLoadouts { | ||
| loadouts: loadouts::resolve_active_loadouts(selection, &cfg, global)?.loadouts, | ||
| ignore: Some(inputs.user_policy.vars().ignore().clone()), |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50 · in activate_box
The comment says these are the gated loadouts, and SelectedLoadouts is documented as taken after the loadout gate with none for a sealed box. resolve_active_loadouts does not gate. It returns every selected loadout. Only expand drops them for a sealed box. The result is right today, but the doc is wrong. A caller that trusts it can skip the gate. The call also reads the loadout files a second time after prepare_activation_inputs_with_config, so the two reads can differ if a file changes between them.
What the reviewer checked
loadouts: loadouts::resolve_active_loadouts(selection, &cfg, global)?.loadouts (loadouts.rs:228 has no gate)
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/cmd/boxes/create.rs
Lines: 3684-3689
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
The comment says these are the gated loadouts, and `SelectedLoadouts` is documented as taken after the loadout gate with none for a sealed box. `resolve_active_loadouts` does not gate. It returns every selected loadout. Only `expand` drops them for a sealed box. The result is right today, but the doc is wrong. A caller that trusts it can skip the gate. The call also reads the loadout files a second time after `prepare_activation_inputs_with_config`, so the two reads can differ if a file changes between them.
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.
There was a problem hiding this comment.
Disputed — not addressed: The selection is gated before the call. create.rs:3666 sets selection = loadouts::gate_selection(..., mode), and gate_selection returns LoadoutSelection::None for a sealed box (loadouts.rs:132). So resolve_active_loadouts receives the gated selection, and the doc on SelectedLoadouts is true. The second read of the loadout files got its answer in the earlier thread PRRT_kwDOPdfcxM63QUll.
|
Round 3 of 10 on the runtime's review findings: the coder changed nothing. Revise round 3: no code change. Both open threads do not need a change in the code. Thread PRRT_kwDOPdfcxM63Q2Z9 is about the close line in the PR body. The runner writes that body, and I cannot edit it or file an issue. A person must remove #3302 from the close line, or file a new issue for the min task run gap and update the comment at create.rs:1647. The tests ran at the branch head and pass. Review threads the coder judged:
|
There was a problem hiding this comment.
Read at 804ea4a. The code does what BOX-179 asks of the expansion, and I have one request, which is about the pull request's text and not its code.
The request: do not close #3282 with this. #3282 asks for the daemon to store each hook with its declared_by in spec.json, and for a test that creates a box and reads both hooks back with their declarers. Here the expanded spec with declarers is built on the client and logged at debug level; the stored spec (mfile::spec::BoxSpec) still has no hooks, and stored_spec_keeps_each_hook_with_its_declarer checks the client's expansion, not a stored spec. The agent's own note says so and points at #3257. Merging with "Closes #3282" would close the tracker the min box spec <box> hooks rows depend on, with its acceptance unmet. Please change the line to "Part of #3282" (or confirm that #3257 explicitly owns storing and reading back declared_by), and drop "in the stored spec" from the title. With that changed I am happy to approve as it stands.
What I checked and found right:
- Each selected loadout is now a layer of its own, so its hooks name it; project hooks from any layer name the project with no path; a hook declared by both appears once for each. The mfile test pins each case, including a
declared_bythe project writes itself, which is overwritten. - Nothing persisted or sent changes shape. The stored v0 spec is untouched, there is no digest over the expanded spec, and
declared_byis stripped before the entry reaches the daemon. No cross-version risk. - The declarer cannot be chosen by the party it names: the kind is fixed by the layer, the loadout name comes from the file stem, and a loadout file cannot carry
declared_byat all.
Smaller points, none blocking:
- A
declared_bykey a user writes in a project hook used to fail the start, becauseLifecycleHookdenies unknown fields. Now it is overwritten and dropped without a word. I would refuse it, or at least warn. - The new debug log dumps the whole expanded spec, loadout variable values included. Until #3210 settles how a loadout secret is marked, logging each hook's declarer and layer only would be safer.
- The double read of the loadout files that the review bot flagged is real: the BOX-183 check can run on different loadouts than the contribution carries if a file changes in between. A follow-up that reuses the loadouts already resolved for the activation would close it.
- The whole expansion includes the type chain's defaults, and the lists sent to the daemon do not. A project Box Type's default hooks or vars can therefore appear in this spec and take part in the BOX-183 check without ever reaching the box. Is that gap tracked? It matters more once #3257 stores this spec.
- Is the BOX-183 refusal at
min session startnew for users, or did the daemon's composer already refuse the same conflict later? If it is new, a project that setsPS1orPROMPT_COMMANDnow conflicts with the built-in default loadout, which deserves a release note.
On the open threads: the --no-hooks and #3302 ones are answered by the code and the body. The reply on the "gated" doc comment is right, since the selection goes through gate_selection before both reads.
…ycle-hook-in-the-stored-spec-names-its
The spec carries loadout variable values. The per-hook debug log already records each hook's declarer and layer.
…ycle-hook-in-the-stored-spec-names-its
|
@bryan-minimal thanks. Here's where each point stands. #3282: the body no longer closes it. #3282 stays open, and T129 (#3409) does the storing: the daemon keeps the expanded spec in Your other points:
When the next head lands with the first two fixes, could you re-review? |
|
Round 4 of 10 on a review requesting changes, pushed as
Verify Converted to a draft: something above needs a person before review. On the client, the expanded spec of a box with a project hook and a loadout hook keeps both hooks, and each hook names its declarer. A conflicting loadout var fails the create with exit 3 before any record exists. The daemon does not yet store the hooks in spec.json. Notes from the agent: Review request (PR text): this pull request is Part of #3282. It must not close #3282. The stored spec (mfile::spec::BoxSpec) still has no hooks, and stored_spec_keeps_each_hook_with_its_declarer checks the client's expansion, not a stored spec. #3257 owns the step that stores and reads back declared_by. Please drop 'in the stored spec' from the title. Code this round: I removed the debug log that dumped the whole expanded spec, because it carried loadout variable values. The per-hook debug log still records each hook's declarer, layer and loadout. BoxEntryExpansion::spec is now read only by tests, so it carries cfg_attr(not(test), allow(dead_code)) until the daemon stores the spec. Not changed, and open for follow-ups: a user-written declared_by in a project hook is overwritten without a warning. The loadout files are read twice in activate_box. The type chain's defaults take part in the BOX-183 check but do not reach the daemon. Whether the BOX-183 refusal at min session start is new for users (PS1 or PROMPT_COMMAND against the default loadout) is not checked here, and it can need a release note. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The compare removes the debug log of the whole expanded spec. That spec carries loadout variable values, and AT27 says telemetry must not carry secrets. The per-hook log in box_entry stays, so the hook layer is still recorded. The merges of main bring no change to this PR's files. C1 and C2 carry the open work from the baseline as filed residuals: the daemon stores the spec (#3409), and min task run passes its loadouts (#3302).
Ruled at 75c0fad against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| /// The expanded spec over every layer, the selected loadouts included. | ||
| /// Each of its hooks names its declarer (BOX-179). Only the tests read | ||
| /// it until the daemon stores this spec. | ||
| #[cfg_attr(not(test), allow(dead_code))] |
There was a problem hiding this comment.
C1 · This attribute is an interim. Remove it when the daemon stores this spec (T129, #3409). Name that issue in the doc comment above, so the flip condition has an owner.
There was a problem hiding this comment.
Addressed in 5d724078a664: The doc comment on BoxEntryExpansion::spec now names #3409 (T129) as the condition that removes the allow.
| &bytes, | ||
| entry, | ||
| hooks_enabled, | ||
| &SelectedLoadouts::default(), |
There was a problem hiding this comment.
C2 · An open task gets no selected-loadouts layer here. Lines 1231 and 1285 put the selected loadouts in every expansion that loadout_mode permits. Pass the task's gated loadouts in place of SelectedLoadouts::default() (#3302).
There was a problem hiding this comment.
Disputed — not addressed: The only caller of task_box_entry is crates/minimal/src/task.rs:1533, and the gated task loadouts come from task_activation_inputs in that file. This task's layers do not include task.rs. The comment in task_box_entry names the gap and #3302 owns it.
| let selected = SelectedLoadouts { | ||
| loadouts: loadouts::resolve_active_loadouts(selection, &cfg, global)?.loadouts, | ||
| ignore: Some(inputs.user_policy.vars().ignore().clone()), | ||
| }; |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50 · in activate_box
resolve_active_loadouts runs a second time here. prepare_activation_inputs_with_config already resolved the same selection. The two reads can disagree if a loadout file changes between them. Then the contribution carries one set of loadouts and the BOX-183 check and declared_by use another. Reuse the loadouts from the first read.
What the reviewer checked
loadouts: loadouts::resolve_active_loadouts(selection, &cfg, global)?.loadouts, after prepare_activation_inputs_with_config(... selection.clone() ...)
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/cmd/boxes/create.rs
Lines: 3689-3692
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
`resolve_active_loadouts` runs a second time here. `prepare_activation_inputs_with_config` already resolved the same selection. The two reads can disagree if a loadout file changes between them. Then the contribution carries one set of loadouts and the BOX-183 check and `declared_by` use another. Reuse the loadouts from the first read.
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.
There was a problem hiding this comment.
Disputed — not addressed: prepare_activation_inputs_with_config consumes its resolved loadouts in compose_user_contribution and does not return them. ActivationInputs has only loadout_names. To reuse the first read, crates/minimal/src/loadouts.rs must change, and that file is outside this task's layers.
| fn entry_type_layers( | ||
| doc: &toml::Table, | ||
| entry: &mfile::entry::BoxEntry, | ||
| ) -> (TypeTables, TypeTables) { | ||
| if let Ok(types) = mfile::box_types::BoxTypes::from_file(doc) | ||
| && let Ok(resolved) = mfile::expand::expandable_type(entry, &types) | ||
| { | ||
| return (resolved.defaults, resolved.constraints); | ||
| } | ||
| match entry | ||
| .box_type | ||
| .as_deref() | ||
| .and_then(mfile::box_types::builtin) | ||
| { | ||
| Some(root) => ( | ||
| vec![(root.to_owned(), mfile::box_types::builtin_defaults(root))], | ||
| vec![(root.to_owned(), mfile::box_types::builtin_constraints(root))], | ||
| ), |
There was a problem hiding this comment.
LOW · style · confidence 0.55 · in entry_type_layers
entry_type_layers repeats the type-chain and built-in fallback logic of builtin_type_layer and the gate code in crates/minimal/src/loadouts.rs (around lines 85-125). It also differs: the loadouts.rs version refuses a non-built-in type that does not resolve, and this one returns empty layers. The two paths can drift. Share one helper.
What the reviewer checked
loadouts.rs: fn builtin_type_layer(entry) -> Option with the same builtin_defaults/builtin_constraints pair
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/cmd/boxes/create.rs
Lines: 1823-1840
Category: style
Severity: low (reviewer confidence 0.55)
Finding:
`entry_type_layers` repeats the type-chain and built-in fallback logic of `builtin_type_layer` and the gate code in `crates/minimal/src/loadouts.rs` (around lines 85-125). It also differs: the loadouts.rs version refuses a non-built-in type that does not resolve, and this one returns empty layers. The two paths can drift. Share one helper.
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.
There was a problem hiding this comment.
Disputed — not addressed: builtin_type_layer is private to crates/minimal/src/loadouts.rs, which is outside this task's layers. The difference is on purpose: entry_loadout_gate runs first and refuses an unresolved non-built-in type, so the empty layers in entry_type_layers never reach an expansion.
…ycle-hook-in-the-stored-spec-names-its
The allow on BoxEntryExpansion::spec is an interim until the daemon stores the expanded spec. Name #3409 so that the removal has an owner.
|
Round 5 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A box with a project hook and a loadout hook stores both hooks in its expanded spec, each with its declared_by. A conflicting loadout var fails the create with exit 3 before any box record exists. The tests above show both. Notes from the agent: Revise round 5. The only change is a doc comment: it names #3409 as the condition to remove the dead_code allow. Three threads are invalid only because their fix is outside this task's layers: crates/minimal/src/task.rs (task loadouts) and crates/minimal/src/loadouts.rs (reuse of resolved loadouts, shared type-layer helper). A follow-up task can own them. |
|
/revise Two fixes from Bryan's review of 804ea4a that stay in this PR:
Change nothing else. The double read of loadout files is #3411, type-chain defaults are T129 (#3409), and the release note is #3410. |
Only the expansion writes a hook's declarer. A project hook that sets declared_by now fails the expansion with exit 3, naming the hook and the key, in place of a silent overwrite.
|
Round 6 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. A box with a project hook and a loadout hook stores both with their declarers. A conflicting loadout var fails the create with exit 3 before any record exists. A project hook that sets declared_by now fails the start and Notes from the agent: Directive item 1: expand() now runs check_project_declarers before the fold. It refuses a declared_by in a hook of any project layer, and the command-line override layer too, with exit 3. A loadout's declared_by is still replaced. The new message is: " |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
This head conforms to the design for BOX-179 in the client expansion. The new check_project_declarers refuses a declared_by that a project writes, with exit 3. This fails closed, and only the expansion writes the declarer. The two open items from the last ruling stay open. C1: the daemon must store the expanded spec (#3409). C2: min task run must pass its selected loadouts (#3302). Both have filed issues, so this change can merge with them open.
Ruled at 65c4c4d against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| /// Each of its hooks names its declarer (BOX-179). Only the tests read | ||
| /// it until the daemon stores this spec. Remove the `allow` below when | ||
| /// gominimal/minimal#3409 (T129) lands and the daemon stores it. | ||
| #[cfg_attr(not(test), allow(dead_code))] |
There was a problem hiding this comment.
C1 · The daemon does not store this spec yet. The design says the stored spec carries the composed hook list (architecture.md line 1151). Remove this allow when #3409 lands and the create path sends the spec.
There was a problem hiding this comment.
Tracked in #3409 (T129): the daemon stores the expanded spec there, and that task removes this allow once the create path sends the spec.
There was a problem hiding this comment.
Disputed — not addressed: Nothing to change in this PR: the doc comment above the allow already names #3409 (T129) as the owner. That task removes the allow when the daemon stores the spec.
| return Ok(None); | ||
| }; | ||
| box_entry(project, &bytes, entry, hooks_enabled).map(Some) | ||
| // Gap (BOX-183, issue #3302): `min task run` does not pass its gated |
There was a problem hiding this comment.
C2 · task_box_entry sends SelectedLoadouts::default(). Selected loadouts are expansion layer 6 (architecture.md line 1285). Pass the task's gated loadouts here under #3302, and remove this gap comment.
There was a problem hiding this comment.
Tracked in #3302: that issue fills the selected-loadouts layer for task_box_entry with the task's gated loadouts and removes this gap comment.
There was a problem hiding this comment.
Disputed — not addressed: Outside this task: T127 covers box_entry only. The gap comment names #3302, which owns passing the task's gated loadouts in task_box_entry and removing the comment.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 11 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3693, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs:1650, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3692, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
@bryan-minimal your two in-PR points are in at 65c4c4d: a |
There was a problem hiding this comment.
Read again at 65c4c4d. Both points I asked to keep in this PR are in, and the close line is fixed, so this is an approval.
- A project's own
declared_byis refused.check_project_declarersstops the expansion with exit 3 and names the layer, the hook and the key; the test covers an entry,[defaults], and a loadout, whosedeclared_byis still replaced. The message tells the person what to remove. - The debug log no longer carries the expanded spec. It records each hook's declarer, layer and loadout, and nothing of a loadout's variable values.
- #3282 stays open, and the body says what is left and where (#3409, #3302).
One thing left, small: the title still says "in the stored spec". Nothing is stored yet, and the title becomes the commit's subject on a squash. Could it say "in the client's expansion" before this merges?
The two architecture notes on this head (remove the allow when #3409 lands; pass the task's gated loadouts under #3302) read as follow-ups to me, and the body already names both.
|
/revise Merge origin/main into this branch and fix the semantic conflict that ejected this PR from the merge queue. The merge group failed to compile, in clippy and in the core workspace tests: This PR makes |
…ycle-hook-in-the-stored-spec-names-its
Main added a test that builds Layers with loadouts as one table. This branch makes loadouts one named table per selected loadout.
|
Round 7 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
A box with a project hook and a loadout hook stores both hooks with their declarers, and a conflicting loadout var fails the create with exit 3 before any record exists. The branch now compiles with origin/main merged in. Notes from the agent: The merge of origin/main was already on the branch (4711243) when this round started. I added one fix commit: the T26 test at crates/mfile/src/expand.rs:4072 now builds Layers with |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The merge with main keeps the per-loadout layers in the order that architecture.md line 1251 gives. Line 1253 says the project hooks run first, then each loadout's hooks. The merge does that too. The only change of the PR's own since 65c4c4dc is one test fixture line. The two open items from the earlier rulings stay open. C1 passes the task's selected loadouts in task_box_entry (#3302). C2 stores the expanded spec with declared_by in the daemon (#3282).
Ruled at 113de2d against gominimal/arch@327e1b57d16b by claude-opus-5-5.
| &bytes, | ||
| entry, | ||
| hooks_enabled, | ||
| &SelectedLoadouts::default(), |
There was a problem hiding this comment.
C1 · This passes no selected loadouts for a task. Line 1304 of architecture.md applies the selected loadouts after the entry. Pass the task's gated loadouts here, and remove the gap comment. Issue #3302 tracks it.
There was a problem hiding this comment.
Tracked in #3302: that issue fills the selected-loadouts layer for a task with its gated loadouts and removes this gap comment.
| /// Each of its hooks names its declarer (BOX-179). Only the tests read | ||
| /// it until the daemon stores this spec. Remove the `allow` below when | ||
| /// gominimal/minimal#3409 (T129) lands and the daemon stores it. | ||
| #[cfg_attr(not(test), allow(dead_code))] |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 13 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3915, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs:1837, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:3914, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
T127 — Each lifecycle hook in the stored spec names its declarer, and the selected loadouts reach the expansion
slice: S5
kind: task
covers: BOX-179
size: M
est: 160 code, 220 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: min box spec shows declared_by on each hook; a BOX-183 refusal names the loadout
observability: the expansion report records the layer of each hook
layers:
- expansion:
- crates/mfile/src/expand.rs: one loadouts layer per selected loadout with its name; write declared_by into each hook as the fold appends it
- crates/mfile/src/spec.rs: a lifecycle hook table accepts declared_by
test: cargo nextest run -p mfile expanded_lifecycle_hooks_carry_declared_by
- client:
- crates/minimal/src/cmd/boxes/create.rs: box_entry passes each gated selected loadout with its name
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal stored_spec_keeps_each_hook_with_its_declarer
test: cargo nextest run -p minimal conflicting_loadout_var_refused_before_create
produces: none
consumes:
- crates/mfile/src/expand.rs
proof: A box with a project hook and a loadout hook stores both with their declarers, and a conflicting loadout var fails the create with exit 3 before any record exists.
depends on:
- blocked by #3248
- blocked by #3254
#3282 stays open: this PR builds each hook's
declared_byin the client's expansion, and T129 (#3409) stores it in the daemon'sspec.json. #3302 stays open too:min task runstill sendsSelectedLoadouts::default()fromtask_box_entry, so an open task gets no selected-loadouts layer and no BOX-183 refusal before the create.Proof
A box entry with a project hook and a loadout hook now expands into a spec that keeps both hooks. The project hook carries declared_by = { kind = "project" }, and the loadout hook carries declared_by = { kind = "loadout", name = "rust" }. The daemon composes the box from the project hook. A loadout var that conflicts with the project fails the start with exit 3. The error names the variable, the entry and the loadout, and the start fails before it sends the create request.
Notes from the agent: Proof gap: the daemon does not store the expanded spec yet (#3257). The client builds the whole expanded spec with declared_by on each hook, logs it at debug level, and returns it as BoxEntryExpansion::spec. The daemon keeps provenance as before: project hooks come from the entry and loadout hooks come from the contribution with their loadout source. So the stored_spec test checks the expanded spec and that the daemon composes the project hook. It does not read a stored copy of the spec.
Design: Layers::loadouts is now Vec<(name, table)>. Origin gains a loadout name. The fold writes declared_by into each hook table and replaces any declared_by that a layer wrote. spec.rs adds DECLARED_BY, HookDeclarer and hook_without_declarer. boxes' LifecycleHook denies unknown fields, so box_entry strips declared_by before the wire. box_entry runs two expansions. The whole one (type layers plus the selected loadouts) gives the refusals and the spec. The project-only one (unchanged) gives the wire lists, because loadout items already reach the daemon on the contribution and must not repeat as project items. The whole expansion reads the type chain's layers, because otherwise the expand gate sees no loadout_mode and seals the box.
Behaviour changes in printed text: the BOX-183, BOX-172 and constraint messages now say "the loadout
<name>" instead of "a selected loadout". One loadout that sets a name twice is now a BOX-184 DuplicateVar that names that loadout.…[truncated]Tests
cargo nextest run -p mfile expanded_lifecycle_hooks_carry_declared_bycargo nextest run -p minimal stored_spec_keeps_each_hook_with_its_declarercargo nextest run -p minimal conflicting_loadout_var_refused_before_createVerify
min task run agent-verifyexited 100, so this PR is a draft.Closes #3311