Repository navigation
id: per-account quotas — ownership resolution at the guest-burn charge path (#1067) - #12739
Conversation
…e path (#1067) World→account ownership as decided 2026-11-22: calling account by default, admin registry and creator principal as per-world options, precedence registry > creator configuration > caller. - account_charge (new, id-worlds): ChargeMode, WorldChargeConfig, WorldAccountRegistry (JSON config store, shared install), and the pure resolve_charge_account. Creator mode with no recorded creator is a typed error, never a silent caller fallback. - guest_burn: per-account concurrency bound beside the process-wide one (queue-never-refuse, per-waiter eligibility so one account's bound queues only its own calls), grant order by account attained service then key, per-account counters in the snapshot, charges settling by actual fuel at both levels. acquire() delegates with the key as its own account, so pre-account callers are unchanged. - sandbox: WorldInstance resolves the charge account before admission; a resolution failure fails the call visibly (logged, nothing charged). Composition setters mirror set_charge_key / set_burn_budget. - world_store restore_program installs the shared registry and applies RuntimeLimits::guest_burn_per_account_concurrency (--world-guest-burn-per-account-concurrency; 0 = no bound). Design: doc/2026-11-23_design_id1067-account-quotas.md
|
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 16 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. |
|
Verification addendum from the lane: clippy could not be run to a verdict on the laptop venue. Three configurations (broker-pooled target dir; fresh target dir with the profile cargo; fresh target dir with the rustup-pinned 1.99.1 toolchain end-to-end) all fail in dependency crates with E0514 ("found crate |
Refs #1067 — the per-account quotas slice of F12.10, on the ownership model Drewry decided 2026-11-22 (decision note on #1067). Design:
doc/2026-11-23_design_id1067-account-quotas.md.What lands
Ownership resolution at the charge path (new
id-worlds::account_charge):resolve_charge_accountimplements the decided precedence: an explicit admin registry entry wins; a world configured for creator-principal charging charges its recorded creator; otherwise the calling account pays. A call carrying no caller identity at this layer charges the world's own charge key as its account bucket — visible in the counters, never silently charged to a different account.WorldAccountRegistryis the (b) store: a JSON config mapping ({ "worlds": { "<id>": { "account": ..., "mode": ... } } }), runtime configuration in theRuntimeLimitsidiom — installed once by the serve path (install_shared, first install wins), no admin UI. A malformed file is an error, not an empty registry.ChargeResolutionError::CreatorNotRecorded. At the funnel the call does not run, no permit is taken, nothing is charged, atracing::warn!names the world and reason, and the error propagates as the call's error. No world records a creator yet, so the mode is inert until a creation record lands — by design, and loudly rather than silently if configured early.Per-account enforcement (
guest_burn, beside slice 2's process-wide budget):acquire_charged(key, account, allowance)admits against both the process-wide bound and an optional per-account concurrency bound. Queue-never-refuse preserved; grant eligibility is per waiter, so one account at its bound queues only its own calls (no cross-account head-of-line blocking, no deadlock — every admitted call is fuel-bounded).snapshot()gains per-account counters and the configured bound. The pre-accountacquire()delegates with the key as its own account, so existing callers/budgets are behaviour-identical when no account bound is configured.RuntimeLimitspattern:guest_burn_per_account_concurrency/--world-guest-burn-per-account-concurrency,0= no per-account bound (the default — an unconfigured hub runs exactly slice-2 admission).restore_programapplies it to the shared budget and installs the shared registry on every restored guest.Wiring boundary, stated plainly: the funnel sees participant ids, not accounts — no caller principal reaches
WorldInstancethrough the actor today, and no world records a creator. This slice wires everything downstream of that threading (resolution, enforcement, counters, the instance setter surface mirroringset_charge_key/set_burn_budget); session→actor caller threading is the remaining plumbing, named on #1067.Evidence (laptop, under
fleet-build-lock)origin/mainfail to compile with 10 errors naming the missing surface (acquire_charged,new_with_account_bound, snapshotaccounts,max_concurrent_per_account).cargo test -p id-worlds --features sandbox --lib -- guest_burn account_charge sandbox::— 57 passed, 0 failed, including all 14 new tests: resolution (registry wins / creator / caller / caller-less bucket / creator-less error / registry JSON), budget (per-account isolation, per-account fair grant order, settle-by-actual-fuel, bound clamping), and instance wiring (registry account charged; creator-less guest fails visibly and charges nothing).cargo test -p id-caps --lib— 179 passed.cargo check -p id-cliclean;cargo test -p id-cli --lib— 743 passed, 1 failed:test_command_lists_cover_all_clap_subcommands("README CLI Commands table omitswalk"), which fails identically on pristine main (743/1 there too) — pre-existing fallout from theid walklanding, not this change.Exit shape — not claimed
This slice does not claim #1067's exit criterion. The
fuel_spin_isolationratio gap is attributed inBASELINES.mdto scheduler contention around the burn path (spawn/shutdown churn, the blocking round trip), which a per-account concurrency bound does not govern. What this slice changes: per-account fairness is now real at the funnel — one account's worlds can no longer hold the whole burn pool at once, grant priority has an account axis, and every burn is attributed to an account under the decided ownership model. Remaining on #1067: the hub scheduler, slow-client back-pressure, caller-principal threading to the funnel, and the persistent-spinner profile variant named inBASELINES.md.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.