ADR-068: Live-Service Degradation Posture Under DB I/O Stall — Server-Yields-First Typed Failure, Route-Class Request Ceilings, a Phase-Aware DB Error Taxonomy, and Saturation Hysteresis
Status
Accepted (2026-08-23). Design unit of #1404 (epic &83’s last child, outside the &83 program
by the ratified boundary — ADR-067 §Open questions). Drafted FIRST per the
draft-first path; implemented on
feature/1404-degradation-posture. Plan:
DB-Degradation Posture (archived). The design survived one
internal adversarial review (11 findings) and the maintainer’s external stop-ship review
(26 findings); the censuses in the appendices are review outputs, not estimates. Ratified
direction (steer 2026-08-16, mode B): server-yields-first typed failure + honest health.
Merging this design promotes the C21 pool-contention characterization from report-only to
enforcing (contested-surfaces.toml, pool.craig-db.serving-acquire). Amended in part by
§ Amendment — #1571 (Proposed 2026-09-17; Accepted 2026-09-18 at that
plan’s close-out U8, #1940 — plan
Background Jobs (#1571), archived): the Batch class
is gone — the eight backgrounded engines landed as jobs and CeilingClass is
Standard | Extended; D1 / D1a / D1b below are restated to the as-built. Amended in part by
§ Amendment — #1572 (Proposed 2026-09-19; Accepted 2026-09-20 at that
plan’s close-out U2, #1947 — plan
Streaming Object-Store Downloads (#1572), archived):
the nine download GETs stream and move to Standard — the Extended class keeps only the upload nests and the two
reporting export POSTs; the class-table row, the streamed-body sentence and the BFF pairing bullet in D1a are
restated below to the as-built. Amended by § Amendment — #2478 (Accepted 2026-11-12, a
maintainer ruling): D1’s revisit trigger has fired, and a three-deep synchronous chain is accepted where each inner
hop’s budget is const-asserted inside its caller’s.
Context
The 2026-08-11 U4a battery (forensics on #1403) showed the fleet’s actual posture under
Postgres I/O stall: POST /v1/cases/persons hung the full 30 seconds until the client
timed out; outbox single-row UPDATEs ran 25.6s/17.2s. The arithmetic guarantees the hang:
-
The shared S2S client budget (
craig_common::build_shared_client) is 30s total / 5s connect. The sessionstatement_timeout(set once per connection by the pool’safter_connecthook) defaults to 30s. Equal budgets mean the client always eats the whole stall. -
No inbound request deadline exists anywhere:
apply_global_layershas no timeout layer andaxum::serveruns bare. The only server-side bounds are the fixed 5s pool-acquire cliff (craig_db::SERVING_ACQUIRE_TIMEOUT, #1160) and the session statement timeout. -
Error mapping is dishonest about all of it: SQLSTATE 57014 (statement kill) arrives as
sqlx::Error::Database→ the blanketApiError::Db→ a redacted RFC-9457 500 after up to 30s;sqlx::Error::PoolTimedOutmaps to a typed 503 ONLY on the tx-begin path (map_begin_error); everything else — connection loss, commit-phase failures — is a 500 regardless of retry safety or outcome certainty.
A degraded database must never convert into a caseworker-facing raw stall. The server gives up first, typed; already-durable event-pipeline work catches up; health is honest without inviting restart flapping. That is the ratified posture this ADR realizes.
Decision
D1 — Deadline model: the two-inequality rule, enforced by route-class ceilings
Requiring the sum of all inner worst cases to fit under one ceiling is neither achievable nor necessary — every inner budget (pool acquire, statement timeout, authz/rules eval, S2S hop) is itself a fail-fast path that terminates the request with its own typed error. Two inequalities are required, each with explicit margin, and only these:
-
Specific-beats-generic: each single inner budget + processing margin
<the route’s ceiling — when exactly one component is slow, the caller gets that component’s typed error, never the generic ceiling 504. -
Server-yields-first: ceiling + client connect + margin
<the client’s total budget — the server always answers (typed) before any first-party caller gives up.
The Standard chain:
| Bound | Value | Enforcement |
|---|---|---|
Pool acquire |
5s |
|
In-request S2S hop |
≤ 8s |
|
Per-tx statement budget |
10s |
|
Authz / rules eval budgets |
5s (existing defaults) |
unchanged; settings load refuses any configured value ≥ 19s |
Request ceiling (Standard) |
20s |
the new ceiling middleware (D1a) |
S2S client |
30s total / 5s connect |
|
Checks: 5+ε<20, 8+ε<20, 10+ε<20, 20+5+5<30. Where both sides are consts the order is
pinned by const _: assertions; where one side is a knob it is pinned by settings-load
refusal: db_statement_timeout_ms < 10_000 is refused (SET LOCAL would otherwise silently
raise an operator-tightened bound — the floor makes the joint decision explicit), and
authz_eval_timeout_ms / the rules eval budget are refused at ≥ 19s.
SET LOCAL placement — as-built mechanism: the wrapper cannot inject between the claim and
the domain statements (both live inside the handler closure), so the post-claim budget hook
lives INSIDE claim_first itself — it applies the SET LOCAL as its final act, after the
claim resolves. ADR-062’s claim-first contract is untouched, and the claim INSERT keeps the
session-default (30s) lock-wait allowance its duplicate-arbitration math requires. In
execute_within_tx (unclaimed): immediately after begin. There is NO opt-out: every
HTTP-plane domain statement runs under the 10 s budget; long statements belong to jobs
(§ Amendment — #1571, as-built). The original opt-out, claim_first_unbudgeted, served two
censused Batch routes — ncands generate’s 10k-row INSERT…UNNEST batches and the subsidy
sweep’s pinned-set write; both moved to the worker plane inside their background jobs
(#1936, #1939) and the helper was deleted with its last site (#1939). No unbudgeted claim
variant survives, claimed or unclaimed.
One recorded interaction: the 8s hop budget sits BELOW the 19s eval-budget caps. Under
default configs (5s eval) the callee’s typed 503 always arrives first; a deployment that
raises an eval budget past ~7s trades error specificity for the same bounded outcome — the
caller’s typed hop 503 fires at 8s while the callee finishes uselessly. Bounded and typed
either way; specificity degrades gracefully. The reporting→cases NCANDS export hop IS an
8s hop since #1936: CasesClient::export_ncands pages GET /v1/cases/ncands-export by
referral under the fleet S2S_HOP_BUDGET from inside the ncands_generate job (the
whole-FFY hop that once carried BATCH_CALLER_BUDGET went with the class).
Session statement_timeout stays 30s by default — it is the worker-plane authority
(ADR-062 §H derives the inbox winner-hold math from it). Standard routes that begin()
directly on the pool (census: financial adjustments-resolution, placement kinship, cases
report-create, among others) ride ceiling-only until migrated to the funnels; the funnels
are the new-code convention.
Depth-2 honesty (per-hop margins instead of propagation). Absolute deadline propagation
is rejected while the synchronous S2S graph has depth ≤ 2: it is header + re-budgeting
machinery on every hop, and it still cannot validate external budgets. Instead every
synchronous in-request S2S call carries a per-call budget ≤ 8s (the financial
CASES_S2S_DEADLINE precedent), asserted < ceiling. The accepted residue: a downstream
service may finish work after its caller has already yielded — inherent to non-propagation;
effects are claims-idempotent (ADR-062). Revisit trigger: the graph deepens past 2. The trigger fired at depth 3;
§ Amendment — #2478 rules on it.
D1a — The ceiling middleware and route classes
The fleet has a real population of legitimately-long synchronous routes, so the ceiling is
class-based — ONE global middleware selecting the class per request; never an inner
route_layer (an inner layer cannot extend an outer timeout):
| Class | Ceiling | Members | Caller budget pairing |
|---|---|---|---|
Standard |
20s |
everything not listed below |
shared 30s client (inequality 2) |
Extended |
300s |
upload nests (intake signed 30 MiB, cases attachments + contact
attachments + court-order documents, placement home documents, exchange ICPC attachments,
intake attachment proxies) and, since #1936, the two synchronous reporting export POSTs
( |
the specific first-party call sites get per-request |
The table is CLOSED at two classes. A third — Batch, 600s, the synchronous admin/batch/federal
engines — stood from this ADR’s acceptance until § Amendment — #1571’s close-out (2026-09-18,
#1940): its eight members are background jobs (202 + poll), its four FALSE members ride
Standard, and the row, CeilingClass::Batch, BATCH_REQUEST_CEILING, BATCH_CALLER_BUDGET,
the 4-arg with_durations and the built-in admin-replay entry are deleted —
CeilingConfig::production(table) adds nothing behind the service table; an unlisted route is
Standard by absence.
A class ceiling without its caller-budget leg is dead policy — the server would keep working for minutes after every first-party caller abandoned at 30s. The two land together.
Mechanics:
-
The table is data on
ServerOptions:(Method, route template) → Class, matched at runtime viaMatchedPath(thehttp_metrics_middlewareprecedent) — never raw path prefixes (dynamic IDs and shared paths across methods make prefixes ambiguous). A coverage test in each service (ceiling_templates_match_registered_routes) fails on any table entry that is not an operation of the service’s OpenAPI document under that method, or whose un-nested path is not a whole string literal of the route-registration source (#3096; a substring match before that, which a longer route containing the path satisfied), so the table cannot go stale silently. It does not see a registration whose method alone changes. -
Position: innermost of the global layers — inside
http_metrics_middleware(which has no drop guard; an outer timeout would leak the in-flight gauge and lose the 504 from the duration histogram) and insiderequest_id_layer(the problem document carries the correlation id). -
Implementation:
axum::middleware::from_fn+tokio::time::timeout(next.run())— no new dependencies, no tower feature enables, full control of the RFC-9457 body. The bound is cooperative and covers request processing up to the response head: streamed response bodies are not covered BY DESIGN — since § Amendment — #1572 every download handler streams, and the body is bounded upstream by the store’s chunk deadline and at the edge byDOWNLOAD_IDLE_BUDGET(per read, never a total), and downstream byRESPONSE_WRITE_IDLE_BUDGET(write progress, never a total — #1951) — and a non-yielding CPU section cannot be preempted (none exists on these paths; rules and authz evals carry their own budgets and the ADR-024 wedge deadman). -
Prod values are consts; a test-injectable seam (the
HTTP_DRAIN_DEADLINE/serve_with_listenerprecedent) lets fault legs run at ~1s. -
craig-intake does not use
ApiServer: the middleware ships as a reusablepub fnand intake installs it in its own stack explicitly. As-built: the whole ceiling module (craig_common::ceiling) lives in craig-common, not craig-api — intake is deliberately craig-api-free (no sqlx on the stateless edge), and craig-api re-exports it; only the pool-acquire leg of inequality 1 is asserted in craig-api (craig-common cannot depend on craig-db). xtask is deliberately craig-common-free (tool-time OUT-class per ADR-067) and, since #1938, mirrors no caller budget: its one long call, the conversion-import finalize, is a POST-once + poll. -
craig-web (BFF) gets NO inbound ceiling: its handlers legitimately fan out multiple sequential 30s upstream calls; its bound is per-upstream-call. Recorded, not deferred. The BFF is unpaired by design above Extended: it pairs ONLY the Extended budget (
post_extendedon the two export POSTs andpost_multiparton the upload proxies atEXTENDED_CALLER_BUDGET; its download proxies ride the streaming client — head underDEFAULT_TIMEOUT, body underDOWNLOAD_IDLE_BUDGET, § Amendment — #1572) and never carried a Batch leg — its proxies of the once-Batch routes rode the shared 30 s client, which is exactly why those routes became jobs (202 + poll) rather than longer ceilings. -
External (non-first-party) API consumers cannot be validated at config load. The contract is documented instead: responses are bounded at 20s/300s by class — no route answers past 300s; set client budgets above your class. A backgrounded engine answers 202 inside the Standard ceiling and is polled.
D1b — Cancellation safety (census, not hope)
The ceiling’s cut is mechanically the same event as a client disconnect, which hyper already inflicts on every handler when the peer goes away — the ceiling makes an existing hazard deterministic; it does not create the class. The census:
| Sequence class | Outcome when cut |
|---|---|
Funnel tx routes (all convert-class routes, ADR-062) |
drop = rollback; no partial commit; replay-same-id answers from the claim |
Direct- |
drop = rollback (same mechanics, no claim replay) |
Single-statement autocommit writes |
statement-atomic |
Multi-system non-tx sequences (DB row THEN blob delete: contacts, contact/report attachments, court orders) |
a cut between the two leaves an orphan blob — the standing convergence owner is the orphan-blob janitor issue #1274 (pre-existing exposure via client disconnect; unchanged by this ADR) |
Commit-phase cut |
outcome unknown — the D2 |
Background jobs cut by deploy (the 5s |
the attempt ends
|
One sharp edge stated honestly: sqlx 0.8 returns a dropped pooled connection through an
unbounded async ping (the connection waits for Postgres ReadyForQuery). Under a wire
blackhole a pool slot can therefore wedge past statement_timeout, bounded only by the TCP
stack and the pool’s 30-minute max_lifetime. The acquire cliff sheds load meanwhile
(typed 503s — the designed degraded capacity). TCP keepalives via PgConnectOptions are
enabled if the API offers them (implementation-verified). Health probes avoid this trap
entirely by never using the serving pool (D4).
D2 — Phase-aware DB error taxonomy
One context-free mapping cannot be honest: retry safety depends on the request phase, not
just the sqlx variant. The classifier is a pure function in craig-common (it must not
depend on craig-db — dependency direction), consumed through phase-specific ApiError
constructors; the funnels supply the phase.
| Phase (constructor) | Condition | Status / problem type | Retry signal |
|---|---|---|---|
acquire — |
|
503 |
|
statement — |
SQLSTATE 57014 |
504 |
none on the wire; in-tx the work is rolled back |
statement — |
connection family: |
503 |
none |
commit — |
the connection died during COMMIT (connection family) — the server’s verdict never arrived |
503 |
none — no retry invitation on an unknown outcome. A server-REPORTED commit failure (serialization failure, deferred constraint, statement cancel) means the transaction aborted — outcome KNOWN — and rides the ordinary classifier mapping instead. |
any |
everything else |
500 |
— |
ceiling middleware |
elapsed |
504 |
none |
-
The blanket
From<sqlx::Error>impl becomes manual and applies the conservative statement-phase mapping — the safety net for unswept sites. TheDbfield keeps#[source]. -
Full variant decision table (no variant undecided):
PoolTimedOut/PoolClosed→ acquire-class 503 ·Database(code)per the SQLSTATE rows above, other codes → 500 ·Io/Tls→db-connection-lost503 ·Protocol→ 500 ·RowNotFound,TypeNotFound,ColumnIndexOutOfBounds,ColumnNotFound,ColumnDecode,Decode,Encode,Configuration,Migrate,WorkerCrashed, others → 500 (programming/config errors, not degradation). -
No retry-safety promises ride the wire details: the BFF re-render mints a fresh
client_request_idtoday, and the classifier cannot know route idempotency. Per-class retry semantics are documented HERE; the SDKs (which retry same-id per ADR-062) cite this section.Retry-Afteris variant-specific — the rules eval-timeout design explicitly declined it (no truthful estimate) and that decision stands. -
map_begin_erroris deleted — subsumed byfrom_db_acquire; keeping it would be pre-1.0 compat residue. Funnel arms: begin → acquire-phase; domain statements → statement-phase; commit → commit-phase (a connection loss during COMMIT is exactly the outcome-unknown case, today mapped to a plain 500). -
Coverage is enforced, not promised: a new xtask lint (allowlist + monotonic shrink, the quality-budgets idiom) bans direct
ApiError::Db(/Self::Db(construction and sqlx-typedmap_err(ApiError::internal)outside craig-common. The implementation sweep works the census in Appendix B — Classifier sweep census (U5; the lint keeps it closed); the lint keeps it closed. -
Untouched, verified disjoint: craig-security’s dead-letter
classify_sqlx(MQ plane) and craig-mq’s inbox savepoint 57014 handling — neither converts intoApiError. -
OpenAPI: utoipa cannot see middleware. A shared
Modifyadds the 503/504 problem responses to every operation in every service’sApiDoc; the committed API pages regenerate in the same commits (#1022 gate).
D2a — Edge pass-through
-
BFF (craig-web): upstream 503 → 503, 504 → 504; all other upstream 5xx stay 502 (correct gateway semantics — 502 means "the upstream failed", 503/504 alone carry retry meaning).
UpstreamError::Statuscarries no headers, so the BFF does NOT forwardRetry-After(it renders HTML to humans; recorded). Mutation handlers keep redirect + flash; the flash copy becomes class-appropriate ("busy — try again shortly" vs "timed out"). The download proxy’s 5xx-as-data contract is unchanged (recorded) — onget_streamsince § Amendment — #1572 (get_bytesdeleted). -
craig-intake (public portal): the sink stops flattening upstream 503/504 into a redacted 500 — the public edge keeps the typed posture.
-
craig-cases: the rules-upstream guard and the matching-error guard (both have 503-only arms today) extend to 504.
All of this is pre-1.0 breaking and rides the CHANGELOG.
D3 — The honest durability claim
-
Work that was already staged (outbox rows) before or during the stall drains when the DB recovers: the OutboxWorker’s warn-and-retry loop plus lease-healed claims. Delivery is at-least-once with consumer dedup — the outbox’s own contract; this ADR does not upgrade it to exactly-once and no test may claim otherwise.
-
NEW work while the DB is down cannot become durable, and therefore fails typed (503 at the acquire cliff / 504 at the statement kill). There is no queueing fig leaf.
-
Bounds: outbox backlog is bounded by DB disk (the DB-up/broker-down case); the DLX tier (ADR-059) is a consumer-side mechanism, not the pending-outbox path; broker-down ≠ DB-down and keeps its existing posture (ADR-003/ADR-059).
D4 — Health: dedicated-connection probes + saturation hysteresis; readiness unchanged
-
Probes never touch the serving pool. Reachability = a fresh dedicated
PgConnectionper probe, 2s overall bound including connect (the compose healthcheck window is 3s — the probe must answer inside it). Dropping a non-pooled connection is a socket close — none of the pooled return-ping hazard. This also removes today’s amplification: the unbounded/healthzSELECT 1through the pool wedges a connection per hit under a wire stall. -
/readyzsemantics unchanged: reachable ⇒ ready. Pool saturation NEVER gates readiness — flipping readiness on latency invites the restart/eviction flapping the ratified direction forbids (ADR-061 alignment). No contradiction with the 2s bound: pool wait cannot affect a dedicated connection. -
DbSaturationhysteresis, fed by the existing 15s pool-probe loop: a probe is BAD when its acquire wait exceeds 2.5s (half the cliff) or times out; degraded after 2 consecutive BAD (~30s of signal); clears after 4 consecutive OK (~60s). Exposed as the newdb_pool_degradedgauge (0/1) and the/healthzdatabase valueok|degraded|error. -
The probe task decouples from telemetry: today it spawns only when metric registration succeeds and non-otel builds skip it entirely. Functional health cannot depend on observability being compiled in — the probe always runs and feeds health state; metric emission is the optional part. Startup state is
ok; the probe task is supervisor-watched (Observed). -
/livezuntouched. The deployment guide gains thedb_pool_degradedalert row (the worker-staleness convention’s sibling).
D5 — Load-shed / circuit-break: the pool is the admission control, stated precisely
Judgment-protocols comparison (all in-stack options considered):
| Option | Verdict |
|---|---|
Pool acquire cliff + request ceiling (CHOSEN) |
Admission control lives at the
constrained resource: the fixed 5s cliff sheds to a typed 503 exactly when DB capacity is
exhausted, with no proxy metric to mis-tune; the pool also caps the reconnect herd
against a recovering database at |
tower |
A second admission bound ABOVE the pool that must
be sized against |
Circuit-breaker crate ( |
A new dependency and per-route trip state duplicating what the acquire cliff provides at the resource itself; its half-open probing is already served by the pool’s bounded reconnects. Rejected. |
Stated precisely: the pool is a connection-concurrency cap with a bounded (5s)
per-request wait — it is NOT a circuit breaker. It has no open state, no cooldown, no
pending-waiter cap: during a full outage every DB-bound request parks one acquire future
for ≤ 5s and then fails typed, so at arrival rate R roughly R×5 futures are parked (1,000
rps ⇒ 5,000 parked futures — well inside tokio’s envelope; the arithmetic is the recorded
justification for not adding a waiter cap). A hysteresis-driven fast-fail (shed at 0s while
db_pool_degraded is set) is explicitly DEFERRED, with its trigger recorded: operators
needing sub-5s shed under sustained outage. The per-IP rate limiter (429) and the
authz/rules eval budgets keep their existing roles.
Amendment — #1571 — Background jobs; the Batch class retires (Accepted, 2026-09-18)
Standing. Proposed 2026-09-17 with the approved plan; Accepted 2026-09-18 at that plan’s close-out (U8, #1940 — plan Background Jobs (#1571), archived). D1 / D1a / D1b above are restated to the as-built; this section records what changed and how it landed (As-built notes).
Scope — the class table shrank to Standard 20s | Extended 300s. CeilingClass::Batch, BATCH_REQUEST_CEILING,
BATCH_CALLER_BUDGET, the 4-arg CeilingConfig::with_durations and the admin-replay auto-entry went with the
close-out (U8, #1940), AFTER the admin-replay fix: landed (#1941 — an index / batching defect, not a duration class).
Admin-replay is Standard by absence (class_for on a table miss; pinned by admin_replay_is_standard), on the
#1941 bound MEASURED on the devstack test plane (PG 18, a 100 000-row scratch outbox, two samples —
crates/craig-api/tests/admin_replay_battery.rs::a_full_call_restages_the_cap_under_budget_with_a_resume_cursor):
one call re-stages at most RESTAGE_MAX_BATCHES_PER_CALL 20 × RESTAGE_BATCH_ROWS 5 000 = 100 000 rows, each batch
its own execute_within_tx under the 10 s domain budget; a full 100 k-row call took 636 / 627 ms wall (≈ 0.63 s), the
slowest single batch 33.0 / 30.8 ms (≈ 0.3 % of the 10 s SET LOCAL statement_timeout; the whole call ≈ 6 %), and the
(created_at, id) index built in 23.8 / 21.1 ms (≈ 22 ms) — two orders of magnitude inside the 20 s Standard ceiling;
a window past the cap is walked by more / resume_from, never by a longer ceiling. Four registered Batch routes
were FALSE Batch — the ceiling sheltered nothing — and reverted to Standard with no 202: financial claims/generate and rules promote (execute) ride the BUDGETED
claim_first (the 10 s SET LOCAL) inside one short tx; security archive/purge is a bounded slice (PurgeParams
1..=100, selection EMPTY until DFCS names a schedule); reporting afcars/generate was the #949 zero-record stub
until P-D2 flipped it to the afcars_generate job (#2144: 202 + Location, the NCANDS shape; its claim transaction stays
Standard; P-D4 (#2127) retires the marking-only transmit route). The two reporting export POSTs (ncands|afcars/{id}/export) flipped to Extended,
paired with the BFF’s per-request extended budget (streaming downloads landed as #1572 — § Amendment
— #1572, Accepted 2026-09-20). The eight remaining engines —
placement expiry-sweep/run, security archive/run, rules promote/preview, reporting ncands/generate, financial
subsidy-payments/generate, subsidy-imports/{id}/finalize, subsidy-reviews/sweep/preview,
sweep/{run_id}/execute — became background jobs on five owning services (placement, security, rules,
reporting, financial).
D1a — claim_first_unbudgeted is deleted. Both census sites (ncands generate’s 10 k-row UNNEST, the sweep’s
pinned-set write) moved to the worker plane inside their jobs (#1936, #1939 — the helper went with its last site). The
invariant is: every HTTP-plane domain
statement runs under the 10 s budget; long statements belong to jobs, which ride the session default (30 s, the
worker-plane authority). No unbudgeted claim variant survives, claimed or unclaimed.
The reporting → cases hop is no longer a Batch exception. D1’s whole-FFY export hop became PAGED BY REFERRAL (#1936)
under a FIXED cohort: GET /v1/cases/ncands-export?ffy&as_of&after&limit≤500 returns whole referrals (never split across
pages) from received_at ∈ [ffy) AND created_at ≤ as_of (as_of = the job’s queued_at), ordered
(received_at, id), each page under the 8 s S2S hop budget, inside reporting’s job; cases' Batch row and reporting’s
hop_budget went with it. Appendix A — S2S client census (per-hop budget and synchronous depth) carries the row.
Background jobs — the model. A job is a LOGICAL resource; executions are ATTEMPTS. Per service, behind ONE
craig_api::jobs module (the request_claims ×8 precedent): background_jobs (id = the claim’s entity_id; kind,
dedup_key, lease_key, typed input / progress / result, a categorical error, owner_instance, version)
plus background_job_attempts (outcome ∈ succeeded | failed | interrupted | crash | lost_proof).
-
Enqueue = the ADR-062 claim transaction, on all eight. Each route takes a REQUIRED
client_request_id;claim_firstis the tx’s first statement; every CONSENT gate stays synchronous in that tx with its typed 4xx (finalize’senter_finalizing; sweep execute’s token / CAS / authority refusals); the arbiter is a partial-unique index(jurisdiction, dedup_key) WHERE state IN ('queued','running')→ typed 409job-already-active(problem_types::JOB_ALREADY_ACTIVE); the row is insertedqueued; commit; 202 with theJobViewbody plusLocation: /v1/<svc>/jobs/{id}. The sameclient_request_idreplays the SAME job (202 again, whatever its state); a fresh id is a new job. -
The executor. Per service, owner-pinned,
Criticality::Critical(a PROMOTED contestedworkeranchor); dispatch bylease_key(one running job per key per instance); 4 permits, one RESERVED for consent kinds; a 5 s heartbeat (UPDATE … WHERE id AND state = 'running' AND owner_instance = me; 0 rows ⇒ the engine future is dropped); a 15 s scan, the first at boot; a 30 s stale classification coveringrunningrows (stale heartbeat ⇒ attemptcrash) ANDqueuedrows (aged past 30 s ⇒ the owner died between commit and handoff). -
Consent kinds vs proof-less kinds.
import_finalizeandsweep_executecarry an in-memory ADR-074 proof that cannot leave the process: a stale queued row islost_proof— terminalfailed; the caller re-POSTs with a fresh id. The six proof-less kinds (expiry_sweep,archive_run,subsidy_generate,ncands_generate,promote_preview,sweep_preview) may be ADOPTED by any replica (CASowner_instance+version) — the one bounded cross-replica pickup. -
Recovery.
interrupted(the shutdown token at the engine’s boundary insideWORKER_DRAIN_DEADLINE5 s) andcrashre-queue a convergent kind asattempt + 1up tomax_attempts = 3, thenfailed(exhausted); a consent kind endsfailedon its firstcrash.succeededandfailedare the ONLY terminal states and are IMMUTABLE (the terminal UPDATE is byid+version). -
Retention is claim-joined, not arithmetic. The pruner (knob
CRAIGBACKGROUND_JOBSWINDOW_DAYS, default 31,0= disabled) deletes only TERMINAL jobs older than the window whose claim row no longer exists — a claim kept forever keeps its job forever; attempts go with their job. -
The poll is generic and read-only.
GET /v1/<svc>/jobs/{id}→JobView, authorized on a NEWResourceType::BackgroundJob({j}-authz-background_job.json×2, bootstrapped per environment BEFORE the first image that consults it); a deny is the fleet’s typed 403, a missing row 404, no existence collapse;Cache-Control: no-store. No GET writes anything for any kind: the sweep token is an explicit single-usePOST …/sweep/runs/{run_id}/token(the jobsucceeded, the runpreviewed,started_at + 15 min > now— else 409sweep-preview-expired; a second call 409sweep-token-issued;no-store; behind the BFF’s POST CSRF path). -
The ONE engine change is a
&JobBoundary(theCancellationToken+ a progress counter — as-built, erratum 2) checked at each engine’s natural boundary (expiry per home, finalize per record, archive per batch, generation per child batch; ncands has none before its commit); archive additionally gainsrun_passeswith its `TableState`s preserved across passes. -
The drain gap moved and closed. D1b’s "Batch routes cut by deploy" row retired with the class: the 20 s HTTP drain that abandoned a 600 s route became the 5 s worker drain, CLOSED by the attempt ledger + stale classification — a cut job reads
interrupted/crashin its attempts and follows the recovery rule above.
Honest residue. No cross-replica pickup for consent kinds — the ADR-074 proof cannot leave process memory, so a
stale queued consent row is lost_proof, never adopted (the deferred pickup is a follow-up on the plan; it needs a
durable proof this amendment does not design); the sweep run’s non-resumability becomes VISIBLE through the poll (a
consented / executing run flips failed, counters PRESERVED); five new BLOCKING worker anchors in the contested
census (worker.craig-placement.main.watch.4, worker.craig-security.lib.watch.3, worker.craig-rules.main.watch.3,
worker.craig-reporting.main.watch.3, worker.craig-financial.main.watch.3); the sub-second commit-before-handoff
window makes lost_proof a new visible failure class (pinned by the plan).
As-built notes (U1–U8; the plan page’s errata, restated). Where a unit’s landing differed from the model above, the as-built reading is the truth:
-
U1 (#1933, the substrate + the placement pilot). Unknown / forged body fields answer the fleet extractor’s 422
validation-failed, not a typed 400. The engine seam is ONE&JobBoundary(theCancellationToken+ a progress counter) checked once per home. Aqueuedrow’s staleness is measured from its owner’s LAST sign of life —GREATEST(queued_at, heartbeat_at), the owner keep-aliving its own queued backlog every pass — so a row waiting behind a permit or a lease key is never adopted or failedlost_proofwhile its owner lives.lease_keyis NULLABLE.drain_pendingis the ONE test seam. -
U4 (#1936, reporting
ncands_generate). The plan’s one lease-less kind.resourceis empty (no submission GET exists; the submission id equals the job id in the result). Same-tx completion is the substrate’scomplete_in_tx, keyed on (id,running, owner, attempt) — never the version, which the heartbeat bumps. The two export POSTs are Extended, paired with the BFF’spost_extended;afcars/generaterides Standard. -
U5 (#1937, financial
subsidy_generate). The hourly generator tick keeps taking thesubsidy-genlease directly and SKIPS (info) while a job holds it; a job attempt that finds the tick holding it readswaiting_for_lease(D6 wrote the tick as the waiter).claims/generaterides Standard. -
U6 (#1938, financial
import_finalize— the first consent kind). The pass loop ends on ANY batch status other thanfinalizing(staging= live rejections is a pass-terminalsucceeded;abortedis unreachable inside finalize).failed(no_progress)carries NOresult(resultis present iffsucceeded) —remaining_staged/passesrideerror.detail.resource_typeis the path tokenfinancial/subsidy-imports.inputis{ batch_id, as_of }(the business date captured at enqueue). The xtask tool’s 20-pass loop and mirrored 610 s const are gone (POST-once + poll). -
U7 (#1939, financial
sweep_preview+sweep_execute+ the token POST). The token POST consults the supervisorreview_sweepUpdate row AND thebackground_jobread row on the preview job (its creator, or an admin); a run no preview job wrote is 409sweep-run-statefor everyone, and the execute enqueue’s window refusal shares the token POST’s 409sweep-preview-expired. The previewresultisPreviewSweepResult— the pinned sets plus a CLOSEDtoken_state(available | issued | expired) and NOexecute_token/expires_at.mark_run_failedPRESERVES counters byCOALESCEunder the guardstate IN ('observed', 'consented', 'executing')— aconsentedrun failed before its attempt started keeps NULL counters, not zeros.claim_first_unbudgeteddeleted with its last site. -
U8 (#1940, the close-out).
CeilingClass = Standard | Extended;BATCH_REQUEST_CEILING,BATCH_CALLER_BUDGET, their const-assert, thebatchduration, the 4-argwith_durations, the built-in admin-replay entry andCeilingConfig::templates()(zero callers — the coverage guard takes the raw table) deleted; the CLI transport’spost_batchhelper + theclients/mod.rsmacro arm deleted (zero callers after U2 / U4 / U5); admin-replay Standard by absence with the #1941 bound above; every service ceiling table Batch-free and its coverage test green with zero Batch rows; the post-close-out grep (CeilingClass::Batch|BATCH_REQUEST_CEILING|BATCH_CALLER_BUDGET|post_batch| post_empty_batchover crates / services / xtask) finds nothing.
Amendment — #1572 — Streaming downloads; the download GETs move to Standard (Accepted, 2026-09-20)
Standing. Proposed 2026-09-19 with the approved plan; Accepted 2026-09-20 at that plan’s close-out U2 (#1947 — plan Streaming Object-Store Downloads (#1572), archived; epic &97; U1 #1946 the store + the eight backend handlers, U2 #1947 the edges + this acceptance). D1a’s class table, its streamed-body sentence and its BFF pairing bullet above are restated to the as-built; this section records what changed and why.
Scope — the Extended class keeps only uploads and the two export POSTs. The nine download GET rows (cases ×3,
exchange ×1, intake ×1, placement ×2, reporting ×2) leave the Extended table — Standard by absence — because their
handlers no longer buffer: Store::get_stream answers the response head after ONE object head() and streams the
body as lazy 8 MiB ranged reads whose transport frames are forwarded, never collected (no allocation proportional to
the object or the chunk). Each chunk request keeps the store’s existing per-request total timeout and fixed retry
policy (#1523), and object_store’s own ETag-ranged body resumption; the worst case with no bytes flowing is the retry
budget, exposed as DEFAULT_CHUNK_DEADLINE (100 s). Each service’s ceiling_table_tests gains
every_extended_row_is_a_post — the one-directional coverage guard cannot pin a deletion.
The streamed-body doctrine (restated into the D1a "Mechanics" bullet at U2). The ceiling bounds the response head; a
streamed body is bounded UPSTREAM by the store’s chunk deadline and, at every first-party edge, by an idle budget
derived from it (DOWNLOAD_IDLE_BUDGET 120 s = DEFAULT_CHUNK_DEADLINE 100 s + 20 s headroom, const-asserted
DEFAULT_CHUNK_DEADLINE ≤ DOWNLOAD_IDLE_BUDGET in craig-store for the DEFAULT; a raised request_timeout_secs past 36
— 3 × 36 + 10 = 118 ≤ 120 — is ONE tracing::warn! at Store::build, never a refusal) on a dedicated streaming client
(craig_common::http::build_streaming_client: connect 5 s, read_timeout = the idle budget, NO total; both public
builders share one private base builder, so the lint allowlist stays at one site) with the head awaited under
tokio::time::timeout(DEFAULT_TIMEOUT) (30 s) — a head timeout records the outbound sample itself and is the untyped
transport class (502 at the BFF).
Never a total budget: a total budget on a body re-creates the class on the caller side. A failed chunk, a 412 from
if_match, or a blob deleted mid-stream ENDS the body — the connection closes and the client detects truncation by
Content-Length; no status can change after the head. Body failures are logged inside the request span (method /
route and the X-Request-Id correlation id, recorded on that span as request_id since #1953) and counted
(download_stream_outcome_total{outcome = completed | failed | abandoned}, abandoned = the peer dropped the body
before either end) because the head-scoped HTTP metrics never see them. The guarantee is two-sided since #1951:
DOWNSTREAM, every CRAIG HTTP server (the ApiServer services, craig-intake on its plain and in-process-TLS paths, the
BFF edges craig-web and craig-portal, craig-intake-keyring) accepts on craig_common::write_idle, which ends a
connection whose writes make no progress for RESPONSE_WRITE_IDLE_BUDGET (120 s, beside the ceilings; re-armed by
every accepted write, never a total). The stopped reader’s body is dropped and counts abandoned. hyper 1 has no
write timeout, and its HTTP/1 dispatcher stops polling a body whose writes stall, so the bound sits on the
connection’s IO, not in a tower layer. It is per connection: an HTTP/2 peer (intake’s TLS ALPN, or h2c
prior-knowledge where hyper-util http2 is compiled in) that withholds flow-control credit is not covered.
Content-Length and compression. Attachment downloads are exempted from the backend CompressionLayer on every
surface (a NotForAttachments predicate: any response carrying Content-Disposition), so Content-Length — which the
buffered body’s size hint already produced — survives streaming; text exports lose gzip. Downloads carry
Cache-Control: no-store end to end (the helper sets it; every edge forwards it with Content-Length, Content-Type and
Content-Disposition — the portal additionally under its own global no-store layer). The four craig-web download
routes now forward the backend’s Content-Type — the attachment routes lose the constant application/octet-stream,
the two exports go from text/plain; charset=utf-8 to reporting’s bare text/plain (pre-1.0 Changed; safe under
the edge-wide nosniff layer + Content-Disposition: attachment).
Caller pairing correction. The table’s "CLI export fetches" never existed in code: the CLI has no download commands
(its one export fetch is the Standard rules JSON over the shared client). The BFF pairs the Extended budget ONLY on
post_extended (the two export POSTs) and post_multipart (uploads); its download proxies — craig-web ×4,
craig-portal ×1 — ride the streaming client through Transport::new(caller, http, streaming_http) + get_stream(base, path,
user) → UpstreamDownload (any upstream status is data; Err is transport-only), and the intake partner proxy through
Extension<StreamingHttp> on its partner nest (the BFF’s head under DEFAULT_TIMEOUT, intake’s under its own
Standard 20 s ceiling — no separate timeout; the body under DOWNLOAD_IDLE_BUDGET at every edge; a
non-2xx head never streams — the flash arms and intake’s #933 buffered redaction are unchanged); the BFF get_bytes is
DELETED and intake’s Extended download row with it (every_extended_row_is_a_post ×5). HEAD on a backend download
route issues zero range reads; the edges keep forwarding the GET they issue today.
Deferred, each a filed issue. Resumable downloads (Range / Accept-Ranges / If-Range, #1948; since delivered:
a single range streams only its slice through Store::get_stream, 2026-11-08); a trailing-digest
audit on streamed reads (#1949); the rules export’s raw-name Content-Disposition (fix:, #1950); the fleet-wide
server-side write-progress timeout (#1951); the X-Request-Id on the request span so body-failure lines carry it
(#1953); the BFF Transport caller label per host — craig-portal’s outbound samples read caller="craig-web" (fix:,
#1954); the build_streaming_client sites in the contested census (#1955).
Amendment — #2478 — Depth 3 is accepted under nested, const-asserted budgets (Accepted, 2026-11-12)
Standing. Accepted 2026-11-12 by maintainer ruling on #2478. Documentation only: it rules on a state the code already has and changes no budget.
The trigger fired. D1 rejects absolute deadline propagation "while the synchronous S2S graph has depth ≤ 2" and names its revisit trigger, "the graph deepens past 2". The warm graph has been three deep on every placement-facts read since the federal ICWA-status consult landed (#1993, ADR-073): craig-placement → craig-cases → craig-rules. Appendix A (A.1) is the census that records it. A cold authorization cache adds one hop to any chain into an engine-bearing callee; that predates D1 and is not the depth D1 measured.
Ruling. Deadline propagation stays rejected. A three-deep synchronous chain is accepted when it is contained: the innermost hop’s budget plus the processing margin fits inside the budget of the hop that carries it, and that hop’s partition fits the route’s ceiling, each as a compile-time assertion. Under containment the specific-beats-generic inequality still holds at every level: when the innermost service is the slow one, the middle service’s typed refusal is answered inside the outer hop, so the outer caller reports the hop that failed and never its own ceiling.
The assertions that make it hold (services/craig-placement/src/eligibility.rs, with the budgets they name):
| Assertion | Values |
|---|---|
|
2 s + 2 s ≤ 4 s |
|
4 s + 4 s + 2 s < 20 s |
|
4 s + 4 s + 8 s + 2 s < 20 s |
ICWA_STATUS_BUDGET is declared once, in craig-cases-contracts (placement_facts.rs), so the service that spends
it and the service that budgets for it read the same constant; craig-cases bounds the consult by the smaller of it and
its rules client’s hop budget (icwa_status.rs).
A fourth hop needs a new ruling. Containment divides a fixed budget: every level takes its own margin out of the level above, and the 4 s facts read already leaves its nested consult 2 s. A hop nested inside that consult would have nothing left to be typed within. So a change that would make any synchronous chain four deep, or that nests a second chain three deep without the assertion pair above, does not land on this amendment: it returns to the maintainer, with deadline propagation and a depth cap as the alternatives to weigh.
Consequences
-
Caseworkers and S2S callers see typed, bounded failures — worst-case time-to-error on a Standard route drops from 30s (client transport error) to ≤ 20s (server-typed 504), and for the common single-slow-component cases to 5s/8s/10s with the specific diagnosis.
-
Pre-1.0 breaking changes (CHANGELOG’d): 57014 becomes 504 (was 500-after-30s);
PoolTimedOutbecomes 503 fleet-wide (was begin-path-only); commit-phase failures become 503db-outcome-unknown(was 500); BFF/intake/cases edges pass 503/504 through;db_statement_timeout_msgains a 10s floor. -
Existing tests pinning 500-on-DB-error or BFF-502 are updated as part of the same change — a legitimate oracle change for a deliberate semantic change, called out per commit (testing-discipline).
-
The C21 pool-contention oracle promotes to load-robust shape assertions (wins < the acquire bound; timeouts ≥ ~the bound — never exact milliseconds, per the harness’s own "load shifts latencies, not counts" note).
-
Filed at acceptance, two since landed: backgrounding the Batch engines (202 + poll — removed the 600s class’s reason to exist) → #1571, LANDED 2026-09-18 (§ Amendment — #1571, Accepted; the class is deleted); streaming object-store downloads → #1572, LANDED 2026-09-20 (§ Amendment — #1572, Accepted; the nine download GETs are Standard by absence, the body outside the ceiling by design). Still deferred as a filed issue: hysteresis fast-fail (#1573; trigger recorded above).
Appendix A — S2S client census (per-hop budget and synchronous depth)
Refreshed 2026-10 (#1781) against every class = "s2s-client" entry in contested-surfaces.toml plus the
in-request hops the registry does not anchor. Depth counts the synchronous HTTP hops on the longest chain from
the first-party edge (BFF, portal, intake, CLI), the edge → service hop counting 1; cold adds the callee’s authz
lazy load when the callee is engine-bearing (cases, composition, exchange, financial, placement, reporting,
security — craig-rules reads its own database, so a hop into rules adds nothing). Worker-plane rows count from the
worker. An edge hop (A.3) is depth 1; the callee’s own A.1 hops and its cold lazy load continue the chain. A.1 is
the population D1’s ≤ 8s rule governs.
A.1 — In-request service-to-service hops
| Caller → callee (call) | Site · budget const | Budget | Depth warm / cold | Registry id |
|---|---|---|---|---|
cases → rules (investigation safety assessment) |
|
8s |
2 / 2 |
|
cases → rules (screening surface read on a cache miss) |
|
8s |
2 / 2 |
|
cases → rules (screening consult, concurrent evaluates) |
|
8s |
2 / 2 |
|
cases → rules (response priority, window, override) |
|
8s |
2 / 2 |
|
cases → rules (person-match evaluates, report person suggestions) |
|
8s per entry |
2 / 2 |
|
cases → rules (person-match ruleset metadata, once per request) |
|
8s |
2 / 2 |
|
cases → rules (IV-E surface read, per-child consults) |
|
8s |
2 / 2 |
|
cases → rules (ICWA status, nested in the placement-facts read) |
|
2s |
3 / 3 |
|
cases → exchange (SSA screening run: stage, cancel, latest status) |
|
5s |
2 / 3 |
|
exchange → placement (a partner-reported education record, once per admitted report of the admin collection run, #3188) |
|
3s |
2 / 3 |
|
exchange → cases (open-stages pages, the admin catch-up walk) |
|
5s |
2 / 3 |
|
financial → placement (subsidy eligibility) |
|
5s |
2 / 3 |
|
financial → placement (caregiver bindings, portal payments) |
|
4s |
2 / 3 |
|
financial → cases (child date of birth, subsidy enrollment and activation) |
|
4s |
2 / 3 |
|
financial → cases (party existence sweep) |
|
4s |
2 / 3 |
|
financial → cases (permanency plan, guardianship activation) |
|
4s |
2 / 3 |
|
financial → rules (subsidy-eligibility consult) |
|
4s |
2 / 2 |
|
financial → cases (subsidy import staging: each person, then the household) |
|
8s per read, 15s walk |
2 / 3 |
|
placement → cases (child placement facts: matching, both activation sites, episodes) |
|
4s |
3 / 3 |
|
placement → cases (person display names, own principal) |
|
4s |
2 / 3 |
|
placement → security (worker contacts, portal unit detail; degrades) |
|
4s |
2 / 3 |
|
placement → rules (eligibility consult; matching fan-out) |
|
4s / 8s |
2 / 2 |
|
any engine-bearing service → rules (authz ruleset lazy load on a cache miss) |
|
2s; with the 5s |
the cold column |
|
Const-asserted partitions under the 20s Standard ceiling: financial enrollment 5 + 4 + 4 + 4 + 2 < 20
(age_check.rs: placement, DOB, rules, parties, margin); financial guardianship activation 5 + 4 + 4 + 4 + 2 = 19
(plan_check.rs); placement matching 4 + 4 + 8 + 2 = 18 and both activation routes 4 + 4 + 2 = 10
(eligibility.rs); cases screening consult, response priority, the IV-E act and report person suggestions (matching/mod.rs: the
metadata read, then one entry’s evaluate fan-out) 2 × 8 + 2 < 20; the nested ICWA
hop ICWA_STATUS_BUDGET + MARGIN_MS ⇐ CASES_FACTS_BUDGET (2 + 2 ≤ 4, craig-placement). The authz lazy load
composes inside a caller’s hop (LAZY_LOAD_BUDGET + DEFAULT_EVAL_BUDGET < S2S_HOP_BUDGET, 2 + 5 < 8, #2477). The
person-suggestions partition covers a craig-rules that stops answering, which refuses at the first entry’s deadline. A
report of several entries makes one fan-out per entry in turn, so a craig-rules that answers each inside its budget
but slowly can still spend more than the ceiling across entries; no partition bounds that sum.
D1 revisit trigger. D1 rejects deadline propagation "while the synchronous S2S graph has depth ≤ 2" and names the trigger "the graph deepens past 2". The warm graph reached depth 3 with the ICWA consult: placement → cases → rules on every placement-facts read (ADR-073, the #1993 amendment). The trigger has fired; § Amendment — #2478 rules on it. A cold authz cache adds one hop to any chain into an engine-bearing callee; that predates D1 and is not the depth D1 measured. As built, the nested hop is contained: its budget plus the margin fits inside its caller’s hop budget (const-asserted), and the caller’s partition fits the ceiling. The amendment accepts that containment as the answer at depth 3.
A.2 — Worker, job and verifier plane (no inbound request)
| Caller → callee (call) | Site · budget const | Budget | Depth warm / cold | Registry id |
|---|---|---|---|---|
financial → cases (child date of birth, placement-activated billing, MQ inbox) |
|
8s |
1 / 2 |
|
cases → rules (report auto-link, MQ inbox) |
|
10s pass; 8s per entry |
1 / 1 |
|
reporting → cases (NCANDS referral pages, |
|
8s |
1 / 2 |
|
reporting → placement, financial, cases (AFCARS producer pages, |
|
8s |
1 / 2 |
|
exchange → cases (SSN custody release and outcome, SSA worker) |
|
5s / 5s |
1 / 2 |
|
exchange → cases (trigger outbound-principals reads, send worker) |
|
5s |
1 / 2 |
|
cases → rules (screening-surface and IV-E surface verifiers) |
|
8s |
1 / 1 |
|
financial → rules (subsidy authority verifier) |
|
4s |
1 / 1 |
|
reporting → rules (AFCARS surface verifier) |
|
4s |
1 / 1 |
|
admin-units snapshot read → security (verifier cadence, event leg; the shared body) |
|
4s |
1 / 2 |
|
cases → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
composition → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
exchange → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
financial → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
placement → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
reporting → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
rules → security (admin-units snapshot, this service’s own principal) |
|
4s |
1 / 2 |
|
any engine-bearing service → rules (authz boot fetch, invalidation and TTL refresh) |
|
the shared 30s client |
1 / 1 |
|
A.3 — Edge clients and constructors
| Caller → callee | Site · budget const | Budget | Depth | Registry id |
|---|---|---|---|---|
craig-web BFF |
|
30s / 5s connect; 310s |
1 |
|
craig-web |
|
30s; 5s |
1 |
|
craig-web download proxies ( |
|
30s head; 2 min idle |
1 |
|
craig-portal |
|
30s / 5s connect |
1 |
|
craig-portal document downloads |
|
30s head; 2 min idle |
1 |
|
craig-cli → every backend |
|
30s / 5s connect |
1 |
|
craig-intake → cases (report forward, status, owner; JWS replay check) and → security (partner verify, signer key) |
|
30s / 5s connect |
1 |
|
craig-intake attachment upload forward → cases |
|
310s |
1 |
|
craig-intake attachment download proxy |
|
20s head; 2 min idle |
1 |
|
shared client constructor |
|
30s / 5s connect |
none of its own (its consumers' rows) |
|
admin-units unit-test helper |
|
not production |
not production |
none: the census prunes test-only module files (#2475) |
Retired since the last revision: cases → rules via services/craig-cases/src/screening_policy.rs (replaced by
the screening surface client, #1672) and reporting → cases detail hydration (cases_client.rs keeps only
export_ncands).
Appendix B — Classifier sweep census (U5; the lint keeps it closed)
| Site | Today |
|---|---|
financial subsidy maps ×7 ( |
direct |
the funnels' own begin/commit arms ( |
commit errors → |
|
→ |
rules store map ( |
→ |
reporting store maps (~30 sites incl. |
→ |
composition |
own |
security archive ( |
→ |
exchange store maps |
→ |
service error enums: |
Db arms flattened |
Alternatives considered
-
Absolute deadline propagation (header + per-statement re-budgeting): rejected at graph depth ≤ 2 — see D1. The revisit trigger fired at depth 3; § Amendment — #2478 keeps the rejection.
-
Lowering the session
statement_timeoutdefault so the typed 57014 always beats the ceiling: rejected — the session default is the worker-plane authority and ADR-062’s inbox lock-wait math derives from it; the funnel-scopedSET LOCALdelivers the same ordering on exactly the HTTP tx plane with zero worker blast radius. -
tower timeout/load-shed layers and breaker crates: see D5.
-
One flat ceiling with per-route exemptions: rejected — the review census showed a real population of legitimate 25s+ routes; exemptions-by-default invert into the Extended/ Batch classes with caller-budget pairing instead.