Skip to content

feat(minvmd): refuse a minted box id that a retained revocation record holds (T74) - #2611

Merged
norrietaylor merged 4 commits into
mainfrom
agent/2585-refuse-a-minted-box-id-that-a-retained-revocatio
Oct 26, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
agent/2585-refuse-a-minted-box-id-that-a-retained-revocatio

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

T74 — Refuse a minted box id that a retained revocation record holds

slice: S10
kind: task
covers: BEP-070
size: M
est: 100 code, 100 tests
executor: agent
difficulty: unknown ground
model: strongest
diagnostics: the CollidingBoxId refusal names every source the check reads
observability: one warn line per colliding mint
layers:
- collide:
- crates/bep/src/control.rs: an owner-only control op returns the box ids the proxy's restored revocations hold
- crates/minvmd/src/box_registry.rs: holds_box_id also refuses an id that op returns, and the AllocationError::CollidingBoxId text names live rows, kept creations, attachments and revocation records
test: cargo nextest run -p minvmd a_minted_id_a_revocation_holds_is_refused
produces: none
consumes: none
proof: A minted box id that only a retained revocation record holds is refused as a collision.
depends on:
- blocked by #2286

Proof

A box registration whose minted id only a revocation record holds is now refused with CollidingBoxId. The record is one the Box Egress Proxy restored from its audit log at start. The test a_minted_id_a_revocation_holds_is_refused shows it end to end: revoke_box writes the record, restore reads it back, a real bep control socket serves it, and the minvmd registry refuses the id. No row is published, and a fresh mint still registers.

Notes from the agent: Design: the proxy control socket gets a new op, {"op":"revoked_box_ids"} -> {"ok":true,"box_ids":[...]}. It is a separate request type (RevocationsRequest, RevokedBoxIdsReply), dispatched in serve() the same way as rotate_signing. I did not add a Request variant or a Reply field because crates/minimal/src/tests.rs matches every Request variant and builds Reply literals, and that file is outside this task's layers. holds_box_id now returns the source that holds the id (live row, kept creation, attachment, revocation record). It asks the proxy only when with_proxy_control set a socket. The warn line names that source in held_by. Failure policy (a judgement call): when no proxy listens (NotFound or ConnectionRefused), the check logs at debug and continues, because no proxy means no revocation is in force. Any other failure, for example a timeout of up to 2 s or a refusal, logs one warn line and lets the registration continue. It is not refused. A reviewer can want fail-closed instead. Printed text: the CollidingBoxId message is now 'box id is already in use. A running box, a stopped box that can resume, a Box Egress Proxy attachment, or a revocation record of the Box Egress Proxy holds it'. 'attachment' is close to a design term, but the task asks the text to name attachments. The message gives no next step, because I did not check which command a person reruns. Test changes inside box_registry.rs: expired_credentialed_box_sends_no_revocation_and_stays_resumable now answers the one revoked_box_ids quer…[truncated]

Tests

