8000 feat: T28 — Refuse a digest mismatch, and report the expander version by minimal-foundry[bot] · Pull Request #3442 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

feat: T28 — Refuse a digest mismatch, and report the expander version - #3442

Merged
agent-137 merged 5 commits into
mainfrom
agent/2432-refuse-a-digest-mismatch-and-report-the-expander
Nov 15, 2026
Merged

agent-137 merged 5 commits into
mainfrom
agent/2432-refuse-a-digest-mismatch-and-report-the-expander

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

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, min prints 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 makes min send it.

New printed text: the daemon refusal "No box was created. minimald read different box set…[truncated]

Tests

line exit tail
cargo nextest run -p minimald projection_digest_mismatch_refuses_create 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimald unenrolled_evaluates_no_policy 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimald-rpc get_version_reports_expander_version 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal expander_skew_reports_and_continues 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify

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

bug/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 minimal --package minimald --package minimald-rpc --locked` exited with code 101

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.rs

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimald/src/rpc.rs

Closes #2432

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.
@coderabbitai
coderabbitai Bot commented Nov 14, 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: 260884de-fade-4e27-bf3c-b80d45f0e650

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
minimal-foundry Bot commented Nov 14, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 2 threads unresolved at 9f6d087e5f76.

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.

@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_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,
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 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).

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

@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 +1595 to +1603

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`.",
)
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 · 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 --force to 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.

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 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.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 9f6d087e5f76.

line exit tail
cargo nextest run -p minimald projection_digest_mismatch_refuses_create 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimald unenrolled_evaluates_no_policy 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimald-rpc get_version_reports_expander_version 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal expander_skew_reports_and_continues 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 warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify min task run agent-verify exited 101.

btle-d4ee3adaa82dd067,libcmov-45bd4af2ffaf6bf5,libzeroize-839e2912eb255706,libtypenum-ba1598732f210209,libserde_json_lenient-d40e6f0e7b3e9eef,libitoa-9ca95701043ab126,libryu-0d9f6319717c2636,libglobset-d675b9d89ac69765,liblog-438092e92453965a,libbstr-e486a46c74a4ad7c,libregex_automata-78493a18fcc8828b,libregex_syntax-913a3a1c2b02ab63,libaho_corasick-c7544a0898654238,libmemchr-64a87164b387290e,libwalkdir-8278203427ac3159,libsame_file-0d4c610508a69e8c,libnutype-2060fd37b9d379f2,libclient_config-b967f21a883cbf40,libtoml-2aea33601fef026d,libtoml_writer-14581a9d8fee7cd3,libtoml_parser-9d71f9449b11f073,libwinnow-0b86322c90e7afd1,libserde_spanned-d96ed742cfb92972,libtoml_datetime-be2b7a398aebdb67,libtracing-83feaaf26e80a884,libpin_project_lite-965c2dcbe863fe30,libtracing_core-84f58f17c6893e81,libonce_cell-9a2fd160c1da4076,libportable_atomic-0dd514cc30f274c2,libpaths-38d338f2d2882e54,libdirs-460e2d244a8fc274,libdirs_sys-5e8776d10c678365,liboption_ext-b0ea52c3b95d09a1,libthiserror-d936554554fa5dac,libcamino-0c63145602122330,libuuid-2ad4c678aa627cb6,libgetrandom-3bfdefd1957f2b79,liblibc-4f2d736fc0e30dce,librand_core-d44f5774360f5730,libcfg_if-5af2d58a3df8aa54,libserde-a2d31a39ef0e3ca2,libserde_core-149b29d4f6c47ae0,libanyhow-c1ffd3cc4fbec0bd}.rlib" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/work/build-cache/cargo-home/build/debug/deps/rustcFgNz4K/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/work/build-cache/cargo-home/build/debug/build/zstd-sys-0d91391d9ed43bde/out" "-L" "/work/build-cache/cargo-home/build/debug/build/ring-43aedddb25fbb121/out" "-L" "/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-467e076f78a0a3c4/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-6abcf750100a3ada/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-4d55240ed02e956b/out" "-L" "/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out" "-L" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/work/build-cache/cargo-home/build/debug/deps/minimal-3af70b8d9884a410" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: final link failed: No space left on device
          collect2: error: ld returned 1 exit status
          

error: could not compile `minimal` (lib test) due to 1 previous error
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package minimal --package minimald --package minimald-rpc --locked` exited with code 101

Outside the task's layers::

  • crates/minimald/src/rpc.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_manager.rs:1617: 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.
  • 👍 valid — crates/minimald/src/box_manager.rs:1603: 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 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 min stop, not min stop --force. When the expander versions of min and minimald differ, min prints both versions and the create continues.

Notes from the agent: Revise round 1. The refusal remedy now says min stop. A plain min stop stops minimald, and its own refusals name --force when the stop needs it. The test pin in box_manager/tests.rs was updated to match. Thread C1 is correct: no min create path calls set_client_projection_digest, so BOX-072 does not refuse a real create today. That fix also needs crates/minimal/src/task.rs and crates/minimal/src/dash/rpc.rs, and both are outside this task's layers. This runner has no credential to file an issue. A person must file the client-side issue and name it on the thread and in the PR body. Its flip condition: every min create path sends the client digest. Also, the skew message in crates/minimald-rpc/src/lib.rs (expander_skew_message) says "minimald refuses to create the box if it reads the box settings differently from this min". Until the client sends a digest, the code cannot prove that sentence. I did not change it in this round because the directive does not name it. The same follow-up issue can rewrite it.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 17:31
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-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).

@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 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.

@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 18:21
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 14, 2026
@agent-137
agent-137 added this pull request to the merge queue Nov 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 14, 2026
@agent-137
agent-137 added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 266c13f Nov 15, 2026
39 checks passed
@agent-137
agent-137 deleted the agent/2432-refuse-a-digest-mismatch-and-report-the-expander branch November 15, 2026 00:20
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.

T28 — Refuse a digest mismatch, and report the expander version

2 participants

0