> Taken from the Transit Fabric source repository at commit 91be12e (91be12ef98b775c7f045124e6b8c686c15439650, main), file docs/specs/scoring.md. Links into the private source tree are shown as plain text.

# Spec: scoring

Status: draft · Implemented in `crates/bwos-core/src/scoring/mod.rs` · Red-team every change (`incentive-red-team` subagent)

All scoring is **integer fixed-point**. Fractions are parts per million (`ppm`, 1_000_000 = 1.0). Divisions floor. Lists are sorted by UID before any reduction. This makes weights byte-identical across validators and platforms.

## Mechanism 0: transit (`mechid=0`)

Per operator UID `u` in a window:

```
K_u    = Σ over live bound nodes n: scoring_capacity_mbps(n) * G_n / 1e6   # capacity-bonds.md, §Endpoint dedupe
A_u    = uptime ppm (attributed link evidence, [T29]; capacity-weighted over the fleet's nodes)  # measurement.md §Uptime
cap_u  = K_u * A_u^k / 1e6^k          (k = UPTIME_EXP, default 2)

use_u  = Σ over nodes n, classes c:  bytes(n,c) * W_c * Q_n * C_n * G_n / 1e24
         bytes: verified via receipts.md, credited per "Byte crediting" below
         W_c: class weight ppm; Q_n: quality ppm; C_n: coverage ppm (1e6 = no bonus)
         G_n: locational price ppm (§Locational price `G_n`, ADR-0057 proposed); 1e6 for every node
              while GEO_PRICING_ENABLED is false, which it is today

share_u = W * cap_u / Σcap  +  (1e6 - W) * use_u / Σuse        (ppm)
         W = capacity_weight_ppm(..)   (§Capacity weight `W`)
```

If `Σcap` or `Σuse` is zero, that term's weight moves to the other term. If both are zero, the whole mechanism's weight is unearned (§Unearned weight and the first-party UID). While `W = 1_000_000` (before the trigger latches) the usage term has no weight, so it never takes the capacity term's: with `Σcap` zero the whole mechanism is unearned even if some usage was credited (F5).

### Capacity weight `W` (F5, Task 15)

`W` replaces the fixed `ALPHA` (700_000). Capacity carries all of Mechanism 0 pay until real paid traffic exists, then steps down to 70/30 and below (design §3). `run_tempo` computes `W` and ignores `TempoInput::mech0_params.alpha_ppm`, so no input can set it.

**The trigger is gated off (`ALPHA_TRIGGER_ENABLED = false`, fix round 1, red team H2/M1).** While it is off, `W = 1_000_000` in every window and `TempoOutcome::capacity_trigger_latched_at` is always `None`. The latch below is specified and implemented, and tested with the gate on, but no validator runs it. Each validator's latch would come from its own view of the receipts. So validators that saw different batches (`latch_split_brain`), a validator that joined late (`late_joiner_latch`), or one a node withheld a batch from (`receipt_withholder_resets_trigger`) would latch differently, and their weights would disagree from then on. **The gate turns on only after Task 19b commits each validator's per-window attested bytes on chain, and the latch is computed from the stake-weighted lower median of those committed values, never from a validator's local view (OQ-102).** With the gate on and the latch state unknown, `run_tempo` gives **no weights**: both vectors are empty and `TempoOutcome::weights_refused` says why. The state is unknown unless there is a latch record or committed history from window 0 (fix round 2, N2). A run of the last `ALPHA_TRIGGER_SUSTAIN_WINDOWS - 1` windows no longer counts, because it can't tell "never latched" from "latched before the history starts" (sim `late_joiner_latch_gate_on`).

**Preconditions for turning the gate on** (fix rounds 1-2; all of them, in Task 19b or later, OQ-102):

1. **Committed attested bytes.** Each validator's per-window attested bytes are committed on chain. The latch is computed from the stake-weighted lower median of those committed values, never from a validator's local view (H2).
2. **Known latch state (N2).** The latch state counts as known only with a committed latch record, or committed history from window 0.
3. **Withholding (M1).** Either the run counts N of M windows rather than M consecutive ones, or the committed medians above close it (sim `receipt_withholder_resets_trigger`).
4. **What counts toward the trigger (N3).** Today three colluding authorized clients latch it (sim `three_client_latch`). The trigger must instead count the sum over clients of `min(bytes, trigger / ALPHA_TRIGGER_MIN_CLIENTS)`, with a cap per ingress node rather than per session. It must count only bytes that are source-verified by hop digests (ADR-0038) or uploaded by a trusted egress.
5. **Gate-on sims.** Sims that run the gate-on path (`run_tempo_gated(.., true)`) against the committed-median design, as `late_joiner_latch_gate_on` and `three_client_latch` do today.

- **Attested paid bytes (`validator::attested_paid_bytes`, fix round 1 H1).** Only credited `paid` counts: the `paid` the receipt pipeline (§Byte crediting) takes on a creditable production-table route, which needs a co-signed hop receipt on every hop and client coverage after the voucher gate. A bare client receipt therefore attests nothing (sim `authorized_client_latch`).
  - **Per route pair.** The pair counts the lower of the `paid` its paths took and its sessions from clients in `TempoInput::authorized_clients`. Each session is capped at its ingress node's verified capacity for the window (`max_window_bytes`).
  - **Authorized clients only.** With `authorized_clients` `None` or empty the figure is `0`. A client key the validators haven't authorized can sign receipts but never moves the trigger (F5, sim `fake_paying_client`).
  - **A minimum number of clients.** The window's figure is `0` unless at least `ALPHA_TRIGGER_MIN_CLIENTS` distinct authorized clients are behind the counted bytes.
- **The trigger latches (`scoring::capacity_weight_ppm`, with the gate on).** `paid_history` is `TempoInput::paid_bytes_history` plus `(window, attested_paid_bytes)`.
  - **The carried history.** It is sorted by window, entries for `window` or later are dropped, and a duplicated window counts at its lower figure (review M5).
  - **When it latches.** The trigger latches at `window` when the last `ALPHA_TRIGGER_SUSTAIN_WINDOWS` entries are consecutive windows ending at `window`, each at or above `ALPHA_TRIGGER_PAID_GIB` GiB (`2^30` bytes). A gap, or a window below the trigger, before the run completes doesn't latch.
  - **It stays latched.** Once latched (`TempoInput::capacity_trigger_latched_at`, at or before `window`), a dip in paid traffic never returns pay to capacity-only. A `latched_at` after `window` is ignored.
- **The weight.** `W = 1_000_000` until latched, so always while nothing is attested. Once latched, `W = CAPACITY_WEIGHT_LATCHED_PPM` (700_000). If the `CAPACITY_WEIGHT_SCHEDULE` entry with the greatest `from` window at or before `window` is lower, `W` is that entry's ppm instead (on a tie, the lower ppm). The schedule is the published step-down (OQ-5), empty until the founder publishes one.
- **Carried state.** `TempoOutcome` reports `attested_paid_bytes` and `capacity_trigger_latched_at`. Until the gate turns on, the live loop (Task 19b) may carry them like `declaration_history`: append `(window, attested_paid_bytes)` to the next input's `paid_bytes_history` and carry `capacity_trigger_latched_at`. Once it is on, they come from committed medians (above).

### Capacity declarations are verified (S4, Task 15)

`validator::node_declarations` and `validator::declared_capacities` count a declaration only if it is signed by the declaring UID's metagraph hotkey in `uid_hotkeys` (both of them, fix round 1 L2, sim `foreign_key_declaration`) and `CapacityDeclaration::verify` passes: `validate` plus a `hotkey_sig` that verifies over `wire::signing_bytes("capacity-declaration", decl)`. An SS58 hotkey is checked with `identity::verify_sr25519` (64 zero bytes, a missing signature and the all-zero account are refused); a 32-byte hex ed25519 hotkey with `verify_ed25519_strict`. A declaration that fails gives its nodes `0` declared capacity, so they score no capacity (sim `zero_sig_declaration`, `capacity-bonds.md`). Commitment manifests aren't a `TempoInput` field and are verified where they're fetched (Task 19b, D16).

### Byte crediting

`bytes(n,c)` is derived from the verified per-hop receipt totals (`receipts.md`) as follows (`validator::run_tempo`):

0. **Class only from the ends (ADR-0037).** A hop receipt carries one unsplit `total` and no class. Every byte of it starts as unattributed, and its class comes only from client receipts and attestation: the part the route pair's client receipts cover is `paid` (2 and 4 below), and the rest is `free` (5 below). Hop receipts never produce `canary` credit (`bytes(n, canary) = 0` from receipts; canary credit from the validators' own records is OQ-17). Per-class agreement, baselines and the chain check therefore run on the one total. A relay has no class to relabel (sim `class_relabeller`).

   **Order-free crediting (fix round 3, `validator::ingest_credited_hops`).** No path's figures depend on the order paths are processed in or on another pair's receipts. Each active path has a *bottleneck*, the smallest hop total on it.
   - *Baseline bytes* decide flagging only. A hop is inflated when its total exceeds the sum of the bottlenecks of the active paths through it, beyond `RECEIPT_TOLERANCE_PPM`. Honest traffic never trips this: each path carries at most its bottleneck, and a hop's total is the sum of its paths' flows. An inflated hop is credited nothing, and paths through it take no coverage.
   - *`paid`*: within each route pair (paths ordered longer first, then by node path), each path takes the pair's remaining client coverage up to its bottleneck (`reclassify_unverified_paid` slack). Coverage is never shared across pairs, so a covered path never takes more than it is covered for. A hop's `paid` is the sum of its paths' takes, capped at its total.
   - *`free`*: without an allowlist, a hop's `free` is its total less its `paid`. With one, see step 5.
   - *Weight bytes* (step 7) are each path's own `paid` and `free` takes, so with the allowlist an unattested route weighs nothing.

   This replaces the greedy pass that let a covered 1-hop route swallow a shared hop and get it flagged (F1, sim `covered_one_hop_swallow`), let a 1-hop route's inflated weight carry a regret-gated path's bytes (F2, `one_hop_weight_regret_bypass`), and let a covered path take another path's share (F3). Uncovered traffic never marks an honest hop inflated (`one_hop_free_griefer`). Colluding hops hiding inflation behind a 1-hop route gain nothing with an allowlist, and without one no more than fabricating on that route alone (`adjacent_hops_hide_inflation`, threat-model T16). A seeded property test over 500 random small tables, with the allowlist on and off, checks that honest traffic never flags a hop and that a forged 1-byte client receipt never lowers any hop's weighted credit. Node credit there runs with random regret gates and dedupe groups, some pairs have two paths, and a gated route that carries nothing must not lower anyone's credit either (step 7, fix round 4). Per dedupe entity, the only change it allows is `[SCR-10]`'s per-class floor remainder: one byte of each class per incident hop.

