8000 refactor(bep): give the proxy-binary resolver one owner for min secret and minvmd (T62) by minimal-foundry[bot] · Pull Request #2581 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

refactor(bep): give the proxy-binary resolver one owner for min secret and minvmd (T62) - #2581

Merged
norrietaylor merged 4 commits into
mainfrom
agent/2542-give-the-proxy-binary-resolver-one-owner-shared
Oct 26, 2026
Merged

norrietaylor merged 4 commits into
mainfrom
agent/2542-give-the-proxy-binary-resolver-one-owner-shared

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Oct 25, 2026 •
Copy link
Copy Markdown
Contributor

T62 — Give the proxy-binary resolver one owner shared by min secret and minvmd

slice: S9
kind: task
covers: BEP-051
size: S
est: 80 code, 100 tests
executor: agent
difficulty: routine
model: standard
diagnostics: min secret set and minvmd run print the same proxy path in their logs for one PATH and one MINVMD_BEP_BIN
observability: one d 8000 ebug line naming the resolved proxy path at each resolution
layers:
- resolver:
- crates/bep/src/store.rs: proxy_binary_path is the one rule, and its doc stops naming #2527
- crates/minvmd/src/cmd/run.rs: resolve_bep_binary calls bep::store::proxy_binary_path instead of its own copy
- crates/minimal/src/cmd/secret.rs: resolve_proxy uses the shared rule and its doc stops naming #2527
test: cargo nextest run -p minvmd minvmd_and_min_secret_resolve_the_same_proxy_binary
produces: none
consumes: none
proof: Under one PATH and one MINVMD_BEP_BIN, min secret set and minvmd run resolve the same proxy binary, and the rule has one definition.
depends on:
- blocked by T26

Proof

bep::store::proxy_binary_path is now the only definition of the proxy-binary rule. minvmd's resolve_bep_binary and min secret's resolve_proxy both call it. So under one PATH and one MINVMD_BEP_BIN, min secret set and minvmd run resolve the same bep binary. Each resolution logs one debug line that names the path. No doc comment names #2527 now.

Notes from the agent: Out of layers: crates/minvmd/Cargo.toml and Cargo.lock. minvmd did not depend on the bep crate, and it cannot call bep::store::proxy_binary_path without that dependency. The change adds one dependency line and the matching lock entry. The shared function now takes minvmd as a closure and returns Option. So the variable check runs only once, and minvmd is looked up only when the variable is unset or empty. min secret keeps its own extra refusal of a relative MINVMD_BEP_BIN, and its error texts are the same as before. minvmd's BEP_BIN_ENV now aliases bep::store::PROXY_BIN_ENV. The minvmd test cannot call min's resolve_proxy, because the minimal crate is a binary crate and minvmd does not depend on it. So the test proves that minvmd's resolution equals the shared rule's result, and min uses the same rule. Extra checks also passed: cargo nextest run -p minimal secret (17 passed), cargo nextest run -p minimal resolve_proxy proxy (24 passed), cargo nextest run -p bep store (19 passed). Clippy is clean for bep, minimal and minvmd.

Tests

line exit tail
cargo nextest run -p minvmd minvmd_and_min_secret_resolve_the_same_proxy_binary 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-5a19... 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.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-2b76...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking check v0.0.1 (/workbench/crates/check)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Layer exception

The epic owner's rule accepts out-of-layer changes a task needs. The babysitter accepted this one on 2026-10-26:

  • crates/minvmd/Cargo.toml (and its Cargo.lock line): minvmd now depends on bep for bep::store::proxy_binary_path, the one owner of the proxy-binary rule that min secret also uses. This dependency put bep's macOS-only code into the macOS clippy scope, which surfaced a lint in crates/bep/src/keys.rs. That lint is fixed on main, and the branch picked up main.

Out of scope

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

  • crates/minvmd/Cargo.toml

Closes #2542


Generated by Claude Code

minvmd now resolves the bep binary through bep::store::proxy_binary_path,
the same rule min secret names in a keychain item's access control. The
rule logs one debug line with the resolved path. minvmd gains a bep
dependency for it.
@coderabbitai
coderabbitai Bot commented Oct 25, 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: 49310afb-d2cd-42f6-a5ee-ff271d88bd93

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
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. Revise round 1: no change. The directive gives two failed checks. ci-macos-success is the lane aggregator and only runs exit 1. The unit excerpt shows only the libkrun setup script lines and exit code 101. It names no failing test and no compile error. I could not reproduce a failure on Linux at the branch head (f48b85f0, after the merge of main): cargo metadata --locked passes, so Cargo.lock is current. cargo fmt --check -p minvmd -p bep -p minimal is clean. cargo clippy -p minvmd -p bep -p minimal --all-targets --locked --no-deps -- -D warnings is clean. The same clippy for minvmd with RUSTFLAGS=--cfg minvmd_libkrun (the macOS code path) is clean. The test line passes. I could not run macOS natively. I could not run doctests because this box has no rustdoc. A clippy run without --no-deps fails in minimald-rpc (clippy::chunks_exact_with_const_size). That comes from the local rustc 1.98.1 against the pinned 1.97.0, and this branch does not touch that crate. …[truncated]

Copy link
Copy Markdown
Member

