You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id(comms): budgets — app-wide, per-IP, per-ID, and per-counterparty overrides (P1 of #2032) #2247
From the #2032 investigation (record). Blocked by #2244 (counters must exist before a budget can be evaluated).
Problem
The issue's requirement is "configurable budgets — max MB per window across the whole app, per IP, or per ID, and message/MB caps for a SPECIFIC counterparty, not just any counterparty". The last part is the one no existing limiter can express: world chat bounds lines per participant in a world, nothing can give one peer a smaller allowance than everyone else.
Work
Rolling-window byte budgets: app-wide inbound 32 MiB/s / 20 GiB/h, outbound 64 MiB/s / 40 GiB/h; per peer 100 MiB/h burst 8 MiB/min; per IP 250 MiB/h (direct connections only).
Per-counterparty override rows{peer, bytes_per_window, messages_per_window}, consulted before the default bucket — an operator can cap one peer at 1 MiB/day without touching the global budget.
Configuration in id-server-config.toml (server_config/parse.rs), defaults in code so an unchanged config behaves as today.
An operator can set a per-peer cap in config, observe the budget counters, and a peer exceeding it is refused with a retry value while the rest of the app is unaffected.
agent-note:v1
event: handed_off
task: 5936 (repo-health-code-pilot, openchamber scheduled lane)
state: queued; not_before=2026-11-01T22:30:00Z
next: revalidate #2244/#3882/PR #3960; park if P0-A integration is still open or blocked.
dedupe: repo-health:v1:fix:developing-today/code:issue:2247
Action: handed off to the opencode claimant per the lane assignment. Parking with the cleared gate named so the next claim resumes the work, not the gate check.
🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-o — Session/ID: task 9172, repo-queue-worker-shift-o 2026-11-09 run. Task 9172 (small_fix) for issue #2247: Wire id serve's loaded abuse budgets into WorldProtocol. Fresh check: issue #2247 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. Execution lane row 1950 = opencode. Checkpointed handed_off with handoff_reason: scheduled shift is time-bounded; claimant is the persistent execution session. Parking task 9172 for 20 minutes for the claimant window.
agent-note:v1
lane: code-w
task: 9172
issue: #2247
stage: handed_off
note: Task 9172 (small_fix, issue #2247) handed off to the opencode claimant: lane assignment row 1950 is opencode (re-confirmed this claim). Issue #2247 OPEN, no hard-stop labels, no status/needs-triage (fresh, lane code-w 2026-11-10). Attempts 16/32. Revalidated by lane code-j 2026-11-10. Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session. Next: claimant launches the bound opencode session.
Trace: the packet's serve.rs:1319 line is stale; on current main the live construction is WorldProtocol::with_local_node(...) in cmd_serve (which hard-wires BudgetPolicy::default()), and the loaded config sits unused in _started_server_config (its doc comment says later slices wire consumers from this one load — this task is that wire for budgets). ServerConfig::budgets() returns &BudgetPolicy (Clone + PartialEq); WorldProtocol::with_budgets already exists.
Plan: rename the binding, add a world_protocol_for helper that passes started.config.budgets().clone() when a config was loaded and keeps with_local_node otherwise, plus focused tests (configured policy incl. a counterparty override reaches the protocol's evaluator and refuses an over-budget charge; no-config path yields the default policy).
state: info
task: 9172
lane: code-w
issue: "#2247"
Resume handoff for task 9172 (lane code-w held the claim until its lease expired during two long cargo compiles on 2026-11-10; the task has since been re-served — this note leaves the branch in a verified state for whoever holds it now).
State of branch queue/9172-2247-serve-budgets (pushed, worktree ~/git/fleet/9172-2247-serve-budgets):
2c717c4480 — the implementation (pre-existing): world_protocol_for() in pkgs/id/src/commands/serve.rs wires the loaded server config's budgets into WorldProtocol::with_budgets; no-config keeps the with_local_node default path.
275e20b04c — test fixes from this lane, after running the targeted suite: (1) the new test called limits_for_peer on the evaluator — the method lives on BudgetPolicy (abuse.rs), so the call now goes through started.config.budgets(); (2) both new tests were plain #[test] but WorldHandle::spawn needs a Tokio reactor — converted to #[tokio::test], the crate's pattern in world_net.rs.
Verified: cargo test --manifest-path pkgs/id/Cargo.toml serve_world_protocol — 2 passed, 0 failed (laptop, 2026-11-10T21:5xZ, log test-9172c in the lane scratch). The original blocker is gone: PR #5096 MERGED 2026-11-09T05:26:41Z.
Remaining for the current holder: open the PR from the branch (title scope = the serve-side wire; the broader #2247 budget model stays open on this issue), then complete task 9172 as pr_opened. Nothing else is outstanding — no other files were touched.
Verification: diff is exactly 1 file (pkgs/id/src/commands/serve.rs, +88/-2): world_protocol_for builds the protocol with the loaded config's BudgetPolicy when a server config was given, defaults otherwise, plus two tests. Targeted tests at PR head: cargo test --lib serve_world_protocol — 2 passed (configured policy reaches the protocol and refuses an over-budget peer as BudgetExhausted without disconnect; default policy preserved without config). Current main was merged into the branch cleanly first (head c06163f349); every seam the change calls (WorldProtocol::with_budgets/with_local_node, ServerConfig::budgets) verified present on current main. A merged-tree re-run of the same tests was still compiling at completion under extreme laptop load (load average 93, 100+ concurrent rustc fleet-wide; job cfaf9d8cc38a on the laptop) — the head run is the recorded pass.
Verification follow-up (task 9172, lane code-l): the merged-tree re-run that was still compiling at completion has now finished — laptop job cfaf9d8cc38a, cargo test --lib serve_world_protocol on the merged head c06163f349: exit 0 (all test binaries ran, no failures). PR #8240's merged tree is test-verified, not just its pre-merge head.
Activity
developing-today commentedon Oct 29, 2026
CODE-1113
dezren39 commentedon Nov 1, 2026
agent-note:v1
event: handed_off
task: 5936 (repo-health-code-pilot, openchamber scheduled lane)
state: queued; not_before=2026-11-01T22:30:00Z
next: revalidate #2244/#3882/PR #3960; park if P0-A integration is still open or blocked.
dedupe: repo-health:v1:fix:developing-today/code:issue:2247
dezren39 commentedon Nov 1, 2026
agent-note:v1 — picked up — OpenChamber scheduled lane
dezren39 commentedon Nov 1, 2026
agent-note:v1 — parked — OpenChamber scheduled lane
3993ac941e, Drew-authored. CodeRabbit passed, but the prerequisite integration is not merged.509 remaining items
dezren39 commentedon Nov 10, 2026
Agent note — lane code-t, task 9172
ghcheck 2026-11-10T02:32Z.dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off
opencode(lane row 1950)dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-o — Session/ID: task 9172, repo-queue-worker-shift-o 2026-11-09 run. Task 9172 (small_fix) for issue #2247: Wire id serve's loaded abuse budgets into WorldProtocol. Fresh check: issue #2247 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. Execution lane row 1950 = opencode. Checkpointed handed_off with handoff_reason: scheduled shift is time-bounded; claimant is the persistent execution session. Parking task 9172 for 20 minutes for the claimant window.
dezren39 commentedon Nov 10, 2026
agent-note:v1 — state: handed_off (task 9172, lane code-t)
dezren39 commentedon Nov 10, 2026
Lane code-y picked up task 9172 (issue #2247) — handed off to opencode claimant.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-t — Session/ID: task 9172, repo-queue-worker-shift-t 2026-11-10 run. Task 9172 (small_fix) for issue #2247: wire id serve's loaded abuse budgets into WorldProtocol. Fresh check: issue #2247 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. Execution lane row 1950 = opencode. Handoff reason (#8097 Rule 4): scheduled shift is time-bounded; claimant is the persistent execution session. Checkpointed handed_off; parking task 9172 for 20 minutes for the claimant window.
dezren39 commentedon Nov 10, 2026
agent-note:v1
lane: code-w
task: 9172
issue: #2247
stage: handed_off
note: Task 9172 (small_fix, issue #2247) handed off to the opencode claimant: lane assignment row 1950 is opencode (re-confirmed this claim). Issue #2247 OPEN, no hard-stop labels, no status/needs-triage (fresh, lane code-w 2026-11-10). Attempts 16/32. Revalidated by lane code-j 2026-11-10. Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session. Next: claimant launches the bound opencode session.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-u — Session/ID: task 9172, repo-queue-worker-shift-u 2026-11-10 run. Task 9172 (small_fix) for issue #2247. Fresh check: issue #2247 OPEN, labels: task/triage, status/parked, source/creator, queue/parked, app/id, work/assigned. Execution lane row 1950 = opencode. handed off to opencode claimant (lane row 1950).
dezren39 commentedon Nov 10, 2026
Task 9172 (issue #2247) — handed off to opencode claimant, lane B shift 2026-11-10.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · picked up
directper fix(queue): single-session by default — launch-on-handoff, lane works, inline triage (reverses #8097 Rule 3) #8187; this lane works it itself. Fresh check: issue id(comms): budgets — app-wide, per-IP, per-ID, and per-counterparty overrides (P1 of #2032) #2247 OPEN, no hard-stop labels; blocker PR fix(id): surface per-peer frame/byte abuse counters with direction split (#4918) #5096 already merged.WorldProtocol::with_local_node(...)in cmd_serve (which hard-wires BudgetPolicy::default()), and the loaded config sits unused in_started_server_config(its doc comment says later slices wire consumers from this one load — this task is that wire for budgets).ServerConfig::budgets()returns &BudgetPolicy (Clone + PartialEq);WorldProtocol::with_budgetsalready exists.world_protocol_forhelper that passesstarted.config.budgets().clone()when a config was loaded and keeps with_local_node otherwise, plus focused tests (configured policy incl. a counterparty override reaches the protocol's evaluator and refuses an over-budget charge; no-config path yields the default policy).dezren39 commentedon Nov 10, 2026
🤖 Agent note · parked (dependency wait on #7081)
cargo test --manifest-path pkgs/id/Cargo.toml --lib serve_world_protocoland--lib budgetin the PR worktree, confirm both new tests pass, disposition any Codex review on PR feat(id): wire serve loaded budgets into WorldProtocol (#2247) #8240, merge it, complete task 9172.dezren39 commentedon Nov 10, 2026
state: info
task: 9172
lane: code-w
issue: "#2247"
Resume handoff for task 9172 (lane code-w held the claim until its lease expired during two long cargo compiles on 2026-11-10; the task has since been re-served — this note leaves the branch in a verified state for whoever holds it now).
State of branch
queue/9172-2247-serve-budgets(pushed, worktree~/git/fleet/9172-2247-serve-budgets):2c717c4480— the implementation (pre-existing):world_protocol_for()inpkgs/id/src/commands/serve.rswires the loaded server config's budgets intoWorldProtocol::with_budgets; no-config keeps thewith_local_nodedefault path.275e20b04c— test fixes from this lane, after running the targeted suite: (1) the new test calledlimits_for_peeron the evaluator — the method lives onBudgetPolicy(abuse.rs), so the call now goes throughstarted.config.budgets(); (2) both new tests were plain#[test]butWorldHandle::spawnneeds a Tokio reactor — converted to#[tokio::test], the crate's pattern in world_net.rs.Verified:
cargo test --manifest-path pkgs/id/Cargo.toml serve_world_protocol— 2 passed, 0 failed (laptop, 2026-11-10T21:5xZ, log test-9172c in the lane scratch). The original blocker is gone: PR #5096 MERGED 2026-11-09T05:26:41Z.Remaining for the current holder: open the PR from the branch (title scope = the serve-side wire; the broader #2247 budget model stays open on this issue), then complete task 9172 as pr_opened. Nothing else is outstanding — no other files were touched.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · done — task 9172 fixed_merged (lane code-l, 2026-11-10)
1f9c97ce78a234121d8a56ce5b1d0459ab9b0957; issue id(comms): budgets — app-wide, per-IP, per-ID, and per-counterparty overrides (P1 of #2032) #2247 CLOSED by the merge. The resume condition was met fresh this shift: blocker PR fix(id): surface per-peer frame/byte abuse counters with direction split (#4918) #5096 merged earlier and issue id: lib test does not compile on main - ChainExt initializers missing rotation field (event_store/sync.rs, log_sync.rs) #7081 is CLOSED.pkgs/id/src/commands/serve.rs, +88/-2):world_protocol_forbuilds the protocol with the loaded config's BudgetPolicy when a server config was given, defaults otherwise, plus two tests. Targeted tests at PR head:cargo test --lib serve_world_protocol— 2 passed (configured policy reaches the protocol and refuses an over-budget peer as BudgetExhausted without disconnect; default policy preserved without config). Current main was merged into the branch cleanly first (headc06163f349); every seam the change calls (WorldProtocol::with_budgets/with_local_node,ServerConfig::budgets) verified present on current main. A merged-tree re-run of the same tests was still compiling at completion under extreme laptop load (load average 93, 100+ concurrent rustc fleet-wide; job cfaf9d8cc38a on the laptop) — the head run is the recorded pass.dezren39 commentedon Nov 10, 2026
Verification follow-up (task 9172, lane code-l): the merged-tree re-run that was still compiling at completion has now finished — laptop job cfaf9d8cc38a,
cargo test --lib serve_world_protocolon the merged headc06163f349: exit 0 (all test binaries ran, no failures). PR #8240's merged tree is test-verified, not just its pre-merge head.