> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moda.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# B

# B — call sites (B1–B5)

## Goal

Pass the tenant rung: attribute serving dollars to nonempty tenants at each
app/caller site. Run ID and stage rollout wait for the run rung. The scoreboard
holds current values; use the [architecture](../architecture.md) and existing
B1–B5 ownership in `infra/cost-lanes.json`, not a new `B` marker.

## Metric

Share of serving dollars with a nonempty tenant, by app and caller site.
Published non-internal dollars, including unexplained dollars, are a conservative
serving denominator until C classifies them; never improve the fraction by
discarding an unknown app/site or an unexplained row. Absolute signed row amounts
measure attribution exposure, not net bill reconciliation (E owns that gate).

## Proof query

```sql theme={"dark"}
WITH publications AS (
  SELECT day,argMax(ledger_run_id,tuple(ledger_version,published_at,ledger_run_id)) AS run
  FROM moda.cost_ledger_publications
  WHERE day>=toDate(now('UTC'))-7 AND day<toDate(now('UTC')) GROUP BY day
)
SELECT caller_app,caller_site,max(day) AS last_published_day,
  sum(abs(toInt128(cost_nanos))) AS serving_exposure_nanos,
  sumIf(abs(toInt128(cost_nanos)),tenant_id!='')/nullIf(sum(abs(toInt128(cost_nanos))),0) AS tenant_share,
  toUInt8(sum(abs(toInt128(cost_nanos)))>0 AND tenant_share>=0.90) AS exit_pass
FROM moda.cost_ledger_daily FINAL
PREWHERE day>=toDate(now('UTC'))-7 AND day<toDate(now('UTC'))
WHERE (day,ledger_run_id) IN (SELECT day,run FROM publications) AND kind!='internal'
GROUP BY caller_app,caller_site ORDER BY caller_app,caller_site
SETTINGS readonly=2,max_threads=1,max_bytes_to_read=1000000000,max_result_rows=1000,
  max_execution_time=30,read_overflow_mode='throw',result_overflow_mode='throw'
```

## PRs to adopt now

From the [merged map](../pr-lane-map.md), keep each PR's existing owner:

* B1: #11362 (GitHub/replay credentials; split other owners' work). Preserve
  \#10901, #8661 and #7060; they are adjacent work, not provider-close adoption jobs.
* B2: #11363, #11360, #11359 (staged credentials), #11316 (app/key attribution),
  \#11309 (occupancy prerequisites with D). #4378: verify still relevant; rebase or close.
* B3: #11506 (insertion retries), #11106 (approved reader-key handling).
* B4: coordinate the replay slice of #11362; no separate B4 adoption is assigned.
* B5: #11535 (internal probe classification), #11361 (embedding/segment keys).
* Park #11331, #11328, #11325, #11324, #11318 and #11314: call-ID/run coverage
  waits for the run/message rungs. Preserve their scope/membership work.

## Stop-and-ask conditions

Stop before a deploy/flag flip, cross-lane edit, shared-key fallback or changing
work scope to make a missing tenant look internal. Do not add run/stage rollout
or per-message coverage to the tenant job. Follow [standing rules](README.md).

## Exit check

Every returned serving app/site must have `exit_pass=1`; no rows or a missing
expected app/site is fail, not success. Check inventory against C's bill/key
registry and the scoreboard: this query cannot detect an entirely absent emitter.
E must also establish a fresh, bill-closed publication before this is a rung exit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.