Repository navigation
Conversation
Quest-Claim: f551eaa9b5db85fa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Maintainer decision (relayed from the maintainer's /quest-run round, 2026-11-26):
(Written by Claude Opus 5.5) |
Collaborator
Author
|
Superseded by the 2026-11-26 maintainer
Closing this PR as superseded. (Written by Gemini 4 Neon with high) |
Collaborator
Author
|
Superseding the 2026-11-25 decision (maintainer,
(Written by Gemini 4 Neon with high) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements quest/m1/grant-cost.md and deletes it.
Problem
A relay accepting a session cannot price its link. Only the dialer can (
Client::with_cost), and only once, at connect. A mesh coordinator that prices links by measured quality needs to set an accepted session's cost through its auth answer, and reprice it as quality changes without a reconnect.Approach
moq_auth::Grantgainscost: Option<NonZeroU64>.@moq/auth'sGrantSchematakes the same field (a positive int), and the shared corpus covers it. Zero, negative, fractional, string, andnullvalues are refused, as is any unknown field.moq-netgainssession::Price: a cloneable handle for this side's link price, fromSession::price()andserver::Handshake::price(). It defaults to the dialedwith_costand can be set before the session learns a route.Nonefalls back to the peer's SETUP price, then1. Setting it reprices in place. Nothing goes on the wire, so other relays learn the new cost from the route adverts they already get.route::node::Stream::reprice/Router::repricechanges the port's cost. Routes heard from a routing neighbour reselect, claims an endpoint or scoped neighbour gave are recharged and restated, and the node re-advertises them.with_costtoday.setreturnsError::Unsupported.moq-relay:Refresh(the in-band auth supervisor) prices the link from the connection credential's grant only. The newest one is used if the credential was presented again. A request token's grant never prices the link. When the connection credential ends while another credential keeps the session alive, the price falls back toNone. The price is set inLease::preparing, before SETUP OK. If a re-check changescostand the session can't apply it (moq-transport), the session ends withlink cost changed: …and reconnects at the new price.moq-tokio::server::Request::price()and the relay's sealedIncoming::price()expose the handshake's handle.test/drill/mutations/subscriber-leaks-broadcasts.patchis retargeted onto the editedPrefixRun. It applies again and its mutation is unchanged.Choices made without asking (listed for review):
costis typedNonZeroU64, so zero can't be represented and is refused when the grant is parsed. That's stricter than the quest's "refused at validation", with the same effect.Lease::newcallers) ignorecost, since they learn no routes.Impact
moq-auth:Grant::cost(new public field;Grantis#[non_exhaustive]). Wire: the auth endpoint's grant JSON gains an optionalcost. A relay that predates it refuses such a grant, which fails closed. An auth server must sendcostonly to relays that read it (branch onRequest::relay), asdoc/bin/relay/auth.mdnow says.@moq/auth:GrantSchema/Grantgain optionalcost.moq-net: newsession::Price(set,get),Session::price(),server::Handshake::price(). All additive. No moq-lite or moq-transport wire change.moq-tokio: newserver::Request::price().costreprices a lite session in place and ends a moq-transport one.No breaking change, so no
!and no migration note.Alternatives
Compatibility with related PRs
Grantand doesn't overlap. Whichever lands second rebases.quest/m1/js-session-cost.md(running in parallel) addsServer::with_cost. That fits here: it can seedHandshake::pricefrom the builder. This PR deletes only its link to this quest.Validation
rs/moq-net/tests/integration/link_price.rs: over real mock sessions, a subscriber accepts links from two relays and prices them throughSession::price()on the server side. Repricing the cheap link above the other moves the route on lite-06 and lite-07. SettingNonereturns it to the default1. moq-transport refuses withUnsupportedand keeps no price. Mutation check: with the lite-06 and lite-07 reprice calls removed, both lite tests fail.route::relay::tests::a_repriced_link_reranks_what_it_gave: an endpoint's claims recharge (a claim at the ceiling stays there), and the best route moves off a routing neighbour whose link got dearer.moq-relay auth::refresh::tests::the_connection_credential_prices_the_link: the price is set before SETUP OK, a re-check reprices in place, a request token'scostis ignored, and the price falls back toNoneonce the connection credential expires.moq-authgrant round-trip, cross-language vector, unknown/invalid field refusals, and corpus.js/authbun test(290 pass) with the updated Rust vector.just checkon the branch: 11888 Rust tests pass and every module passes except drill, which was then fixed (just test drill-sensitivity --apply-only: 11 of 11 mutations apply).Follow-ups
None.
Waiting
cost, should the relay end the session (it reconnects at the new price) or should moq-transport reprice live?@moq/netmirrorSession.price/ the accept-side price handle now?js-session-costquest already gives JS a fixed cost on connect and acceptModels
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown (arm A)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)