GeezerVison is showing github.com — feat(id): serve-proxy mux credit accounting for DATA accept and WINDOW_UPDATE (#13694) by dezren39 · Pull Request #13859 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Closes #13694 (and #8970, whose last open criterion this closes).
Summary
Builds the mux consumer of the serve-proxy credit primitive (design record #5792): a new Mux in pkgs/id/src/serve_proxy_mux.rs holding a per-stream CreditWindow per open stream plus one aggregate per-connection window.
- DATA-accept path:
accept_data admits a payload only when both the stream window and the aggregate connection window cover it, consuming both atomically; a refusal changes neither window, so credit is never exceeded and never goes negative.
- Credit-return path:
apply_window_update grants a received WINDOW_UPDATE to the named stream window (or the connection window for stream 0), bounded by each window's ceiling. An over-ceiling or overflowing grant is rejected with an ERROR frame carrying ErrorReason::CreditOverrun and leaves the window unchanged — never silently saturated (fix(id/serve-proxy): bound credit grants to flow-control limits #8970). A WINDOW_UPDATE for an unknown stream (or a non-WINDOW_UPDATE frame) maps to a ProtocolViolation ERROR frame.
- Credit returns only as bounded buffer space is released: closing a stream drops its stream window and does not refund connection credit — that credit returns only via a connection WINDOW_UPDATE from the peer (HTTP/2-style). Ceilings stay parameterized from the effective configuration (
Mux::with_credit); no universal deployment limit is invented.
- Tests: 9 unit tests + 1 model property test (
mux_accounting_matches_the_model) over interleaved opens/accepts/grants/closes, naming feat(id/serve-proxy): wire CreditWindow into mux DATA-accept and credit-return paths #13694/fix(id/serve-proxy): bound credit grants to flow-control limits #8970 as oracle.
This branch also carries a blocker fix (separate commit): commit 819e0f4 added the at: Option<u64> field to id_events::groups::Event without updating five struct literals in the id crate's test fixtures, so cargo test -p id --lib failed to compile on main (E0063). The fixtures predate timestamps, so at: None is the documented-correct value. Current main still carries the break; this PR fixes it in passing.
Evidence
Remote verification via the fleet-command.yml workflow fallback (fleet queue dispatch is blocked by TLS defect #13185):
cargo test -p id --lib serve_proxy_mux on xaltha/13694-credit-mux @ 93f93be1d: 10 passed, 0 failed (589 filtered out) — run https://github.com/developing-today/fleet/actions/runs/45287417777 (conclusion: success).
- Before the fix, the same command failed to compile on main's HEAD with 5× E0063 in
hosted_binding.rs/pull_policy.rs (run 45284168795); after the at: None commit the lib test target compiles and the 10 mux tests run green.
- Not built locally; relies on the remote run above. No new test file, so no suite-registry row is needed (inline tests in the already-registered
id.rust.unit target).
Merge Danger
- New module only, plus one
pub mod line in pkgs/id/src/lib.rs and five at: None lines in test fixtures. No behaviour change outside the new mux and the previously uncompilable test fixtures.
- The mux is not yet wired into any live leg (leg establishment is a later slice on id: implement broker / serve-proxy wire protocol per #5792 decision #7569); nothing calls
Mux yet, so this cannot change runtime behaviour.
- Branch merges cleanly against current main (verified with
git merge-tree, no conflicts).
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-23T23:37:31Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": "/home/hatch/workspace/github-work/code-13694-credit-mux",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/hatch/workspace/github-work/code-13694-credit-mux",
"repo": "developing-today/code",
"branch": "xaltha/13694-credit-mux",
"sha": "93f93be1dffd658c6686f216879830d56a9c5ecc"
},
"auth_subject": "xaltha",
"stamped_by": "fleet 0.1.0 (native)"
}
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…W_UPDATE (#13694)
Mux consumer of the CreditWindow primitive: per-stream and aggregate
per-connection windows in the DATA-accept path (atomic refuse, never
negative), grant() on received WINDOW_UPDATE bounded by each window's
ceiling, over-ceiling/overflow grants rejected with an
ErrorReason::CreditOverrun ERROR frame and the window unchanged.
Unit + property coverage for per-stream/aggregate accounting,
over-ceiling/repeated WINDOW_UPDATE, and unchanged state after refusal.
Commit 819e0f4 added the `at: Option<u64>` timestamp field to
`id_events::groups::Event` without updating the five struct literals
in the `id` crate's test fixtures, so `cargo test -p id --lib`
fails to compile on main (E0063, 5 sites). The fixtures predate
timestamps, so `None` is the documented-correct value. Unblocks
verification of the serve-proxy mux slice on this branch.
After consuming 100 of 100 initial credit the window holds 0, so
refilling it to the 250 ceiling needs a grant of 250, not 150.
Warning
Review limit reached
You'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 35 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2dcc3894-d1fd-48d8-a412-1a8a517910bb
Commits
-
Reviewing files that changed from the base of the PR and between 5e2b480 and 93f93be.
Files selected for processing: 4
-
pkgs/id/src/hosted_binding.rs
pkgs/id/src/lib.rs
pkgs/id/src/pull_policy.rs
pkgs/id/src/serve_proxy_mux.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 24, 2026
This was referenced Nov 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|