Repository navigation
feat: T28 — Refuse a digest mismatch, and report the expander version - #3442
Conversation
A create whose client projection digest differs from the one the daemon recomputes from the spec it received is refused before the record exists (BOX-072). The daemon log and the create span name both digests. The create span and log also record that an un-enrolled host evaluates no policy against the projection (BOX-073).
GetVersion now carries the version of the expansion the daemon applies (BOX-074), and the wire crate forms the text the client prints when its own expander version differs.
Under the version skew override, min asks minimald for its expander version before the create, prints both versions when they differ, and goes on (BOX-074). Without the override the build gate already refuses another build, so the activation path pays no round trip.
…igest-mismatch-and-report-the-expander
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: no findings; approval withheld, 2 threads unresolved at APPROVE withheld: 2 unresolved threads — minimal-arch[bot] crates/minimald/src/box_manager.rs:1617, minimal-foundry[bot] crates/minimald/src/box_manager.rs:1603. 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: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The change conforms to the design for BOX-072, BOX-073 and BOX-074. minimald recomputes the digest and refuses a mismatch before the record exists, as Gatehouse §6.3 requires. No min sends a client digest yet, so this refusal does not run on any real create. The daemon admits a create with no digest, and no issue tracks that interim. C1 files the issue and names it in the PR body and in mismatch().
Ruled at 5fc1c54 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
| fn mismatch(&self, has_spec: bool) -> bool { | ||
| has_spec | ||
| && match &self.client { | ||
| ClientDigest::Absent => false, |
There was a problem hiding this comment.
C1 · This arm admits a create that has no client digest. No min sends a digest yet, so BOX-072 does not refuse a real create. File an issue for the client side. Name it here and in the PR body, with the flip condition (C1, Gatehouse §6.3 line 629).
There was a problem hiding this comment.
Addressed in 9f6d087e5f76: Correct: no min create path sets the client digest, so the Absent arm admits every real create. The client fix needs task.rs and dash/rpc.rs, outside this task's layers. This runner cannot file issues, so a person must file the follow-up. Flip condition: every min create path sends the digest.
|
|
||
| impl std::fmt::Display for ProjectionDigestRefusal { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
| f.write_str( | ||
| "No box was created. minimald read different box settings from the box spec \ | ||
| than the `min` that sent it. This can happen when `min` and minimald are \ | ||
| different builds. Run `min stop --force` to stop minimald, then run the \ | ||
| command again to start minimald from the same build as `min`.", | ||
| ) |
There was a problem hiding this comment.
LOW · printed-text · confidence 0.50 · in ProjectionDigestRefusal
The refusal tells the user to run min stop --force. The help for that flag says it forces shutdown even when another session is mid-create, and on a VM can lose unflushed data. A plain skew refusal does not need that. Suggest min stop without --force, or state the risk.
What the reviewer checked
Run
min stop --forceto stop minimald, then run the command again; cli.rs:2263 'Force shutdown even if a session is mid-create ... data not yet flushed inside the VM can then be lost'
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_manager.rs
Lines: 1595-1603
Category: printed-text
Severity: low (reviewer confidence 0.50)
Finding:
The refusal tells the user to run `min stop --force`. The help for that flag says it forces shutdown even when another session is mid-create, and on a VM can lose unflushed data. A plain skew refusal does not need that. Suggest `min stop` without `--force`, or state the risk.
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.
Addressed in 9f6d087e5f76: The refusal now says min stop without --force. The test pin is updated. A plain stop's own refusals name --force when the stop needs it.
A plain `min stop` stops minimald, and its own refusals name --force when a stop needs it. The forced stop can lose unflushed VM data.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
A create whose client projection digest differs from the daemon's digest is refused and files no record. The refusal now tells the person to run Notes from the agent: Revise round 1. The refusal remedy now says |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-arch[bot] crates/minimald/src/box_manager.rs:1617, minimal-foundry[bot] crates/minimald/src/box_manager.rs:1603. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to Gatehouse §6.3 check 5 and line 629. minimald refuses a differing projection digest before it mints an id or files a record. The policy="none" field agrees with the un-enrolled mode in Gatehouse §6.2 line 580. The skew report continues, as architecture.md line 556 permits. The compare from 5fc1c548 changes only the remedy text, and the design is silent on it. Issue #3387 owns one residual: a real min does not send a client digest yet, so the refusal does not trigger until that work lands. Make the agent-verify build green before merge.
Ruled at 9f6d087 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
T28 — Refuse a digest mismatch, and report the expander version
slice: S6
kind: task
covers: BOX-072, BOX-073, BOX-074
size: L
est: 280 code, 260 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: daemon log names both mismatched digests
observability: create span records a digest refusal
layers:
- daemon:
- crates/minimald/src/box_manager.rs: mismatch refusal; no policy
- crates/minimald/src/box_manager/tests.rs: tests
test: cargo nextest run -p minimald projection_digest_mismatch_refuses_create
test: cargo nextest run -p minimald unenrolled_evaluates_no_policy
- wire:
- crates/minimald-rpc/src/lib.rs: expander version
- crates/minimald-rpc/src/tests.rs: tests
test: cargo nextest run -p minimald-rpc get_version_reports_expander_version
- client:
- crates/minimal/src/cmd/boxes/create.rs: prints skew, continues
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal expander_skew_reports_and_continues
produces: none
consumes:
- crates/mfile/src/projection.rs
proof: A digest mismatch leaves no record; version skew is reported.
depends on:
- blocked by #2430
Proof
A create whose client projection digest differs from the digest minimald computes from the spec it received is refused before the record exists. No box, id or name is left, and the daemon log and the create span name both digests. GetVersion now reports minimald's expander version. Under MINIMAL_ALLOW_VERSION_SKEW,
minprints both expander versions before the create when they differ, and the create continues.Notes from the agent: Out of layers: crates/minimald/src/rpc.rs got one field in the GetVersion handler (expander_version). The new GetVersionResponse field must be filled where the daemon builds the reply, and that is the only place it is built. The task did not name that file.
The existing test projection_digests_stored_side_by_side expected a differing or malformed client digest to be stored. Under BOX-072 those creates are now refused, so I updated the test to expect the refusal. A create with no client digest (an older client) or with no spec is not compared and goes ahead. A malformed client digest is refused.
The expander version is "<BOX_SPEC_VERSION>.<PROJECTION_VERSION>" from mfile. The client asks for it only under the skew override, MINIMAL_ALLOW_VERSION_SKEW. Without the override, must_match_version makes a daemon of another build refuse the create, and one build has one expander version. So the activation path still makes no extra round trip, and the_activation_path_makes_no_version_round_trip still passes. The GetVersion call is in the helper report_expander_skew, not in activate_box.
BOX-073: no enrollment state exists in minim 8000 ald, so the change records policy="none" on the box.create span and on the projection-digest log line. No policy evaluation runs.
No client (
min) sends a projection digest on a create yet. So the BOX-072 refusal triggers only for a client that sets projection_digest.client, until a later task makesminsend it.New printed text: the daemon refusal "No box was created. minimald read different box set…[truncated]
Tests
cargo nextest run -p minimald projection_digest_mismatch_refuses_createcargo nextest run -p minimald unenrolled_evaluates_no_policycargo nextest run -p minimald-rpc get_version_reports_expander_versioncargo nextest run -p minimal expander_skew_reports_and_continuesVerify
min task run agent-verifyexited 101, so this PR is a draft.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
crates/minimal/src/tests.rsOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimald/src/rpc.rsCloses #2432