1. **Positive-gain routes only (`[SCR-9]`).** Before receipt ingest, the production table is evaluated exactly as a Mechanism 1 submission of the production solver (`evaluate_solver_table`, against the snapshot of the table's preceding window). Overlay routes whose gain is negative, SLA-failed or unmeasurable (`gain_p < 0`) are removed from the table used for crediting, so no Mechanism 0 credit is paid for detours that make a pair worse than direct.
2. **Once per path (`[SCR-10]`).** A hop's credited bytes are divided (per class, floor) by the hop count `L` of the longest active path through it, then split between the hop's `up` (floor half) and `down` (remaining half) node. A byte carried across an `N`-node path is credited `1/(2(N-1))` to each endpoint and `1/(N-1)` to each interior node, so lengthening a path through self-owned interior nodes never increases the total credited.
3. **Capacity bound (`[SCR-11]`).** A node's credited bytes (all classes) are capped at `scoring_capacity_mbps * 125_000 * WINDOW_BLOCKS * BLOCK_SECONDS` (`scoring_capacity_mbps` = verified capacity after §Endpoint dedupe) (bytes it could physically carry in a window), scaling every class by the same ratio (floor). A node with `0` verified capacity is credited nothing: co-signed receipts between one operator's own nodes prove nothing beyond what a capacity test has shown.

4. **Trusted voucher issuers (`[T16]`/`[T20]`, `traffic-verification.md` TV-28).** When `TRUSTED_VOUCHER_ISSUERS` is non-empty, `paid` coverage needs a trusted-issuer `BandwidthVoucher` quota for `(client, egress)`; uncovered `paid` bytes become `free`. Each voucher backs at most its price-floored `effective_max_paid_bytes()` (`MIN_VOUCHER_ALPHA_PER_GIB`), never its raw `max_paid_bytes`.
5. **Attested `free` (`[T16]`, Pass-7).** When `TRUSTED_VOUCHER_ISSUERS` is non-empty (`VoucherPolicy::attest_free`, set by `run_tempo`), `free` bytes on a hop (including uncovered `paid` reclassified as `free`) are credited only up to the end-to-end flow covered by **issuer-attested** client receipts of the route's `(ingress, egress)` pair: client receipts that the trusted egress itself uploaded (`batch.node == egress`, `egress` in the allowlist), less the `paid` bytes already covered on that pair. The pool is computed per session (attested bytes less what that session covers as `paid`), so another session's receipt never shrinks it. It is shared over the pair's paths in the `paid` order, each path taking `min(bottleneck - its paid, remaining pool)`, starting from `pool + pool * RECEIPT_TOLERANCE_PPM / 1e6`. A hop's `free` is the sum of its paths' takes, capped at its total less its `paid`. Colluding transit UIDs on an assigned route between their own nodes therefore earn no `free` credit. Receipts never yield `canary` (step 0), so no hop byte escapes this check as `canary`. With an empty allowlist `free` is credited as before. Consequence: with the allowlist on, `free` traffic on pairs that do not end at a trusted exit earns nothing (open-questions OQ-23).
6. **Route regret gating (`[T23]`, Pass-7).** Every overlay `path` of the production table gets a credit multiplier (`validator::route_regret_credit_ppm`, keyed by node path; when several class routes share one node path the path gets the **mean** of their multipliers (floor), because hop receipts carry no QoS class (ADR-0037; `ClientReceipt.class` is not used to weight the mean yet, because the client and both ends can collude on it) and every pair has the same `demand_mbps_per_pair`, so each class route accounts for an equal share of the path's bytes; taking the minimum let a dealer zero an honest relay's bulk credit by also assigning a regretful class to the same path; residual (Pass-7 round 3): the production solver can still halve an honest relay's credit on all of a path's bytes by assigning one extra regretful class route to that path, at a Mechanism 1 cost of only that route's regret divided by the number of scored pairs, open-questions OQ-23): `1e6` when `route_metric <= best_metric * (1e6 + ROUTE_REGRET_TOLERANCE_PPM) / 1e6`, else `0`, where `route_metric` / `best_metric` are Mechanism 1's `RouteRegret` for that `(src, dst, class)` (the class's scored metric: `route_predicted_us`, or for `realtime` the reference realtime metric `Σ (hop_cost + 2 * jitter_us)`, Pass-7 round 4) (`routing::table_route_regrets` on the same snapshot, demand pairs and `demand_mbps_per_pair` as the evaluator, `routing.md` §Route regret), so both mechanisms use one comparator: the fastest path that meets the class's hard limits, is capacity-feasible given the loads of the table's *other* routes (a capacity-aware detour around a full relay is not regret) and is no worse on the class's other scored attributes. A primary Mechanism 1 does not list (invalid, or no `direct` entry) gets `0`. When this window's failed-link set is non-empty, every route whose primary crosses a failed link and has a `backup_path` is re-scored the same way on a failover view (backup substituted as the path, failed links removed from the snapshot) and its backup gets the resulting multiplier; backups of healthy primaries are never credited (TV-08). This removes the Mechanism 0 profit of pushing top-quartile pairs (trimmed by `GAIN_TRIM_TOP_PPM`) through one's own nodes (sim `top_quartile_dealer`).
7. **Per-path apportionment and entity dedupe (`[T23]`, Pass-7).** Each hop's `[SCR-10]` up/down halves are apportioned to the active paths through the hop by each path's weight bytes `w_i` (its own `paid` and `free` takes, step 0), and each path's portion is scaled by its regret multiplier `m_i` (ppm). On each path, nodes that share an operator UID or an endpoint dedupe group (`scoring::diversity_groups` of `TempoInput::node_diversity`, §Endpoint dedupe) form one entity, and only the member with the largest credit on that path (ties: smallest node key) keeps its credit for that path; the other members are *suppressed* on it. N keys on one host, or one UID's nodes spread along a path, earn a path's credit at most once (was `(N-2)/(N-1)` of it).
   - **Forfeit only real flow (fix round 4).** Weight bytes are upper bounds: a path's bottleneck can count a neighbour path's bytes on the same hop, so `Σ w` over a hop can exceed what the hop carried. On hop `k` with credited bytes `C_k` (all classes, before the `L` division) and `T_k = Σ w_i` over its active paths, an endpoint keeps the fraction `min(1, Σ_{eligible i} w_i·m_i / (1e6 · min(T_k, C_k)))` of its half, where the eligible paths are those it is not suppressed on (`u128`, per class, floor; exactly the half when the numerator reaches the denominator). When `T_k <= C_k` this is the plain proportional split. When paths over-claim, a gated or suppressed path forfeits only `C_k − Σ eligible weight`, not a share of the borrowed weight: a gated path that carried nothing costs honest endpoints nothing. If every path's weight is 0 the hop splits evenly over its paths (weight 1 each, denominator the path count). The keeper's credit estimate on a path uses the same denominator, `half · w_i / min(T_k, C_k)` per hop. Sim `borrowed_weight_gate_griefer` (threat-model T23): before this, a gated zero-flow 1-hop beside an honest 2-hop cut the honest ingress's credit by 50% and the relay's by 25%, a forged voucher receipt did the same under the allowlist, and `n` gated paths cut an honest endpoint to `1/(n+1)`.
   - **Residual, gated-flow escape (T23 P1; LOW with the allowlist).** The other side of the same rule: an eligible path's borrowed weight can now cover a gated path's real flow on a shared hop. With the allowlist an eligible path weighs only its coverage and attested `free`, so the capture is bounded by the voucher bytes bought for it: at most `Q·(1+RECEIPT_TOLERANCE_PPM/1e6)` per shared hop for a voucher of `Q` bytes (sim `one_hop_weight_regret_bypass`). Without the allowlist, a gated path's `paid` flow on hop `k` escapes the gate by up to `min(gated flow on k, Σ eligible borrowed weight on k)`, so up to its full flow, and the escaped bytes are credited at `W_PAID`, not `W_FREE`. Honest busy neighbours trigger it with no attacker (sim `gated_flow_borrowed_escape`, payoff 1.0x ungated, roadmap PB-32). With the allowlist it stays at most `Q·(1+tol)`.

### Endpoint dedupe (`[T24]`)

Every node is put in exactly **one** dedupe group (`scoring::diversity_groups`): nodes whose public endpoint has the same IPv4 /24 share a group; an IPv6-only endpoint is grouped by its IPv6 `/IPV6_DEDUPE_PREFIX_LEN` (/32, conservative reading: /48s are operator-selectable, e.g. tunnel brokers hand out free /48s from their own /32 to unlimited accounts, and a /48 holder already has 65_536 /64s). Honest IPv6-only operators inside one provider /32 are therefore pooled together (OQ-20). A node with an IPv4 endpoint is grouped by its /24 only, even if it also reports IPv6. There is **no** transitive closure across prefixes or address families, so a node with an address in X's /24 and another in Y's IPv6 prefix cannot merge X's and Y's groups (red-team bridging exploit). Endpoint metadata comes in as `TempoInput::node_diversity` (`node -> NodeDiversityMeta {ipv4_prefix24, ipv6_prefix64, asn, unknown}`); an empty map disables dedupe and scoring is unchanged. Groups span UIDs. **Fail-closed (Task 4B fix rounds 1 and 3, red team F2, finding 1):** once endpoint dedupe is on (the batches carrying endpoints meet the stake quorum, `measurement.md` §Probed endpoints, "Dedupe"), a live node with verified capacity and no endpoint gets **zero scoring capacity**: it adds nothing to `K_u` (`validator::endpointless_nodes`). It keeps usage credit for bytes on assigned paths, capped at its own verified capacity, and is its own group. It can't escape dedupe by having no committed endpoint, and endpoint-less nodes are never pooled with each other, so stuffing such a pool takes nothing (sim `unknown_group_stuffer`).

`node_diversity` MUST be derived by each validator from the endpoint address it actually probes (the probe target / WireGuard endpoint it connects to), never from operator self-reports: a self-reported prefix lets an operator claim a fresh /24 per node. The reference `bwos-validator` daemon used to load it from `--diversity-file` (M4-07); since Task 4B fix round 1 that flag is refused. ADR-0039 replaces the file: each validator commits the endpoints it saw in its `ProbeResultBatch`, and `node_diversity` is built from the stake-aggregated endpoint, so it is a committed input and every validator computes the same groups (Invariant 1). See `measurement.md` §Probed endpoints; Phase B Task 4B implements it, and a validator falls back to the previous window's endpoint for one window (OQ-79). Nothing fills the endpoints in the daemon yet (roadmap PB-06, "endpoint producer"), so dedupe is off in production until a producer lands.

- **Pooled capacity** (`scoring::dedupe_diverse_node_capacities`): a group is credited at most the **largest single verified capacity** among its members (one shared uplink can pass N sequential capacity tests, OQ-18), split back to members pro rata to their verified capacity (`u128`, floor): `scoring_capacity(n) = verified(n) * max_group / Σ_group verified` when `Σ_group verified > max_group`, else `verified(n)`. This conservative reading underpays honest operators with separate uplinks in one /24, and a node genuinely co-located in a victim's /24 is pooled with it (symmetric: the co-located node is pooled down by the same factor). **Cohort credit (`[T28]`):** `max_group` is replaced by `max(max_group, max over cohorts C of min(cohort_verified(C), Σ_{n∈C} verified(n)))` over every cohort `C` whose members are all positive-capacity members of the group, where `cohort_verified(C)` is the rolling simultaneous cohort-test aggregate of exactly that membership (`measurement.md` §Cohort capacity tests, `TempoInput::cap_cohort_history`, `capacity-bonds.md` §Endpoint dedupe); cohorts are never summed. `scoring_capacity` feeds `K_u` and the `[SCR-11]` byte cap; the routing snapshot keeps per-node verified capacity.
- **Group usage cap** (`scoring::mech0_shares_grouped`): each node's usage term is summed per dedupe group (nodes without metadata form one entity per UID), the concentration cap below runs on the group shares (bounded redistribution), each group's capped share is split back to its nodes pro rata to their usage terms (floor), node shares are summed per UID, and the concentration cap runs again per UID. A whale that splits one pipe into N UIDs inside one /24 or /48 hits the same cap as one UID (sim `prefix_sybil_splitter`: 1.000x one UID for a /24 split and for a split over four tunnel-broker /48s in one /32, pre-fix 1.772x). Residual (co-location griefing): an attacker node genuinely hosted in a victim's /24 is pooled with it, e.g. halving a 1 Gbps victim with a 1 Gbps attacker node, at the cost of the attacker node's own capacity term.
- **Policy cap (PB-23 fix round 1, red team F3).** After dedupe, a node with an operator policy in the window's committed snapshot (`routing.md` §Operator policy) is credited `scoring_capacity = min(deduped capacity, max_transit_mbps) * admitted_ppm / 1e6` (`u128`, floor; `scoring::policy_capped_capacities`). `admitted_ppm` is the share of the other live nodes its `allowed_peers` names, `1e6` without `allowed_peers` or with no other live node. Naming fewer than two of at least two others gives `0`, since a relay needs one peer in and one out. So `max_transit_mbps = 0` or an empty `allowed_peers` earns no capacity credit, and a node can't be paid for capacity its policy keeps from solvers (sim `policy_capacity_farmer`). The cap feeds `K_u` and the `[SCR-11]` byte cap, like dedupe. It adds no parameter.
- **ASN alone does not group** nodes for capacity or the usage cap: many independent honest operators share a transit ASN, so ASN grouping would pool unrelated capacity. Under ADR-0039, `NodeDiversityMeta.asn` is the node's underlay ASN (`measurement.md` §Underlay, IXPs and shared-risk groups), used by the diversity term (§Coverage) and not for grouping. The endpoint behind `node_diversity` is the stake-aggregated probed endpoint committed in validators' batches (`measurement.md` §Probed endpoints), so every validator builds the same groups.

### Quality `Q_n`

```
lat_ppm  = min(1e6, predicted_us * 1e6 / measured_us)        # 1e6 if measured <= predicted
loss_ppm = 1e6 - min(1e6, loss_ppm_measured * LOSS_MULT)
Q_n      = lat_ppm * loss_ppm / 1e6
```

`predicted_us` is computed deterministically by validators from the window's topology snapshot link latencies along the production path (`routing::route_predicted_us`), never trusted from an unverified solver-supplied `est_us`. Median across the node's sampled paths.

### Coverage `C_n`

**Before Phase B Task 4B (v0).** `C_n = 1_000_000` ppm (1.0x) for every node.

**Since Task 4B.** `run_tempo` sets each node's `coverage_ppm` to the `C_n` below. It computes `diversity_ppm` over `current_snapshot`'s nodes, the snapshot built at the end of the previous window from that window's agreed records and aggregated endpoints. A node missing from `current_snapshot` gets `C_n = 1e6`.

**ADR-0039: the diversity term.** It replaces OQ-3's bonus table. Its inputs come from agreed, committed outside evidence and the node's own committed endpoint (`measurement.md` §Underlay, IXPs and shared-risk groups), never from operator reports:

```
up_part   = DIVERSITY_WEIGHT_PPM     if |upstreams(n)| >= 2 else 0
ixp_part  = IXP_PRESENCE_WEIGHT_PPM  if |ixps(n)| >= 1      else 0
shared    = some node m in the window's snapshot with m.uid != n.uid, verified capacity(m) > 0,
            and srg(n) ∩ srg(m) non-empty
diversity_ppm(n) = (up_part + ixp_part) * (1e6 - (SRG_SHARED_PENALTY_PPM if shared else 0)) / 1e6   (floor)
C_n       = min(C_MAX, 1e6 + diversity_ppm(n))
```

`scoring::diversity::diversity_ppm(node, all) -> u64` is a pure function of the snapshot's `routing::Node`s, whose `capacity_mbps` is the verified capacity.
- **No underlay ASN, no bonus.** A node without an underlay ASN has no upstreams, IXPs or SRGs, so `diversity_ppm = 0`. That includes an ambiguous underlay, where several RPKI-valid origins share the longest prefix (`measurement.md` §Underlay, "Ambiguous underlay", T82).
- **Saturation.** A second independent upstream earns the full `DIVERSITY_WEIGHT_PPM`, and IXP presence earns `IXP_PRESENCE_WEIGHT_PPM`. A third upstream or a second IXP adds nothing. An upstream faked with a tunnel through the first provider, which public data can't tell from real multihoming, therefore earns at most one upstream's credit (`measurement.md` §Underlay, "Not covered").
- **Rarity, counted against real nodes of other UIDs (red team RT7).** Sharing a network or a single upstream costs `SRG_SHARED_PENALTY_PPM`, but only with a node of another UID that has verified capacity. A zero-capacity key can't cut a victim's bonus (sim `srg_zero_cap_griefer`), and an operator's own fleet in one network doesn't penalise itself.
- **Low weights at launch (controller ruling 1).** Upstream evidence is weak until traceroute or failure-correlation evidence exists (OQ-39). The two weights are therefore 50_000 ppm each, so `C_n <= 1.1x`, well below `C_MAX`.
- **Usage term only.** `C_n` multiplies only the usage term `use_u`, a node's own credited bytes. Diversity is therefore paid only on carried traffic, never on capacity tests.
  - **When the founder's direction takes effect.** The direction that "pay rewards diverse, well-connected upstreams" (design §4.5a) takes effect once carried traffic exists. While Mechanism 0 pays on capacity alone, diversity earns nothing directly, and it shapes routing only through `resilient` SRG validity (`routing.md` §Validation).
  - **Founder confirmation.** The founder is asked to confirm this, or to apply diversity to capacity pay too and accept the gaming risk (OQ-40).
- **No gain from splitting.** It multiplies a node's own bytes, so splitting a node into many keys can't multiply it.

Residuals:
- **SRG griefing.** A griefer that runs a tested, positive-capacity node of another UID in a victim's network halves the victim's bonus, at the cost of that node (threat-model T46).
- **Inherited carrier diversity.** Home and CGNAT nodes inherit their carrier's upstreams and IXPs (T47).

### Locational price `G_n` (ADR-0057, proposed)

**Not scored yet.** `scoring::geo::GEO_PRICING_ENABLED` is `false`, so `G_n = 1_000_000` for every node and nothing below changes weights. The pure helpers live in `bwos_core::scoring::geo`. The sims `geo_*` drive them (threat-model T185-T198). PB-44 wires them into `run_tempo`, after the incentive red team.

**Inputs.** All committed:
- **Placement.** The node's region, or none, and its consecutive placed windows, from `measurement.md` §Network position. Carried in the snapshot built at the end of the window.
- **Prior.** Each region's prior, computed by every validator from the dataset `REGION_TABLE` names by SHA-256. `prior_r` is the sum of Internet users over the economies the committed ISO 3166-1 map assigns to `r` (`geo::prior_from_users`; APNIC Labs per-economy user estimates).
  - **The yearly update.** Each region's share moves at most `GEO_PRIOR_MAX_STEP_PPM` toward the new figure (`geo::step_prior_ppm`).
  - **What needs an ADR.** Changing the dataset or the map.
- **Demand.** The window's committed demand set.
- **Capacity.** Each live node's `scoring_capacity` (§Endpoint dedupe, the policy cap and, once merged, the usable-capacity cap, ADR-0057 §6), and a placed node's **in-region capacity** `I_n` (`measurement.md` §Network position): what tests from in-range sites of its region measured.

**Demand.**
- **Attribution.** Only **non-synthetic** demand entries with a demand figure count (`need_mbps`, or the validator-observed aggregates of ADR-0053 M7). Each entry's Mbps goes half to each end's region (`src` gets the floor half), and an unplaced end's half is dropped (`geo::attribute_demand`).
  - **Never node-derived demand.** Today's all-pairs `direct:` demand grows with node count, which an operator controls, so it is never counted.
- **Target.** With `w = GEO_PRIOR_WEIGHT_PPM`, `t_r = (w * prior_share_r + (1e6 - w) * matrix_share_r) / 1e6` (shares ppm, floor). It is `prior_share_r` when no matrix demand is attributed (`geo::demand_target_ppm`).
- **Smoothing.** `d_r = d_r' + (t_r - d_r') * GEO_DEMAND_SMOOTH_PPM / 1e6` (`i128`, the step truncated toward zero). `d_r'` is the previous snapshot's figure, and a region without one starts at `t_r` (`geo::smooth_demand_ppm`).

**Price.**

```
S_r     = Σ min(scoring_capacity(n), I_n) over live nodes placed in r
ΣS      = Σ scoring_capacity(n) over every live node, placed or not
Σd      = Σ_r d_r
price_r = clamp(d_r * ΣS * 1e6 / (Σd * S_r), GEO_PRICE_MIN_PPM, GEO_PRICE_MAX_PPM)    (u128, floor)
        = GEO_PRICE_MAX_PPM when S_r = 0
G_n     = price_r                                  placed in r for >= GEO_PROBATION_WINDOWS windows
        = min(price_r, GEO_PROBATION_PRICE_PPM)    placed in r for fewer
        = GEO_PRICE_MIN_PPM                        unplaced
        = 1e6 for every node                       empty REGION_TABLE, Σd = 0 or ΣS = 0
```

`geo::region_prices_ppm` computes the prices and `geo::node_price_ppm` gives `G_n`. Priced values are `geo::priced(v, G_n) = v * G_n / 1e6` (`u128`, floor).

**Priced capacity** (red-team revision 1, T196). A placed node's capacity counts at `G_n` only up to its in-region capacity:
- **The formula.** `priced_cap(n) = priced(min(c, I_n), G_n) + priced(c - min(c, I_n), GEO_PRICE_MIN_PPM)`, with `c = scoring_capacity(n)` (`geo::priced_split`).
- **Unplaced nodes.** They have no `I_n`, so it is `priced(c, GEO_PRICE_MIN_PPM)`.
- **Where `I_n` comes from (revision 2).** Dedicated full-rate in-region tests, each counted only if its own lowest RTT is within its site's radius, carried between tests for up to `GEO_INREGION_MAX_AGE_WINDOWS`, and pooled per UID and per origin ASN within the region (`measurement.md` §Network position).
- **Credited bytes.** They are priced at the same effective ratio, `bytes * priced_cap(n) / c`.
- **Why.** Only an in-region test's own RTT proves the measured box is inside the region. Capacity seen only from elsewhere may be a different box behind the same endpoint (an anycast front).

**Where it applies.**
- **Capacity.** Each node's `priced_cap(n)` replaces `scoring_capacity(n) * G_n / 1e6` in `K_u`, so `A_u^k` multiplies priced capacity. Under PB-38, it is each node's capacity credit.
- **Carriage.** Each node's credited bytes, after the `[SCR-11]` byte cap, are priced in `use_u`. Under PB-38, it is verified canary carriage. Canary allocation is not priced.
- **Total unchanged.** Both terms are normalised by their own sums, so prices only move pay between UIDs. The total is unchanged up to floor dust (sim `geo_total_conserved`).

**How it interacts with the rest.**
- **`C_n`.** Independent and multiplicative.
- **Dedupe and the policy cap.** Run first. `S_r` and pay both use the deduped figure.
- **`[SCR-11]`.** The byte cap stays on unpriced capacity.
- **Usage concentration cap.** Runs on priced shares, after pricing.

**Properties** (ADR-0057 §3-4; sims, results in the PB-44 report):
- **Region pay is demand share.** Without clamps, `S_r * price_r = d_r * ΣS / Σd`, so a region takes exactly its demand share, and a node's share within it is `K_n / S_r`.
  - **Splitting is linear.** It never gains (`geo_sybil_split`, worst 1.000000).
  - **Withholding lowers the withholder's fraction.** Its region's total never rises. Clamps keep both (`geo_location_spoof` withholding, best 1.000).
- **Delay can only unplace.** With a valid table, delay can make a one-box node unplaced, never place it elsewhere (measurement.md). Unplaced pays `P_MIN`, at or below every price.
- **More boxes under one key don't pay** (T196). Session fronts aren't source-matched (exact IPv4 address, IPv6 /64), peer links come only from the endpoint, and capacity is priced above `P_MIN` only where a dedicated in-region test's own RTT proves the box is in the region (`geo_split_session_front` 0.790, `geo_endpoint_front` 0.213, `geo_anycast_front` 0.923, `geo_v6_prefix_front` 0.790; before up to 1.523).
- **A shared in-region box counts once** (T198). In-region capacity is pooled per UID and per origin ASN within a region by a simultaneous cohort test (`geo::pool_in_region`, `geo_shared_inregion_box` 0.988; 1.094 unpooled, and 1.094 for 8 UIDs with 8 ASNs, the residual).
- **One validator can't place or unplace a node.** Placement needs two independent sites in range, a site's figure a strict stake majority, and every covered location has three independent sites (`geo_site_collusion` 1.000, `geo_site_denial` 1.000; two colluding validators place a node, 1.175, T187).
- **Silence and short gaps don't cost an honest node.** It is carried while its region's silent sites could still place it, and a gap of up to `GEO_GAP_WINDOWS` keeps its placed-window count (`geo_site_outage`, `geo_city_site_outage`).
  - **Others' prices don't fall.** `ΣS` counts unplaced nodes, so no other region's price falls when a node unplaces itself. Its normalised share therefore can't rise (`geo_location_spoof`: 129 delay patterns x 2 schedules, best 1.000, 0 placements outside the true region).
- **A desert pays at most baseline.** `d_r = 0` gives `P_MIN`, and `Σ K G >= P_MIN * Σ K`, so a node there earns at most its unpriced share (`geo_demand_desert`).
- **No supply memory.** Demand is the only smoothed input. Prices have no memory of supply, so no past action of a node moves a later price.
  - **The pump it closes.** A price moving average would let a whale withhold for one window and collect the lag: 1.0117x honest at α = 0.1, against 0.9973x memoryless (`geo_price_stability`).
- **Probation is the hysteresis.** It only lowers pay.
- **Stability.** Operators choosing regions play an exact-potential congestion game, so moves that each improve their mover converge with no cycle (`geo_price_stability`).

**Price map.** The snapshot carries `region_prices`, one row per region in id order: `{region, demand_ppm, supply_mbps, supply_share_ppm, price_ppm}` (`geo::price_map`). It is public and recomputable from committed data, for the dashboard.

**Residuals.** Threat-model T187-T198. The main ones:
- **Validator site collusion** (T187).
- **Unusable capacity paid at a scarce region's price** until the usable-capacity cap merges (T189). PB-44 MUST NOT enable pricing before then unless `GEO_PRICE_MAX_PPM` is held at `1e6`.
- **Herding** (T190).

### Concentration cap

Usage shares `use_u / Σuse` (ppm, after `proportional_ppm`; first per dedupe group, then per UID, when §Endpoint dedupe is active) above `USAGE_SHARE_CAP` are clipped and the clipped excess `E` is redistributed with a **bounded** water-fill (`apply_share_cap_bounded`, `[SCR-1]`):

1. `E` is handed out pro rata to the **pre-cap** shares of UIDs strictly under the cap, but no UID may end above `min(USAGE_SHARE_CAP, pre_cap * USAGE_CAP_REDIST_MULT_PPM / 1e6)` (at most 10 rounds, floor division).
2. Whatever part of `E` no under-cap UID can absorb returns to the clipped UIDs pro rata to their clipped amounts (floor).

The cap is always evaluated; there is no minimum-UID-count trigger. A count trigger let three dust UIDs carrying a few bytes each switch the cap on and absorb ~75% of the usage term (sim `dust_cap_harvester`). With bounded redistribution no UID earns more than `USAGE_CAP_REDIST_MULT_PPM / 1e6` times its measured usage share, and the cap never burns usage.

### Snapshot inputs: one node per ASN (ADR-0033 item 4, PB-04)

The next window's snapshot (`validator::build_snapshot_and_demand`) takes the live nodes, their verified capacities and the aggregated metrics, the committed snapshot it follows (`TempoInput::current_snapshot`), and each node's binding commitment as the chain included it (`TempoInput::binding_committed_blocks`: the block, and the hash of the block after). Every node's overlay ASN is its key's (`identity::node_asn_from_public`), and route origin validation trusts the snapshot to say which ASN originates which `/128` (`datapath.md`), so a snapshot MUST NOT hold two nodes whose keys derive to the same ASN. Who keeps an ASN is decided by `validator::resolve_asn_claims` (ADR-0033 item 4 and its amendment of 2026-11-02), from committed inputs only, so every validator decides the same (Invariant 1):

- **Claims.** A snapshot carries `asn_claims`: per ASN, the node holding it, its UID, its `first_commit_block`, its `tie`, and the last snapshot window it was in (`routing::AsnClaim`). A UID holds at most `MAX_FLEET_NODES` (1024) claims: past that, the claims whose node was in a snapshot longest ago are dropped first, then the lowest ASN, so one UID rotating keys can't grow the signed snapshot past `MAX_OBJECT_BYTES` (`threat-model.md` T84). A claim is kept for `SNAPSHOT_INCUMBENCY_WINDOWS` windows after its node was last in a snapshot, whether the node's binding or consent lapsed or it was quarantined, so its ASN isn't free while it's out. A node in the committed snapshot without a claim (a snapshot from before claims) is given one, so incumbency always comes from the committed snapshot.
- **Ranking.** At each ASN, the contenders are its live nodes and its claim's holder, live or not. The earliest binding commitment wins: the holder's `first_commit_block`, or the block in `binding_committed_blocks`. Two in one block go to the lower `identity::asn_tie(block_hash_after, node_key)`, the hash of the block after the commitment's, which nobody knew when committing and which is fixed once, never redrawn per window. A grinder can't commit before it has seen its victim's key, so it always ranks after it, incumbent or newcomer; nodes serve their binding object only once its commitment is included (`run-a-node.md`). A claim with no block, made before the chain read existed, outranks everyone, and a node with no commitment known ranks last. If nothing tells the best contenders apart (newcomers with no commitments known), every live node at the ASN is left out: until Task 19b fills `binding_committed_blocks`, that is the rule for newcomers, and incumbency the only one for anyone else.
- **The builder refuses a collision**, naming both keys and the ASN: `SnapshotError::AsnCollision { node, with, asn }`, `node` the live node that lost and `with` the winner (or, when nothing decides, the lowest key at the ASN). Errors come in ASN order and then key order.
- **Losers are left out.** `run_tempo` leaves out every live node that lost its ASN and builds the snapshot from the rest, carrying the claims: the winner's (keeping its first block) and every held claim no kept node took. Every collision is listed in `TempoOutcome::snapshot_errors`, so the operator of the node left out is told to rotate its node key, rather than the node silently dropping. A node left out is also purged from the next production table, as a quarantined one is, so a table can't route through a node no peer can check the origin of.
- **Nothing else changes.** A node left out still scores this window on what it carried; it is only absent from the next snapshot and table. With about 95 million ASNs the odds of any collision at 1,000 nodes are about 0.5% (ADR-0033). A collision can be ground on purpose (about 95 million keys for a chosen ASN), but the grinder's commitment is always later than its victim's: sims `asn_incumbent_evict`, `asn_grind_newcomer_block` and `asn_squat_after_lapse` (`threat-model.md` T83).

### Measurement work (ADR-0055; proposed, gated off)

A capped slice of Mechanism 0 pays validators for measuring, so that measuring beats copying the revealed inputs (T175). It is implemented as pure helpers in `scoring::measurement_work`. `run_tempo` doesn't call them while `VALIDATOR_WORK_ENABLED` is `false` (ADR-0055 §8).

- **Inputs, per counted validator `v` (`WorkEvidence`).**
  - `s_v`: its `probe::canary_stake_shares` entry. Owner and buyback hotkeys have none.
  - `paid_uid`: the UID of the measurer hotkey named in its manifest, resolved in the metagraph **at the block the weights are set**, so the weight lands on whoever holds the hotkey's UID then (ADR-0055 §5). It is none, and `v` is unpaid, when no measurer is named, the hotkey isn't registered at that block, or it is `v`'s own hotkey, another counted validator's hotkey, the owner's hotkey or a buyback hotkey. Several validators MAY name one measurer; its share is the sum of theirs.
  - `entries[k]` per category `k` (`WORK_CANARY`, `WORK_CAP_TEST`): one `WorkEntry` per canary entry and per seat, each with its signing nodes' UIDs, its allocated bytes `a_e` and its verified bytes `d_e` (`measurement.md` §Measurement work; seats from `cap_test_seat`).
  - `own_uids`: UIDs whose coldkey is `v`'s coldkey; `refused`: one of `v`'s attestation keys is a bound node key (`attest_key_is_node`).
- **Work fraction.** `f_v = Σ_{e not own} min(d_e, a_e) * 1e6 / Σ_e a_e` over every entry of both categories (`u128`, floor; 0 when nothing is allocated or `refused`; `work_fraction_ppm`).
  - The cap is applied per entry and per seat by `work_fraction_ppm` itself, so overflow on one entry can't fill another's loss (sim `validator_canary_spam`, whose spammer is uncapped).
  - Own entries stay in the denominator and verify nothing (T184, sim `validator_own_fleet`).
  - It is weighted by bytes, so every allocated byte is worth the same.
- **The slice, indexed and steered (fix round 1 item 4, OQ-140).** Committed data only:
  - `A_total = Σ_v Σ_e a_e`, the window's allocated measurement bytes (`total_allocated_bytes`);
  - `slice = clamp(k * A_total / WORK_REF_BYTES, WORK_SLICE_MIN_PPM, WORK_SLICE_MAX_PPM)` (`u128`, floor; `indexed_slice_ppm`), so the slice follows measurement cost as the fabric grows;
  - `k` starts at `WORK_K_START_PPM` and is carried window to window in `TempoOutcome.work_k_ppm` (passed back as `TempoInput.prev_work_k_ppm`). At window `w` with `w % WORK_CONTROL_PERIOD_WINDOWS == 0`, given `TempoOutcome.work_participation_ppm` of the 24 windows before it (passed back as `prev_work_participation`), it steps by `WORK_K_UP_PPM` when their floor mean is below `WORK_PARTICIPATION_TARGET_PPM`, by `WORK_K_DOWN_PPM` when it is above target plus `WORK_PARTICIPATION_MARGIN_PPM`, and is clamped to the slice bounds (`next_work_k_ppm`). With fewer than 24 windows of history it doesn't step;
  - `work_participation_ppm = Σ_v min(s_v, 1e6) * f_v / 1e6` over every counted validator, paid or not (`participation_ppm`).
- **Work share.** `work_v = slice * min(s_v, 1e6) * f_v / 1e12` (floor; `validator_work_shares`), summed per `paid_uid`.
  - It is never renormalised over the validators that did work, so a validator gains nothing when another fails.
  - The total is at most `min(slice, WORK_SLICE_MAX_PPM)`.
- **Mechanism 0 with the slice.** `mech0_u = op_u * (1e6 - Σ work) / 1e6 + Σ_{v paid to u} work_v` (floor; `mech0_with_work`).
  - `op_u` is the operator share **after** the concentration cap (§Concentration cap). Work shares are added after it and are not capped by it: their total is bounded by `WORK_SLICE_MAX_PPM`, and a measurer UID earns nothing from usage.
  - The part of the slice no validator earned stays with the operators, so nothing is unassigned.
  - With no operator share earned, the result is empty and Mechanism 0 is refused as before (§Unearned weight).
- **What it guarantees.** These are sim results, in the base and bear economics.
  - **Against a copier.** An honest validator's profit after bandwidth beats a copier's at equal stake, and a "shirker" that skips capacity tests doesn't beat it either (`validator_free_rider`).
  - **Against faked work.** Work faked with colluders holding a share `c` of capacity saves at most `c^2` of its canary cost plus `c` of its capacity-test cost, and never adds pay (ADR-0055 §6).
  - **Against declarations and acks.** A phantom declarer or a full-stream ack earns a colluder no more than honest work (`validator_phantom_declarer`, `validator_headroom_ack`).
  - **Against an own fleet under the validator's coldkey.** It earns no more than a validator without one (`validator_own_fleet`). A fleet under a second coldkey isn't caught by the rule; it is ordinary collusion, inside the `c` bound (ADR-0055 §6, T203).
  - **Not yet: the controller.** It ratchets in its dead band and is dragged by quality attacks (T200, T201). Fixes are prerequisites for the gate (ADR-0055 §10).
  - **Against fixed costs.** The controller brings participation to its target: measuring pays above about 10% of stake after it, against 11.6% (base) and 62.2% (bear) at a fixed 5% (`validator_fixed_cost_small`).

## Mechanism 1: routing (`mechid=1`)

Validators grade every revealed table against the **next window's snapshot** and pay a **graded ladder** with clone protection (§Grading on the next window's snapshot, §The ladder, §Clone protection; ADR-0035, Task 16a). That is what `validator::run_tempo` does, through `validator::mech1_stage` and `scoring::solver_grade`.

The per-class gains below, computed on the snapshot a table was solved on from probe results, are the `SolverInput` score of the older helpers (`scoring::mech1_shares`, `validator::evaluate_solver_table`, `finalize_mech1_weights`), which the `bwos` CLI's preview and the sims of single rules still use. Those helpers pay the same ladder (§The ladder) and keep their `gains_ppm` copycat rules (§Winner and weights). `run_tempo` doesn't call them.

For solver `s` with a revealed route table:

```
for each sampled demand pair p (shared schedule):
    # Single-feature baseline classes (ADR-0017):
    # class == "latency":
    gain_p = (direct_us(p) - measured_us(s,p)) * 1e6 / direct_us(p)     # signed ppm; "direct" entry → 0
    # class == "bulk" (when composite weights not active or single-feature mode):
    gain_p = (eff_bottleneck_mbps(s,p) - direct_mbps(p)) * 1e6 / direct_mbps(p)
    # class == "cost":
    gain_p = (direct_cost_ppm(p) - eff_path_cost_ppm(s,p)) * 1e6 / direct_cost_ppm(p)

    # Multi-feature composite classes (ADR-0018; each G_* clamped to [-1e6, 1e6] ppm):
    # class == "realtime" (gated on rtt <= direct_us, jitter_us <= MAX_REALTIME_JITTER_US, loss_ppm <= MAX_REALTIME_LOSS_PPM):
    gain_p = (700_000 * G_lat + 300_000 * G_jit) / 1e6
    # class == "low_latency_hd" (gated on rtt <= direct_us, loss_ppm <= PROBE_LOSS_MAX_PPM):
    gain_p = (500_000 * G_lat + 500_000 * G_bw) / 1e6
    # class == "bulk" (gated on rtt <= 1.50 * direct_us, loss_ppm <= PROBE_LOSS_MAX_PPM):
    gain_p = (800_000 * G_bw  + 200_000 * G_lat) / 1e6
    # class == "economy" | "cost" (gated on rtt <= 1.50 * direct_us, loss_ppm <= PROBE_LOSS_MAX_PPM):
    gain_p = (700_000 * G_cost + 300_000 * G_lat) / 1e6
    # class == "resilient" (gated on valid primary + disjoint backup_path, both loss_ppm <= PROBE_LOSS_MAX_PPM):
    gain_p = (600_000 * G_lat + 400_000 * (disjoint_mult_ppm * G_backup / 1e6)) / 1e6
score_s = trimmed_mean(gain_p) - FEASIBILITY_PENALTY * overloaded_nodes(s) - CHURN_PENALTY * churn_ppm(s) / 1e6
          - REGRET_WEIGHT_PPM * mean_regret(s) / 1e6                                # [T23]
```

`mean_regret(s)` (`[T23]`, `scoring::mean_regret_ppm`, `routing::table_mean_regret_ppm`): the floor mean, over **all** scored pairs (every canonical demand pair with a `direct` entry, including the pairs the trim drops), of `regret_p ∈ [0, 1e6]`, where `regret_p = min(1e6, floor((route_metric - best_metric) * 1e6 / direct_us))` (`RouteRegret`; the class metric is predicted latency, or the reference realtime metric `Σ(hop_cost + 2*jitter_us)` for `realtime`) for overlay routes and `0` for `direct`, missing or invalid routes (a table failing `Table::validate` has `mean_regret = 0`; it already scores `-1e6` per pair). The comparator is defined in `routing.md` §Route regret: the metric-best path that is capacity-feasible given the table's other routes and no worse than the submitted route on every other attribute the class scores, so capacity-aware detours and bandwidth/cost/jitter trade-offs carry no regret, while pushing a top-quartile pair down to the trim cutoff through extra relays always costs `(gain lost) / n`. Regret is computed from snapshot predictions only (never probe results), is clamped to be non-negative, and does not depend on the reference solver's table, so it can only lower a score and a solver cannot gain by making another table look worse. Validators pass the per-UID `mean_regret` to `scoring::mech1_shares_with_regret` (`mech1_shares` is the zero-regret special case); the copycat `EPSILON_ROUTE` score comparison uses the regret-adjusted scores.

`trimmed_mean` (`scoring::trimmed_gain_ppm`, `[SCR-9]`): clamp each `gain_p` to `[-1e6, 1e6]` ppm (an invalid or SLA-failed pair, `i64::MIN`, counts as `-1e6`), sort ascending, drop the top `floor(n * GAIN_TRIM_TOP_PPM / 1e6)` values (at least one value is kept), and take the floor (`div_euclid`) mean of the rest. Unlike a lower median, every below-median pair moves the score, so a solver cannot reroute up to `floor((n-1)/2)` of its worst pairs through self-owned detours at no cost (sim `bottom_half_self_dealer`).

- An overlay path slower than direct gives a negative gain, so a solver that knows when to say "go direct" wins.
- A table whose next hops towards any destination, `path` and `backup_path` together across classes, form a cycle fails `Table::validate` (`routing.md`, "Next hops settle"), so every pair scores `-1e6` like any invalid table. BGP might never settle on it. Where classes would choose conflicting next hops towards one destination, at most one of them can have its unconstrained best path; regret's comparator keeps the table valid too, so a detour the rule forces isn't regret (`routing.md` §Route regret, item 4).
- `overloaded_nodes`: nodes the table loads above measured capacity.
- `churn_ppm`: share of pairs whose path changed vs. the solver's previous table.

### Grading on the next window's snapshot (ADR-0035, Task 16a)

`run_tempo` for window `w` grades each table revealed in `w`. Such a table was solved on snapshot `w` for window `w + 1`. It is graded against `next_snapshot`, the snapshot for `w + 1` that the same tempo builds from window `w`'s measurements. No solver could see those measurements when it committed. Everything is integer (`u128` / `i128`, floor division) and every map is a `BTreeMap` (Invariant 1).

1. **Validity is judged on the solved-on snapshot, as before.** A table must pass `Table::validate_under_demand` against the snapshot it was solved on (replay check, requested pairs, loop-free paths, operator policy; `[SCR-8]`, PB-23), with its routes strictly sorted. A table that fails scores 0. It isn't graded and takes no part in clone checks.
2. **Missing pairs are direct.** A demand pair the table has no route for is graded as `direct` (gain 0), as before, so leaving out a bad pair never raises a mean.
3. **Route grade.** For each route `r` whose `(src, dst)` has a `direct` entry in `next_snapshot` with `latency_us > 0` (the lowest one when there are several; a pair without one isn't graded):
   - **Direct.** `g_r = 0`.
   - **Classes other than `latency` aren't graded yet.** `g_r = 0`: no credit and no penalty (OQ-107). `run_tempo`'s demand set is `latency` only (`validator::TEMPO_DEMAND_CLASS`), so no other class reaches it today.
   - **Overlay `latency` route on path `P`.**
     - **Broken: graded as direct at best (fix rounds 1 and 2, red team MH3, N3).** `pred = routing::route_predicted_us(next_snapshot, P)`.
       - **No `pred`.** A hop missing, at 100% loss or at zero capacity, or a node dropped out: the route grades as direct, `g_r = 0`.
       - **A lossy hop.** If `P`'s worst hop loss on `next_snapshot` is above `PROBE_LOSS_MAX_PPM`, then `g_r = min(0, gain_ppm(direct_us, pred))`. A route that was no worse than direct gets 0; one already slower than direct keeps its negative gain, so an operator can't lift its own slow route to direct by breaking it.
       - **For every table alike.** A solver that also runs relays can't sink another table's routes below direct by taking its relays out of the graded window. Paths that were broken when the table was solved still fail validation (item 1).
     - **Sampled.** `sampled = Σ lower_median(samples[(a, b)])` over `P`'s hops, plus `PER_HOP_LATENCY_OVERHEAD_US` per interior relay. It is defined only when every hop has a sample (`measurement.md` §Latency samples for grading).
     - **Probed: keyed by path (fix round 1, red team M4).** The window's aggregated probe of `P` itself, `route:<digest of P>` (`probe::route_path_key`, `measurement.md` "Path probes are keyed by path"). Every table that routes over `P` reads the same result, whichever table the validators chose to probe, so an unprobed near-clone can't outrank a probed table on the same paths. A failed probe (`rtt_us <= 0`, or `loss_ppm` negative or above `PROBE_LOSS_MAX_PPM`) grades like a lossy hop, `g_r = min(0, gain_ppm(direct_us, pred))`. UID-keyed (`path:uid:...`) and label-keyed (`path:<table.solver>:...`) probes aren't read.
     - **Latency.** `lat = max(pred, sampled, probed)`, over the ones that exist: the route is graded on the worst view of it.
     - **Gain.** `g = clamp(gain_ppm(direct_us, lat), -1e6, 1e6)`.
     - **Prediction check.** The solver's prediction is the route's `est_us`. Let `err = |est_us - lat| * 1e6 / lat`, and `err = 0` when `est_us == lat`. The credit is `c = 1e6` when `err <= PREDICTION_TOLERANCE_PPM`, `0` when `err >= 2 * PREDICTION_TOLERANCE_PPM`, and `1e6 * (2 * PREDICTION_TOLERANCE_PPM - err) / PREDICTION_TOLERANCE_PPM` in between. A route with no `est_us` made no prediction, so `c = 0`. A positive gain becomes `g * c / 1e6`; a gain of zero or below is kept as it is, so mispredicting never helps a bad route (sim `prediction_liar`).
   - **Route score.** `q_r = 1_000_000 + g_r`, in `[0, 2_000_000]`, where `1_000_000` is as good as direct. Two entries for one `(src, dst, class)` keep the lower (`solver_grade::route_grades`).
4. **Time weighting** (`solver_grade::time_weighted_score`). `T = Σ q_r * b_r / Σ b_r`, floored, where `b_r` is the blocks route `r` was live, capped at `window_blocks`.
   - **Empty `live_blocks`.** Every route was live the whole window, `b_r = window_blocks`, so `T` is the plain mean. For every solver but the incumbent, and for an incumbent with no attested update chain, `run_tempo` passes an empty map with `window_blocks = TempoInput::window_blocks` (360 by default).
   - **The incumbent's updates (Task 16b).** `TempoInput::table_updates` holds the window's attested chain for `current_prod_table`; `validator::tempo_update_chain` keeps the updates the validator set in force at the window's first block attests at the quorum, signed by the incumbent UID's hotkey, with `block <= now_block` and inside the window, and of those the longest prefix that passes `table_update::apply_update` (`window_start_block` from `TempoInput`, or the window's first block when 0). `route_live_blocks` gives the blocks each production route was live. The incumbent's grade is then `solver_grade::live_adjusted_score`: a graded route whose key is in the map counts `q` for its live blocks and `min(q, 1_000_000)` for the rest; a key not in the map was not a production route this window and counts the whole window. Every key weighs the whole window, so a route cannot drop out of the mean by being removed, and taking a route down never lifts a score (sim `mid_window_self_steerer`). This departs from the plain reading above, where a missing route is live 0 blocks: that reading would let the incumbent remove the production routes of the pairs its new table does badly on.
   - **Clone check (F7, N1).** `zero_prod_copies` runs against the production table after every prefix of the chain (`LiveBlocks`), not just the base table (sim `update_leech`), each version only against tables whose `commit_block` is after the block of the update that made it (fix round 2, sim `prod_version_framer`), so the incumbent can't frame a rival as a copy by updating towards its revealed table. `None` counts as committed last and is checked against every version (OQ-129).
   - **Not yet covered.** Each route version is not graded over its own live span (OQ-123); the incumbent's updates are bounded by `MAX_UPDATE_CHANGE_PPM` instead. Mechanism 0 credit still reads `current_prod_table`, not the table as updated (OQ-122): that must be resolved before the paid-traffic trigger is enabled.
   - **Otherwise.** A route missing from the map was live 0 blocks.
   - **Nothing live.** `Σ b_r = 0` gives `T = 0`.
5. **Graded score.** `grade = max(0, T - 1_000_000)` (`solver_grade::grade_tables`). That is the time-weighted mean gain, floored at 0, so a table no better than going direct earns nothing.
6. **Penalties.** `score = max(0, grade - FEASIBILITY_PENALTY * overloaded_nodes - CHURN_PENALTY * churn_ppm / 1e6 - REGRET_WEIGHT_PPM * mean_regret / 1e6)`. All three are computed on the solved-on snapshot at the window's `demand_mbps_per_pair`: they judge the choices the solver made with what it could see.
   - **Churn** is measured under policy against the submission's `prev_table`. `prev_table` is **validator-derived**: the table this UID committed last window, which Task 19b reads on chain, never from the solver. With `prev_table` `None`, churn is measured against `current_prod_table`, last window's production table (fix round 1, red team H2), so leaving it out never dodges churn. When the production table has no routes (bootstrap), churn is 0.
   - **Regret** uses the comparator solved once per tempo (`[T23]`), with **production hysteresis** (fix round 1, red team H2): a route that keeps the path `current_prod_table` uses for its `(src, dst, class)` carries no regret while its class metric is within `ROUTE_SWITCH_MARGIN_PPM` of the comparator's (`route_metric * 1e6 <= best_metric * (1e6 + ROUTE_SWITCH_MARGIN_PPM)`). That is the margin `routing::stabilize_routes` keeps a path by. The rule is the same for every solver: whoever keeps the production path inside the margin pays no regret for it (`validator::mean_regret_with_hysteresis`).
7. **Hysteresis is unchanged.** Inside a table it is `ROUTE_SWITCH_MARGIN_PPM` (`routing::stabilize_routes`); between tables it is the `EPSILON_ROUTE` incumbent rule (§The production table). Two sims hold the bound. In `next_window_overfitter`, a solver that re-solves every window without hysteresis, chasing dips the next window doesn't keep, grades no higher than the stabilised reference solver. `zero_churn_overfitter` does the same with no `prev_table`.
8. **Solved-on gate grade (fix rounds 1 and 2, red team MH3, N1).** Each valid table is also graded on the snapshot it was solved on, with no samples or probes and **full credit**: `est_us` is ignored (`solver_grade::gate_grades`, `Mech1Stage::solved_on`). A solver whose `est_us` honestly predicts a change of more than `PREDICTION_TOLERANCE_PPM` therefore isn't failed by the gate. An outside solver qualifies to be selected, paid above the reference or counted as `outside_won` only if its solved-on grade is at least the reference solver's. A table can't win on a next window it helped steer if it was worse on what everyone could see when it committed (sim `reference_steering_saboteur`).
   - **The cost.** A solver that genuinely chooses better routes for the next window than the solved-on snapshot shows is held to the reference there too (OQ-107 (8)).
   - **A conservative launch choice.** The gate covers selection and rungs as well as `outside_won`, which goes beyond what the red team asked for. OQ-107 (8) holds the narrower fix for Task 16b: breakage-neutral pairs, with the gate then on `outside_won` only. Foresight of failures is rewarded through ADR-0035's failure bounties instead.
9. **Commit deadline and reveal (Task 19b, OQ-107, OQ-222).** A solver's table counts for window `w` only if its commitment lands by the **commit deadline** `D(w) = window start + SOLVER_COMMIT_DEADLINE_BLOCKS` (block 36 of `w`, a tenth of the tempo). Validators read solver commitments at `D(w)`, by that block's hash (`identity.md` §Commitment manifest, read block), so a commitment landing after `D(w)` is no submission. Most of the measurement that builds `next_snapshot` then happens after every table is fixed.
   - **Reveal after the deadline (fix round 2, red team N2).** Tables are revealed only after the commit deadline. Validators pull each table from its solver's axon by its committed hash when they take the `D(w)` read, once `D(w)` is final (`identity.md` §Pulling a hotkey's objects, OQ-220), and a validator MUST NOT serve a table before `D(w)`. A solver serves it from block `D(w)` on (`bwos-solver daemon` serves it once the best head reaches `D(w)`), so it is there for the draw. No solver can then copy another's table from the same window before its own commitment.
   - **Missing or late is no submission.** A manifest or table not fetched and verified when the `D(w)` read and path-probe draw are taken (within `READ_FETCH_BUDGET`, one attempt per source) is graded as no submission (`measurement.md` §Live loop, OQ-224).
   - **Demand per pair (OQ-221).** `demand_mbps_per_pair` is part of the window's attested signed snapshot (`SignedSnapshot::demand_mbps_per_pair`, `routing.md` §Signed tables, snapshots and peer directory). Solvers and graders read the same attested value; Task 19b's loop publishes it and MUST pass the same number as `TempoInput::demand_mbps_per_pair`.
   - **What stays public.** Last window's production table is still public; perturbing it is red team N2's leech (sim `perturbed_prod_leech`, model-only until Task 16b, OQ-107 (6)).

### Clone protection (Task 16a)

This replaces the `gains_ppm` copycat test in `run_tempo`. That test let through a clone made 2.5% worse (audit F2).

- **Clone distance.** `clone_distance_ppm(a, b) = 1e6 - floor(identical * 1e6 / union)`. Here `union` counts the `(src, dst, class)` keys routed by either table, and `identical` counts the keys both route on the same path (`direct` counts as the same path). Two empty tables are at distance 0. Tables are compared after missing pairs are filled in as `direct` (§Grading item 2).
- **Who is zeroed.** A table within `CLONE_DISTANCE_PPM` (distance `<= 20_000`) of another table committed in the same block or earlier scores 0 (`solver_grade::zero_clones`). The earlier table keeps its score, whatever that score is.
  - **The same block.** Two clones committed in the same block both score 0, since neither came first.
  - **The order** comes from `SolverSubmission::commit_block: Option<u64>`.
    - **What it is.** The first block at which this UID committed this table's hash, as read at the tempo's fixed read block (Invariant 1). Task 19b fills it from `ChainClient::commitments`.
    - **`None` counts as committed last (fix round 1, red team M5).** `None` is the serde default, and it isn't serialised. An unknown block never gets ahead of a known one.
  - **The order keys, earliest first.**
    1. The reference solver's table, which validators derive from the committed snapshot.
    2. The incumbent, when its table is within `CLONE_DISTANCE_PPM` of `current_prod_table`.
    3. Everyone else by `commit_block`.
  - **Last window's production table** counts as committed at block 0 and owned by `incumbent_solver_uid` (fix round 1, review Critical). It ran in the open, so anyone could copy it. Any table other than the incumbent's and the reference solver's within `CLONE_DISTANCE_PPM` of it scores 0 (`solver_grade::zero_prod_copies`). The incumbent re-committing it keeps its score, whenever it committed (sim `prev_production_copier`). With a production table of no routes there is nothing to copy.
  - **Clones of the reference.** A clone of the reference solver's table therefore always scores 0 (F2, sim `ladder_clone_farm`).
- **How tables are compared.** Each table is digested once into one sorted list of `(SHA-256 of src, dst, class; SHA-256 of the path)`, and two tables are compared by one linear merge (fix round 1, red team LM7). The numbers are those of the definition above.
- **Only valid tables take part.** An invalid table can't zero anyone.

### The ladder (Task 16a)

This replaces `WINNER_SHARE` (`solver_grade::ladder_shares`).

- **Who is on the ladder (fix round 1, red team H1, review I2).** The ladder is built over the reference solver and only those solvers that qualify (§Grading item 8) and score `s > s_ref + EPSILON_ROUTE`, where `s_ref` is the reference solver's score.
  - **Below the reference.** A table no better than the reference earns no rung, however different it is: the reference is free, so a worse table adds nothing (sim `near_clone_ladder_farm`).
  - **No reference.** With no reference solver scored, every positive score takes part.
- **Ranking.** Solvers on the ladder with a positive score are ranked by score, highest first. The reference ranks first on a tie, and every other solver is strictly above it anyway; other equal scores rank by lower UID. The top `LADDER_N` (8) take rungs.
- **Rung weights.** Rung `k` (0-based) weighs `w_0 = 1e6` and `w_k = floor(w_{k-1} * LADDER_DECAY_PPM / 1e6)`, so each rung weighs half the one above by default.
- **Shares.** Rung `k`'s share is `floor(1e6 * w_k / Σ w)`. The remainder goes to the top rung, so the shares sum to exactly `1_000_000`. Zero shares are left out.
- **No positive score.** If no solver scores positive, there are no shares, and the whole mechanism (`1_000_000` ppm) is unearned.
- **The reference solver's rung is unearned** (§Unearned weight and the first-party UID), whichever rung it holds, and so is every rung at or below it.
  - **Disclosed: this raises the first-party share while the reference leads.** While no outside solver beats the reference by `EPSILON_ROUTE`, the reference holds the only rung, and all of Mechanism 1 goes to `first_party_uid`. With one outside solver above it, the reference's rung takes a third. The first-party share is reported publicly (§Unearned weight and the first-party UID).
- **Pay follows score, not incumbency.** The production table (below) may be the incumbent's while the top rung is another solver's.

### The production table (Task 16a)

- **Candidate.** The candidate is the highest score among the reference solvers and the qualified solvers (§Grading item 8). Score ties break in favour of the reference solver, then the lowest UID.
- **Incumbent rule.** The candidate replaces a qualified, positive-scoring incumbent only if `score_candidate >= score_incumbent + EPSILON_ROUTE`.
- **No positive score.** If the selected score is 0, the reference solver is selected, and with none, the validators' own capacity-aware solve.
- **`outside_won`** (§Split trigger). It holds when all of these do:
  - the selected solver isn't the reference solver;
  - its score is more than `EPSILON_ROUTE` above the reference solver's (the highest one if there are several), the same bar as a rung (fix round 2, red team N4);
  - it is at least the reference on the solved-on gate grade (it qualified).

  With no reference solver scored, it is `false`.

### Winner and weights

These rules apply to the older `SolverInput` helpers (`scoring::mech1_shares*`, `finalize_mech1_weights*`), not to `run_tempo`. Their shares are the ladder over `max(0, score_s)` of the solvers that survive the copycat rules, with the reference-relative threshold and the production-table rules above. They have no solved-on grade, so every solver qualifies.

- Non-reference solvers within `EPSILON_ROUTE` of the reference solver's score or of its `trimmed_mean` gain, matching the reference solver's `gains_ppm` profile, or duplicating an earlier solver's `gains_ppm` profile are excluded as copycats. Identical `gains_ppm` profiles are deduplicated in seniority order (`is_reference == true` -> `incumbent_uid` -> lowest `uid`) **before** sorting by post-churn score so a zero-churn copycat (`prev_table == None`) can never disqualify an incumbent that has legitimate route adaptation churn (`[CRITICAL-02]`).
- Candidate = highest `score_s`. Score ties break in favor of the reference solver (`is_reference == true`) first, then lowest UID.
- The candidate replaces a positive-scoring incumbent only if `score_candidate >= score_incumbent + EPSILON_ROUTE`.
- If no solver achieves a positive score (`winner_score <= 0`), or no solver is scored at all, the whole mechanism's weight (`1_000_000` ppm) is unearned (§Unearned weight and the first-party UID) and the reference solver is selected.
- Weights: the ladder (§The ladder) over the surviving solvers' `max(0, score_s)`. `WINNER_SHARE` is retired (Task 16a).
- Tables are checked once per solver with `routing::Table::validate_under_demand` at the window's `demand_mbps_per_pair` (structure, `window == snapshot.window + 1` replay check, requested pairs only, loop-free valid paths, operator policy); any failure scores every pair as `i64::MIN` (`[SCR-8]`).
- **Operator policy (PB-23, Phase B Task 7).** Policy is read only from the committed snapshot the table was solved on, the same `snapshot` the replay check pins (`routing.md` §Operator policy and §Validation, "Operator policy"). Every solver is therefore graded against the same policy it could read before solving. A policy committed after a table was solved belongs to a later snapshot, so it never makes that table invalid and never costs it a pair: a table is invalid under policy only when it breaks the policy of the snapshot it was solved on. The regret comparator and the reference solver read the policy where a node is a relay and never bind a route's ends, so respecting a policy is never regret (`routing.md` §Validation, "Reference solver and regret"). Sim `policy_griefer` holds the bound: an operator that sets `allowed_peers` to exclude peers changes no solver's rank among solvers that solve against the committed snapshot, and its node is assigned no more transit than with no policy (`threat-model.md` T97). Policy adds no parameter: its fields are per node.
- Label-keyed probe results (`path:<table.solver>:...`) are used only when no other submission in the tempo carries the same `table.solver` label; UID-keyed results (`path:uid:<uid>:...`) always take precedence (`[SCR-4]`).
- Any share earned by the reference solver (whether as winner or runner-up) is unearned weight (§Unearned weight and the first-party UID): it goes to the disclosed first-party UID, never to an owner-coldkey hotkey.

### Split trigger (R10, Task 15)

The founder sets how emissions split between the two mechanisms. Validators report when the published trigger for revisiting it is met, as `TelemetryReport::split_trigger_met` (`scoring::split_trigger_met`):

- `TempoInput::solver_win_history` holds `(window, outside_won)` per past window. It is sorted by window, entries for `window` or later are dropped, and a duplicated window counts as a loss.
  - **What `outside_won` means.** It is `TempoOutcome::outside_solver_won`: the selected solver is not the reference solver, scored positive, and its graded score (after penalties and clone protection, Task 16a) is more than `EPSILON_ROUTE` above the reference solver's, and it is at least the reference on the solved-on gate grade (§The production table, fix rounds 1 and 2).
  - **No reference solver.** With no reference solver scored, it is `false` (fix round 1 L1, sim `split_trigger_without_reference`).
  - **Carried forward.** The live loop appends it to the next input, as it does `declaration_history`.
- The trigger is met when the last `SPLIT_TRIGGER_WINDOWS` (72) entries of the history are consecutive windows ending at `window - 1`, all `true`, and `W < 1_000_000` (real paid traffic exists). A gap or a `false` resets it. `windows = 0` or `window = 0` is never met.
- It is telemetry only: it changes no weight. The founder sets the split. `TelemetryReport::split_trigger_met` is omitted from the encoding when `false` (review M7). While `ALPHA_TRIGGER_ENABLED` is off, `W` is always `1_000_000`, so the trigger is never met.

### Proposed (ADR-0046): grading `transfer`

**Proposed in ADR-0046, not yet normative.** Nothing here changes current scoring, code or vectors. It applies once ADR-0046 is accepted and implemented (roadmap PB-30, Task 30d), and only to `transfer` pairs (`routing.md`, "Proposed (ADR-0046)"). Until then no demand set carries them.

**Arithmetic.**
- All arithmetic is integer (`u128` / `i128`). Divisions floor, using `div_euclid` wherever the dividend can be negative.
- `ceil(a / b)` is `(a + b - 1) / b` on non-negative values.
- `dc` is `direct_cost_ppm`, or `DEFAULT_COST_PPM` when that is unset or 0.
- A pair with `need_mbps = 0` is skipped: it isn't scored, isn't divided by, and isn't counted in `n`.

**Capacity semantics.** Link `avail_mbps` is read as total capacity, not spare (ADR-0046 §5).

**Tables that lose their `transfer` routes.** A table loses its `transfer` routes, not the whole table, if any of these holds:
- it breaks the stripe-prefix budget against the production table it replaces (`|SP(T_prev) ∪ SP(T)| <= STRIPE_PREFIX_BUDGET`).
  - `SP` counts only non-synthetic `transfer` routes.
  - `SP(T_prev)` is the production table as applied, after any `transfer` drop and fallback.
- it oversubscribes a link on the snapshot it was solved on (the `transfer` stripes' `Σ mbps` above the link's residual after non-`transfer` loads);
- it allocates `Σ mbps > need_mbps` on any pair.

Those pairs grade as missing: rate 0, gain `-1e6`. Latency-class routes are never voided by these three failures.

**Tables that fail whole.** A broken stripe in-tree, or a `transfer` route with a `backup_path`, fails `Table::validate`, so every pair scores `i64::MIN` (`[SCR-8]`), latency classes included. Only the solver can cause either, since both depend on the table's paths alone (`routing.md`, "Proposed (ADR-0046)").

**Delivered rate**, on the next-window snapshot (ADR-0035):
1. Take each stripe's loss-adjusted bottleneck after every non-`transfer` primary's load.
2. Set `d_k = min(mbps_k, bottleneck_k)`. Where the `d_k` on a link exceed its residual, divide the residual **max-min fair** by an integer water-fill on that link:
   - **Each round.** With `R` Mbps left and `m` unsatisfied stripes, `share = floor(R / m)`. Stripes with `d_k <= share` take `d_k` and leave, and `R` drops. Repeat until none leaves.
   - **The rest.** The rest take `share`.
   - **Leftover.** The leftover `R - share * m` (`< m` Mbps) goes 1 Mbps each to them in `tie_key` order of their paths, then by stripe index (lowest first) for stripes of one route on identical node paths.

   The split is not weighted by `mbps`. A stripe's `fair_k` is its minimum over its hops. Taking the minimum per link is deterministic, though not a global max-min optimum, and it can only lower rates.
3. `delivered_k = min(d_k, fair_k)`, and `rate = Σ delivered_k`.

**Cost.** `cost_k = Σ eff_cost_ppm` over stripe `k`'s hops.
- **Which link.** Each hop is the directed link `path[i] → path[i+1]` (the live entry `route_predicted_us` uses).
- **Base cost from the solved-on snapshot.** `eff_cost_ppm = base_cost * (1e6 + CONGESTION_SURCHARGE_PPM * util_ppm² / 1e12) / 1e6`. `base_cost` comes from the snapshot the table was **solved on**: its link `cost_ppm`, or `max(cf, ct)` of the declarations in force for it (`validator.rs:3580-3594`), or `DEFAULT_COST_PPM`.
- **Utilisation from the graded snapshot.** `util_ppm` comes from the graded snapshot's capacity and the table's loads.
- **Why.** Declared costs from the graded window would let a griefer poison the comparator after commitment.

**Path cost.** `path_cost = Σ_k delivered_k * cost_k / Σ_k delivered_k`. If `Σ delivered_k = 0`, then `G_cost = -TRANSFER_PACE_SPLIT_PPM`.

```
# class == "transfer" (gated per stripe, i64::MIN for the pair: loss_ppm <= TRANSFER_LOSS_MAX_PPM, route_predicted_us <= TRANSFER_MAX_PATH_US;
#                      Σ mbps > need_mbps drops the table's transfer routes (above); a broken in-tree fails the whole table)
G_cost    = clamp(((dc - path_cost) * 1e6).div_euclid(dc), -TRANSFER_PACE_SPLIT_PPM, 1e6)
shortfall = ceil((need_mbps - min(rate, need_mbps)) * 1e6 / need_mbps)                 # 0 when on pace, else >= 1
gain_p    = G_cost                                                                       if shortfall == 0
          = max(-1e6, -TRANSFER_PACE_SPLIT_PPM - ceil(shortfall * (1e6 - TRANSFER_PACE_SPLIT_PPM) / 1e6))   otherwise
```

- **Pace dominates.** On-pace gains lie in `[-TRANSFER_PACE_SPLIT_PPM, 1e6]`. Behind-pace gains lie in `[-1e6, -TRANSFER_PACE_SPLIT_PPM - 1]`, strictly disjoint because the ceiling of a positive shortfall is at least 1. So no cost saving can buy a shortfall. Being on pace is the same as a projected completion by the deadline, because `need_mbps` is the even pace.
- **No reward for width.** Delivering more than `need_mbps` earns nothing, and allocating more is invalid.
- **`direct` routes.** A `direct` route is on pace when `direct_mbps >= need_mbps`, and then gains `0`. Otherwise its shortfall is computed with `rate = direct_mbps`. When `direct_mbps` is unset it gains `0`.
- **Failed gates.** A stripe over the loss or path-latency ceiling makes the pair `i64::MIN`.
- **Regret.** `regret_p = max(max_k regret_k, regret_rw)`, both with the `TOL = ROUTE_REGRET_TOLERANCE_PPM` deadband, measured from the band edge.
  - `regret_k = min(1e6, max(0, cost_k - best_marginal * (1e6 + TOL) / 1e6) * 1e6 / dc)` against the comparator's costliest needed stripe.
  - `regret_rw = min(1e6, max(0, path_cost - best_mean * (1e6 + TOL) / 1e6) * 1e6 / dc)` against the comparator's rate-weighted mean cost (`routing.md`, "Proposed (ADR-0046)"; ties broken by `tie_key`).
  - Sim `stripe_regret_noise`: ±10% cost noise gives regret 0.
  - **Unlike the other classes.** Their Mechanism 1 regret has no deadband, and `ROUTE_REGRET_TOLERANCE_PPM` is only Mechanism 0's gate. `transfer` has one because its congestion-priced cost moves more with measured capacity than a latency does, and `max_k regret_k` takes the worst of up to four stripes, so without it an honest route's regret would grow with its stripe count (ADR-0046 §5).
  - It goes into `mean_regret(s)` like any other class.
  - The per-stripe term stops dilution, and the rate-weighted term stops a stripe priced at the marginal from carrying more than its share (laundering).
- **Churn.** A `transfer` pair whose stripes changed counts `TRANSFER_CHURN_WEIGHT_PPM / 1e6` of a pair in `churn_ppm`.
- **Other classes ignore `transfer` loads.** Non-`transfer` classes are graded as if `transfer` loads didn't exist: their gains, regret comparators, capacity checks and congestion-priced cost leave those loads out. `transfer` loads still count towards `overloaded_nodes`.
- **Synthetic entries** (`"synthetic": true`) are graded here, but their routes are removed from the production table, so §Byte crediting never sees them.
- **Mechanism 0, §Byte crediting.**
  - **`[SCR-9]`.** A `transfer` route is removed from crediting only when `direct` is on pace and `G_cost < 0`. A shortfall alone doesn't remove it.
  - **Stripes are paths.** Every stripe is an active path for `[SCR-10]` and item 7.
  - **Apportionment by modelled delivery.** Item 7 apportions a stripe by `w_k = delivered_k * min(need_mbps, rate) / rate` (`u128`, floor; 0 when `rate = 0`), never the solver's `mbps`. Item 6 weights the class routes sharing a node path the same way: `w_k` for `transfer`, `demand_mbps_per_pair` otherwise.
    - **A model, not a count.** "Measured delivery" is the graded snapshot's model, because hop receipts aren't split by stripe or class. The hop's receipted bytes are apportioned by it.
    - **Bound.** Each stripe's weight equals its modelled delivery share within one floor. The pair's weights total `min(need_mbps, rate)`. Synthetic routes move nothing, since they aren't in the production table.
  - **Laundering cap, tolerance-preserving.** Credited stripes are taken costliest first (ties by their paths' `tie_key` sequences, then by stripe index, lowest first):
    - `c'_k = cost_k * 1e6 / (1e6 + TOL)`;
    - `budget_k = A(c'_k) * (1e6 + TOL) / 1e6 + TOL * min(need_mbps, rate) / 1e6`;
    - `credited_k = min(w_k, max(0, budget_k - Σ credited so far))`.

    Here `A(c)` is the comparator's allocation on stripes costing at least `c`. The remainder is carried but not credited. A route whose stripes are each within 1.1x of the corresponding comparator stripe's cost and allocation is credited in full (sim `laundering_cap_tolerance_flip`, 1.00x). Inflating the comparator's residual raises a dealer's credit by at most the tolerance (`comparator_residual_inflater`).
    - **What it bounds: price, not share.** Each credited byte costs at most 1.1x the comparator byte it displaces. A dealer priced at the comparator's marginal can carry 100% when the comparator's stripes all cost within 10% of each other (`marginal_stripe_launderer`).
    - **Residual.** An honest route whose split differs from the greedy comparator's by more than 10% plus the slack loses some credit. Sim `honest_split_reshuffle` measures how much (T53).
  - **Paid coverage.** It is spread across a `transfer` route's stripes by `w_k`, so the order's client-billed bytes bound the total credited (OQ-26 fixed for `transfer`).
  - **Regret gate, per stripe.** Item 6's multiplier is `1e6` for stripe `k` only when `cost_k <= best_marginal * (1e6 + ROUTE_REGRET_TOLERANCE_PPM) / 1e6`, else `0`, whatever the route's other stripes cost.
  - **Pay capped at the routed link cost.** For bytes on `transfer` stripe hops, the ADR-0018 §3 per-byte scaling uses `min(node's declared cost_ppm, the base cost of the directed hop link path[i] → path[i+1])`, both from the solved-on snapshot.
    - **When it matters.** It only bites when a snapshot-set link `cost_ppm` is below the node's declaration. `max(cf, ct)` is never below the node's own.
    - **What it doesn't do.** It doesn't throttle declaration changes, which is PB-31 (in progress).
    - **Not covered.** Canary bytes and the capacity term are not cost-scaled (ADR-0046, Consequences).

### Proposed (ADR-0059): sharded solving and the master-table merge

**Proposed: not active.** Nothing here changes current scoring, code paths in `run_tempo`, or vectors. `shard_merge::SHARDED_SOLVING_ENABLED` is `false`, and the one-shard plan (`ShardPlan::single()`) reduces every rule below to the rules above. It applies once ADR-0059 is accepted and PB-46 is built, activated on ADR-0049's scheduled-change path. The pure helpers are in `bwos_core::shard_merge`; the merge itself is in `routing.md` §Proposed (ADR-0059). Mechanism 1 stays `mechid = 1` (Invariant 6): shards split its emission, they are not mechanisms.

**Shards.** The committed `SHARD_PLAN` puts each demand pair `(src, dst, class)` in exactly one shard: its class group, then its destination's ADR-0057 region on the solved-on snapshot, else the group's residual shard (`ShardPlan::shard_of`, `ShardPlan::assign`). A plan that doesn't partition every `(class, region)` fails `ShardPlan::validate` and is never published. Launch reading (OQ-230): one class group, regions only.

**Submission.** One commitment per UID per tempo, before the commit deadline (§Grading item 9). With two or more shards it is `hash("route-table-bundle", bundle)` over at most one table per shard; the whole bundle is revealed or none of it (T260). With one shard it stays `hash("route-table", table)`. `commit_block` is the UID's, for every shard table in the bundle.

**Grading, per shard.** Shard `s`'s table is graded exactly as §Grading on the next window's snapshot grades a whole table, with these substitutions:
- **Pairs.** Only shard `s`'s pairs. A table that routes any other pair is invalid.
- **Validity.** On **shard `s`'s view** (`routing.md` §Proposed (ADR-0059), "Allocations"), with node `capacity_mbps`, relay `max_transit_mbps` and finite link `avail_mbps` set to the shard's allocations: `Table::validate_under_demand` passes, and `validator::compute_overloaded_nodes` is 0 (`valid_on_view`). With two or more shards, node and link capacity are therefore validity rules inside each shard, not only `FEASIBILITY_PENALTY`.
- **Reference.** The global reference table restricted to shard `s`'s keys. The gate grade (item 8), the ladder's bar `s_ref + EPSILON_ROUTE`, `outside_won` and the unearned first-party rung are all per shard against it.
- **Penalties.** `overloaded_nodes` and churn are computed on shard `s`'s view and pairs. Churn compares against the UID's previous table for shard `s`, or else production's routes for shard `s`'s current keys.
- **Regret and the Mechanism 0 gate (red team round 1, T262).** These are computed on the **full** solved-on snapshot. The comparator's loads are those of the merged table's other routes, with the table's own shard-`s` routes in place of the merged slice. They are never computed on the shard view, which hides capacity another shard left unused, so a detour through one's own relay would be regret-free there (sim `shard_view_dealer`: 0 ppm on the view, 200_000 ppm under this rule). Mechanism 0's regret gate reads the same comparator for a relay on a merged route (OQ-238 (b)).
- **The cost.** Every table in a shard, the reference slice included, can be charged for capacity its view forbids. The ladder's bar is relative to the reference slice, so this cancels to first order.
- **Clone protection.** Against the shard's reference slice, against last window's production table restricted to shard `s`'s **current** keys (owned by shard `s`'s incumbent, including keys that moved shard), and against other tables for shard `s` by `commit_block` (T255).
- **Ladder and production candidate.** §The ladder and §The production table run per shard, each with its own incumbent. A shard with no qualified, positive-scoring winner selects its reference slice.

**Thin shards fold (red team round 1, T261).** A non-residual shard whose pairs' destinations belong to fewer than `SHARD_MIN_DEST_UIDS` distinct UIDs is folded into its group's residual shard for the window (`fold_thin_shards`).

**Emission split (red team round 1, T261).** `D_s` is the ADR-0057 smoothed regional demand `d_r` (§Locational price: prior plus non-synthetic demand) of the regions shard `s` owns. The residual shard takes the regions no live shard owns (`region_demand_by_shard`). Pair counts never enter, since sybil destinations can inflate them (sim `shard_sybil_region_capture`).
- **Weights.** `W_s = SHARD_WEIGHT_FLOOR_PPM + apportion(1e6 − live × SHARD_WEIGHT_FLOOR_PPM, D_s)`, with largest-remainder rounding and ties to the lower id, so `Σ W_s = 1_000_000` (`shard_weights_ppm`). `W_s` reads only committed regional demand, never entrants, scores or pair counts (T254).
- **Class groups.** How `d_r` divides between class groups is open (OQ-236).
- **A UID's share.** `Σ_s floor(W_s * ladder_share_s(uid) / 1e6)` (`combine_shard_shares`). Reference rungs, the rungs at or below them, an unentered or unbeaten shard's weight and floor dust are unearned (§Unearned weight and the first-party UID).
- **First-party cap (red team round 1).** While at least one shard has an outside winner, the unbeaten shards' weights are scaled to `FIRST_PARTY_SHARD_CAP_PPM` in total, and the excess goes to the beaten shards in proportion to their weights (`cap_unbeaten_weight`). With none beaten, the whole mechanism is unearned, as today. It is capped rather than burned because the burn UID is retired (R12) and emission should keep paying for routing work.

**Incremental updates, per shard.** As `routing.md` §Incremental updates, with one chain per `(window, shard)`, signed by shard `s`'s incumbent, changing only shard `s`'s keys, checked on shard `s`'s view. `MAX_UPDATE_CHANGE_PPM`, `UPDATE_CHANGE_FLOOR`, `MAX_ROUTE_CHANGES_PER_WINDOW`, `MIN_UPDATE_INTERVAL_BLOCKS` and `MAX_CHAIN_UPDATES` apply per shard (OQ-235). Item 4's live-block grading and the clone check against each production version run per shard on its own chain.

**Split trigger.** Current reading (OQ-234): `outside_won` holds for a window when shards holding at least half of `Σ W_s` have an outside winner by the per-shard rule.

**Class groups (not at launch).** With more than one class group, a route the merge displaces (`routing.md` §Proposed (ADR-0059), "Acyclicity") is graded **as submitted**, live-block weighting included. The displacement is recorded only in the merge record, so a higher-priority shard can't lower a rival's score by displacing it (red team round 1, T253, sim `shard_cycle_saboteur`). There is no merge-harm term.

**Sims.** These run in `make sim` against the helpers, each with an asserted bound:
- `shard_capacity_hog` and `shard_link_hog` (T250);
- `shard_merge_determinism` (T251, T252);
- `shard_sybil_region_capture` (T261);
- `shard_view_dealer` (T262);
- `shard_cycle_saboteur` (T253);
- `shard_recheck_blame` (T263).

Still to write with PB-46, before anything is enabled: `shard_crowding`, `cross_shard_copier`, `shard_collusion_pair` and `shard_update_race`.

## Launch audit blockers (`.audit/2026-10-30`, Task 15)

| ID | Finding | Where it's fixed |
|---|---|---|
| F1 | The validator daemon scored a fixed demo input | Task 19b: the live loop builds `TempoInput` from chain and object-store reads |
| F2 | A reference clone made slightly worse took the runner-up pool | Task 16a: the reference solver's table counts as committed first, so a table within `CLONE_DISTANCE_PPM` of it scores 0, and the ladder replaces the runner-up pool (§Clone protection, sim `ladder_clone_farm`) |
| F3 | Capacity was capped by the prober's uplink | Task 4Dc: team capacity tests |
| F4 | Sybil dedupe had no data (`node_diversity` empty) | Task 4B: committed probed endpoints and the dedupe trigger |
| F5 | Any client key counted as paying | Here: `W` stays `1_000_000` until paid traffic from **authorized** clients passes `ALPHA_TRIGGER_PAID_GIB` for `ALPHA_TRIGGER_SUSTAIN_WINDOWS` windows, then the trigger latches (§Capacity weight `W`, sim `fake_paying_client`) |
| S4 | SS58 `hotkey_sig` never verified | Here: every capacity declaration verified (§Capacity declarations are verified, sim `zero_sig_declaration`); commitment manifests where they're fetched, Task 19b (D16) |

## Unearned weight and the first-party UID (R11, R12, Task 15)

Weight no miner earned is **unearned**: all of Mechanism 0 when `Σcap` and `Σuse` are both zero, all of Mechanism 1 when no solver scores positive or none is scored, and the reference solver's share as winner or runner-up. The burn UID is retired (it replaces OQ-4): `TempoInput::burn_uid` is removed.

- **Mechanism 1.** With `TempoInput::first_party_uid = Some(u)`, Mechanism 1's unearned weight (the reference solver's share, all-negative rounds, no solver scored) goes to `u`, the owner's disclosed first-party UID under a separate disclosed coldkey (design §3). It never goes to an owner-coldkey hotkey or a burn UID, because weight to an owner-coldkey hotkey cuts the subnet's TAO share (sim `unearned_weight_to_owner_hotkey`).
- **Mechanism 0 never goes to the first-party UID (fix round 1 M3).** With nothing earned (no capacity term before the latch, or no capacity and no usage after it), Mechanism 0 gives no weights and its `1_000_000` ppm is reported as unassigned, whatever `first_party_uid` is. The live loop refuses to submit (sim `first_party_take_when_no_capacity`).
- **No weights while anything is unassigned (fix round 1 H3).** A mechanism with unassigned unearned weight (`first_party_uid` `None` for Mechanism 1, or Mechanism 0 with nothing earned) gives no weights at all. Its earned shares are never renormalised over the unassigned part, which paid earners up to 3.33x their share (sim `unassigned_unearned_renormalized`).
  - **Reporting.** `TempoOutcome::unearned_ppm_by_mech` gives each mechanism's unassigned ppm, so neither mechanism's figure blocks the other (N1).
  - **The public helpers return it.** `scoring::assign_unearned`, `mech1_shares`, `mech1_shares_with_regret`, `validator::finalize_mech0_weights*` and `finalize_mech1_weights*` all return the unassigned ppm, so no caller can drop it.
  - **The validator refuses per mechanism.** `bwos-validator`'s `validate_weights` refuses a mechanism whose own figure is non-zero, and holds both back when `weights_refused` is set. `run-tempo` fails only when neither mechanism can be submitted.
  - **Old inputs fail loudly.** `TempoInput` refuses unknown fields, so an input still carrying the retired `burn_uid` fails to load rather than losing it silently.
- **Each mechanism on its own (fix round 2, N1).** `TempoOutcome::unearned_ppm_by_mech` reports the unassigned ppm per mechanism (`[mechid 0, mechid 1]`), and `validator::mechanism_refusal` judges each mechanism on its own figure. On a fresh network with no tested node, Mechanism 0 is refused while Mechanism 1 (first-party UID set) is still submitted (sim `bootstrap_refusal_blocks_routing`). Since Task 16a no overlay route grades positive there, because an untested node has no capacity in the graded snapshot, so all of Mechanism 1 goes to the first-party UID.
- **Before launch (Task 19b).**
  - `first_party_uid` MUST be committed on chain, and its coldkey checked against the subnet owner's. Scoring can't tell the difference (OQ-102, threat-model T129).
  - Someone MUST check on localnet what the chain does when Mechanism 0 never gets weights, for example its emission and `activity_cutoff` handling, because a network with no tested node refuses Mechanism 0 every window.
- The first-party share is reported publicly and is meant to stay small and fall (design §3).

## Weight vector

Shares (ppm per UID) are converted to u16 weights summing to 65_535 using the **largest remainder method**: floor each, then hand the leftover units to the largest remainders, ties by lowest UID. Output is a list of `(uid, weight)` sorted by UID, zero weights omitted.

**Scoring version (ADR-0049).** Every scoring version has a `version_key`, sent with each weight-setting call. A release that changes scoring names an activation block at least 21,600 blocks (3 days) after it is published, and validators score with the old version until that block. A validator MUST NOT set weights under a scoring version it knows is superseded: if a newer scoring release has activated, or the chain's `weights_version` is above its own `version_key`, it pauses weight-setting and alerts its operator. Its last weights keep counting until the subnet's `activity_cutoff`, so `activity_cutoff` is kept to at most about one day (ADR-0049). An emergency release (activation before 3 days) MUST NOT change share formulas or parameters.

## Parameters

| Name | Default | Meaning |
|---|---|---|
| `ALPHA_TRIGGER_PAID_GIB` | 1_000 GiB per window | Starting value. Attested paid bytes across the network in a window (`validator::attested_paid_bytes`, authorized clients only) at or above which the window counts toward the capacity-weight trigger (§Capacity weight `W`, F5). Replaces `ALPHA` |
| `ALPHA_TRIGGER_ENABLED` | `false` | Fix round 1 (red team H2/M1). Whether the capacity-weight trigger runs. Off: `W` is always `1_000_000` and nothing latches, because each validator's latch would come from its own view of the receipts and validators would diverge. Turns on only after Task 19b commits per-window attested bytes on chain and the latch uses their stake-weighted lower median (OQ-102) |
| `ALPHA_TRIGGER_MIN_CLIENTS` | 3 | Starting value (fix round 1 H1). Distinct authorized clients that must be behind a window's attested paid bytes for them to count |
| `ALPHA_TRIGGER_SUSTAIN_WINDOWS` | 24 | Starting value. Consecutive windows at or above `ALPHA_TRIGGER_PAID_GIB` that latch the trigger (about a day at the default tempo). Once latched it stays latched |
| `CAPACITY_WEIGHT_LATCHED_PPM` | 700_000 ppm | Capacity weight `W` once the trigger has latched (70/30 capacity to usage), before any lower `CAPACITY_WEIGHT_SCHEDULE` entry. Until it latches `W = 1_000_000` |
| `CAPACITY_WEIGHT_SCHEDULE` | empty | Starting value. The published step-down (OQ-5): `(from window, ppm)` entries; after the latch `W` is the lower of `CAPACITY_WEIGHT_LATCHED_PPM` and the entry with the greatest `from <= window` |
| `SPLIT_TRIGGER_WINDOWS` | 72 | Consecutive windows an outside solver must beat the reference, with `W < 1_000_000`, for `split_trigger_met` (§Split trigger). Telemetry only; the founder sets the split |
| `UPTIME_EXP` | 2 | Exponent on uptime |
| `GEO_PRICING_ENABLED` | `false` | ADR-0057 (proposed). Whether `run_tempo` applies `G_n` (§Locational price). Off: `G_n = 1e6` for every node. Turned on only by PB-44 through ADR-0049's scheduled-change path, and not before the usable-capacity cap merges unless `GEO_PRICE_MAX_PPM` is held at `1e6` |
| `GEO_PRICE_MIN_PPM` | 500_000 ppm | Starting value. Lowest region price (0.5x), and `G_n` of an unplaced node |
| `GEO_PRICE_MAX_PPM` | 3_000_000 ppm | Starting value. Highest region price (3x), and the price of a region with demand and no supply |
| `GEO_PLACE_RTT_US` | 20_000 µs | Starting value. The radius of a site that names none: a site is in range of a node when its figure is at or below its radius (`measurement.md` §Network position). Sites `a`, `b` of different regions must be `(R_a + R_b) * GEO_LIGHT_KM_PER_MS / 2000` km apart by chord. The proposed table's radii are in ADR-0057 §9 (OQ-185, OQ-193) |
| `GEO_PLACE_MIN_SITES` | 2 | Independent sites (disjoint validator sets) that must be in range to place a node (T187) |
| `GEO_SITE_REDUNDANCY` | 3 | Independent sites every covered location must have, so any one validator's site can be lost (revision 2) |
| `GEO_GAP_WINDOWS` | 3 | Starting value. Windows a node may be unplaced and come back to the same region without its placed-window count starting again |
| `GEO_INREGION_MAX_AGE_WINDOWS` | 8 | Starting value. Windows an in-region capacity figure is carried between dedicated in-region tests (about every 2.5 windows) before it expires |
| `GEO_OUTAGE_CARRY_WINDOWS` | 24 | Starting value. Windows a node keeps its placement, count and in-region capacity while its region's sites are silent for it (revision 2: per node, `geo::could_qualify`) |
| `GEO_PRIOR_MAX_STEP_PPM` | 50_000 ppm | Starting value. The most a region's prior share moves at one yearly update |
| `GEO_SITE_STAKE_MIN_PPM` | 50_000 ppm | Starting value. Validator stake a site's members must hold together for the site to place nodes (`measurement.md` §Network position; buyback and owner hotkeys excluded), so a dust validator can't run a site (T187) |
| `GEO_LIGHT_KM_PER_MS` | 300 | Speed bound for the separation rule: `c` in vacuum rounded up, which no medium beats. Separation is measured by chord, which no path beats |
| `GEO_DEMAND_SMOOTH_PPM` | 100_000 ppm | Starting value. Share of the way the smoothed demand share moves to its target each window. Demand is the only smoothed input (ADR-0057 §4) |
| `GEO_PRIOR_WEIGHT_PPM` | 1_000_000 ppm | Weight of the region table's prior in the demand target. Prior only until a demand aggregate neither miners nor the company can steer exists (OQ-186) |
| `GEO_PROBATION_WINDOWS` | 24 | Starting value. Consecutive windows a node must be placed in one region before it is paid above `GEO_PROBATION_PRICE_PPM` there (about a day) |
| `GEO_PROBATION_PRICE_PPM` | 1_000_000 ppm | The most a node on probation is paid (1.0x) |
| `REGION_TABLE` | empty | ADR-0057. Regions (id, name) with at least two independent sites each. Sites carry a region, coordinates, a radius and a validator set (validator agents, or Atlas anchors). Also the prior dataset's SHA-256 and the ISO 3166-1 to region map. Published on ADR-0049's scheduled-change path. Empty: pricing is neutral. Invalid if two sites of different regions are closer than the separation rule allows |
| `W_PAID` / `W_FREE` / `W_CANARY` | 1_000_000 / 250_000 / 100_000 ppm | Class weights. `W_CANARY` is not used by receipt crediting until OQ-17: hop receipts carry no class (ADR-0037), so receipt bytes are only `paid` or `free`, and with `attest_free` on, canary bytes on a hop (unattested) earn 0 |
| `LOSS_MULT` | 10 | Loss penalty multiplier |
| `C_MAX` | 2_000_000 ppm | Coverage multiplier cap. The ADR-0039 diversity term reaches at most `1.1x` at its defaults (§Coverage) |
| `USAGE_SHARE_CAP` | 250_000 ppm | Max usage share per UID |
| `USAGE_CAP_REDIST_MULT_PPM` | 2_000_000 ppm | Max post-redistribution usage share of an under-cap UID as a multiple of its pre-cap share (`2.0x`, `[SCR-1]`) |
| `GAIN_TRIM_TOP_PPM` | 250_000 ppm | Fraction of highest per-pair gains dropped before the Mech 1 trimmed mean (`[SCR-9]`) |
| `BLOCK_SECONDS` | 12 s | Block time used to bound per-window credited bytes (`verified_mbps * 125_000 * WINDOW_BLOCKS * BLOCK_SECONDS`, `[SCR-11]`) |
| `EPSILON_ROUTE` | 20_000 ppm | Margin by which a candidate must beat a positive-scoring incumbent to replace the production table. It sets the production table only, never pay (§The production table) |
| `LADDER_N` | 8 | Rungs of the Mechanism 1 ladder (`solver_grade::LADDER_N`, §The ladder, Task 16a). Replaces `WINNER_SHARE` (700_000 ppm), which is retired |
| `LADDER_DECAY_PPM` | 500_000 ppm | Each rung's weight relative to the rung above (`solver_grade::LADDER_DECAY_PPM`). At the defaults the top rung takes 50.2% with 8 rungs filled, and 100% alone |
| `CLONE_DISTANCE_PPM` | 20_000 ppm | A table at most this far (share of `(src, dst, class)` keys on a different path) from a table committed in the same block or earlier scores 0 (`solver_grade::CLONE_DISTANCE_PPM`, §Clone protection) |
| `PREDICTION_TOLERANCE_PPM` | 250_000 ppm | Starting value (OQ-107). Relative error of a route's `est_us` against its graded latency that keeps full credit for the route's positive gain. The credit falls linearly to 0 at twice this (`solver_grade::PREDICTION_TOLERANCE_PPM`, §Grading item 3) |
| `GRADE_WINDOW_BLOCKS` | 360 blocks | Default `TempoInput::window_blocks` (Task 16b), the `window_blocks` that `run_tempo` passes to the time weighting: the default tempo, `probe::DEFAULT_WINDOW_BLOCKS` |
| `SHARDED_SOLVING_ENABLED` | `false` | **Proposed (ADR-0059): not active.** Whether `run_tempo` shards Mechanism 1 (`shard_merge::SHARDED_SOLVING_ENABLED`, §Proposed (ADR-0059)). Turned on only by PB-46 through ADR-0049's scheduled-change path |
| `SHARD_PLAN` | `ShardPlan::single()` | **Proposed (ADR-0059): not active.** The committed shard plan: class groups and, per shard, the destination regions it owns, with one residual shard per group. Changed only by an ADR and a scoring release on ADR-0049's path. The one-shard plan is today's Mechanism 1 |
| `MAX_SHARDS` | 16 | **Proposed (ADR-0059): not active.** Most shards a plan may list (`shard_merge::MAX_SHARDS`). Bounds validator work: one ladder, clone check and update chain per shard. Proposed start: 3 to 4 shards (OQ-237) |
| `SHARD_WEIGHT_FLOOR_PPM` | 50_000 ppm | **Proposed (ADR-0059): not active.** Least Mechanism 1 weight of a live shard (`shard_merge::SHARD_WEIGHT_FLOOR_PPM`); the rest follows smoothed regional demand `d_r` (red team round 1, OQ-231) |
| `SHARD_MIN_DEST_UIDS` | 3 | **Proposed (ADR-0059): not active.** Distinct destination UIDs a non-residual shard needs in a window, or it folds into its residual shard (`fold_thin_shards`, T261) |
| `FIRST_PARTY_SHARD_CAP_PPM` | 250_000 ppm | **Proposed (ADR-0059): not active.** Most of Mechanism 1 the unbeaten shards may send to the first party while any shard is beaten; the excess goes to the beaten shards (`cap_unbeaten_weight`, red team round 1) |
| `MAX_UPDATE_ROUTES` | 256 | Task 16b. Most routes one `TableUpdate` may change and remove together (`table_update.rs`, `routing.md` §Incremental updates) |
| `MAX_UPDATE_BLOCK_SLACK` | 5 blocks | Task 16b fix rounds 1 and 2 (F1, N3). Most an update's `block` may be ahead of, or behind, the chain block when a validator attests it. The live loop also counts only updates dated at least this far before the window's last block (OQ-127) |
| `SOLVER_COMMIT_DEADLINE_BLOCKS` | 36 blocks | Task 19b (OQ-107 (5)). The live loop reads route tables at `S + 36`; a later commitment is no submission for the window (`measurement.md` §Live loop) |
| `OWN_COMMIT_OFFSET_BLOCKS` | 300 blocks | Task 19b. When a live validator commits its manifest for the window (record, probe batch, evidence), before the read at `S + 359` |
| `REVEAL_DELAY_BLOCKS` | 10 blocks | Task 19b (6), raised by its verification (M-b). Blocks after the window's last block before the live loop scores it, so withheld objects revealed after the read block reach the stores |
| `DRAW_GRACE_BLOCKS` | 12 blocks | 19b verification, M-a. A path-probe draw that failed at `S + SOLVER_COMMIT_DEADLINE_BLOCKS` is retried until `S + 36 + 12`; a validator still without a draw grades no table and holds Mechanism 1 back for the window (`measurement.md` §Live loop, OQ-224) |
| `PROBE_BATCH_REASK` | 2.5 s | 19b verification, M-b; live loop, not scored. While scoring, how often a missing probe batch of a validator-permit holder is asked for again |
| `PROBE_BATCH_REASKS` | 4 | Integration fix round, M2; live loop, not scored. Most re-asks per scoring pass, so an unrevealed batch costs at most about 10 s of `SCORE_FETCH_BUDGET`; a due path-probe draw stops them (L1) |
| `REFRESH_MARGIN_BLOCKS` | 720 blocks | Task 19b (R17). Weights are due `activity_cutoff - 720` blocks after the last set (`refresh_deadline_block`); the loop warns when a mechanism would age out |
| `LIVE_DEMAND_MBPS_PER_PAIR` | 100 Mbps | Starting value, Task 19b. `TempoInput::demand_mbps_per_pair` in the live loop, and the `demand-mbps-per-pair` its update checks use |
| `UPDATE_PROPAGATION_MARGIN_BLOCKS` | 12 blocks | Task 19b fix round 1 (F4). Updates count for a window only when dated at least `MAX_UPDATE_BLOCK_SLACK + 12` blocks before its last block, so the quorum's attestations reach every store before scoring |
| `READ_FETCH_BUDGET` | 60 s | Task 19b fix round 1 (F2). Time a chain read's remote fetches may take; an object not here by then counts as absent |
| `SCORE_FETCH_BUDGET` | 120 s | Task 19b fix round 1 (F2). The same for scoring one window |
| `MAX_IN_FLIGHT_FETCHES` | 512 | Task 19b fix round 1 (F2). Remote fetch jobs at once, across reads; further jobs queue until one ends or the budget does (fix round 3, H1) |
| `MAX_FETCHES_PER_HOTKEY` | 8 | Task 19b fix round 3 (H1). Fetch jobs one hotkey's objects may hold at once; jobs start one hotkey at a time in turn, so junk UIDs can't starve the objects that sort after theirs |
| `PATH_PROBES_PER_TABLE` | 8 | Task 19b fix round 2 (question 6). Paths probed per committed table each window, drawn from the hash of the solver commit deadline block |
| `READ_LOOKBACK_WINDOWS` | 25 | Task 19b: `EVIDENCE_MAX_AGE_WINDOWS + 1`. Chain reads the live loop keeps and rebuilds after a gap; also the binding-rank lookback (T83) and the stake history the validator set's lookback minimum reads |
| `COMMIT_MARGIN_BLOCKS` | 4 blocks | Task 20, solver side. `bwos-solver daemon` sends no commitment within this many blocks of `SOLVER_COMMIT_DEADLINE_BLOCKS` (finality lag and inclusion) |
| `UPDATE_LEAD_BLOCKS` | 3 blocks | Task 20, solver side (OQ-240). `bwos-solver daemon` dates its update this many blocks after the finalized block it signs at, at most `MAX_UPDATE_BLOCK_SLACK`, to cover the update manifest's inclusion and the validator's relay interval |
| `FIRST_UPDATE_DELAY_BLOCKS` | 36 blocks | Fix round 1 (F7). Earliest first update, counted from the window's first block: the proposed commit deadline (item 9) |
| `MAX_UPDATE_CHANGE_PPM` | 250_000 ppm | Fix round 1 (F2), proposed. Most of the base table's routes (distinct keys) a window's updates may change or remove. A window holds at most 14 updates and an honest solver answers failures on a few routes; a quarter bounds how much of the graded table can be steered after grading. Tune by sim (OQ-124) |
| `MAX_ROUTE_CHANGES_PER_WINDOW` | 2 | Task 16b fix round 2 (N4). Most updates in one window's chain that may change or remove the same route. An honest solver moves a failed route and perhaps moves it back; flipping a heavy pair to steer its traffic stops at the third. With it, the change budget is also weighted by each pair's demand (`check_demand_budget`, OQ-128) |
| `UPDATE_CHANGE_FLOOR` | 8 routes | Fix round 1 (F2). The change budget is never below this, so a small table can move |
| `MIN_UPDATE_INTERVAL_BLOCKS` | 25 blocks | Task 16b. Fewest blocks from the window's first block to the first update, and between updates: about five minutes |
| `FEASIBILITY_PENALTY` | 50_000 ppm per node | Penalty per overloaded node (`routing.md`) |
| `CHURN_PENALTY` | 100_000 ppm | Applied to full churn |
| `REGRET_WEIGHT_PPM` | 1_000_000 ppm | Weight of the mean per-pair route regret subtracted from the Mech 1 score (`scoring::REGRET_WEIGHT_PPM`, `Mech1Params::regret_weight_ppm`, `[T23]`) |
| `PER_HOP_LATENCY_OVERHEAD_US` | 500 µs | Latency charged per interior relay in `route_predicted_us` and every reference-solver search (`routing::PER_HOP_LATENCY_OVERHEAD_US`, `Params::per_hop_overhead_us`, `routing.md`, `[T23]`) |
| `MIN_VALIDATORS` | 2 | Minimum revealed values per measurement, counting only validators with positive stake when `VALIDATOR_STAKES` is set (`measurement.md`) |
| `VALIDATOR_STAKES` | empty (every validator weighs 1) | Validator SS58 hotkey -> stake, used by the stake-weighted lower probe median, the evidence quorum, endpoint aggregation and the attestation-key stake check (`TempoInput::validator_stakes`, `measurement.md`, `[T21]`, ADR-0039). Probe batches' ed25519 keys are mapped to hotkeys through `TempoInput::attestation_keys` (Task 11a records). A record is valid only with the hotkey's signature, the ed25519 key's `attestation-key-pop` proof of possession, a canonical torsion-free key, and positive stake in this map. A hotkey may hold one record per probe agent, and only records committed before the window's first block count. The attestation key comes only from the hotkey's single `attest` record (round 5 F2). A hotkey with stake but no valid record is excluded from teams, and its batches don't count. Team draws use `ValidatorEntry.stake` from the signed set at block `b`; everything else uses this map. Before Task 11a (sim and localnet) the map is keyed by ed25519 probe key, as today |
| `NODE_DIVERSITY` | empty (no dedupe) | Node key -> public-endpoint IPv4 /24, IPv6 prefix, ASN for §Endpoint dedupe (`TempoInput::node_diversity`, `[T24]`); MUST be derived by the validator from the probed endpoint address, never self-reported |
| `IPV6_DEDUPE_PREFIX_LEN` | 32 | IPv6 prefix length that groups IPv6-only endpoints for §Endpoint dedupe (`scoring::IPV6_DEDUPE_PREFIX_LEN`, `[T24]`) |
| `PROBE_STAKE_QUORUM_PPM` | 333_333 ppm | Minimum share of total listed validator stake (of revealed validators when no stakes are set) that must report a probe key for it to be aggregated (`measurement.md`, `[T21]`). Under ADR-0039, once attestation-key records exist, the total is `recorded_stake`, the stake of hotkeys holding a valid record. The same quorum applies to endpoint aggregation and agreed evidence (red team RT5) |
| `PROBE_PARTICIPATION_FLOOR_PPM` | 500_000 ppm | Starting value, tuned by sim and red team. When `recorded_stake` (records committed before the window's first block) is below this share of all stake, the window is under-participated: where no fresh aggregate reaches quorum, scoring carries forward the previous window's aggregated probe metrics and charges no missing-measurement failures, and history gets only fresh tests. Stake that can't probe therefore can't stall the subnet (`measurement.md` §Team capacity tests, red team RT5, sim `recordless_stake_staller`). The same floor applies to agreed outside evidence, which has no carry: below it nothing is agreed (Task 4C red team RT1, sim `evidence_minority_injector`) |
| `WORK_K_START_PPM` | 50_000 ppm | ADR-0055 §4.2. The controller's `k` in the gate's first window: the slice at `A_total = WORK_REF_BYTES` (5%). Sim `validator_free_rider` gives the break-even: 1.9% in the base case, 3.9% in the bear, 7.7% on metered bandwidth in a bear market and 17.9% for a fabric ten times larger |
| `WORK_SLICE_MIN_PPM` | 10_000 ppm | ADR-0055 §4.1. The least slice, and the least `k` (1%) |
| `WORK_SLICE_MAX_PPM` | 150_000 ppm | ADR-0055 §4.1. The most slice, and the most `k` (15%). Covers bandwidth up to about 7x the launch fabric's measurement bytes in the base economics and 4x in the bear (OQ-140). Re-tuned only by an ADR-0049 release |
| `WORK_REF_BYTES` | 356_000_000_000 | ADR-0055 §4.1. `A_ref`, the launch fabric's allocated measurement bytes per window (27 GB canaries, about 329 GB seats; sim `validator_free_rider`) |
| `WORK_CONTROL_PERIOD_WINDOWS` | 24 | ADR-0055 §4.2. Windows between controller steps, and the participation mean's span |
| `WORK_PARTICIPATION_TARGET_PPM` | 670_000 ppm | ADR-0055 §4.2. `k` rises when the 24-window mean of `Σ s_v f_v` is below this |
| `WORK_PARTICIPATION_MARGIN_PPM` | 150_000 ppm | ADR-0055 §4.2. `k` falls only above target plus this (82%) |
| `WORK_K_UP_PPM` | 1_125_000 ppm | ADR-0055 §4.2. `k`'s step up (x1.125). Sim `validator_fixed_cost_small`: bear settles at 11.4%, base at 5.6%, both at participation 0.68 |
| `WORK_K_DOWN_PPM` | 937_500 ppm | ADR-0055 §4.2. `k`'s step down (x0.9375) |
| `VALIDATOR_WORK_ENABLED` | `false` | ADR-0055 §8. Whether `run_tempo` pays the slice. Turns on only after Task 14, scored ADR-0038 digests and Task 19b's `WorkEvidence`, and a red-team pass |
| `WORK_CATEGORIES` | 2 | ADR-0055 §3. Canary bytes (`WORK_CANARY`) and capacity-test bytes (`WORK_CAP_TEST`), combined weighted by bytes |
| `PROBE_CARRY_MAX_WINDOWS` | 2 windows | Starting value, tuned by sim and red team. Most under-participated windows that carry metrics forward in any `PROBE_CARRY_SPAN_WINDOWS` (`TempoInput.prev_carried_windows`, output as `TempoOutcome.carried_windows`). Past that budget, keys are scored fresh against `recorded_stake` and missing measurements are failures again, so a freeze can't shelter an offline node (`measurement.md` §Team capacity tests, round 4 RT2, round 5 F5, sims `selective_freeze`, `freeze_alternator`) |
| `PROBE_CARRY_SPAN_WINDOWS` | 24 windows | Starting value, tuned by sim and red team. The sliding span over which `PROBE_CARRY_MAX_WINDOWS` is counted, so alternating above and below the participation floor can't restart the carry budget (round 5 F5). Implemented in `validator::probe_stage` (Task 11a) |
| `SIGNED_INPUT_QUORUM_PPM` | 666_667 ppm | Share of a validator set's stake whose ed25519 attestations a node needs before it applies a signed table, snapshot, peer directory or next validator set: `attesting * 1e6 >= total * quorum_ppm` over the whole set (`signed::attested`, ADR-0042, `routing.md` §Signed tables, snapshots and peer directory). Exactly two equal thirds fall just short, so three equal validators need all three |
| `MAX_SET_ADVANCE_BLOCKS` | 720 blocks (2 windows) | Furthest a proposed validator set's `block` may be past the current set's (`signed::accept_next_set`, ADR-0042 item 5, red team 2). Validators publish a set every window, so an online node steps one window at a time with room for one missed publication; without a bound a quorum could sign a set at block `u64::MAX` that nothing could replace |
| `VALIDATOR_SET_LIFETIME_BLOCKS` | 8_640 blocks (24 windows) | Longest a validator set is trusted: `block < not_after <= block + this`, and the builder sets the maximum. Past `not_after` a node re-anchors on its `--validators` file. With the operator replacing the file it bounds the veto of stake that has left the chain to 24 windows plus the operator's response (`24 + R` windows in sim `set_exit_veto`, R the operator's response; red team 3, Task 11c); a node offline longer re-anchors instead of walking rotations |
| `SET_STAKE_LOOKBACK_WINDOWS` | 24 windows | A validator set's stake per hotkey is the minimum metagraph stake over this many windows (`signed::lookback_min_stakes`); a hotkey missing from any of them gets nothing, so stake can't be flash-staked into a set and stake that leaves weighs nothing in the next one |
| `LINK_BLAME_MARGIN_PPM` | 100_000 ppm | A failed link is excused for a node only when its leave-one-UID-out base pass rate exceeds the peer's by more than this; otherwise both ends are charged (`measurement.md` §Uptime, `[T29]`) |
| `MAX_ONE_SIDED_CHARGES_PER_NODE` | 2 | Maximum one-sided link-failure charges (peer excused) a node can receive per window across all peers; later ones are charged to both ends (`measurement.md` §Uptime, `[T29]`) |
| `ONE_SIDED_EXEMPT_RATE_PPM` | 250_000 ppm | A node with **no validator-vantage evidence** (no verified capacity and no passing acked capacity test this window) whose base pass rate excluding the judged peer's UID is strictly below this takes one-sided blame without the `MAX_ONE_SIDED_CHARGES_PER_NODE` budget, e.g. a zero-capacity burner (`measurement.md` §Uptime, `[T29]`) |
| `MIN_CLEAN_PEER_UIDS` | 2 | A node is clean when at least this many other UIDs have only passing attributable link results with it, each of those UIDs including at least one vouched node; a clean node passing its `vantage:` probe is never charged a link failure alone (`measurement.md` §Uptime, `[T29]`) |
| `MAX_NEUTRAL_FAIL_UIDS` | 2 | A failed link between two clean nodes that both pass their `vantage:` probe is neutral only while each end has failed results with at most this many other UIDs (`measurement.md` §Uptime, `[T29]`) |
| `MIN_DARK_PEER_UIDS` | 3 | A vantage-Fail node with no passing link is dark (takes every failure alone, no one-sided budget) only when peered with at least this many other UIDs (`measurement.md` §Uptime, `[T29]`) |
| `CAP_COHORT_FRESH_ENTRIES` | 8 | Cohort credit is the lower median of a cohort's samples in the last this many `cap_cohort_history` entries (windows with an aggregated cohort test); no sample there = no credit (`validator::rolling_cohort_capacities`, `[T28]`). A cohort is due about once per 2.5 windows, so about 4% of cohort-windows lapse with no attacker (T116(a); OQ-95 proposes credit until the cohort's next due test) |
| `CAP_COHORT_TEAM_MIN_SAMPLES` | 2 | Task 4Dc fix round 5 (red team B1(b), T125). In team mode a cohort's credit counts toward its group only with at least this many samples in the `CAP_COHORT_FRESH_ENTRIES` span (`validator::rolling_cohort_capacities_min`): a team cohort sample is one team's result, and the lower median of two is their minimum, so one colluding seat on one sample never raises a group. A cohort with fewer has no credit (the group falls back to its largest single). Costs honest cohorts more lapse (T125) |
| `MAX_CAP_COHORT_NODES` | 16 | Largest simultaneous capacity-test cohort; a larger dedupe group is tested in chunks and credited its best single chunk (`measurement.md` §Cohort capacity tests, `[T28]`) |
| `MAX_CHARGED_LINK_FAILS_PER_UID` | 2 | Maximum link failures charged to one node from the nodes of any single other UID per window (`measurement.md` §Uptime, `[T29]`) |
| `MAX_CLIENT_BYTES_PER_WINDOW` | 100 TiB (109_951_162_777_600 bytes) | Physical upper bound on paid bytes per `(client, ingress, egress)` session, per hop and class, and on a `(client, issuer)` voucher quota per window (`validator::MAX_CLIENT_BYTES_PER_WINDOW`, `[C-02]`, TV-28) |
| `TRUSTED_VOUCHER_ISSUERS` | empty (no voucher check) | Exit-partner issuer keys whose `BandwidthVoucher`s back `paid` client receipts and whose uploaded client receipts attest `free` bytes (`TempoInput::trusted_voucher_issuers`, `traffic-verification.md` TV-28, §Byte crediting 4-5, `[T16]`/`[T20]`). **Mainnet launch requirement** (ADR-0037, controller ruling 2026-11-01): non-empty, or another mechanism for choosing trusted issuers. Empty is for local and test networks only. Hop receipts carry no class, so with an empty set nothing but the hop totals bounds how much of a path colluding ends can claim as `paid` (sims `end_split_shifter`, `shared_hop_coverage_capture`, threat-model T16/T19) |
| `ROUTE_REGRET_TOLERANCE_PPM` | 100_000 ppm | Mechanism 0 route regret gate: a production path earns credit only while its class metric is at most `1.1x` the Mechanism 1 regret comparator's (`RouteRegret::route_metric <= best_metric * 1.1`; the metric is predicted latency, or `Σ(hop_cost + 2*jitter_us)` for `realtime`) for the same `(src, dst, class)` (`validator::ROUTE_REGRET_TOLERANCE_PPM`, §Byte crediting 6, `[T23]`) |
| `N_PROBES` | 8 | Default canary probe slots per window (`measurement.md`) |
| `WINDOW_BLOCKS` | 360 blocks | Default window length (`1` tempo, `measurement.md`) |
| `PROBE_LOSS_MAX_PPM` | 50_000 | Probe pass threshold (`measurement.md`) |
| `CAP_TEST_PERIOD` | 900 blocks | Expected blocks between capacity tests per node (`measurement.md`) |
| `CAP_CALL_PERIOD` | 2_400 blocks | **Peer-load capacity tests (ADR-0056 with red-team revision 1; specified and simulated, not scored).** Starting value, tuned by sim and red team. Replaces `CAP_TEST_PERIOD` once peer-load tests score: about 3 calls a day at 12 s blocks, at blocks drawn from the coordinator's committed `plan_secret` (label `cap-peer-call`), so nobody outside the call knows them in advance (T173). Replaces OQ-43 (b)'s 15 a day (founder, 2026-11-08) |
| `CAP_PEER_SLICE_KBPS` | 500_000 kbps | ADR-0056, not scored. Starting value, tuned by sim and red team. Rate of one slice, `s`. A call has `k = max(CAP_PEER_HIDDEN_SLICES, ceil(R / s))` slices of `ceil(R / k)` each, `R` the ramped test rate. Also the least spare capacity that makes a node an eligible peer, and the unit of its slots (`floor(spare / s)`, the most endpoints it holds in one call) |
| `CAP_PEER_TEST_SECS` | 30 s | ADR-0056, not scored. Starting value, tuned by sim and red team. How long every slice of a call runs (`T`) |
| `CAP_PEER_MEAS_SECS` | 20 s | ADR-0056, not scored. Starting value, tuned by sim and red team. The last part of a call that hidden slices are measured over (`T_meas`), so a token bucket that drains within `T - T_meas` is measured at its committed rate (sim `capacity_token_bucket`; longer burst credits are OQ-138) |
| `CAP_PEER_HIDDEN_SLICES` | 4 | ADR-0056, not scored. Starting value, tuned by sim and red team. Hidden validator slices per call (`m`), held by validators that self-select by VRF on stake (label `cap-peer-hidden`), each entering and leaving through drawn terminating relays `H_in` and `H_out`. Validator bytes per call are at most `m * s * T` = 7.5 GB each way, whatever the node's size (sim `capacity_big_node`). Hidden slices MUST be shown indistinguishable from peer slices before scoring (T148, OQ-117, OQ-166; sim `capacity_hidden_leak_ramp`) |
| `CAP_PEER_HIDDEN_MIN` | 3 | ADR-0056, not scored. Fewest revealed hidden results for a call to count; fewer is void (neither a sample nor a short call), so absent validators can't fail a node. A call whose `plan_secret` isn't revealed is void too, and its coordinator is charged |
| `CAP_PEER_LOOKBACK_WINDOWS` | 48 windows | ADR-0056, not scored. Starting value, tuned by sim and red team. Verified capacity is `min(declared, lower median of the samples of calls and retests ending in the last this many windows)`: about 7 calls. A short call's sample is 0 |
| `CAP_PEER_RETEST_WINDOWS` | 4 windows | ADR-0056, not scored. Starting value, tuned by sim and red team. A short call is retested once at a block drawn from `plan_secret` within this many windows, with a fresh draw; the bond applies if the retest is short too (red-team revision 1, sim `capacity_flood_framing`) |
| `CAP_PEER_SHORT_STRIKES` | 2 | ADR-0056, not scored. Starting value, tuned by sim and red team. Short calls (not retests) in one cooldown epoch that apply the bond whatever their retests showed. Proposed in revision 1 and accepted by the controller on 2026-11-08, because the retest alone leaves a burst renter at up to 1.162x per unit of cost (sim `capacity_burst_renter_calls`) |
| `CAP_PEER_UID_SLOTS` | 8 | ADR-0056, not scored. Starting value, tuned by sim and red team. Most endpoints (sources, `R_out` relays, sinks, hidden relays) one UID holds in one call. Endpoints are drawn uniformly per UID, then uniformly within it, so spare capacity buys no draw weight (sim `capacity_spare_feedback`) |
| `CAP_PEER_DUTY_QUANTILE_PPM` | 500_000 ppm | ADR-0056, not scored. Starting value, tuned by sim and red team. Quantile of a source's per-slice delivered ratios its duty record reads (`peer_load::source_duty_charged`, sim `capacity_lazy_sources`) |
| `CAP_PEER_DUTY_MIN_PPM` | 950_000 ppm | ADR-0056, not scored. Starting value, tuned by sim and red team. A source whose record's quantile ratio is below this is charged the bond on its own credit; the node under test never is |
| `CAP_PEER_DUTY_MIN_SLICES` | 8 | ADR-0056, not scored. Fewest sourced slices, each through a distinct node under test, before a duty record can charge its source |
| `CAP_PEER_DRAW_TRIES` | 64 | ADR-0056, not scored. Rejected draws per endpoint before a call runs with the slices drawn so far (`measurement.md` §Peer-load capacity tests, "The draw"; OQ-137) |
| Peer eligibility (rules) | — | ADR-0056 revision 1, not scored. An endpoint has spare capacity of at least `CAP_PEER_SLICE_KBPS` and is not under test in an overlapping call; it shares neither `N`'s UID, nor its coldkey group, nor its dedupe group, nor its underlay ASN; a slice's three endpoints are in different UIDs and dedupe groups; hidden relays are never validator-run; the call tolerance is `CAP_TOLERANCE_PPM` and the bond's span is `CAP_CHANGE_WINDOWS`. Option E (`CAP_PEER_PROOF_COUNTS`) was dropped for sink blinding |
| `CAP_TEST_SECONDS` | 10 s | Duration of today's single-agent capacity test (`probe::CAP_TEST_SECONDS`, `measurement.md`). Replaced by `CAP_TEST_SECS` when team tests land (ADR-0039, Phase B Task 4Dc) |
| `CAP_TEST_MAX` | 2 | Max concurrent capacity tests per validator per block (`measurement.md`) |
| `CAP_TEST_SECS` | 60 s | Starting value, tuned by sim and red team. How long each team member streams in a team or cohort capacity test (`measurement.md` §Team capacity tests, ADR-0039; Phase B Task 4Dc) |
| `CAP_TEST_BLOCKS` | 5 blocks | Derived: `ceil(CAP_TEST_SECS / BLOCK_SECONDS)`. How many blocks a team test occupies each member's `CAP_TEST_MAX` slots, for the deterministic slot assignment (`measurement.md` §Team capacity tests) |
| `CAP_TEAM_MAX_VALIDATORS` | 4 | Starting value, tuned by sim and red team. Largest capacity-test team. At each block the team of `min(this, |E(b)|)` is drawn by stake from all of `E(b)` and busy members dropped; the test starts with all of them free, or with at least `CAP_TEAM_MIN_VALIDATORS` at its last chance, else waits (Task 4Dc fix round 2, red team N1, T108). Budgets cap the rate but never decide eligibility. The result is `min(declared, measured + credited background)` (`measurement.md` §Team capacity tests) |
| `CAP_TESTS_PER_UID_MAX` | 4 per window | Starting value, tuned by sim and red team. Most tests of nodes with `verified_prev = 0` that count per UID per window, counted in the window each test ends in, so tests carried in from the previous window count. Proven nodes (`verified_prev > 0`) are uncapped. Tests of every tier, cohorts included, go in a round-robin by UID weighted by the UID's pooled previous capacity (0 for a node with no endpoint while dedupe is on, the UID's largest single node while it is off: `validator::schedule_weights`, Task 4Dc fix round 4, T114), at least `CAP_RAMP_FLOOR_MBPS` per unproven node up to this many (Task 4Dc fix round 3, T112), with a cohort keyed by its least-tested member UID at that UID's per-node weight (T111, T115) (proven before unproven within a UID), so neither fresh zero-capacity keys nor one UID's many proven tiny keys, as node tests or as cohorts, can crowd out slots (`measurement.md` §Team capacity tests, T48, T104, T110, sims `zero_cap_slot_crowder`, `proven_sybil_slot_flood`) |
| `CAP_TEST_DEFER_BLOCKS` | 4 blocks | Task 4Dc fix rounds 1-2 (red team F3, N1). How long a due test may wait for its drawn team to be free, in capacity-weighted round-robin order, before it is skipped (never past the window's last block); a test not started keeps waiting. Without it a flood of tests started in earlier blocks held every slot whenever an honest test fell due. It gives a node up to `(4 + 1) × BLOCK_SECONDS` (about 60 s) of notice of its test (T41, red team N5); don't raise it (`measurement.md` §Team capacity tests) |
| `CAP_TEAM_MIN_VALIDATORS` | 3 | Starting value, tuned by sim and red team. Smallest capacity-test team, so no test runs with fewer. A test with fewer revealed members credits what they measured but gives no `ratio_t` (round 4 RT5). With two revealed members `measured` still takes the median term (round 5 D). A test with one revealed member isn't a sample (red team F9). One colluding member, which lets the node starve one honest member under the lower median, gets the node credited `k-1` shares for `k-2` carried: up to 1.5x at `k = 4`, 2x at `k = 3`; two colluding members on a team of 4, which stake splitting allows, 3x (Task 4Dc fix round 1, red team F1; capped shares in `Σ`). The rolling lower median of tests is the real bound (controller ruling 3) |
| `CAP_TEST_HEADROOM_PPM` | 100_000 ppm | Starting value, tuned by sim and red team. A team pushes `declared * 1.1` (before the ramp; rates in kbps, OQ-91), so packet overhead doesn't keep a small honest node below 90% of declared. Credit stays capped at `declared`, and `ratio_t` is judged against `min(declared, sent)`, so the headroom never counts against a node that carries its declaration (red team RT5, round 4 RR1) |
| `CAP_RAMP_FLOOR_MBPS` | 100 Mbps | Starting value, tuned by sim and red team. The tested rate is `min(declared * 1.1, 2 * verified_prev + this)`, so a node's tested rate grows only as fast as it proves capacity (red team RT4). Also the team schedule's weight floor per unproven node (T112), and the cap on a last-chance team of three's record, `max(verified_prev, this)` (T113) |
| `cap_share_budget_mbps` | per validator, published in its signed validator-set entry; `2_500` Mbps for the reference validator (`bwos-validator`'s default) | Starting value, tuned by sim and red team. The most one validator's probe agent pushes to one node in one test. A team's rate is capped at the sum of its members' budgets, split by water-filling; in a cohort test it caps a member's total over all nodes. A node faster than that is tested and verified at the cap, never skipped (red team RT2, RT4; Task 11a carries the field) |
| `CAP_SHARE_BUDGET_MIN_MBPS` | 1_000 Mbps | Starting value, tuned by sim and red team. A validator is in `E(b)`, and can be drawn for a team, only with `cap_share_budget_mbps` at least this, so a tiny budget can't cap a team's rate while voting in the median (`measurement.md` §Team capacity tests, round 4 RR3, RT6, sim `low_budget_griefer`). A validator at the floor with about 16% of eligible stake still holds a 10 Gbps node at about 0.85x in the lower median (8,500 Mbps of team budget), under-credited but never haircut |
| `CAP_ECHO_CHECK_PPM` | 10_000 ppm | Starting value, tuned by sim and red team. Share of echoed `CAP_ECHO_BLOCK_BYTES` blocks each team member byte-checks, picked by its own private randomness. Any failed block zeroes that member's share (`measurement.md` §Team capacity tests) |
| `CAP_ECHO_BLOCK_BYTES` | 4_096 bytes | Starting value, tuned by sim and red team. Granularity of the echo check (`measurement.md` §Team capacity tests) |
| `CAP_BACKGROUND_MAX_PPM` | 250_000 ppm | Starting value, tuned by sim and red team. Most of a team result that can be credited background traffic, as in FlashFlow: `bg <= measured * 0.25 / 0.75`. Background comes from co-signed hop-receipt counters with other UIDs, never the node's own report. Before Task 12b it was the window average and lifted only the test's `ratio_t`. Since Task 12b it is, per receipt stream, the slowest interval overlapping the test in a gap-free run of receipts within one window, every interval at most `ceil(RECEIPT_INTERVAL / BLOCK_SECONDS)` blocks, summed over streams, and counts in both `team` and `ratio_t`. Stall and carry around tests leaves about 1.11x (red team RT4, round 4 RT3, RT4, round 5 B, C, F1). Kept separate from `CAP_TOLERANCE_PPM` (controller ruling 2, OQ-41) |
| `probe::BACKGROUND_IN_TEAM` | `false` | Off until PB-38 (ADR-0051/0053 digest-verified carriage): team-test background is the window average in `ratio_t` only, never in `team`. Only PB-38's change may turn it on, and Task 19b's team mode needs PB-38 landed first (Task 12b fix round 2, red team H1; OQ-106; sim `gate_holds_in_run_tempo`) |
| `probe::CAP_BACKGROUND_GAP_BLOCKS` | 3 blocks | `ceil(RECEIPT_INTERVAL_SECS / BLOCK_SECONDS)`: the widest gap between consecutive points of a receipt run, so a dropped or delayed receipt shows as a wide interval and its stream adds no background (Task 12b, round 5 F1; `measurement.md` §Background traffic) |
| `probe::CAP_BACKGROUND_SPAN_BLOCKS` | 11 blocks | `CAP_TEST_BLOCKS + 2 * CAP_BACKGROUND_GAP_BLOCKS`: the widest `block_after - block_before` of a receipt run (Task 12b) |
| `receipts::MAX_STREAM_HISTORY` | 256 receipts | Co-signed receipts a node's `ReceiptBook` keeps per stream for receipt runs; a window holds 144 at `RECEIPT_INTERVAL`. Node-side, not used in scoring (Task 12b) |
| `STAMP_PACKETS_PER_SAMPLE` | 10 | Starting value, tuned by sim and red team. STAMP test packets per `vantage:` sample (`measurement.md` §STAMP probes and probe sessions) |
| `VANTAGE_SAMPLE_INTERVAL_SECS` | 30 s | PB-48, the agent's own timing, not a scored value. The slot length in plan mode: one `vantage:` sample per slot on a session, started at a uniform point inside it, and the window expects one per elapsed slot less one; a window's samples combine into its one `vantage:` sample (`measurement.md` §STAMP probes and probe sessions, "The window's sample") |
| `CAP_PLAN_BLOCKS` / `CAP_PLAN_MARGIN_BLOCKS` | 235 / 20 blocks | PB-48. A window's single-agent capacity tests are the nodes first due at a block `b` with `S <= b < S + CAP_PLAN_BLOCKS`, so the last rank's staggered start is `CAP_PLAN_MARGIN_BLOCKS` before the batch is committed at `S + OWN_COMMIT_OFFSET_BLOCKS` (300 = 235 + 15 x 3 + 20, checked at compile time). Tests due later in the window are in no plan (`measurement.md` §Live loop, "The probe agent's plan and results") |
| `CAP_TEST_STAGGER_BLOCKS` / `CAP_STAGGER_RANKS` | 3 blocks / 16 | PB-48 (red team fix 2). Validator rank `r` (among the read's permit holders, by hotkey) starts a due test `(r mod 16) * 3` blocks after its due block, so tests of one node don't overlap |
| `CAP_MIN_REPORTERS_FLOOR` | 2 | PB-48 verification. Fewest reporting validators a `cap:` key needs under PB-48's rules: `cap_min_reporters(revealing) = clamp(revealing - 1, CAP_MIN_REPORTERS_FLOOR, CAP_MIN_REPORTERS)`, where `revealing` is the window's staked validators whose batch counts (deterministic per window) |
| `MAX_PLAN_NODES` | `MAX_PROBE_SAMPLES / 2` | PB-48 verification C1. Most nodes a probe plan names, after per-UID quotas and UID turns (`probe_plan::plan_candidates`) |
| `CAP_MIN_REPORTERS` | 3 | PB-48 (red team fix 7; verification). The most reporting validators a `cap:` key needs under PB-48's rules (`validator::cap_rules_on`, latched): `cap_min_reporters` is between `CAP_MIN_REPORTERS_FLOOR` and this |
| `CAP_DIALED_CEILING_MBPS` | 100 Mbps | PB-48 (red team fix 9, OQ-283; interim, testnet). Most a test a node behind NAT dialled out for is credited, and its ceiling when the agent paces it (`min(declared, ceiling)`; `measurement.md` §Capacity tests of nodes behind NAT) |
| `CAP_TEST_BUDGET_MBPS` | 2_000 Mbps | PB-48 final verification F2, agent default (`bwos-probe serve --cap-test-budget-mbps`). The most one agent's capacity tests are paced at together: a group test takes `min(budget, Σ ceilings)` once its connections are made (release round, T329); its members' rates are water-filled across UIDs first, then within each (`probe_plan::cap_test_rates_by_uid`, T326), recorded as `CapTarget::paced_mbps`. Each validator's verdict is `measured / paced` (`cap:<n>:verdict_ppm`), scoring takes its median (T327) and judges each test against its own pace, a passing test paced below the declaration censored from the measured median (`TempoOutcome::cap_verdicts`), so a budget-paced node isn't cut as an overclaim. Set it to the validator's real link rate (`measurement.md` §Live loop, "The agent's work") |
| `CAP_GROUP_MAX_TESTS` | 16 (`MAX_CAP_COHORT_NODES`) | PB-48 final verification. Most tests of one draw group (one carried target `/24`, IPv6 `/32`, `probe_plan::cap_draw_key`) in one window, after proven-first and `cap_test_order`; the rest wait for a later draw |
| `CAP_DIALED_GROUP_MAX_TESTS` | 20 (`CAP_TEST_BUDGET_MBPS / CAP_DIALED_CEILING_MBPS`) | PB-48 release round (T325). Most tests of one UID's dialed draw group in one window: all of a UID's NAT nodes are drawn together |
| `CAP_GROUP_UNPROVEN_SLOTS` | 4 | PB-48 release round (T328). Of a group's slots, those kept for unproven nodes when that many are due |
| `CAP_HOLD_SECS_PER_UID_PER_WINDOW` | 60 s | PB-48 release round (T329). Dial-hold seconds one UID's members may cause one agent a window (one `CAP_DIAL_HOLD_SECS` per group); past it a failed push isn't offered a dial |
| `CAP_GROUPS_RUNNING_MAX` | 8 | PB-48 release round (T329), agent (`bwos-probe`). Group tests running at once; the budget bounds what they stream |
| `CAP_DIAL_PORT` | 8_625 | PB-48 fix 9, not a scored value. UDP port of a dial request inside the probe session, at both ends (`bwos_core::cap_dial`) |
| `CAP_DIAL_WAIT_SECS` | 15 s | PB-48 fix 9, agent timing. How long a dial token stays valid after the agent asks; a test with no dial by then is a failed sample |
| `CAP_DIAL_HELLO_SECS` | 5 s | PB-48 fix 9. How long either end waits for the hello, and the node for the request header |
| `CAP_DIAL_MIN_GAP_SECS` | 30 s | PB-48 fix 9. A node takes at most one dial request per probe peer this often |
| `CAP_DIAL_MAX_CONCURRENT` | 4 | PB-48 fix 9. Dials a node runs at once across its probe peers; more are dropped |
| `CAP_DIAL_MAX_HANDSHAKES` | 64 | PB-48 fix 9; final verification F1. Dialed connections an agent reads hellos on at once. Only a source IP holding an unexpired token gets one, one per token; any other is closed on accept with no slot (replaces `CAP_DIAL_ACCEPTS_PER_IP_PER_MIN`) |
| `CAP_DIAL_MAX_BYTES` | 256 MiB (`MAX_CAP_TEST_BYTES`) | PB-48 fix 9. Most a node echoes on one dialed test |
| `CAP_PUSH_CONNECT_SECS` | 3 s | PB-48 fix 9, agent timing (`bwos_core::cap_dial`). How long a push to a node's sink may take to connect before the agent asks for a dial |
| `CAP_DIAL_HOLD_SECS` | 20 s (`CAP_PUSH_CONNECT_SECS + CAP_DIAL_WAIT_SECS + 2`) | PB-48 final verification F3. Once any member of a group test asks for a dial, every stream of the group, pushed or dialed, starts this long after the group started, the connections held with their headers sent; a node serving a dialed test allows it on top of its stream deadline |
| `CAP_ABORT_AFTER_SECS` / `CAP_ABORT_PPM` | 3 s / 10_000 | PB-48 (red team fix 5). An echoed test under 1% of its paced rate after 3 s stops there, and can't then carry the bytes its credit needs |
| `MAX_PROBE_SESSIONS_PER_UID` / `MAX_UNCONSENTED_SESSIONS_PER_UID` | 64 / 16 | PB-48 (red team fix 6). Probe sessions one UID's nodes may hold at one agent, and of those how many may still lack a consent (they can only deliver it) |
| `LINK_PROBE_PORT` / `LINK_ECHO_PORT` | 8_623 / 8_624 (UDP) | PB-48 (red team fix 1). A node's link-probe relay, reached over its probe session, and its signed echo, reached over the overlay from a BGP peer |
| `UNCONFIRMED_GRACE` | 30 s | PB-48, the agent's own timing, not scored. How long a probe session the agent answered is kept before the node's first packet confirms it (`measurement.md` §STAMP probes and probe sessions, "Who gets a session") |
| `CAP_SINK_PORT` | 8_621 (TCP) | PB-48. A node's `cap-sink -persist` listens here, at the address its probe sessions come from, where plan-mode capacity tests reach it (T300, T301) |
| `STAMP_MEAN_GAP_MS` | 100 ms | Starting value, tuned by sim and red team. Mean of the exponential gap between STAMP test packets, drawn from OS randomness and clamped to `10..=1_000` ms |
| `STAMP_REPLY_DEADLINE_MS` | 2_000 ms | Starting value, tuned by sim and red team. A STAMP reply after this is lost |
| `STAMP_MAX_BYTES` | 1_500 bytes | Largest STAMP datagram either end reads; longer ones are dropped (`measurement.md`, "Lengths and TLVs", Task 4Db) |
| `MAX_PROBE_SESSIONS` | 1_024 | Most probe sessions one probe agent holds, all from bound nodes (`measurement.md` §STAMP probes and probe sessions, Task 4Db) |
| `PROBE_AGENT_HANDSHAKES_PER_SEC` | 100 | Starting value. Handshakes a probe agent takes a second, across all its sessions, before it asks for cookies (one boringtun rate limiter shared by every session; Task 4Db fix round 1, red team RT1) |
| `PROBE_PEER_STAMP_PER_SEC` | 20 | Starting value. STAMP tests a node answers per probe peer a second; a sample is 10 tests at least 10 ms apart (Task 4Db fix round 1, red team RT4) |
| `PROBE_PEER_STAMP_BURST` | 20 | Starting value. Token-bucket depth for `PROBE_PEER_STAMP_PER_SEC`, so a whole sample sent at the minimum gap is answered |
| `FORWARD_REVEAL_CUTOFF_BLOCKS` | 60 blocks | PB-45b, OQ-200; 60 since the integration fix round (L4), so the cutoff is `S + 300`, the live loop's own commit block. A probe batch for window `w` lists the consents and forwarded objects its validator held at block `(w + 1)·tempo − 60`; later arrivals go in the next window's batch (`identity.md` §Delivery over the probe session) |
| `MAX_REVEAL_CONSENTS` / `MAX_REVEAL_CONSENTS_PER_UID` | 4_096 / 16 | PB-45b, OQ-200, fix round 1 (H1). Most consents one probe batch lists, and under one UID (each node's current consent first, then its newest revocation; one of each per node, and only the revocation when it supersedes the consent, fix round 2 M4). A batch over the total is refused; a list over a UID's quota adds nothing to the union. A fleet of more than 16 nodes on one UID delivers consents by the store path (OQ-263) |
| `MAX_REVEAL_OBJECTS` / `MAX_REVEAL_OBJECTS_PER_UID` | 768 / 3 | PB-45b, OQ-215, fix round 1 (H1). Most forwarded operator objects one probe batch lists, and under one UID (manifest, binding, then the rest), each `(domain, hash)` once, whole UIDs; only objects admitted against the chain at the read block. A UID over its quota in a list adds nothing from that list; the rest of the list still counts (fix round 2, H1) |
| `MAX_REVEAL_FORWARD_BYTES` | 2_750_000 bytes | PB-45b fix round 1 (M4). Most canonical bytes a batch's `consents` and `forwarded` take together: every cap at its maximum fits, and over 1.4 MB of `MAX_OBJECT_BYTES` stays for the rest of the batch |
| `MAX_FORWARD_PAYLOAD` | 1_150 bytes | PB-45b fix round 1 (M3), not scored. Longest forwarded payload, so the outer packet stays within 1,280 bytes |
| `MAX_NODE_CONSENTS` / `MAX_NODE_OBJECTS` | 8 / 4 | PB-45b, not scored. Most consents and operator objects a node forwards to each probe agent; a validator's pending pool keeps per node its current consent, its newest revocation and `MAX_NODE_OBJECTS` objects, a new one replacing the least recently sent of the domain the node holds most of (fix round 2, H3; cold-start fix) |
| `PROBE_FORWARD_BURST` / `PROBE_FORWARD_REFILL_MS` / `PROBE_FORWARD_RECENT` | 16 / 5_000 ms / 16 | PB-45b, not scored. Per-session token bucket at the agent for forwarded datagrams (past it they are dropped, `forwarded_rate_limited`), and the messages a session remembers so a resend is taken once and, checked first, spends no token (fix round 2, H3) |
| `PROBE_FORWARD_RESEND_SECS` / `PROBE_FORWARD_MIN_GAP_SECS` | 600 s / 60 s | PB-45b, not scored. A node resends what it forwards at least this often, and on a new handshake only once the last send is this old. The agent hands a resend of a message it took on to the pool again at most once per `PROBE_FORWARD_MIN_GAP_SECS` (cold-start fix) |
| `MAX_PROBE_PEERS` | 64 | Most probe peers a node lists (`datapath.md` §Peer admission, "Probe peers", Task 4Db) |
| `DIRECT_ECHO_PORT` | 8_620 (UDP) | Port of a node's public echo responder for `direct:` probes, which carry random payloads, not STAMP (`measurement.md` §STAMP probes and probe sessions) |
| `DIVERSITY_WEIGHT_PPM` | 50_000 ppm | Starting value, tuned by sim and red team; low until stronger upstream evidence exists (OQ-39). Diversity bonus for a node whose underlay ASN has at least two neighbours in public BGP. More add nothing (§Coverage, `measurement.md` §Underlay, ADR-0039; Phase B Task 4B) |
| `IXP_PRESENCE_WEIGHT_PPM` | 50_000 ppm | Starting value, tuned by sim and red team; low because PeeringDB entries are maintained by the ASN holder (T39). Diversity bonus for a node whose underlay ASN is present at an IXP. More IXPs add nothing (§Coverage) |
| `SRG_SHARED_PENALTY_PPM` | 500_000 ppm | Starting value, tuned by sim and red team. Cut to a node's diversity bonus when it shares a shared-risk group (`as:` or `up:`) with a snapshot node of another UID that has verified capacity (§Coverage) |
| `EVIDENCE_MAX_AGE_WINDOWS` | 24 windows | Starting value, tuned by sim and red team. Oldest outside evidence `usable_evidence` keeps: `window - ev.window <= this`. Only the newest object per `(validator, source)` counts. Reveals are served, and retained in `<state-dir>/evidence/`, for at least this plus one windows (`measurement.md` §Outside evidence; Phase B Task 4C) |
| `MIN_ORIGIN_PREFIX_V4` | 8 | Shortest IPv4 prefix an `origin` evidence record may carry; a shorter one makes the object invalid, so no record covers nearly every endpoint and widens every scope (`measurement.md` §Outside evidence, red team RT2; Task 4C fix round 1) |
| `MIN_ORIGIN_PREFIX_V6` | 16 | Shortest IPv6 prefix an `origin` evidence record may carry (as above) |
| `MAX_AGREED_SCOPE_ORIGINS` | 4 | Starting value. Most agreed origin ASNs `evidence-scope` takes per endpoint beyond the validator's own and the underlay (`priority_asns`) ASNs, lowest ASN first. An honest prefix has one or two origins; the cap stops colluders who reach agreement from flooding a scope so an import drops honest records (`measurement.md` §Outside evidence, Task 4C fix round 2 F3, sim `origin_stripper`) |
| `CAP_TOLERANCE_PPM` | 100_000 | Allowed shortfall in a capacity test before penalty (`capacity-bonds.md`) |
| `CAP_PENALTY_WINDOWS` | 24 | Windows a failed test is remembered, and lookback of the peak declaration the overclaim haircut is checked against (`capacity-bonds.md`, `RT2-4`) |
| `CAP_TEST_ID_BYTES` | 32 bytes | Validator-chosen random capacity-test nonce (`test_id`) carried in the request header and signed in the `cap-test-ack` (`measurement.md`, `RT2-3`) |
| `MAX_CAP_TEST_ACK_BYTES` | 1_024 bytes | Maximum canonical JSON size of a sink's `cap-test-ack` reply (`measurement.md`, `RT2-3`) |
| `CAP_CHANGE_WINDOWS` | 24 | Cooldown windows between capacity declaration changes (`capacity-bonds.md`) |
| `OVERCLAIM_PENALTY_PPM` | 200_000 | Haircut when declared ≫ measured (`capacity-bonds.md`) |
| `RECEIPT_TOLERANCE_PPM` | 5_000 | Hop counter agreement (`receipts.md`) |
| `RECEIPT_INTERVAL` | 30 s | Interval between hop receipt co-signing rounds (`receipts.md`) |
| `RECEIPT_UPLOAD_INTERVAL` | 300 s (5 min) | Interval between receipt batch uploads (`receipts.md`) |
| `RETENTION_WINDOWS` | 48 | Windows nodes retain receipts (`receipts.md`). `bwos-validator serve` also uses it as its ingest bound: it refuses a receipt batch whose window is outside `[current - RETENTION_WINDOWS, current + RECEIPT_FUTURE_WINDOWS]` and prunes batches (and dumped window directories) older than `current - RETENTION_WINDOWS` whenever its current window moves (SEC-2, F7, `receipts.md` §Submission) |
| `RECEIPT_FUTURE_WINDOWS` | 2 | Windows past `serve`'s current window a receipt batch may claim (D1 fix round 1, review I4). Until Task 19b's chain clock, `current` comes from operator inputs, and a node exports a window's batch during that window and the next, so a slack of 2 keeps a two-window input lag from losing receipts. Look-ahead windows can't fill the store: the window quotas below apply to them too (`object_store.rs`) |
| `RECEIPT_PAST_INGEST_WINDOWS` | 4 | Windows before `serve`'s current one a **new** receipt upload may claim: new uploads are accepted for `[current - 4, current + RECEIPT_FUTURE_WINDOWS]` (D1 fix round 2, N1). An honest uploader sends only its closed and current windows, so older windows only cost memory: one UID can fill at most 7 windows at a time, not all 51 retained. Stored batches, and batches restored from the dump at startup, are still kept for `RETENTION_WINDOWS` (`object_store.rs`) |
| `MAX_RECEIPT_WINDOW_STEP` | 2 | Furthest one `--signed-inputs` reading may move `serve`'s receipt window forward, the first reading after a restart included: a restarted `serve` starts from the window its dump last confirmed (`receipts/receipt-window.state`, or the newest `window-<w>/` less `RECEIPT_FUTURE_WINDOWS`). A bigger jump (a typo, a far-future table) is logged and held until a later reading offers a window just past it, up to the same step, so one bad file can neither close ingest nor make the dump prune unscored windows (F6, R-I1, `publish.rs`) |
| `MAX_CLIENT_DELTA_BYTES` | 16 MiB | Largest client-receipt delta one request may carry at an ingress, relay or exit (`vpn.rs`, `receipts.md` §Overlay data plane) |
| Relay per-window tables | 1_024 entries | `relay_client_bytes` sessions and the upstream/downstream lock tables per relay (`MAX_STORED_RECEIPTS`, `[INCENTIVE-HOP-01]`); at most 256 registered relay peers (`MAX_REGISTERED_NODES`) |
| `HOP_LOCK_WAIT` | 10 s | Longest wait for a hop proposal lock at an ingress or relay before giving up (`503`) (`vpn.rs`, OQ-27) |
| `-validator` endpoints | 16 | Most validators one `bwos-node exit-serve`/`ingress-serve` uploads receipt batches to (`receipts.md` §Submission) |
| `RECEIPT_DUMP_INTERVAL_SECS` | 30 s | Interval at which `bwos-validator serve` writes the windows whose batches changed under `<state-dir>/receipts/window-<w>/`, one file per batch (F2), and logs the uploads it refused since the last pass, by reason, in one line (F3) |
| `MAX_TEMPO_INPUT_BYTES` | 64 MiB | Largest `run-tempo --input` file (`tempo_cli.rs`) |
| `MAX_RECEIPT_FILE_BYTES` / `MAX_RECEIPT_FILES` / `MAX_RECEIPT_WINDOW_FILES` | 16 MiB / 4_096 / 16_384 | Largest receipt file, most `*.json` files read directly from `run-tempo --receipts-dir`, and most read from its `window-<w>/` directory. Past a count bound the rest (in name order) are skipped with a warning, never failing the whole read or the tempo (N3). The dump writes one batch per file, at most `MAX_OBJECT_BYTES`, so no file reaches the per-file bound however full the window (F2); it and `run-tempo` keep at most `MAX_BATCHES_PER_NODE_WINDOW` batches per node per window, the highest ranked (highest `seq`, then most bytes), and log what they drop (N3, `tempo_cli.rs`) |
| `LOSS_US_PER_PPM` | 1 µs | Reference solver latency penalty per ppm of loss (`routing.md`) |
| `DIRECT_MARGIN_PPM` | 50_000 | Margin by which overlay must beat direct path in reference solver (`routing.md`) |
| `MAX_BULK_LATENCY_MULT` | 1_500_000 ppm | Max allowed latency ratio vs. direct for `bulk` class routes (`1.5x`, `ADR-0017`) |
| `MAX_COST_LATENCY_MULT` | 1_500_000 ppm | Max allowed latency ratio vs. direct for `cost`/`economy` class routes (`1.5x`, `ADR-0017`) |
| `TRANSFER_LOSS_MAX_PPM` | 50_000 ppm | **Proposed (ADR-0046), not yet normative.** Highest hop loss on a `transfer` stripe. The default is the probe pass threshold (OQ-49) |
| `TRANSFER_MAX_PATH_US` | 1_000_000 µs | **Proposed (ADR-0046), not yet normative.** Sanity ceiling on a `transfer` stripe's `route_predicted_us`. There is no latency gate relative to `direct` |
| `TRANSFER_MAX_STRIPES` | 4 | **Proposed (ADR-0046), not yet normative.** Most stripes per `transfer` route (`path` plus `stripes`), and stripe addresses per destination (at most `MAX_BOND_STRIPES`) |
| `TRANSFER_MAX_ORDER_MBPS` | 10_000 Mbps | **Proposed (ADR-0046), not yet normative.** Cap on one order's `need_mbps`. An order whose first-window need is larger is refused, and one whose need later grows past it is `late` |
| `TRANSFER_MAX_DEADLINE_WINDOWS` | 120 windows | **Proposed (ADR-0046), not yet normative.** Longest `deadline_window - issued_window` (about 6 days) |
| `TRANSFER_DELIVERY_LAG_WINDOWS` | 2 windows | **Proposed (ADR-0046), not yet normative.** A demand set for window `w` counts delivered bytes committed in manifests by window `w - 2`'s cutoff, so every receipt is in. Windows still inside the lag are counted at `min(graded rate, need)` until their receipts commit |
| `TRANSFER_MIN_DEADLINE_WINDOWS` | 3 windows | **Proposed (ADR-0046), not yet normative.** Shortest `deadline_window - issued_window` (`TRANSFER_DELIVERY_LAG_WINDOWS + 1`), so an order's first window commits before its last |
| `TRANSFER_MIN_ORDER_BYTES` | 1_073_741_824 bytes (1 GiB) | **Proposed (ADR-0046), not yet normative.** Smallest admitted order. It bounds how finely an order can be split |
| `TRANSFER_MAX_PAIR_MBPS` | 20_000 Mbps | **Proposed (ADR-0046), not yet normative.** Cap on a pair's aggregated `need_mbps` |
| `TRANSFER_MAX_CLIENT_SHARE_PPM` | 100_000 ppm | **Proposed (ADR-0046), not yet normative.** Most pairs carrying one client's orders, as a share of `TRANSFER_MAX_DEMAND_PAIRS` (102 at the defaults), chosen by the client's own funded remaining bytes per pair, then `hash(src, dst)`. A weak limit: client keys are free |
| `TRANSFER_IDLE_WINDOWS` | 3 windows | **Proposed (ADR-0046), not yet normative.** An order with no committed delivered bytes for this many windows after its first is dropped, counting only windows in which its in-lag share was above 0 |
| `TRANSFER_LATE_GRACE_WINDOWS` | 24 windows | **Proposed (ADR-0046), not yet normative.** A late order stays as best effort for this many windows past its deadline, then is dropped |
| `TRANSFER_MAX_DEMAND_PAIRS` | 1_024 | **Proposed (ADR-0046), not yet normative.** Most `transfer` entries per demand set, ranked by funded remaining bytes (largest first), then by entry hash |
| `TRANSFER_PREFIX_HEADROOM` | 512 prefixes | **Proposed (ADR-0046), not yet normative.** Prefixes kept free under `MAX_PEER_PREFIXES` when sizing stripe destinations |
| `STRIPE_PREFIX_BUDGET` | derived, 448 at the defaults | **Proposed (ADR-0046), not yet normative.** `MAX_PEER_PREFIXES - TRANSFER_PREFIX_HEADROOM - MAX_SNAPSHOT_NODES - MAX_SNAPSHOT_ADMISSIONS_PER_WINDOW`. Every table change and incremental update needs `|SP(T_prev) ∪ SP(T)| <= STRIPE_PREFIX_BUDGET`, or the table loses its `transfer` routes. `SP ⊆ SP_prev` and stripe-free tables always pass, and there is no node term (sims `snapshot_union_freeze`, `stripe_prefix_flood` steady state and window change) |
| `TRANSFER_MAX_STRIPE_DESTINATIONS` | derived, 56 at the defaults | **Proposed (ADR-0046), not yet normative.** `STRIPE_PREFIX_BUDGET / (2 * TRANSFER_MAX_STRIPES)`: the most distinct non-synthetic `transfer` destinations per demand set, so any table fits even with full stripe turnover (synthetic routes aren't counted in `SP` and are never announced) |
| `MAX_SNAPSHOT_NODES` | 3_072 | **Proposed (ADR-0046), not yet normative. Launch safety parameter, a founder decision to revisit (OQ-52), not a design limit.** Most nodes in a topology snapshot, and a snapshot with more is invalid. Nodes left out get no routing and no pay in any class. Admission is ranked by deduplicated scoring capacity from window `w - 1`'s `run_tempo` (`[T24]`/`[T28]`), incumbents first (slots of incumbents that are out stay reserved), ties by `tie_key` (tests `snapshot_node_bound`, sim `snapshot_capacity_evictor`) |
| `MAX_SNAPSHOT_ADMISSIONS_PER_WINDOW` | 64 | **Proposed (ADR-0046), not yet normative.** Most nodes not in the previous snapshot admitted per window. This bounds `/128` churn at a window change to 64, and fills an empty snapshot to 3,072 in under three days (20 windows a day). Returning incumbents take these admissions ahead of newcomers. An evictor can't displace incumbents, present or out |
| `MAX_SNAPSHOT_NODES_PER_UID` | 128 | **Proposed (ADR-0046), not yet normative.** Most snapshot nodes per UID, so at least 24 UIDs are needed to fill it |
| `MAX_SNAPSHOT_NODES_PER_GROUP` | 8 | **Proposed (ADR-0046), not yet normative.** Snapshot nodes per §Endpoint dedupe group. Incumbents within the cap are all kept; the room left, `8 - I`, is split across the `u` UIDs with newcomer candidates, `(8 - I) / u` each, with leftover and unused slots in `tie_key(window, "uid:<n>")` order, and a UID with no node in the group still gets 1 (the group can exceed 8, one UID per extra slot). Above 8 incumbents (merged groups) the cap is split over the incumbent UIDs alone (sims `group_cap_squatter`, `group_split_evictor`). Dedupe already pools such a group's capacity to one uplink |
| `MAX_SNAPSHOT_ADMISSIONS_PER_UID_PER_WINDOW` | 8 | **Proposed (ADR-0046), not yet normative.** Most newcomers admitted per UID per window, so one operator can't take all 64 admission slots. Returning incumbents aren't counted (sim `incumbent_ddos_evictor`) |
| `SNAPSHOT_INCUMBENCY_WINDOWS` | 24 windows | **Normative for ASN claims (PB-04, `routing::SNAPSHOT_INCUMBENCY_WINDOWS`):** an ASN claim outlives the last snapshot its node was in by this many windows (§Snapshot inputs). 24 windows is about 29 hours at 72-minute windows: a node down for a day, or with its binding or consent lapsed or quarantined that long, keeps its key's ASN, and an ASN whose node has gone is free a day later. Longer holds dead ASNs, which matters only to a node whose key collides with one, and it can rotate its key. The same figure as ADR-0046's incumbency, so one history serves both. **For slots, proposed (ADR-0046), not yet normative:** a node is an incumbent if it was in at least one of the last this many snapshots and, in at least one of the last this many windows, was live with scoring capacity `> 0` and `Q_n >= SNAPSHOT_INCUMBENCY_MIN_Q_PPM`. Its slot stays reserved while it is out. Otherwise it competes as a newcomer. The history is the snapshot's `incumbency` field, so a validator that joined late builds the same snapshot (sims `snapshot_slot_squatter`, `incumbent_ddos_evictor`) |
| `SNAPSHOT_INCUMBENCY_MIN_Q_PPM` | 500_000 ppm | **Proposed (ADR-0046), not yet normative.** Lowest Mechanism 0 quality `Q_n` that counts towards keeping incumbency. `Q_n` is probed quality, not carried traffic |
| `TRANSFER_IDLE_DELIVERY_PPM` | 100_000 ppm | **Proposed (ADR-0046), not yet normative.** An order whose committed delivery in a committed window is below this share of its in-lag share for that window is demoted, ranked after sending clients for the per-window and destination caps (sim `transfer_destination_squatter`) |
| `DEFAULT_COST_PPM` | 1_000_000 ppm | **Proposed (ADR-0046), not yet normative.** Cost used for `direct_cost_ppm` when it is unset or 0, and for a link with no `cost_ppm` (the snapshot's existing 1.0x default, named) |
| `TRANSFER_SYNTHETIC_PAIRS` | 16 | **Proposed (ADR-0046), not yet normative.** Synthetic `transfer` entries per window, drawn from the probe-schedule seed and marked `synthetic`, so solvers are graded before customers exist. Their routes are removed from the production table and never credited |
| `TRANSFER_PACE_SPLIT_PPM` | 500_000 ppm | **Proposed (ADR-0046), not yet normative.** Splits `transfer` gains into the on-pace band `[-split, 1e6]` and the behind-pace band `[-1e6, -split - 1]` |
| `TRANSFER_CHURN_WEIGHT_PPM` | 250_000 ppm | **Proposed (ADR-0046), not yet normative.** Weight of a changed `transfer` pair in `churn_ppm` (other classes: `1_000_000`) |
| `TRANSFER_SWITCH_MARGIN_PPM` | 50_000 ppm | **Proposed (ADR-0046), not yet normative.** Solver-side, not used in scoring: how much cheaper a `transfer` route's new stripes must be before they replace kept ones that still give `need_mbps` (`ROUTE_SWITCH_MARGIN_PPM` stays for other classes) |
| `WINDOW_SECONDS` | 4_320 s | **Proposed (ADR-0046), not yet normative.** `WINDOW_BLOCKS * BLOCK_SECONDS`, used in `transfer`'s `need_mbps` |
| `OVERLAY_BASE_ASN` | 4_200_000_000 | Base RFC 6996 4-byte private ASN (`ADR-0017`). It no longer sets overlay origins or any overlay node's ASN: since PB-04 every node peers with, and origin validation checks, `identity::node_asn_from_public` of its key (`NODE_ASN_MIN`..`NODE_ASN_MAX`, ADR-0033 item 4; `datapath.md`; §Snapshot inputs). Kept for `provisioning.rs`, `identity.rs` and the Edge appliance, which still use it |
| `table_policy::MAX_PEER_PREFIXES` / `bgp::MAX_LEARNED_ROUTES` | 4_096 prefixes per session | Datapath, not used in scoring (`datapath.md`, "Prefix limit"; ADR-0033 item 10, kept for launch by the founder). Past it a session is closed with NOTIFICATION Cease/1, but the kinds count differently (OQ-44): FRR (`maximum-prefix 4096`, no `force`, no `soft-reconfiguration inbound`) counts the routes its inbound policy accepts from that session and drops refused ones as they arrive; the no-root session in `bwos_net::bgp` counts every route offered, refused or not. Raising it needs an ADR |
| `table_policy::MAX_PREFIX_RESTART_MINUTES` | 1 minute | Datapath, not used in scoring (`datapath.md`, "Prefix limit"; OQ-37). FRR's `maximum-prefix ... restart` interval: how long a kernel node waits before it tries a session it closed for going past `MAX_PEER_PREFIXES` again |
| `routes::MAX_ROUTES` | 4_096 prefixes per node | Datapath, not used in scoring (`datapath.md`, "Transit through a no-root node"; ADR-0033 item 10). Node-wide limit on a no-root node across all sessions: past it a new prefix is refused but kept waiting, and takes a slot when one frees, so a fill that clears doesn't black-hole an honest route |
| `bgp::MAX_REFUSED_ROUTES_PER_MINUTE` | 16_384 routes per session per minute | Datapath, not used in scoring (`datapath.md`, "Prefix limit"; Task 10 fix round 2). Routes a no-root node refuses from one session in a minute that no honest peer sends (outside the overlay, reserved, or from the wrong origin; unassigned ones don't count, as an honest relay sends them) before it closes the session with Cease/1 and holds the peer down |
| `bgp_peer::MIN_HOLD_DOWN_MS` / `MAX_HOLD_DOWN_MS` / `HOLD_DOWN_RESET_MS` | 1 s, doubling to 60 s; reset after 10 min up | Datapath, not used in scoring (`datapath.md`, "Prefix limit"; OQ-37). How long a no-root node refuses a peer after closing its session with Cease/1 for its routes |
| `table_policy::DAMP_PENALTY_PER_FLAP` | 1_000 | Starting value. Datapath, not used in scoring, but it changes which paths carry traffic (`datapath.md`, "Flap damping"; T141, sim `damping_griefer`). Penalty a (peer, prefix) path gains each time the peer withdraws it, on both node kinds (FRR's fixed figure) |
| `table_policy::DAMP_SUPPRESS` | 6_000 | Starting value. Penalty at which a path is suppressed: seven flaps 10 s apart reach about 6,841, six about 5,886, one restart 1,000 (`datapath.md`, "Flap damping") |
| `table_policy::DAMP_REUSE` | 750 | Starting value. A suppressed path is used again once its penalty decays below this (`datapath.md`, "Flap damping") |
| `table_policy::DAMP_HALF_LIFE_MS` | 900_000 ms (15 min) | Starting value. Half-life of the penalty; FRR takes whole minutes (`datapath.md`, "Flap damping") |
| `table_policy::DAMP_MAX_SUPPRESS_MS` / `DAMP_CEILING` | 3_600_000 ms (60 min) / 12_000 | Derived, not tuned: four half-lives, FRR's default ratio. The penalty never exceeds `DAMP_REUSE * 2^4`, so a path is reusable within an hour of its last flap (`datapath.md`, "Flap damping") |
| `damping::HOLD_DOWN_MS` | 2_000 ms | Starting value. No-root node only. After a peer's BFD session goes down, its paths are chosen for this long only where no other peer offers one (`datapath.md`, "Flap damping"). Not the session hold-down after a Cease above |
| `overlay_bgp::REFRESH_WAIT_SECS` | 10 s | Datapath, not used in scoring (`datapath.md`, "A new table"; `threat-model.md` T57). How long `bwos-node refresh-check` waits after asking a kernel node's peers for their routes again before it hard-clears one that hasn't answered or still has paths the new policy doesn't give, and quarantines it: at later applies a quarantined peer is judged once the others have answered, but no earlier than `QUARANTINE_JUDGE_SECS` after it's asked, without the wait. A peer it can't verify by then is cleared if its lists changed against the table applied before, it's quarantined, or a path from it was seen stale, and otherwise logged as unverified (fail closed) |
| `overlay_bgp::QUARANTINE_JUDGE_SECS` | 2 s | Datapath, not used in scoring (`datapath.md`, "A new table"; `threat-model.md` T57; Task 10 fix round 4). The earliest `refresh-check` judges a quarantined peer after asking it, so an honest one that answers within it isn't cleared. The sim's `refresh_ignorer_framer` uses the same constant for how long a quarantined ignorer's stale path stands at each apply |
| `install.sh` `APPLY_LOCK_WAIT_SECS` / `APPLY_VTYSH_SECS` / `APPLY_INPUTS_SECS` / `APPLY_REFRESH_SECS` / `APPLY_WG_SECS` | 60 s / 30 s per commit / 120 s / 60 s / 30 s | Datapath, not used in scoring (`datapath.md`, "Apply bounds"; RB-02). What `bwos-apply-table` waits for the apply lock, and the bound at which each `vtysh -f`, `signed-inputs`, `refresh-check` and `allowed-ips` call under it is killed, failing the apply and freeing the lock |
| `install.sh` `APPLY_UNIT_SECS` / `OTHER_UNIT_SECS` / `GUARD_UNIT_SECS` / `LINKS_SECS` | 600 s / 300 s / 60 s / 120 s | Datapath, not used in scoring (`datapath.md`, "Apply bounds"; RB-02). `TimeoutStartSec` of the apply units, of `bwos-links`, `bwos-report` and `bwos-advert`, and of `bwos-guard`; the bound on `links.sh` during an install |
| `install.sh` `ADVERT_LOCK_BOUND_SECS` (`advert_check::DEFAULT_LOCK_BOUND_SECS`) | 900 s | Datapath, not used in scoring (`datapath.md`, "Advertising check" and "Apply bounds"; RB-02). The apply lock held longer than this is a wedged apply: `advert-check` restarts FRR, under its usual jitter and rate limit |
| `allowed_ips::SUBPROCESS_DEADLINE_SECS` | 20 s | Datapath, not used in scoring (`datapath.md`, "Apply bounds"; RB-02). Each `vtysh` and `wg` call of `bwos-node allowed-ips` is killed past this and that pass fails |
| `install.sh` `LOG_RATE_INTERVAL` / `LOG_RATE_BURST` | 30 s / 1,000 lines | Operations, not used in scoring (`datapath.md`, "Apply bounds"; RB-06). Every kernel-node unit's journald rate limit |
| `node::UNASSIGNED_LOG_INTERVAL` | 10 s | Datapath, not used in scoring (`datapath.md`, "From a peer"; Task 10 fix round 4). A no-root node logs the first unassigned route from a peer in each interval as it comes, and the rest as one count per peer at the interval's end |
| `node::MAX_PEERS` | 8 | Datapath, not used in scoring: most peers one no-root node takes (`bwos_net::node`) |
| `bgp::MAX_AS_PATH_LEN` | 64 | Datapath, not used in scoring: longest AS path a no-root node accepts; longer is treated as withdrawn (`bwos_net::bgp`) |
| `advert-check` `-grace-secs` / `-restart-every-secs` / `-restart-jitter-secs`, timer | 20 s / 1_800 s / 60 s, every 10 s | Datapath, not used in scoring (`datapath.md`, "Advertising check"): a stall counts after a peer has been Established and unadvertised for the grace period; FRR restarts are at most one per 1,800 s plus a per-node jitter of up to 60 s; `bwos-advert.timer` runs the check every 10 s, on its own timer |
| `ROUTE_SWITCH_MARGIN_PPM` | 100_000 ppm | Solver-side, not used in scoring (`routing::stabilize_routes`; `bwos-solver -previous` and the prototype loop `bwos-solver links`): how much better a pair's new path must be, by its class's measure, before it replaces the previous table's (`routing.md`, "Reference solver"). Holds an incumbent's `churn_ppm` down when a contested link's latency swings (`threat-model.md` T34) |
| `bfd::DEFAULT_INTERVAL_US` / `bgp-overlay -bfd-ms` | 200 ms, by 3 | Datapath, not used in scoring (`datapath.md`, "Sub-Second BFD Failover"): BFD transmit and receive interval on every overlay session, kernel and no-root. Detection in 600 ms, so both ends are on the backup in under a second. **Cost:** 600 ms with no packet from a peer resets its BGP session, so a link that loses that much in a row flaps, where FRR's 300 ms default tolerates 900 ms but missed the second (up to 1,108 ms). False flaps over long WAN paths are Task 7c's to measure |
| `MIN_COST_PPM` | 200_000 ppm | Minimum operator-declared transit rate multiplier (`0.20x`, `ADR-0018`) |
| `MAX_COST_PPM` | 2_000_000 ppm | Maximum operator-declared transit rate multiplier (`2.00x`, `ADR-0018`) |
| `CONGESTION_SURCHARGE_PPM` | 2_000_000 ppm | Quadratic link utilization congestion surcharge factor (`+2.0x` at 100% load, `ADR-0018`) |
| `MAX_REALTIME_JITTER_US` | 5_000 µs | Hard jitter SLA gate for `realtime` class routes (`5 ms`, `ADR-0018`) |
| `MAX_REALTIME_LOSS_PPM` | 5_000 ppm | Hard packet loss SLA gate for `realtime` class routes (`0.5%`, `ADR-0018`) |
| `BACKUP_INTERIOR_DISJOINT_MULT_PPM` | 1_000_000 ppm | Disjointness multiplier (`1.0x`) when `backup_path` is both interior-node-disjoint and edge-disjoint (`ADR-0018`) |
| `BACKUP_LINK_DISJOINT_MULT_PPM` | 500_000 ppm | Disjointness multiplier (`0.5x`) when `backup_path` is edge-disjoint but shares an interior node (`ADR-0018`). Unreachable for `resilient` since ADR-0039: a backup sharing an interior node is invalid (`routing.md` §Validation rule 2), pending founder sign-off (OQ-82) |
| `PROTOCOL_VOUCHER_BURN_PPM` | 50_000 ppm | Minimum protocol burn/fee (`5%`) when minting a `BandwidthVoucher` from $\alpha$ (`ADR-0019`) |
| `MIN_VOUCHER_ALPHA_PER_GIB` | 1_000 raw α units / GiB | `[T20]` voucher price floor: a voucher backs at most `min(max_paid_bytes, floor(alpha_credit_u64 * 2^30 / MIN_VOUCHER_ALPHA_PER_GIB))` paid bytes (`BandwidthVoucher::effective_max_paid_bytes`). Below the floor a voucher is capped, not rejected; an effective quota of 0 is refused (receipts.md §Price floor, `vpn.rs`) |
| `MAX_RETAINED_CONSENTS` | 65_536 | Most node consents a validator retains in `<state-dir>/consents-state.json` (`bwos-validator` `consent_state.rs`, OQ-22). On overflow, non-revoked consents are evicted first and revocations last; validators with different retained sets can disagree on which bindings are live |
| `MAX_PENDING_CONSENTS_PER_NODE` | 4 | Most not-yet-started consents retained per node (`consent_state.rs`); lower-`seq` started consents are dropped because they can never win (`identity::effective_consents`) |
| `MAX_AGGREGATOR_COMMISSION_PPM` | 200_000 ppm | Maximum commission (`20%`) a Fleet Aggregator UID can deduct before sub-node $\alpha$ distribution (`ADR-0019`) |
| `MAX_BOND_STRIPES` | 8 | Maximum parallel interior-node-disjoint stripes in a Programmable Multi-Path Virtual Bond (`ADR-0020`, `routing.rs`) |
| `MAX_BATCH_RECEIPTS` | 1_024 | Maximum `HopReceipt` or `ClientReceipt` entries per `ReceiptBatch` (`receipts.rs`) |
| `MAX_FABRIC_NODES` | 64 | Maximum nodes permitted in a single self-hosted Private/Hybrid Fabric manifest (`ADR-0022`, `cli-and-mcp.md`) |
| `MAX_WIRE_BYTES` | 4_194_304 bytes (4 MiB) | Maximum canonical JSON payload size (`encoding.md`, `wire.rs`) |
| `MAX_JSON_DEPTH` | 16 | Maximum JSON nesting depth in canonical wire format (`encoding.md`, `wire.rs`) |
| `MAX_DECLARATION_NODES` | 1_024 | Maximum nodes per `NodeBinding` or `CapacityDeclaration` (`identity.md`, `capacity-bonds.md`) |
| `MAX_ROUTE_PATH_NODES` | 16 | Maximum nodes (including `src` and `dst`) per route `path`, `backup_path` or bond stripe (`routing.md`, `routing.rs`) |
| `MAX_ROUTE_ID_LEN` | 128 bytes | Maximum length of a route `id`/`src`/`dst`/`class`/path node ID; printable ASCII only (`routing.md`, `routing.rs`) |
| `PARETO_FRONTIER_CAP` | 32 | Maximum simultaneously retained Pareto labels per node in the reference `realtime` and `economy` label-setting searches (`routing.md`, `routing.rs`) |
| `SAMPLE_RATE_PPM` | 10_000 ppm | Secure sampling rate: a packet is sampled when the first 4 bytes of its keyed tag, big-endian, are below `rate_ppm * 4294` (`measurement.md` §Secure sampling, `hop_digest.rs`, ADR-0038). Not scored while `HOP_DIGESTS_SCORED` is `false` |
| `SAMPLE_REVEAL_DELAY_MS` | 3_000 ms | Earliest an ingress reveals an epoch's sampling key after the epoch ends; hops publish that epoch's `HopDigestBatch` before it (ADR-0038) |
| `SAMPLE_EPOCH_MS` | 1_000 ms | Length of one sampling epoch, the unit of key reveal and of `HopDigestBatch` (ADR-0038; OQ-63) |
| `SAMPLE_EPOCHS_PER_WINDOW` | 8_192 | Length of a window's sampling key chain: epochs `1 ..= 8_192` are sampled, epoch 0 is the anchor (ADR-0038) |
| `MAX_HOP_DIGESTS_PER_BATCH` | 200_000 | Most digests in one `HopDigestBatch`, which keeps a batch under the object store's 4 MiB (`receipts.md` §Hop digests; OQ-64) |
| `HOP_DIGESTS_SCORED` | `false` | Whether hop digests and spoof evidence affect any weight. `true` only once ADR-0038's `incentive-red-team` pass clears it; Task 16c pays spoof evidence only while it is `true` |
| `CANARY_BUDGET_BYTES_PER_WINDOW` | 27_000_000_000 bytes | Starting value (Task 14, ADR-0051 §5), set in PB-38. The global canary budget a window's allocation spends: 50 Mbps averaged over the window, fabric-wide. At 100 equal nodes, 270 MB of ingress per node per window (0.5 Mbps); at 1,000, 27 MB (50 kbps). A validator sources and sinks its stake share: 270 MB a window, about 162 GB a month each way, at 1% of the counted stake (`measurement.md` §Canary plans). Not scored |
| `CANARY_WINDOW_MS` | 4_320_000 ms | Derived: `DEFAULT_WINDOW_BLOCKS * BLOCK_SECONDS * 1000`. A plan entry's `start_ms` is below it |
| `CANARY_NODE_WEIGHT_CAP_MBPS` | 10_000 Mbps | Starting value. A node's allocation weight is its deduped verified capacity up to this. Splitting above it pays, bounded by the per-UID cap (T147) |
| `CANARY_UID_CAP_PPM` | 250_000 ppm | Starting value. Most of the total allocation weight one UID's nodes can hold, as `USAGE_SHARE_CAP` |
| `CANARY_PAIR_MAX_BYTES` | 1_000_000_000 bytes | Starting value. Per-pair, and so per-path, cap on allocated bytes per window. Fits a plan entry's `u32` |
| `CANARY_CHUNK_BYTES` | 64_000_000 bytes | Starting value. Target bytes per allocation draw: a node gets `quota / CANARY_CHUNK_BYTES` destinations, within its floor and `CANARY_MAX_PAIRS_PER_NODE` |
| `CANARY_MIN_PAIRS_PER_NODE` | 4 | Starting value. The per-node floor, in destinations, not bytes. It applies only to nodes with deduped verified capacity of at least `CANARY_FLOOR_MIN_MBPS`, and to at most `CANARY_FLOOR_NODES_PER_UID` per UID. Other nodes get at least 1 |
| `CANARY_MAX_PAIRS_PER_NODE` | 16 | Starting value. Most destinations one node's quota is spread over |
| `CANARY_FLOOR_MIN_MBPS` | 100 Mbps | Starting value, as `CAP_RAMP_FLOOR_MBPS`. Least deduped verified capacity that earns the pair floor |
| `CANARY_FLOOR_NODES_PER_UID` | 16 | Starting value. Most nodes of one UID that get the pair floor |
| `CANARY_MAX_PAIRS` | 12_288 | `4 * MAX_SNAPSHOT_NODES`. Most allocation draws. Above it every node gets one draw, and above it in nodes, a weight-blind lottery keeps this many |
| `CANARY_MAX_ENTRIES` | 16_384 | Most entries in one plan, which keeps a `CanaryReveal` under the object store's 4 MiB |
| `CANARY_MIN_FLOW_BYTES` | 64 bytes | Smallest plan entry. A validator's share of a pair below it is 0 |
| `CANARY_PACKET_BYTES` | 1_420 bytes | Largest inner IPv6 packet the canary driver asks its source node to send: the overlay path MTU. Packets are filled to it with a remainder tail (fix round 1, F1) |
| `CANARY_COMMIT_CUTOFF_BLOCKS` | 5 blocks | Fix round 1 (F3). A validator's canary-plan commitment counts only as its manifest slot stood at the seed block plus this, among values set at or after the seed block; later overwrites are ignored (`probe::pinned_canary_commitment`) |
| `CANARY_SECRET_RETAIN_WINDOWS` | 48 windows | Fix round 1 (F6), as `RETENTION_WINDOWS`. How far back verifiers check a hotkey's revealed canary secrets for reuse; reuse further back is outside the bound (`probe::canary_secret_is_fresh`) |
| `CANARY_MAX_KEY_LEN` | 64 bytes | Longest node key the canary allocation admits and a plan entry may name (an ed25519 key in hex). With `MAX_MARGINAL_CLASS_LEN` it keeps a `CANARY_MAX_ENTRIES` plan under 4 MiB |
| `MAX_MARGINAL_CLASS_LEN` | 32 bytes | Longest class name in `GlobalMarginals` and in a plan entry |
| `MAX_MARGINAL_BUCKETS`, `MAX_MARGINAL_CLASSES`, `MAX_MARGINAL_SLICES` | 64, 16, 1_024 | Most size buckets, classes and timing slices in `GlobalMarginals`; a part over its limit is replaced by the default mix's |
| `MAX_STORED_RECEIPT_BATCHES` | 208_896 | Receipt batches retained per validator object store: `(MAX_RECEIPT_NODES + MAX_RECEIPT_EXTRA_BATCHES_PER_WINDOW) x (RETENTION_WINDOWS + RECEIPT_FUTURE_WINDOWS + 1)`, every listed node's first batch plus the window's extras for each of the 51 windows held. With an allowlist of at most `MAX_RECEIPT_NODES` the per-window rules keep the store under it, so it is a backstop (`object_store.rs`) |
| `MAX_RECEIPT_NODES` | 3_072 | Most node keys on `--receipt-nodes-file` (`MAX_SNAPSHOT_NODES`: only snapshot nodes carry routed transit). Each listed node's **first** batch for a window is always admitted, from a reserve, unless the node is at `MAX_BATCHES_PER_NODE_WINDOW`; a dominating batch that replaces a node's only one counts as its first (F1) |
| `MAX_RECEIPT_EXTRA_BATCHES_PER_WINDOW` | 1_024 | Batches beyond each node's first that one window may hold, across all nodes. Honest cumulative uploads dominate and replace each other, so they need none; extras hold non-dominating batches (a counter rollback kept as evidence) (F1) |
| `RECEIPT_UID_QUOTA_PER_NODE` | 2 | Batches one UID may hold in one window per node it has on the allowlist, firsts included: so at most one extra per node, and at most `RECEIPT_UID_EXTRAS_CAP` extras in all. A UID binding 123 sybil keys holds 246 batches a window, never the store (red team R3). Applies when `--receipt-nodes-file` maps keys to UIDs (`{"<node key>": <uid>}`); a key without a UID is bounded by `MAX_BATCHES_PER_NODE_WINDOW` alone (F1) |
| `RECEIPT_UID_EXTRAS_CAP` | 256 | Most of one window's `MAX_RECEIPT_EXTRA_BATCHES_PER_WINDOW` pool one UID may hold (a quarter), so a 1,024-node UID can't take every extra slot from other UIDs (N2, `object_store.rs`) |
| `MAX_FAILED_UPLOAD_CACHE` | 4_096 | Raw receipt uploads whose verification failed that a store remembers by SHA-256, oldest dropped first; the same bytes again are refused unverified (`failed_before`), so a failed batch can't be replayed to keep verification slots busy (N4, `object_store.rs`) |
| `MAX_STORED_OBJECTS` | 212_992 | Objects retained per object store: `MAX_STORED_RECEIPT_BATCHES` + 4_096 other ADR-0015 objects (receipt batches are also served as objects); `bwos-validator serve` and `bwos-node run` accept object `PUT` only from loopback, decided on the parsed request before the body is read (`object_store::request_allowed`, TV-27) |
| `HTTP_REQUEST_DEADLINE` | 10 s | Overall wall-clock deadline for reading one object store HTTP request, header and body (`408` on expiry; `traffic-verification.md` TV-27, `object_store.rs`) |
| `HTTP_IO_TIMEOUT` | 5 s | Per-read and per-write socket timeout on object store HTTP connections (`object_store.rs`) |
| `MAX_HTTP_CONNECTIONS` | 64 | Object store connections handled concurrently per listener by `bwos-node run` and `bwos-validator serve`; extra connections get `503` (`object_store.rs`) |
| `MAX_HTTP_CONNECTIONS_PER_IP` | 8 | Object store connections handled at once from one non-loopback source, under `MAX_HTTP_CONNECTIONS`; extra ones get `503` and are closed unread, so one source can't take every slot (F5, T120, `object_store.rs`). A source is an IPv4 address, or an IPv6 `/64` (an IPv4-mapped address counts as its IPv4 address), since a host can rotate addresses within its `/64` (N5). Loopback peers are exempt |
| `FETCH_TIMEOUT` | 5 s | Overall deadline for one `fetch::get`: connect, request, headers and body together. Peers are IP literals, so no resolver call runs outside it (`routing.md` §Distribution, `fetch.rs`) |
| `MAX_FETCH_PEERS` | 64 | Most peers one fetch asks, after duplicates are removed; `--peer-validators` refuses more. Peers are asked in parallel, so a fetch takes about one `FETCH_TIMEOUT` (`fetch.rs`) |
| `REPUBLISH_INTERVAL_SECS` | 30 s | How often `bwos-validator serve` merges peer attestations into its published inputs again (`publish.rs`) |
| `SIGNED_INPUTS_POLL_SECS` | 10 s | How often `bwos-validator serve` re-reads `--signed-inputs` and publishes new or changed files without a restart (DEP-05, `routing.md` "Live reload", `publish.rs`) |
| `MAX_CONCURRENT_RECEIPT_VERIFICATIONS` | 4 | Receipt batch uploads whose receipt signatures are verified at once per object store server, **at most one per node key** (review I1, F5); another gets `503` unverified. Before a slot is taken, an upload passes the allowlist, window bound, replay, failed-upload cache, domination and quota checks under the store lock (quota counters are kept running, so these are `O(log n)`), then its own batch signature, one check off the lock, so a forgery with no key never takes a slot (SEC-1, N4, `object_store.rs`) |
| `QUARANTINE_SUPERMAJORITY_PPM` | 670_000 ppm | Stake-weighted validator supermajority threshold (`67%`) required to quarantine an abusive `fc00::/128` node (`ADR-0031`, `overlay_web.rs`) |
| `MIN_QUARANTINE_VALIDATORS` | 2 | Minimum distinct active validators required alongside `QUARANTINE_SUPERMAJORITY_PPM` when `>= 2` active validators exist (`ADR-0031`, `overlay_web.rs`) |
| `MAX_FABRIC_NAME_LEN` | 63 bytes | Maximum DNS-compatible label length for `<name>.fabric` records (`ADR-0031`, `overlay_web.rs`) |
| `MAX_FABRIC_DIRECTORY_RECORDS` | 4_096 | Maximum verified `FabricNameRecord`s retained in `FabricNameDirectory` (`ADR-0031`, `overlay_web.rs`) |
