Plan: Admin-Unit Scoping — The Worker→Unit Registry, Claim Enrichment, the Unit Stamp, and Honest Texas Regional Rows (#1086)

Archive record

Merge requests: !1651 (U0 plan page + ADR-077, Relates #1086) + !1652 (U2a, Closes #1898) + !1653 (U1a, Closes #1899) + !1654 (U1b, Closes #1900) + !1656 (U3a, Closes #1901) + !1657 (U3b, Closes #1902) + !1658 (U2, Closes #1903) + !1659 (U4, Closes #1904) + !1660 (U5, Closes #1905 / #1086)

2026-09-17 — architecture B (ratified 2026-08-29; rev 3 approved in plan mode 2026-09-16 after the maintainer’s 15-finding gate): a CRAIG-owned worker→admin-unit registry on craig-security whose scope token is the county NAME frozen at assign; the engine ENRICHES claims from a verified, generation-guarded snapshot (installs only above the held generation; MAX_AGE 300 s; the gauge admin_units_snapshot_verified{jurisdiction}), claims.admin_units ALWAYS an array and a consulting ruleset a typed 503 ADMIN_UNITS_UNAVAILABLE while the snapshot is not ready — never a widened row; the typed ScopeFilter every list handler matches exhaustively under a BLOCKING lint, the eleven admin_unit = ANY($n) binds; every check on the ten unit-bearing types sees the row’s creation-time admin_unit stamp, written under ONE lock protocol with unit-only heals and a revision-independent backfill, investigations stamped from the referral; the 52 Texas authz files that declared the dead i_regional input (the U0 census) re-authored on regional_director — unit rows where the resource carries a unit, supervisor-row copies only where that row is live, NO realm-flat arm above i_unit_match — the changed set pinned as the former i_regional set, never a count; rollout gated on the derived rules drift manifest and the verified gauge. Rulings: R1 the Texas regional token is the existing office role regional_director; R2 on non-unit resources the regional row = the supervisor row only where that row is satisfiable; R3 case-less agreements / payments / imports stay outside unit scopes (#1908); R4 investigations take the referral’s county. ADR-077 Accepted; follow-ups #1906–#1913, #1927–#1932.

Status

Done (2026-09-17) — !1660

Erratum (2026-09-16, U1a #1899): D2 as built refuses ANY PUT on a bound registry row (fips_code / state_fips included — a split SET makes the guarded-update miss ambiguous under version drift); revoke first. The Decision text is left as approved.

Erratum (2026-09-16, U1b #1900): rules drift reports FIXTURE-JURISDICTION files (testonia, #1621) as a fourth printed status fixture — never looked up, outside --strict — because the seed’s negative receipt forbids their ever being live; the classifier itself stays absent | behind | current as D8 states.

Erratum (2026-09-16, U3b #1902): the U3b row’s "twelve" fetch-before-check reorders are 13 handler paths / 10 code edits (check_lifecycle_authz is ONE fn behind approve / issue / clear / void); the attachment delete was already existence-first and only routes its literal.

Erratum (2026-09-17, U2 #1903, ruling 1): the U2 row’s "every AuthzBootSpec literal and engine constructor (a compile-forced set)" — the compile-forced set is the nine AuthzBootSpec literals; the engine takes ZenAuthzEngine::set_units_source (the set_eval_budget shape) and DEFAULTS to StaticUnitsSource::not_ready(Unconfigured), fail-closed (the "13" was a mis-count). As built the spec field is units_source: UnitsSourceSpec (the snapshot READER as a trait object — the HTTP parts, or craig-security’s own-table adapter — plus the age bound), resolved into the ONE SecurityUnitsSource by boot_authz_engine; units_for is a private engine method; the census locates the LIST marker by the output whose field == "scope" (D3 / D5’s o_scope is the id as shorthand).

Erratum (2026-09-17, U2 #1903, ruling 3): D4’s "each subscriber is a mq-consumer entry" and the U2 row’s "one mq-consumer census entry per engine-bearing service" — the census keys on CALL SITES: ONE mq-consumer.craig-bootstrap.admin_units entry at the single subscribe_exclusive (both two-path legs), plus s2s-client.craig-bootstrap.admin-units (the shared fetch body) and seven s2s-client.<svc>.security-admin-units consumer entries (craig-security’s own-table read is not an S2S client). The eight queues (<svc>.authz-cache.units.{uuid}, inside every existing authz-cache broker ACL) are a deployment fact, recorded in the deployment guide’s topology row.

Erratum (2026-09-17, U2 #1903, ruling 4): D4’s and the U2 row’s "reuse and re-document the existing security_base_url leaf" — the leaf was a PlacementSettings extension field, and a ServiceSettings twin is the flatten hazard cases_base_url already records, so it was LIFTED to ServiceSettings (env names unchanged; the placement leaf, its default and its pins moved). craig-rules takes the HTTP source like the other six — its first outbound HTTP edge (rules → security), recorded in architecture.adoc and the CHANGELOG. D5’s “ScopeConstraints` becomes Clone” — it already was; as built it drops `Copy.

Erratum (2026-09-17, U4 #1904, ruling 1): the U3b note carried to #1904 ("SubsidyAgreement Approve / Read + FosterHome Approve keep a realm-flat arm ABOVE i_unit_match`") is superseded — as built there is NO regional Approve / sweep / run-read / matching arm in Texas: a realm-flat arm would be first-hit over the unit row, so the nil-id checks fall through it and are refused for a pure `regional_director exactly where a Texas supervisor is; the subsidy row flips to i_regional_director + i_unit_match + 'read', foster_home’s regional CHECK row is the wildcard-action unit row (a real-id home ref admits in-unit Approve = proposal accept; the nil-id expiry sweep and matching check(List) fall through). A discriminator attr at the three nil-id sites is the only future path (an issue, not U4).

Erratum (2026-09-17, U4 #1904, ruling 2): D7’s "the eight regional FIELD rows … are re-keyed with their CHECK twins" → two re-keyed (foster_home), four deleted (health_record / education_record — no admin_unit column, refs None), two deleted (placement — the TX placement supervisor admits read + list only, so a field row has no update twin); the "in-unit governed field write" leg is foster_home only.

Erratum (2026-09-17, U4 #1904, ruling 6): D7’s "`rule_evaluation` keeps its two … rows byte-identical" reads "cell-identical on the declared inputs" — the deleted i_regional input’s "" key is dropped from every row (zen never reads a key with no input); `texas_rule_evaluation_directors_create_only’s assertions stay byte-identical, its comment corrected.

Erratum (2026-09-17, U4 #1904, ruling 10): the U4 row’s / test-matrix "eligibility consult still 200" — the Texas proof is the unchanged in-process pin texas_rule_evaluation_directors_create_only; the live leg is a Georgia-side POST /v1/rules/evaluate smoke with rita’s bearer, named so in its doc (the consult is reached only from require_georgia routes, and the devstack is all-georgia); a Texas live proof waits on #1910.

Erratum (2026-09-17, U4 #1904, ruling 15): § Rollout’s "→ U4 images" and ADR-077 D8’s "the Texas-rows images" name nothing product-side — no engine evaluates a JDM file from its image (the placement / composition / seed images copy rulesets/ for the .toml surfaces only; every engine reads the live craig-rules row); step 7 of the deployment guide’s rollout section is the per-file two-step promote over the verified gauge, and the devstack converges through cargo xtask dev reseed.

Erratum (2026-09-17, U4 #1904, wording): ADR-077 D7’s "fixtures seed a financial case_assignments row carrying the unit (grant_case_assignment_with_unit)" holds for Georgia births only — every subsidy write route is require_georgia, so the TX live harness raw-seeds agreements / payments and stamps admin_unit directly.

Erratum (2026-09-17, U4 #1904, wording): the U4 row’s "the three pins" are seven re-authored regional pins (four renamed for the property they now assert) plus the texas_regional_supervisor_claims() helper retired for regional_director_claims() / the bound bound_regional_claims(); the two must-still-pass pins are unchanged.

Anchors

#1086 (epic &95; children #1898 U2a, #1899 U1a, #1900 U1b, #1901 U3a, #1902 U3b, #1903 U2, #1904 U4, #1905 U5 — U5 closes the anchor), ADR-077 (Proposed at U0; Accepted at U2 — #1903, the first consumer; U5 adds the as-built notes), ADR-026 (amended — claims.admin_units is CRAIG-derived at evaluation, never an IdP mapper), ADR-054 (D1 note — in Texas the office role regional_director ALSO carries unit-scoped OPERATIONAL rows, a jurisdiction reading ⁂ #1073), ADR-072 (tier doctrine — the rows are tier-1 content, the registry tier 3), ADR-049 (the non-degradable scope channel the cases binds ride), ADR-062 (the registry writes are claim-first; the stamp locks follow claim_first), ADR-074 (the verified-surface + gauge resolver precedent), ADR-076 (the claims.channel precedent — the last time the engine’s input grew), #1369 (the TX live-HTTP financial harness — the test vehicle), #1654 (the program queue; this is item 10), #1083 (the subsidy_agreement regional DENY rows this program flips to the scoped shape), #1793 (the screening actor-role hierarchy — a sibling regional reading), #1791 (none floor / a 4th office tier — untouched here); follow-ups filed at U0: #1906 (DFPS regions as a registry hierarchy ⁂ #1073), #1907 (a Studio page for worker units), #1908 (case-less agreements' unit, R3 ⁂), #1909 (child-keyed education / health / home-document / training rows), #1910 (a cases / placement live-HTTP TX harness), #1911 (a stamp-rewrite xtask for renamed units), #1912 (fix: the dead TX i_supervises supervisor rows), #1913 (fix: revoked_by / acknowledged_by never lifted into audit_log).

Context

#1086 was filed at Step 0 of the subsidy-agreement foundation plan after review 2 flagged the Texas regional rows as an over-grant, and parked 2026-08-09 at a three-way fork. The maintainer ratified B on 2026-08-29 — a CRAIG-owned worker→admin-unit registry on craig-security, claims ENRICHED with the worker’s units at evaluation time, a creation-time immutable admin_unit stamp, ListScope::Custom implemented, the Texas rows re-authored honestly, the #1369 TX live-HTTP harness as the test vehicle. The research record (five read-only lanes, a contextless critique, the maintainer’s 15-finding rev-2 gate, each finding re-verified) is ADR-077 § Context; the census the units build on:

  • 52 of the 56 texas-authz-*.json files declare i_regional ('regional_supervisor' in claims.roles — NOT a realm role; the office role is regional_director): 50 the template allow-all row, foster_portal unused, subsidy_agreement the #1083 DENY — no identity can hit the row today.

  • The engine is token-fed through THREE entrypoints (check_typed, auto_scope_list_typed, resolve_field_permission) and caches RULESETS, never decisions (the fetch-start refresh guard, cache.rs:94, is a note in ADR-077 D4); 35 auto_scope_list call expressions fan out to 46 list handlers, 13 of which match ListScope NON-exhaustively and fall through to the UNFILTERED query (field_proposals.rs:117 first); craig-cases lists ride the ADR-049 channel.

  • Report / referral GETs and eleven other Report sites, investigation create, check_lifecycle_authz and the adjustment approve / deny check attr-less or id-only refs BEFORE fetching; Report refs come from FOUR duplicate builders + one inline literal; admin_unit lives natively on cases, referrals, reports, foster_homes only, case.created carries it and both case_assignments projections drop it; investigations are referral-keyed.

  • craig-security owns the vocabulary (admin_unit_registry: 159 GA / 254 TX counties, unit_type free TEXT) and its writers rename (PUT, CLI, the xtask seed’s UPSERT); the audit subscriber lifts the actor from created_by | approved_by | user_id | archived_by | sub and routes unknown security.* to a catch-all; extract_resource_id knows eight prefix families; validate_admin_unit is case-insensitive.

Decisions (specifics only — each ends with its ADR-077 section; ADR-026 amended, ADR-054 D1 noted)

  1. Registry = a NEW audited craig-security table with a resolvable subject. worker_admin_units { id uuidv7, worker_sub UUID, admin_unit_id UUID → admin_unit_registry, unit_name TEXT, unit_type TEXT, jurisdiction TEXT, assigned_by UUID, assigned_at, revoked_at, revoked_by, version } (NOT NULL but the revoke pair), partial-unique (worker_sub, admin_unit_id) WHERE revoked_at IS NULL — a second assign of a LIVE (worker_sub, admin_unit_id) pair → 409 ADMIN_UNIT_ALREADY_BOUND (the admin-unit create’s conflict_typed shape); single-row worker_admin_units_meta (generation BIGINT) bumped inside every assign / revoke tx (the keyring_meta shape). Routes: POST /v1/security/admin/workers/{sub}/admin-units (ADR-062 claim security.assign_worker_admin_unit), DELETE …/admin-units/{id} (soft revoke, If-Match; replay 200), GET …/admin-units/{id} (REVOKED rows too); ResourceType::WorkerAdminUnit + {j}-authz-worker_admin_unit.json ×2 (admin only; readonly read / list). Events security.worker_admin_unit.assigned {binding_id, worker_sub, admin_unit_id, unit_name, jurisdiction, created_by} / …revoked {binding_id, …, user_id} with EXPLICIT audit arms above the security. catch-all (assign_admin_unit / revoke_admin_unit, resource_type = worker_admin_unit) and a NINTH extract_resource_id family on binding_id. The seed binds rita.regional to Harris and Travis. Surface = API + CLI craig worker-unit assign|revoke|list (no craig-web page; #1907); the CLI takes --sub <uuid> or --username <name> resolved through GET /v1/security/workers?search= (exactly one match, else a typed error). Rejected: attrs JSONB; revoked_by as the lifted actor key (#1913). (ADR-077 D1)

  2. The token is the unit NAME FROZEN AT ASSIGN, counties only. Assign reads the registry row FOR SHARE, refuses unit_type != 'county' or active = false (typed 400 ADMIN_UNIT_NOT_BINDABLE; parish / borough ⁂) and copies unit_name / unit_type onto the binding; the snapshot reads BINDING rows (unit_type = 'county' AND revoked_at IS NULL), never the live registry. update_unit / delete_unit (API, CLI, the xtask seed’s UPSERT) gain AND NOT EXISTS (live binding): a rename / retype / deactivate of a BOUND row is 409 ADMIN_UNIT_BOUND (fips_code / state_fips stay editable; deactivation never cascades to revocation; the rename procedure + #1911 in the ADR). The stamp-minting creates — CreateCaseRequest, CreateReportRequest, foster-home create / update — validate via validate_admin_unit(State::from_jurisdiction_key(..)) and PERSIST the canonical unit.name (typed 400 INVALID_ENUM_VALUE; pre-1.0 Changed). The token stays a plain String across Ready(Vec<String>), ListScope::AdminUnits, ScopeFilter::Units and BindValue::TextArray — the primitive IS the concept (the validated admin_unit TEXT vocabulary the four native columns already carry); no newtype. Rejected: a registry id as the token; immutable names outright. (ADR-077 D2)

  3. Enrichment is an engine-side port consulted by ALL THREE entrypoints, only for rulesets that declare a unit token. craig_authz::WorkerUnitsSource (units(worker_sub, jurisdiction) → UnitsAnswer::{Ready(Vec<String>), NotReady(reason)}) on ZenAuthzEngine via AuthzBootSpec (ONE test double craig_authz::StaticUnitsSource); compile_fetched records consults_units on CachedRuleset from the D5 census; one helper units_for(entry, claims, jurisdiction) runs between lazy_load and the input build in check_typed, auto_scope_list_typed AND resolve_field_permission. claims.admin_units is ALWAYS a JSON array ([] for service principals and non-consulting rulesets — an absent key makes i_unit_match an evaluation error). A consulting ruleset with NotReady → AuthzError::UnitsUnavailable → typed 503 ADMIN_UNITS_UNAVAILABLE on all three paths — never [], never FieldPermission::None, never collapsed to Denied by the untyped auto_scope_list. Rejected: a per-request S2S read from every handler. (ADR-077 D3)

  4. The source is a verified snapshot whose monotonicity is a server-issued generation. craig_bootstrap::admin_units::SecurityUnitsSource: the service’s own principal reads GET /v1/security/worker-identities/admin-units?jurisdiction= (service-only; ONE {j}-authz-worker_identity 1.3.0 row claims.is_service && resource.attrs.projection == 'admin_units' ABOVE the service DENY, admitting every engine-bearing service; the map sub → [unit_name] + registry_generation, no PII, no-store) under a 4 s budget, and reuses and re-documents the existing security_base_url leaf (crates/craig-common/src/settings.rs — today documented as placement-only and degrade-on-unreachable; after U2 every engine-bearing service reads it and the snapshot path is 503-class while the display-name path still degrades); the store reads the generation FIRST, then the rows, in one tx. A Critical admin-units-verifier re-reads every 60 s AND on security.worker_admin_unit. — each service that boots an authz engine subscribes in the composition cache-invalidation shape (subscribe_exclusive: a per-instance exclusive queue bound to security.worker_admin_unit. on craig.events, no inbox, no idempotency row — the handler only calls refresh_now()); only the craig.events exchange rides the operator-owned topology (ADR-003 #1202) — the exclusive queue and its binding are declared by the consumer at subscribe time, as composition’s invalidation subscriber does today — and each subscriber is a mq-consumer entry in contested-surfaces.toml (the two-path rule applies). The three callers (cadence, event, refresh_now()) serialize on one mutex and never coalesce onto an in-flight fetch; a snapshot installs only when generation > held (equal = no-op; lower = refused + WARN); older than CRAIG_<SVC>ADMIN_UNITSMAX_AGE_SECS (default 300, injectable) = NotReady(Stale). Gauge admin_units_snapshot_verified{jurisdiction}; the missing-1.3.0-row remedy logged on a 403; readiness NOT gated; craig-security reads its own table; the #1369 BootSpec gains verify_units. Rejected: fetch-start order; coalescing; /readyz gating. (ADR-077 D4)

  5. LIST scope is a TYPED filter every handler matches exhaustively; every CHECK on a unit-bearing type sees the row.

    • Wire: the o_scope cell is exactly {"custom": {"scope": "admin_units"}}; parse_scope_output maps THAT custom payload to ListScope::AdminUnits(units) and leaves every other custom payload as Custom; compile_fetched parses the cell as JSON (not a substring) when flagging consults_units, and flags the expression token claims.admin_units wherever it appears in an input field; the CHECK input is {"id": "i_unit_match", "name": "UnitMatch", "field": "resource.attrs.admin_unit in claims.admin_units"} (an absent attrs.admin_unit evaluates false — a NULL stamp never matches).

    • List: ListScope gains AdminUnits(Vec<String>) and #[must_use] fn filter(&self) → ScopeFilter { All, Worker, Supervisor, Units(Vec<String>), Denied, Refused }; list_scope_verdict, refuse_custom_scope and PortalScope::decode are re-expressed over it; all 46 list handlers match ScopeFilter — the unit-bearing eleven (cases / referrals / reports / investigations / foster_homes / placements ×2 / kinship / payments / adjustments / subsidy_agreements) BIND admin_unit = ANY($n) (craig-cases via ScopeConstraints::AdminUnits, BindValue::TextArray, push_scope → {col} = ANY($n), admin_unit_column(); no column → Break(PageEmpty); v_investigations recreated; ScopeConstraints becomes Clone); every other handler’s Units arm IS its Denied arm; the 13 non-exhaustive sites become exhaustive; validate_authz_coverage gains a BLOCKING rule (if let .*ListScope:: / matches!(scope inside a list handler fails validate).

    • Check: every authz.check on Case / Referral / Report / Investigation / Placement / KinshipOption / FosterHome / Payment / PaymentAdjustment / SubsidyAgreement carries attrs.admin_unit — from the ROW through the type’s ONE builder fetched BEFORE the check (the get_payment shape; existence-first 404), from the BODY on report / case / foster-home creates (post-belt), from the pre-check case_assignments read on placement / kinship creates, from the pre-fetched referral on investigation create; a NULL stamp = attr ABSENT (sites: the U3b row). Exceptions: subsidy-agreement creates (case unknown pre-check; i_unit_match on Read / Update / Approve rows only), nil-id List / sweep checks; the existing {"admin_units": [..]} fail-closed pins keep payload AND expectation (Refused). Rejected: a dynamic scope cell. (ADR-077 D5)

  6. The stamp rides the projection under ONE lock protocol, healed and backfilled unit-only.

    • Columns: case_assignments.admin_unit TEXT NULL ×2, seeded from case.created (the seed’s DO NOTHING becomes DO UPDATE SET admin_unit = EXCLUDED.admin_unit WHERE admin_unit IS NULL) and from case.assignment_changed, whose new admin_unit key is OPTIONAL at every consumer (COALESCE(EXCLUDED.admin_unit, admin_unit) in the upsert; exchange ignores it) because retained pre-upgrade envelopes reach the parser after the cases image ships — staged-but-undrained outbox rows at the restart, queued deliveries, and admin replays past the 31 d inbox window (POST /v1/admin/events/replay re-stages verbatim) — and the unit is not an authorization identity ordered by the revision: absent = NULL = fail-closed until the unit-only fill writes it; the identity keys keep the #1084 hard-required posture. Stamp columns admin_unit TEXT NULL + partial index on placements, kinship_options, payments, payment_adjustments, subsidy_agreements, investigations.

    • Protocol: every ROOT birth with a case_id takes lock_case_assignment (pg_advisory_xact_lock(hashtext( 'case-assign:' || case_id)), ported verbatim to placement) BEFORE its FOR SHARE projection read — placement / kinship after claim_first, create_agreement_active after the pay-exclusion lock, create_guardianship_agreement after the family lock, per-diem unchanged; both placement inbox handlers take it FIRST; every CHILD birth copies its parent under a parent-row lock (the generator’s FOR UPDATE OF a; create_adjustment’s SELECT gains `FOR SHARE); the generator never takes the case lock (cycle).

    • Heals + backfill: SEPARATE unit-only statements (SET admin_unit = ca.admin_unit WHERE … admin_unit IS NULL, never the pair or revision), parents first — agreements → payments → adjustments; placements → kinship — run by case.created AND assignment_changed; the pair predicates stay byte-identical. backfill-cross-service-assignment adds an unconditional, revision-independent unit-fill pass after the pair legs (projections, then resources, adjustments via the payments JOIN). investigations.admin_unit is stamped from the referral at create and BACKFILLED (UPDATE … FROM referrals, total: referral_id NOT NULL, plaintext) in the cases migration that recreates v_investigations — additive, no floor bump. Imports and case-less agreements stay NULL (R3). Rejected: a NULL arm inside the pair predicate. (ADR-077 D6)

  7. Honest Texas rows on regional_director (R1), qualified. For a UNIT-BEARING resource the regional row = the TX supervisor row’s actions with i_unit_match on CHECK and the marker on LIST, the regional LIST row ABOVE the supervisor LIST row (one scope per evaluation; CHECK rows fall through, so a dual holder keeps both reads); the eight regional FIELD rows (foster_home / placement / health_record / education_record) are re-keyed with their CHECK twins. For a resource with no unit attribute the regional row = the supervisor row ONLY where that row is satisfiable at the resource’s check sites (R2); where the TX supervisor row keys on i_supervises and every check ref carries supervisor_sub: None (~35 types, listed in the ADR) NO regional row is added — a pure regional_director stays default-deny (the dead supervisor rows are #1912). rule_evaluation keeps its two County director create (#1624) / Regional director create (#1624) rows byte-identical and texas_rule_evaluation_directors_create_only UNCHANGED; investigation keeps its County director / Regional director response-deadline override rows (#1748). The i_regional input is DELETED from all 52 files (grep gate: zero regional_supervisor under rulesets/); the subsidy DENY flips to the scoped shape; texas_regional_supervisor_role_recognized and the two subsidy pins are re-authored (the #1369 legs: dana.county supervisor, rita.regional regional — the U4 row); investigations take the referral’s county (R4). Rejected: regional_supervisor as a tenth realm role; a resource-less regional grant on the non-unit types. (ADR-077 D7)

  8. Rollout gates on the derived manifest and the gauge. New cargo xtask rules drift [--strict] classifies every JDM file against the live service (absent → bootstrap, behind by version or canonical content → promote, current); no count is ever a literal. (ADR-077 D8)

Units — each Relates to #1086; U5 Closes #1086

MR Issue Scope W

U0

#1086

This page (Active nav), ADR-077 (Proposed), the ADR-026 pointer, epic &95 + the eight children, the follow-ups #1906–#1913 (incl. the two fix: issues), #1086 rewritten to B, label Plan::ADMIN-UNIT, the census pinned as grep expressions

1

U2a

#1898

ScopeFilter + ListScope::filter(), the three helpers re-expressed, the 13 non-exhaustive sites converted, the validate_authz_coverage exhaustiveness rule (BLOCKING), screening_reviews.rs onto the shared arm — green on the five existing variants; a fence before AdminUnits exists

3

U1a

#1899

craig-security registry: table + meta + migration, store, the write family staging both events, explicit audit arms + the ninth resource family, the bound-row 409 on update / delete / seed, the county-only assign, the duplicate-assign 409 ADMIN_UNIT_ALREADY_BOUND, the revoked-row GET, ResourceType::WorkerAdminUnit + {j}-authz-worker_admin_unit ×2, contracts, test-lib clients, route-to-client-method.toml + api-docs, mq-topology, CLI (--sub / --username resolved through workers?search=), seed (rita.regional bound to Harris and Travis), data-model-security, CHANGELOG

5

U1b

#1900

The service-only snapshot projection (registry_generation), {j}-authz-worker_identity 1.3.0 ×2 (a PROMOTE), cargo xtask rules drift, the deployment-guide rollout section steps 1–2

3

U3a

#1901

The stamp program: projection column ×2 (seed DO UPDATE, optional assignment_changed key + producer, COALESCE), six stamp columns, the lock protocol (placement port, the two agreement creates, adjustment FOR SHARE), unit-only heals in order, the backfill unit-fill pass + grant_case_assignment_with_unit ×2, investigations migration + view, the canonical-name belt (cases, reports, foster homes), seed + verify-seed, data-model pages, CHANGELOG Changed

5

U3b

#1902

The check census: the ten unit-bearing builders carry attrs.admin_unit (Report builders collapsed to one), six inline literals routed, twelve fetch-before-check reorders (report / referral GETs, convert, follow-ups ×2, attachment delete, investigation create, check_lifecycle_authz ×4, adjustment approve + deny), the three recorded exceptions, the attrs: HashMap::new() recurrence pin

3

U2

#1903

craig-authz: WorkerUnitsSource + StaticUnitsSource, the JDM census (the o_scope cell parsed as JSON + the claims.admin_units token in input field`s), `units_for on the three entrypoints, always-array, ListScope::AdminUnits + marker resolution, UnitsUnavailable → 503; craig-bootstrap: the generation-guarded single-flight snapshot source, verifier + gauge + remedy log, event invalidation in the subscribe_exclusive shape (D4) with one mq-consumer census entry per engine-bearing service, MAX_AGE, reuse and re-document the existing security_base_url leaf (crates/craig-common/src/settings.rs — today documented as placement-only and degrade-on-unreachable; after U2 every engine-bearing service reads it and the snapshot path is 503-class while the display-name path still degrades), BootSpec.verify_units, every AuthzBootSpec literal and engine constructor (a compile-forced set) on the one StaticUnitsSource double; one contested s2s-client.<svc>.security-admin-units entry per engine-bearing service; craig-search AdminUnits / TextArray / ANY / admin_unit_column(); the eleven binds; ADR-077 Status → Accepted (the first consumer)

8

U4

#1904

The Texas re-author: i_regional deleted from 52 files, unit rows where the supervisor row is live (the o_scope marker cell and the i_unit_match input exactly as D5 pins them), the eight field rows, the rule_evaluation / investigation exceptions (rows named by _description, D7), version bumps, citations, rules check, the grep gate, the three pins + the two must-still-pass pins, rulesets/README.adoc to B; the #1369 legs (dana supervisor; rita regional: in-unit 200 / out-of-unit 403 / list narrows / empty → empty page / verify_units off → 503 / retained-envelope replay / Georgia differential / eligibility consult still 200) + in-process legs for cases and placement

5

U5

#1905

Close-out: the ADR-077 as-built notes (Accepted at U2, #1903 — the first consumer), the ADR-026 amendment, the ADR-054 note, data-model-security.adoc:379, adr-037:206-207, deployment-guide.adoc:858-861, idp-integration (no mapper), rulesets.adoc, the rollout section finalized, testing-reference, .claude/CLAUDE.md; plan archived

2

Order: U2a ∥ U1a → U1b ∥ U3a → U3b → U2 → U4 → U5 — U2a and U1a start together; U1b reads U1a’s table; U3b reads U3a’s columns; U2 needs every unit before it; U4 needs U2; U5 closes. Two reasons fix the order. Mechanics — every seam is fail-closed, so a consumer landing before its producer denies or errors, never over-grants: AdminUnits is born into U2a’s exhaustive ScopeFilter match under the BLOCKING lint, the eleven binds need U3a’s columns and the checks U3b’s attrs, and a Texas row naming claims.admin_units before U2 emits it is an evaluation error. Rollout — each unit deploys alone and is behaviour-neutral until U4: Georgia pays nothing, and regional_director holds no operational row in Texas until the rows land LAST over a verified snapshot (the gauge gate in § Rollout).

Test matrix (by risk)

  • Confidentiality (evil): a unit-A worker reads a unit-B payment / agreement / placement / case / report / referral / investigation by id → 403; lists never widen — empty units → empty page, NULL-stamped rows absent, ?admin_unit= cannot lift the scope; list_scope_verdict(AdminUnits) / refuse_custom_scope(AdminUnits) → 403; one #1407-shape test per converted site under AdminUnits(["Harris"]) (the field-proposals leak named first); the lint refuses an if let list handler; a Custom of any other shape → Refused; a snapshot older than MAX_AGE → 503 (injected clock); a hand-inserted region-typed binding is absent from the snapshot; regional_supervisor in roles grants nothing after U4.

  • Registry integrity (sad, conc): rename / retype / deactivate a BOUND unit → 409 until every binding is revoked (a concurrent assign vs rename cannot leave a bound row renamed); assign refuses a region / inactive row; the snapshot emits the name frozen at assign; a revoked binding still reads by id; the seed skips bound rows and reports drift.

  • Revocation (sad, conc): a lower generation never replaces an installed snapshot; equal is a no-op; arbitrary arrival order converges to the max (proptest); refresh_now() serializes behind an in-flight fetch and observes the revoke; assign / revoke bump the generation in-tx (a rolled-back assign does not); revoke replay 200; both acts land action / resource_type / resource_id = binding_id / actor in audit_log and resolve by resource.

  • Enrichment (sad): a Georgia ruleset never consults the source (counting fake, all three entrypoints); NotReady → 503 on check, list AND field permission; service principals carry []; a Georgia-bound worker in Texas carries []; the acting worker is the enriched identity; the marker-only ruleset is flagged.

  • Stamp (sad, conc): the unit heal fills NULL without touching a newer triple (case_created_after_a_reassignment_never_rewinds extended); a unit-less projection row gains the unit at its revision; a heal blocked on a generator-locked agreement still stamps the payment; an adjustment born during the heal inherits; placement / kinship create racing the first case.created is serialized by the case lock (both interleavings); the backfill is revision-independent and idempotent; the investigations backfill is total; "harris" stored "Harris"; a retained six-key assignment_changed envelope applies the pair and leaves the unit NULL; missing_supervisor_key_fails_loud unchanged.

  • Texas rows (happy + evil): rules check, twin parity, no_texas_authz_file_declares_i_regional (computed), the changed-file set equals the i_regional set, rule_evaluation directors create-only unchanged, a pure regional denied where the supervisor row is dead, regional == supervisor verdict on live non-unit resources, an in-unit governed field write 200 / out-of-unit 403, the four-leg live harness per stamped resource, the Georgia differential.

  • Property: ListScope → ScopeFilter total; marker resolution total; the snapshot parser total; the belt idempotent.

Verification

Per MR: fmt, clippy, the budgets, the lints (validate-authz-coverage with its new rule, rules check, contested-census, mq-topology), check-docs, plan-lint, rules drift --strict where a family changed, the pre-push battery. Live probe after U4, against the TX financial harness with the seeded rita.regional (Harris
Travis): a Harris-stamped agreement reads 200, a Dallas one 403, the list shows Harris + Travis rows only; craig worker-unit assign --sub <rita> Dallas → the Dallas read 200 after refresh_now(); revoke → 403 again; verify_units off → 503; GET /security/audit/resource/worker_admin_unit/{binding_id} lists the assign and the revoke; PUT /security/admin/units/{Harris} rename → 409 while bound.

Rollout

Per environment: (1) U1a image → rules-bootstrap worker_admin_unit ×2; U1b image → rules-promote worker_identity 1.3.0 ×2 → rules drift --strict green. (2) U3a: cases image FIRST (the optional key), then placement / financial images + migrations + backfill-cross-service-assignment; U3b images. (3) U2a / U2 images, with the security.worker_admin_unit.* invalidation subscribers declaring their own exclusive queues on the operator-owned craig.events exchange (D4; the deployment-guide topology section names the routing key); GATE: admin_units_snapshot_verified{jurisdiction} = 1 on every engine-bearing service (readiness stays green while unverified). (4) rules-promote every file rules drift reports behind (the 52 + any twin) → U4 images.

Risks

The engine’s new cross-service dependency (bounded: consulting evaluations only, MAX_AGE, 503). ScopeConstraints loses Copy. The JDM census sees only the o_scope cell and input field`s (D5) — a unit expression anywhere else evaluates against `[] and denies, never widens. 52 hand-edited files (rules check + parity + the computed-set pins). Renamed units orphan old-name stamps (#1911). `regional_director’s operational rows in Texas are a reading ⁂ (#1073).

Rulings (approved 2026-09-16, plan mode)

R1 the Texas regional role token = re-key to the existing regional_director (rita.regional is the live probe; a dual holder gets the regional LIST scope and both CHECK reads) — not regional_supervisor as a 10th realm role. R2 non-unit resources: the regional row = the supervisor row WHERE that row is satisfiable; NO row where it is dead — not a resource-less regional_director grant on those ~35 types. R3 case-less subsidy_agreements / payments / imports stay OUTSIDE unit scopes (NULL stamp; #1908) — not a stamped approving_county. R4 investigations are stamped and backfilled from the referral’s county (Texas assignment_area is a REGION token) — not role-flat for regionals. Recorded as decisions with their rejected alternatives rather than rulings: the frozen-name token and county-only allowlist (D2), the generation-guarded snapshot and its 300 s parameter (D4), the optional assignment_changed key (D6), no craig-web page (D1).

Review log

Rev 1 went to a contextless critique; rev 2 took the maintainer’s 15-finding gate (each finding re-verified against source and folded); rev 3 was approved 2026-09-16 and entered round 1.

Round Vendor Resolved model Verdict

1

Anthropic — one fresh contextless subagent, the four plan-lifecycle questions, over this page + ADR-077

Claude Fable 5.1

no-ship (2026-09-16; 3 blockers, 10 advisories) → folded the same day: B1 the marker cell + i_unit_match pinned literally, B2 the subscribe_exclusive invalidation shape + topology + census class, B3 rows named by _description; A1 optional-key justification corrected (retained envelopes, the maintainer’s finding 11 — kept), A2 counts de-literalised, A3 ADR accepted at U2, A4 U0 row, A5 RulesetCache::supersedes, A6 the existing leaf re-documented, A7 Harris + Travis seeded and the duplicate-assign 409, A8 CLI identity resolution, A9 the token stays String, A10 Decisions trimmed to the split-relevant specifics with ADR xrefs; 17 citation spot-checks — 14 matching, 1 partial (U0 as-built), 2 corrected (the count of AuthzBootSpec literals; the security_base_url leaf already exists)

2

open — run by the maintainer through another vendor’s model

open

open

Edit this page · latest