Repository navigation
fix(boxes,minimal): a refusal for a Box Egress Proxy that does not answer names bep.log, the proxy's - #3616
Conversation
ProxyAbsence::NotAnswering carries the last error line of bep.log, and its text tells the user to fix it and restart minvmd.
proxy_present connects to control.sock, so a socket file that a stopped bep serve left behind takes the not-answering branch. The mint names bep.log, its last error line and the step to restart minvmd.
…for-a-box-egress-proxy-that-does-not-a
The connect-site inventory lists every connection by function. The new stale control.sock test opens two proxy control connections.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Un-drafted: the |
|
/review |
|
/arch-review |
|
Approved: no findings at Nothing to do. Clobber: none seen. |
…for-a-box-egress-proxy-that-does-not-a
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. Gatehouse §6.2 keeps gatehouse_unenrolled_node as the refusal where no node-local BEP exists. A proxy that does not answer on its control socket is that case, and the refusal stays exit 5. The quoted bep.log line carries no credential, because no bep ERROR record holds a secret. Note that bep.log is appended across boots. So the quoted "last error" can come from an earlier run. The design does not decide this, so it is not a condition.
Ruled at 1521cb3 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. Gatehouse §6.2 line 580 keeps gatehouse_unenrolled_node as the refusal wherever no node-local BEP exists. A stale control.sock now counts as no proxy, and the refusal code and exit 5 do not change. The added log line and restart step stay in the client and in boxes::core::bep, as #3607 set. Before merge, the author must check two items that are outside the design. The restart step names no command, and the agent-verify run failed in otel_cli.
Ruled at 1521cb3 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
bep.log keeps the records of earlier runs. An ERROR that a later INFO or WARN record follows did not stop the proxy, so the refusal no longer quotes it. After the last record, the first line with no level is kept, not the tail of a backtrace.
…for-a-box-egress-proxy-that-does-not-a
|
Round 1 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:
With bep serve exited and an old control.sock left over, min session activate on a GitHub-grant box prints the bep.log path and the restart step for minvmd. It also quotes the error that ends bep.log, and no longer quotes an older error from an earlier run. Notes from the agent: Revise round 1. last_error_line now reads only the end of bep.log. If the last record is ERROR, its text is quoted. If the last record has another level, the first unleveled line after it is quoted, which is what bep printed when it stopped (for example 'bep stopped serving: ...'). If there is no such line, nothing is quoted. The stale-socket test log no longer ends with an INFO line after the ERROR, because under the new rule that error is not the cause. New assertions cover an old error followed by INFO, an unleveled stop line followed by a backtrace, and an ERROR followed by a wrapped line. cargo clippy -p minimal --all-targets and cargo fmt --check are clean. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The new commit changes only which bep.log line the refusal quotes. Now the refusal quotes an error only when that error ends the log. A proxy that does not answer still refuses the box at creation and at mint, as gatehouse-spec §6.3 line 637 requires. With no quoted line, the refusal still names the log and the restart step. The earlier PASS on this PR stands.
Ruled at 63d49b7 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
|
/revise Fix the two open minimal-review threads in
|
…for-a-box-egress-proxy-that-does-not-a
bep.log keeps earlier runs. The leftover control.sock's modification time marks the start of the last bep serve, so records stamped before it are no longer quoted. An ERROR record now keeps the lines with no level that follow it, so a multi-line error is quoted whole.
|
Round 2 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
With bep serve exited and an old control.sock left over, min session activate on a GitHub-grant box prints the bep.log path, the restart step for minvmd, and the last error of the proxy run that left the socket. A multi-line error is quoted whole. An error from an earlier run is not quoted. Notes from the agent: The note asks for the log length or a start marker from before the proxy starts. min does not start the proxy. minvmd opens bep.log and starts bep serve, bep writes no start marker, and both crates are outside this task's layers. So the run boundary is the leftover control.sock's modification time, which is when the last bep serve began to listen. last_error_line(log, control) reads only from the first tracing record stamped at or after that second. If no record is stamped at or after it, it quotes nothing. When no control.sock file exists, the start is not known and only the earlier end-of-log rule applies. A test pins that case. A future change can make minvmd pass the bep.log length at spawn, or make bep write a start line. That gives an exact boundary for the no-socket case too. The wording of the refusal is unchanged. Continuation lines are joined with spaces, because control characters in the quote are escaped. The existing test for an old ERROR followed by INFO from a later start already passed before this round. This round adds the same case with the socket boundary, and adds an old ERROR that ends the log with nothing from this run after it. I did not run just clippy-strict or the full crate suite. cargo clippy -p minimal --all-targets is clean. |
|
The runtime will not revise this pull request again on its own: the diff is +492/-25 (517 lines), past 3x the plan's estimate of 170 lines (est: 90 code, 80 tests, as #3580 reads now), at round 2 (the last trigger was a /revise note). A person decides now. Remove |
|
Marked ready: the lanes are green at this head. |
|
/review |
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This push quotes only the bep.log error of the last proxy run. It also quotes a multi-line error whole. The design has nothing to say about how the client selects that line. The quoted text comes from bep.log, and architecture.md line 79 keeps secret values out of logs. The 300-character cap and the escape of control characters stay in place, and the refusal still fails closed. The merge of main carries no hand edits. The ruling at 63d49b73 stands for the rest of the change.
Ruled at e09fe29 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-foundry[bot] crates/minimal/src/mint.rs:127, minimal-foundry[bot] crates/minimal/src/mint.rs. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of e09fe29283c4 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.
|
/review |
There was a problem hiding this comment.
Gate passed at e09fe29: minimal-review APPROVE, arch APPROVED, no open threads, lanes green.
Follow-up
Fixes #3580
crates/minimal/src/cmd/boxes/create.rscrates/minimal/src/mint.rscrates/minimal/src/cmd/secret.rscrates/minimal/src/tests.rscrates/boxes/src/core/bep.rsTask marker
Proof
Stop bep serve and leave its old control.sock in place. Then min session activate on a GitHub-grant box refuses the box, and the refusal names the bep.log path and the proxy's last error line from that log. It ends with "Fix that error, then restart minvmd, which starts the proxy again." The creation check and the mint at activation both print this text.
Notes from the agent: proxy_present now connects to control.sock, so a socket file with no listener counts as no proxy. The existing test now binds a real listener where it used to write an empty file. crate::mint::last_error_line reads the last 64 KiB of bep.log. It takes the last tracing record at level ERROR, and keeps the text after the level. A line that is no tracing record (what bep prints as it exits) also counts. ANSI colour codes are removed, and the line is capped at 300 characters. NotAnswering and NotRunning always give the restart step now, also with no error line ("Restart minvmd, which starts the proxy again."), so the pinned texts in a_grant_box_with_no_proxy_is_refused_as_an_unenrolled_node changed. Printed text: the step says "restart minvmd", as the task says, but it names no command, because I did not find one command that restarts minvmd on every host. min host stop followed by an autospawn is a possible step, but I did not check it against this code path. mint_into_request now takes an eighth argument (proxy_log), with a justified #[allow(clippy::too_many_arguments)]. I did not run just clippy-strict or the full crate suites.
Tests
cargo test -p minimal a_grant_box_with_no_proxy_is_refused_as_an_unenrolled_nodecargo test -p minimal a_stale_control_socket_names_the_proxy_logcargo test -p boxes not_answering_names_the_proxy_reason_and_restartVerify
min task run agent-verifyexited 100, so this PR is a draft.Base
The base branch moved while the coder worked; it was merged in before the tests ran.