Repository navigation
Conversation
Quest-Claim: dbeaae4f90ba62d4
The router ranked claims of equal rank by the relays that took them and their claimant, ignoring the mark, so an upstream scoped neighbour could be told nothing while an unmarked claim of the same rank was at hand. Claims now rank the mark after the rank, as routes and restate do. Extracts the functions the route proof's binding calls: Offer::own, Offer::onward, Here::arrive, order, Claim::over, Claim::exported, Claim::adopted, and claim_order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proof's Rust binding ran the prototype. It now runs the router's own functions for a node's own route, sending a route on, taking one in, and ordering candidates, and binds the claim instance too: within a domain, across a grant, and the order claims are picked in. The algebra gains a leading key (a claim's precedence), a tag that reads the route, and an instance-supplied order among equal lengths, so each instance orders as the router does: routes by the neighbour's Node ID, marked identities included; claims by precedence, rank, mark, length, claimant, and giver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Random pairs rarely tied on rank with a different mark or path length, so a router that ignored either still matched every vector. A third of the pairs now differ only there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sticky.rs runs on RelaySim, so the rule-as-it-runs sweep checks the router that ships. The proof README says what the binding covers and what it does not; the prototype helpers only the old binding used go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
✅ No new issues found.
Approach: Sound. It pulls the router's own route and claim functions out of Router and points the Agda binding at them, so the proof now samples what ships rather than the multi.rs prototype. The one behavior change is the claim_order mark fix, which is narrow and has a regression test.
Reviewed changes
This review covers all 19 files: the relay.rs refactor and claim-order fix, the rewritten algebra.rs/sticky.rs binding, and the Agda instances and docs.
relay.rsroute functions:Offer::own,Offer::onward,Here::arrive, andorderreplace inline code inown_offer/usable/reselect/sent. I traced each one and the filters and keys match the code they replace.relay.rsclaim functions:Claim::over,Claim::exported, andClaim::adopted, plus freetakes/stamp, replace the inline join inways/stands/closestand the stamp/limit inadopt/stands.standsmoves the marked-export refusal intoexported(.., upstream). I checked that this is equivalent on every branch:- own claim:
claim.marked; - another node's claim:
claim.over(best).marked, which equals the oldcrossed_markthrough themarks/best.offer.markedinvariant; - unavailable claim:
crossed_mark; - gone claim:
gone.claim.marked.
- own claim:
- Closest-claim fix:
ClaimOrdernow ranks the mark after the rank, soclosestprefers an unmarked claim at equal rank, asrestateand routes already did. Before, a marked scoped neighbour could be told nothing.an_unmarked_claim_is_closest_among_equal_rankscovers it. restatekey: it now goes throughclaim_order(claim, None, owner).ownerfollowsmarked, so the order is unchanged.- Binding tests:
algebra.rsgenerates 336 route vectors and 320 claim vectors from the router functions.sticky.rsruns onRelaySim.- The prototype-only helpers and the
tiestest are removed.
- Agda changes:
Increasinggains a leading key (rise) and an edge-awaretag.Routeadds the metric and other-start filters and orders by the full Node ID.NamedreplacesSim.Claimmodels precedence, adoption versus the domain step, and the chain limit.Orderreplacesshortlexwithnewest/runs.
claude-opus-5-5 | 𝕏

Finishes
quest/m3/route-proof-binding.md.Problem
The lite-07 route rule has an Agda proof (
rs/moq-net/verify/route-algebra/) that routes and claims settle. Its Rust binding still ran the prototype the proof was written against (route/tests/multi.rs), notroute::relay::Router. Sojust test route-proofproved a rule nobody runs.Approach
relay.rsand called by the router itself:Offer::own,Offer::onward,Here::arrive,order,Router::usable;Claim::over(joined with the route to the announcer),Claim::exportedandClaim::adopted(the two sides of a grant), andclaim_order, whichclosestandrestatenow share.Increasing.agda): it gains a leading key, a tag that reads the route, and an instance-supplied order among equal path lengths. Each instance now orders exactly as the router does.Route.agda,Named.agdareplacingSim.agda): nodes are Node IDs, marked identities included.[marked identity, node], and that marked hop counts toward the 32.Claim.agda):closestdoes.algebra.rswrites 336 route results toVectors.agdaand 320 claim results to the newClaimVectors.agda. Agda must reproduce each one byrefl. A third of the choices tie up to the neighbour, claimant, or giver, and a third also differ only in the mark or path length, so each tie-break decides some.sticky.rsruns onRelaySim, so the "rule as it runs" sweep checks the shipping router.a_marked_route_does_not_tie_with_an_unmarked_oneis gone:relay::Routerhas noties, becausewaysoffers every usable route.Counterexample: an upstream told nothing at an equal rank
Binding the claim order showed the router wrong.
closestranked claims of equal rank by the relays that took them and then the claimant, ignoring the mark. Routes andrestateboth put the unmarked one first.Smallest case (
an_unmarked_claim_is_closest_among_equal_ranks): relay 1 hears node 4's claim over a link it marked upstream, and node 5's claim over an unmarked one, at the same rank. Node 4 names the lower Node ID, soclosestpicked it.standsthen tells a marked (upstream) scoped neighbour nothing, even though an unmarked claim of the same rank was at hand. The upstream loses the broadcast.Fixed here, since it changes no wire and no public API:
claim_orderranks the mark after the rank, asrestatealready did. Before the fix the test fails (pickreturned node 4 and the upstream was told nothing); after it, it passes. The mutation sweep (below) plants the old order back, and the Agda vectors reject it.What the bound proof covers
Accelerate).sticky.rson the router: 29 of 2,282 routes differ in next hop between two delivery orders, none in rank, mark, or reachability).What it still does not cover
The proof README's "What this does not give" lists each. In short:
routeandadoptrefuse as malformed. That a node feeds the bound functions the latest offer per neighbour is argued on paper.Decisions
closestdecides it over unreachable claims too. The label is history-dependent likeclaimed, and is documented as such rather than modelled.closestin line with the route order andrestate.Validation
just test route-proof(pinned nix build): every module checks, including both vector files.just check: passes (10,660 tests).relay.rs, the vectors regenerated, and Agda run on them. Caught: an unmarked marked route; a marked route sent upstream; a path naming another start of the receiver's relay; the floor ignored; the hop limit off by one; the named drain ignored; the priority not lowered; the mark, the neighbour Node ID, or the length left out oforder; the mark or claimant left out ofclaim_order; a join keeping the claim cost or dropping the route mark; a claim exported over a marked link; an adopter taking a chain naming it, keeping the priority, ignoring the port mark, or never naming itself; an older run ranked newer. Missed: the exporter's chain limit off by one (equivalent, see above).sticky.rswith the mark moved below the next hop in use: 20 routes differ in the mark, andan_equal_route_in_use_never_leaves_a_neighbour_without_onefails, as the README argues.cargo test --release -p moq-net --lib route::tests::multicast -- --ignored): 6 passed.Impact
route::relayis crate-private).Caused by
closestranking claims without the mark (found by the proof binding).Follow-ups
None.
Models
Size: L
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 207acbe
Base: origin/main at 4c8af4c
Risk: high,
it changes .github/workflows/nightly.yml, which is always high: workflows run with the repository's secrets and decide what merges and shipsClassified: high by the always-high paths
Reviewer: Codex, gpt-6.1-sol, xhigh effort
Session:
01a1f0d7-9a34-74f2-b86e-49e7b162c165, round 1Score: 9/10,
The routing refactor and proof binding appear consistent, with no actionable defects found; builds and tests were not run, as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none