line exit tail
cargo nextest run -p minvmd a_minted_id_a_revocation_holds_is_refused 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-263d... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling version v0.8.0 (/workbenc

Verify

min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

re/compose.rs:402:8
    |
402 | pub fn deferring_env() -> StoredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Residuals

Closes #2585


Generated by Claude Code

The proxy control socket lists the box ids its revocations in force name
(revoked_box_ids). The host's box id check now reads that list beside the
live rows, kept creations and attachments, and the CollidingBoxId refusal
names all four sources.
@coderabbitai

coderabbitai Bot commented Oct 26, 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: 4cb6aa75-3562-41af-a90f-0a46666c6257

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

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry

minimal-foundry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at 1a5a5e7b5a9a.

Address the comments on the diff.

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 — 2 findings, 1 inline.

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

Comment thread crates/minvmd/src/box_registry.rs Resolved

@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 · 2 conditions · the full ruling

The new check refuses a minted id that a restored revocation record names, and the check is in the right owner. One arm fails open. When the proxy answers with a timeout, a refusal, or a reply that does not parse, holds_box_id returns None and the box is created with the records unread. Gatehouse §6.10 line 839 says that creation refuses an id colliding with any retained record. C1 makes that arm refuse the registration. C2 updates the BEP-070 Limit: comment in spec 24, which still names #2585 as an open gap.

Ruled at 7eecfb9 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minvmd/src/box_registry.rs Resolved
Comment thread crates/minvmd/src/box_registry.rs Resolved
A proxy that answers its control socket but times out, refuses the
revoked_box_ids op or sends a malformed reply left the id check
unfinished, and the registration went on. It is now refused with
AllocationError::RevocationsUnread. A socket that is absent or refuses
the connect still reads as no proxy (BEP-070).
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minvmd a_minted_id_a_revocation_holds_is_refused 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-ff7f... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling version v0.8.0 (/workbenc

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.99.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

re/compose.rs:402:8
    |
402 | pub fn deferring_env() -> StoredEnv {
    |        ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
    |
402 + #[must_use]
403 | pub fn deferring_env() -> StoredEnv {
    |

error: this method could have a `#[must_use]` attribute
    --> crates/boxes/src/core/compose.rs:1019:12
     |
1019 |     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#must_use_candidate
help: add the attribute
     |
1019 ~     #[must_use]
1020 ~     pub fn lifecycle_hooks_teardown(&self) -> impl DoubleEndedIterator<Item = &ProvenancedHook> {
     |

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1085:5
     |
1085 |     pub fn as_sandbox_path(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1084:5
     |
1084 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1302:5
     |
1302 |     pub fn host_path(&self) -> &HostAbsPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1301:5
     |
1301 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> crates/boxes/src/core/primitives.rs:1309:5
     |
1309 |     pub fn destination(&self) -> &SandboxRelPath {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
help: remove `must_use`
    --> crates/boxes/src/core/primitives.rs:1308:5
     |
1308 |     #[must_use]
     |     ^^^^^^^^^^^
     = note: alternatively, you may add an explicit reason to the `must_use` attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#double_must_use

error: could not compile `boxes` (lib) due to 6 previous errors

Review threads the coder judged:

  • 👍 valid — crates/minvmd/src/box_registry.rs:4513: holds_box_id now fails closed: a timeout, refusal or malformed reply refuses the registration with AllocationError::RevocationsUnread. Only NotFound and ConnectionRefused read as no proxy. A new test pins it.

A minted box id that only a retained revocation record of the Box Egress Proxy holds is refused as a collision (CollidingBoxId). A proxy that answers but does not list its revocation records also refuses the registration, so the check never lets an id through unread.

Notes from the agent: Revise round 1. holds_box_id now returns Result. A timeout, a proxy refusal or a malformed reply gives the new AllocationError::RevocationsUnread, with one warn line. Only NotFound and ConnectionRefused read as no proxy. Consequence: a proxy of an older version that does not know the revoked_box_ids op refuses every box creation until it is upgraded. Its printed text: 'the box was not created. The Box Egress Proxy did not list its revocation records, so box id was not checked against them: '. It states the situation and gives no command, because no command restarts the proxy that the code can prove. I also ran the box_registry tests in minvmd (78 passed) and clippy -p minvmd --all-targets, which showed no warnings in minvmd.

@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 thread crates/minvmd/src/box_registry.rs Resolved

@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 compare closes the open point from the ruling on 7eecfb9a. A proxy that answers but does not list its revocation records now refuses the mint with RevocationsUnread. The refusal comes before an address is spent. Gatehouse §6.10 line 839 requires creation to refuse an id that a retained record holds. Line 836 puts the read behind the helper's local socket, and the change reads the list there. An absent socket still reads as no proxy, as on the earlier head. The change conforms.

Ruled at 1a5a5e7 against gominimal/arch@109541a48c31 by claude-opus-5-5.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings: the coder changed nothing. Revise round 2: no code change. Each thread is judged invalid, for the reason in its note. C2 asks for an edit to the BEP-070 Limit comment in spec 24 and a new filed issue. That spec file is outside this task's layers, and I cannot file an issue. The Limit comment in spec 24 still says that a collision with a revocation record alone is not refused, and it links #2585. That text is now stale. A follow-up must rewrite it to name the gap that remains: while no proxy answers, the records stay on disk and the check reads none of them.

Review threads the coder judged:

  • 👎 invalid — crates/minvmd/src/box_registry.rs:4501: Already so on this branch: commit 1a5a5e7 makes holds_box_id return AllocationError::RevocationsUnread when the proxy answers but does not list its revocations. register_client_box_as refuses on it before an address is spent, and the warn line stays. Test a_minted_id_a_revocation_holds_is_refused_w
  • 👎 invalid — crates/minvmd/src/box_registry.rs:4483: Outside the task's layers: the change is to the BEP-070 Limit comment in docs/specs/24 (spec 24), and it needs a new filed issue, which this round cannot open. The gap holds: with no proxy answering, the on-disk records are not read. A follow-up must rewrite that Limit comment and replace the T74 — Refuse a minted box id that a retained revocation record holds #2585
  • 👎 invalid — crates/minvmd/src/box_registry.rs:4510: Fail-closed is deliberate. Thread C1 and Gatehouse 6.10 require a refusal when the check cannot decide, and an unknown-op reply cannot show that no record holds the id. Skew is unlikely: minvmd starts bep serve per boot from the binary beside its own (resolve_bep_binary in cmd/run.rs), and the proxy

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

Own review at 1a5a5e7. A new owner-only bep control op lists the box ids that restored revocations hold. holds_box_id refuses a minted id that one of them holds, and refuses with RevocationsUnread when the proxy answers but cannot list them, before an address is spent. The case where no proxy answers is residual #2616.


Generated by Claude Code

@norrietaylor norrietaylor changed the title T74 — Refuse a minted box id that a retained revocation record holds feat(minvmd): refuse a minted box id that a retained revocation record holds (T74) Oct 26, 2026

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

Babysitter approval at 1a5a5e7: every merge gate passes at this head (arch PASS at 1a5a5e7, zero open threads, every lane aggregator green). Squash title feat(minvmd): refuse a minted box id that a retained revocation record holds (T74) and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 2fc77ce Oct 26, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2585-refuse-a-minted-box-id-that-a-retained-revocatio branch October 26, 2026 19:15
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.

T74 — Refuse a minted box id that a retained revocation record holds

1 participant