Repository navigation
feat(bep): wire the redemption decision and each box's declared egress into bep serve - #2486
Conversation
A register_box request records a box's egress authorities and its own_ip or host_ip stance, and forget_box removes the box at destroy. The registry answers egress and attribution per box id, and an unregistered box is attributed to no live box.
BoxRedeemer opens a sealed value under the proxy key, verifies its handle under the registered client keys, reads attribution and egress from the box registry, and gives them with the revocations in force to redeem::decide. Only on an admit does it read the sign-in item for the credential. Unwired stays the test default.
bep serve keeps the loaded sealing key, wires it with the host keychain into the redeemer, and gives the control socket the same registries. The NoSigningKey doc and the startup warning now say that a signing key (#2440) alone gates leaf signing.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The four covered requirements conform to Gatehouse §6.10. The redeemer fails closed, reads the sender's declared egress, and resolves the credential only after an admit. Two interims are in the code with no label and no issue. The redeemer refuses a token that BEP-069 says the proxy must renew, and bep serve passes an empty revocation list. Line 839 requires both. Label each interim and link its issue, as C1 and C2 say. Both stay dormant until #2440, so the change can merge with them open.
Ruled at 669cd4e against gominimal/arch@109541a48c31 by claude-opus-5-5.
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter review of T41 at 669cd4e (round 0). Not an approval yet.
Verified line by line against spec 24: the box registry is read at each request, so a registration or a forget decides the next request, and a box that is not registered has no declared egress and is no live box; the control socket's register_box fails closed on an authority that does not parse; the redeemer opens the value bound to the attributed own_ip box, or to each live host_ip box in turn, verifies the handle under the registered client keys, and gives decide the revocations, the bound and current host sets and the declared egress; the credential is resolved only after an admit, from the Keychain item whose instance the reference names and whose token is live (BEP-019, BEP-020, BEP-022, BEP-025); the property test proves the serving shell admits exactly when the pure decision admits. bep serve shares the client keys and the boxes between the control socket and the redeemer, and the Box Host identity is the sealing key fingerprint, which the minting client must bind to as well. All three commits lint.
The arch ruling's two conditions and the runtime's two findings go to one round, all documentation: label the RenewsAtProxy refusal as an interim with BEP-069 as its flip and #2279 as its issue; state at the bep serve wiring that no revocation is in force until #2290 restores them at start and #2277 records them; say that store rules are empty until #2280, so a store-handle member is never admitted here; and make the startup warning and the NoSigningKey doc say what still stands between a signing key and a serving proxy.
One finding for the plan, not this PR: nothing in the epic sends register_box at a box's creation or forget_box at its destroy, so until a creator does, every box is refused outside_declared_egress. That goes to the person with the T14 split.
Generated by Claude Code
|
/revise Carry the two arch-review conditions at 669cd4e (ruling 5607526616) and the two review findings. Every item is documentation of an interim; change no behaviour. C1 (arch, thread 4343076444). In C2 (arch, thread 4343076446). At the Review MEDIUM (thread 4343067999). Beside the revocations note, say that Review LOW (thread 4343068006). Rewrite the startup Reply on each arch thread with the commit that carries it. Generated by Claude Code |
|
/revise Carry the two arch-review conditions at 669cd4e (ruling 5607526616) and the two review findings. Every item is documentation of an interim; change no behaviour. C1 (arch, thread 4343076444). In C2 (arch, thread 4343076446). At the Review MEDIUM (thread 4343067999). Beside the revocations note, say that Review LOW (thread 4343068006). Rewrite the startup Reply on each arch thread with the commit that carries it. Generated by Claude Code |
State that the redeemer starts with no revocation in force (T20 #2277, T33 #2290, BEP-068 restore-on-start), reads no store rules until T25 (#2280), and refuses a RenewsAtProxy token until T24 (#2279) wires the BEP-069 renewal. Rewrite the startup warning to list what still stands between a signing key and a serving proxy. No behaviour changes.
|
Round 1 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
A request that carries a sealed member from a registered box, to a host inside the box's declared egress, reaches the upstream with the credential in place. The same request from another box, or to a host the box did not declare, is refused before anything goes upstream. This round adds no behaviour. The code now states its interims: no revocation is in force until #2277 and #2290, no store rules until #2280, and a RenewsAtProxy token is refused until #2279. Notes from the agent: Revise round 1 changes only documentation, comments and the startup warn! log text, in commit c2d181c. The module doc, the BoxRedeemer::new doc and the facts doc no longer say that the redeemer passes the revocations in force. cargo clippy -p bep --all-targets is clean, and cargo fmt --check is clean. I did not run just clippy-strict. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The redemption decision conforms to Gatehouse §6.10 lines 823 and 839. The registry fails closed, and each interim refuses and names a flip issue. Two edits remain, both in the startup warn! in serve(). C1: name the issue that makes the host-side creator send register_box and forget_box. C2: state the renewal interim (#2279) and the store-rule interim (#2280) beside the revocation interim. The change can merge with these open.
Ruled at c2d181c against gominimal/arch@109541a48c31 by claude-opus-5-5.
RegisterBox trimmed a trailing dot from the whole host:port text, so github.com.:8443 kept the dot in the stored host and never matched a request. Strip it from the host part after parsing, and refuse a host that is only dots.
|
Round 2 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
A request with a sealed member from a registered box, sent to a host in that box's declared egress, reaches the upstream with the credential in place. The same request from another box, or to a host that the box did not declare, is refused before anything goes upstream. A declared authority such as github.com.:8443 now registers as github.com:8443, so it matches requests to that host. Notes from the agent: Revise round 2. C1 and C2 were already addressed by commit c2d181c, which added the interim comments with their flip issues. This round changes only the control socket's RegisterBox parse. The new parse_egress strips the trailing dot from the host part after parse_authority, and refuses a host that is only dots. forward.rs:442 (request_authority) still trims the dot from the whole Host header text. I did not change it: the reviewer notes that it fails closed, and a change there alters request matching outside this finding. cargo clippy -p bep --all-targets and cargo fmt --check are clean. I did not run just clippy-strict. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare fixes the declared egress parse. A host such as github.com.:8443 now registers without its trailing dot. That matches how the proxy compares the request host (Gatehouse §6.10 line 823). The fix fails closed, and BEP-022 conforms. One residual from the earlier head has no issue: no creator registers a box's declared egress yet. File that issue and name it in the startup warning and the PR body, as C1 says.
Ruled at 2376ce1 against gominimal/arch@109541a48c31 by claude-opus-5-5.
The control socket now lowers an uppercase id, drops a UUID's hyphens, and refuses any id that is not 32 hex digits, on register and forget.
The test now uses a 32-hex box id, which the control socket requires.
|
Round 3 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
A request with a sealed member from a registered box, inside the box's declared egress, reaches the upstream with the credential in place. The same request from another box, or to a host the box did not declare, is refused before anything goes upstream. A box id registered in uppercase or as a hyphenated UUID now matches the box the listener names. An id that is not 32 hex digits is refused at registration, so it does not get a false success. Notes from the agent: Round 3. The control socket now stores a box id as 32 lowercase hex digits. It accepts uppercase digits and a hyphenated UUID, and refuses other text on register_box and forget_box. Because of this, the tests in boxes.rs and main.rs now use 32-hex ids in place of "b1". The bep serve warning now names the #2279 and #2280 interims. Thread C1 is not fixed: I found no issue number for the host-side creator registration in the task, the spec excerpt or the tree, and I cannot file or look up issues. just clippy-strict was not run. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare stores each registered box id in the form the listener uses, and refuses other text. This keeps one id per box, as architecture.md line 495 requires. The startup warning now names each interim. One interim sentence has no issue: no creator registers a box's declared egress. File that issue and name it in the warning and the PR body (C1). The other interims carry their issues as residuals.
Ruled at d2ada70 against gominimal/arch@109541a48c31 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 8 unresolved threads — minimal-arch[bot] crates/bep/src/redeemer.rs:288, minimal-arch[bot] crates/bep/src/main.rs:257, minimal-foundry[bot] crates/bep/src/control.rs, minimal-arch[bot] crates/bep/src/main.rs, minimal-arch[bot] crates/bep/src/main.rs:335, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
/revise Carry the one arch-review condition still open at d2ada70: C1 on the startup The sentence "No creator registers a box's declared egress yet, so every box is refused outside_declared_egress" must name its owners. They exist now: T14 (#2273) sends Reply on both arch threads with the commit that carries it. The C2 thread (4343594409) is already carried by d2ada70. Generated by Claude Code |
|
Round 4 of 10 on a /revise note, pushed as
Verify Review threads the coder judged:
A request that carries a sealed member from a registered box, inside the box's declared egress, reaches the upstream with the credential in place. The same request from another box, or to a host that the box did not declare, is refused before anything goes upstream. This round changes no behaviour. The startup warning and the wire comment now name #2273 and #2277 as the owners of the declared-egress interim. Notes from the agent: Revise round 4 changes only text, in commit 15b67b9. The serve() startup warn! now reads "No creator registers a box's declared egress yet (#2273 at create, #2277 at destroy), so every box is refused outside_declared_egress". The wire() comment above BoxRegistry::default() names T14 #2273 (register_box at create, crates/minimal/src/cmd/boxes/create.rs) and T20 #2277 (forget_box at destroy, crates/minvmd/src/box_registry.rs) as the flip. List #2273 and #2277 as residuals in the PR body. The C2 thread 4343594409 is already carried by d2ada70. This round changes the verdict on thread 4343594407 from invalid to valid, because the note asks for a reply on it. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare adds the flip issues #2273 and #2277 to the box-egress interim, in wire() and in the startup warn!. The interim now has a flip condition and linked issues, and it fails closed. BEP-019, BEP-020, BEP-022 and BEP-025 conform to Gatehouse §6.10 line 823, as in the earlier ruling. C1 stays open under #2273 and #2277. The host-side creator must register each box before its first connection and forget it at its end (§14.5 line 2033). Then remove the interim comment and the warn sentence.
Ruled at 15b67b9 against gominimal/arch@109541a48c31 by claude-opus-5-5.
The cohort loop ran one key agreement per live host_ip box. The open now reads the value's sub from its protected header and binds once to that cohort box, or to the first cohort box when sub names none, which keeps every refusal marker as before.
|
Round 5 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
A request that carries a sealed member from a registered box inside its declared egress reaches the upstream with the credential in place. The same request from another box, or to a host that the box did not declare, is refused before anything goes upstream. A host_ip cohort request now costs one key agreement, whatever the size of the cohort. Notes from the agent: Round 5 changes only crates/bep/src/redeemer.rs. For a host_ip cohort, the redeemer reads the unauthenticated sub from the protected header and binds one open to that cohort box. When sub names no cohort box, or the header does not parse, it binds to the first cohort box. That one open gives the same classification as the old loop. The open authenticates the header, so a forged sub only gives other box. The new test host_ip_cohort_value_is_opened_once uses a counting HeldKey and asserts one agreement for an admit and one for a cross_box refusal in a cohort of five. To support it, the test helpers new_world and sealed_for now take a generic key. just clippy-strict was not run. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 2 conditions · the full ruling
The compare conforms. The cohort open now binds once to the box that the header sub names. The open authenticates that header and refuses a different box, so Gatehouse §6.10 line 823 step 2 still holds and the path fails closed. The interims for revocations (C1) and box registration (C2) stay open as filed residuals. Each one is named in the startup warning with its flip issue.
Ruled at ca37e46 against gominimal/arch@109541a48c31 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 11 unresolved threads — minimal-arch[bot] crates/bep/src/redeemer.rs:319, minimal-arch[bot] crates/bep/src/main.rs:263, minimal-arch[bot] crates/bep/src/main.rs, minimal-arch[bot] crates/bep/src/main.rs:341, minimal-arch[bot] crates/bep/src/main.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 ca37e46bbc69 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.
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter approval of T41 at ca37e46.
Six rounds, each verified against its diff: the box registry is read at each request and a box that is not registered is refused and attributed to no live box; the redeemer opens a value bound to the attributed box, or once to the cohort box its header names, verifies the handle under the registered client keys, gives the pure decision the declared egress, the host sets and the revocations it holds, and resolves the credential only after an admit (BEP-019, BEP-020, BEP-022, BEP-025); the property test proves the serving shell admits exactly when the decision admits; a registered authority loses its trailing dot and a box id takes the listener's form. Every interim is named in the startup warning with its flip issue, and the tasks that flip them carry the removal: #2273 and #2277 for box registration, #2277 and #2290 for revocations, #2279 for renewal, #2280 for store rules. Arch-review passed at this head with those residuals filed, the runtime's review approved, every thread is resolved and each resolution re-verified, the four lane aggregators are green, and the squash subject lints.
Generated by Claude Code
T41 — Wire the redemption decision and each box's declared egress into bep serve
slice: S0
kind: task
covers: BEP-019, BEP-020, BEP-022, BEP-025
size: L
est: 400 code, 400 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics:
min box audit <box>shows each redemption's admit with the member identifier and each refusal with its check marker (undecryptable,cross_box,outside_declared_egress,host_mismatch), never the credential; a box whose declared egress the proxy has not registered is refusedoutside_declared_egressobservability: one info log line when
bep serveinstalls the redeemer naming the registry path, and one debug line per registered box naming its id and the count of its declared authorities, never a credentiallayers:
- registry:
- crates/bep/src/boxes.rs (new): per box id, the declared egress authorities and the
own_iporhost_ipstance, registered over the control socket at creation and removed at destroy- crates/bep/src/control.rs: a
RegisterBoxrequest carrying the box id, its declared egress and its stance, and aForgetBoxrequest- crates/bep/src/lib.rs: module line
test: cargo nextest run -p bep registered_box_egress_is_read_per_request
test: cargo nextest run -p bep forgotten_box_is_refused_no_live_box
- decide:
- crates/bep/src/redeemer.rs (new): the
forward::Redeemeroverredeem::decide: opens the sealed value under the proxy key, verifies the handle against the registered client keys, resolves a sign-in reference to the member's credential from the Keychain item, takes attribution and the declared egress from the registry, and passes the revocations in force- crates/bep/src/forward.rs:
Unwiredstays the test default; the serving proxy installs the real redeemertest: cargo nextest run -p bep sealed_member_is_redeemed_within_declared_egress
test: cargo nextest run -p bep cross_box_value_is_refused_cross_box
test: cargo nextest run -p bep prop_serve_redeems_iff_decide_admits
- serve:
- crates/bep/src/main.rs:
bep serveinstalls the redeemer throughProxy::with_redeemerand gives the proxy the control registry; theNoSigningKeydoc and the startupwarn!say that #2440 alone gates leaf signing now that the decision is wiredtest: cargo nextest run -p bep serve_installs_the_redeemer_and_registry
produces: none
consumes:
- crates/bep/src/redeem.rs
- crates/bep/src/forward.rs
- crates/bep/src/handle.rs
- crates/bep/src/signin.rs
- crates/bep/src/seal.rs
- crates/bep/src/control.rs
proof: A request carrying a sealed member from a registered box inside its declared egress reaches the upstream with the credential in place, and the same request from another box, or to a host the box did not declare, is refused before anything goes upstream.
depends on:
- blocked by T1
- blocked by T4
- blocked by T7
- blocked by T10
- blocked by T11
- blocked by T12
- blocked by T14
Generated by Claude Code
Proof
In the redeemer tests, a request goes through forward_requests with a value sealed for a registered box, to an authority in that box's declared egress. The bytes that reach the upstream carry
Bearer <sign-in token>and not the sealed value. The audit record is an admit that namesgithub:<instance>and does not contain the token. The same value sent from another registered own_ip box is refusedcross_box. Sent to a host the box did not declare, it is refusedoutside_declared_egress. In both refusals, zero bytes reach the upstream.bep servenow installs this redeemer, and its control socket acceptsregister_boxandforget_box.Notes from the agent: Decisions the next tasks need to know:
host/node_idstring that a sealed value and its handle bind.bep serveuses the sealing key fingerprint (ProxyPublicKey::kid), which the published identity already carries. The minting client must use the same value.serve_installs_the_redeemer_and_registrypins this.BoxRedeemer::with_revocationstakes a shared list, andbep servepasses an empty one. Restoring revocations from the audit log (BEP-067 and the restore-on-start sub-requirement) is still open.forget_boxdoes not record a revocation.decideadmits, but whose item is gone, names another instance, or has an expired token, is refusedgithub_sign_in_required(redeemer::SIGN_IN_REQUIRED). The redeemer does no token renewal. A token in the renews-at-proxy standing is refused the same way for now.Checknames (host or module mismatch, malformed, unsupported, bad members, a keychain key failure) are refusedundecryptable, with the reason in a debug line.outside_bound_set.Tests
cargo nextest run -p bep registered_box_egress_is_read_per_requestcargo nextest run -p bep forgotten_box_is_refused_no_live_boxcargo nextest run -p bep sealed_member_is_redeemed_within_declared_egresscargo nextest run -p bep cross_box_value_is_refused_cross_boxcargo nextest run -p bep prop_serve_redeems_iff_decide_admitscargo nextest run -p bep serve_installs_the_redeemer_and_registryVerify
min task run agent-verifypassed ([tasks.verify]).Closes #2483