/revise

Round 2 of #2581, on the red macOS unit job (ci-macos-success, job 121250446982). No round is in flight. The failure is clippy on macOS:

error: unnecessary use of `to_vec`
   --> crates/bep/src/keys.rs:484:73
484 |  .and_then(|bytes| ProxyPublicKey::from_sec1_bytes(&bytes.to_vec()))
    = note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`

This PR caused it, though not in a file it edits. crates/minvmd/Cargo.toml now depends on bep, and the macOS just clippy scope (-p minvmd -p boxes) now lints bep's cfg(target_os = "macos") code. That code was not linted on macOS before. A Linux box cannot reproduce it, because the line is macOS-only.

  1. In crates/bep/src/keys.rs KeychainKey::new, change ProxyPublicKey::from_sec1_bytes(&bytes.to_vec()) to ProxyPublicKey::from_sec1_bytes(&bytes). CFData derefs to [u8]. Change nothing else in that file. It is accepted under the epic owner's layer-exception rule, and the PR body will name it.
  2. Run cargo clippy -p bep --all-targets -- -D warnings and the task's tests, and report them.

One commit, Conventional Commits subject, every body line at most 72 characters.


Generated by Claude Code

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note: the coder changed nothing. every commit this round put on the branch above 90c508e is a merge of the base branch, so it carries no work of its own

@norrietaylor
norrietaylor marked this pull request as ready for review October 26, 2026 03:21
@norrietaylor
norrietaylor requested a review from a team as a code owner October 26, 2026 03:21
@minimal-foundry
minimal-foundry Bot commented Oct 26, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 8884770e4c3b.

@norrietaylor resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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. Gatehouse §6.10 line 831 binds store access to the BEP process identity. One rule in bep::store::proxy_binary_path now gives that identity to both minvmd and min secret. The behaviour and the refusals on each side are the same as at base. The new bep dependency in minvmd moves no process boundary.

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

@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/cmd/run.rs Resolved
Review finding 4373693200: the minvmd test never reached the lookup that
min secret runs. bep::store::proxy_binary_on_path now owns the relative
variable check, the PATH search and the link handling. resolve_proxy only
maps its errors to text, and the minvmd test calls the shared lookup.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on the runtime's review findings, pushed as 8884770e4c3b.

line exit tail
cargo nextest run -p minvmd minvmd_and_min_secret_resolve_the_same_proxy_binary 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-4c5b... 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.

toredEnv {
    |        ^^^^^^^^^^^^^
    |
    = 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
warning: build failed, waiting for other jobs to finish...

Outside the task's layers::

  • crates/minvmd/Cargo.toml

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

Review threads the coder judged:

  • 👍 valid — crates/minvmd/src/cmd/run.rs: Moved the relative-variable check, the PATH search and the link handling from resolve_proxy into bep::store::proxy_binary_on_path. resolve_proxy now only maps its errors to text. The minvmd test calls that shared lookup with a PATH and compares it with bep_binary_at, also through a linked PATH entry

Under one PATH and one MINVMD_BEP_BIN, min secret set and minvmd run resolve the same proxy binary. The rule has one definition in bep::store: proxy_binary_path for the variable-or-beside-minvmd rule, and proxy_binary_on_path for the PATH lookup that min secret uses. The minvmd test now calls the lookup that resolve_proxy calls, and compares it with what minvmd starts.

Notes from the agent: This round moved find_on_path, is_executable and exe_path from crates/minimal/src/cmd/secret.rs into crates/bep/src/store.rs, behind the new bep::store::proxy_binary_on_path and ProxyLookupError. resolve_proxy keeps its two refusal texts unchanged and only maps the error variants to them. minvmd cannot call resolve_proxy directly, because minimal depends on minvmd, so a dependency in the other direction makes a cycle. The shared lookup is the fix in its place. cargo clippy -p minimal -p bep -p minvmd --all-targets shows no warnings in these three crates.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 26, 2026 03:34
@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

This change conforms to Gatehouse §6.10 lines 831 and 844. The rule for the proxy binary now has one definition, bep::store::proxy_binary_path. minvmd and min secret both call it, so the item's access control names the program that minvmd starts. The PATH lookup moved into bep::store::proxy_binary_on_path. It still refuses a relative variable and a missing minvmd. The ruling on the earlier head stands, and there are no conditions.

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

@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: 1 unresolved thread — minimal-foundry[bot] crates/minvmd/src/cmd/run.rs. No findings.

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

@norrietaylor
norrietaylor marked this pull request as ready for review October 26, 2026 04:32
@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 — approved

Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 8884770e4c3b withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 26, 2026
@norrietaylor norrietaylor changed the title T62 — Give the proxy-binary resolver one owner shared by min secret and minvmd refactor(bep): give the proxy-binary resolver one owner for min secret and minvmd (T62) 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 8884770: every merge gate passes C8A9 at this head (arch PASS at 8884770, zero open threads, every lane aggregator green). Squash title refactor(bep): give the proxy-binary resolver one owner for min secret and minvmd (T62) 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 85fce87 Oct 26, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2542-give-the-proxy-binary-resolver-one-owner-shared branch October 26, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T62 — Give the proxy-binary resolver one owner shared by min secret and minvmd

1 participant

0