Skip to content

id(comms): budgets — app-wide, per-IP, per-ID, and per-counterparty overrides (P1 of #2032) #2247

Closed

Description

@dezren39

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.
  • Budget exhaustion is a budget_exhausted refusal with retry_after_ms (from id(comms): per-peer frame/byte accounting + structured rate-limit refusal (P0 of #2032) #2244), not a disconnect.

Done when

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.

Parent: #2056 · Investigation: #2032 · Synthesis: #2033

Activity

  1. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    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

  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — parked — OpenChamber scheduled lane

  7. 509 remaining items

  8. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    Agent note — lane code-t, task 9172

  9. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 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.

  12. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — state: handed_off (task 9172, lane code-t)

  13. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    Lane code-y picked up task 9172 (issue #2247) — handed off to opencode claimant.

  14. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 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.

  15. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    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.

  16. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 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).

  17. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    Task 9172 (issue #2247) — handed off to opencode claimant, lane B shift 2026-11-10.

  18. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  19. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked (dependency wait on #7081)

  20. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    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.

  21. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — task 9172 fixed_merged (lane code-l, 2026-11-10)

  22. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions