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_unitsis CRAIG-derived at evaluation, never an IdP mapper), ADR-054 (D1 note — in Texas the office roleregional_directorALSO 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 followclaim_first), ADR-074 (the verified-surface + gauge resolver precedent), ADR-076 (theclaims.channelprecedent — 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 (thesubsidy_agreementregional DENY rows this program flips to the scoped shape), #1793 (the screening actor-role hierarchy — a sibling regional reading), #1791 (nonefloor / 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 TXi_supervisessupervisor rows), #1913 (fix:revoked_by/acknowledged_bynever lifted intoaudit_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-*.jsonfiles declarei_regional('regional_supervisor' in claims.roles— NOT a realm role; the office role isregional_director): 50 the template allow-all row,foster_portalunused,subsidy_agreementthe #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); 35auto_scope_listcall expressions fan out to 46 list handlers, 13 of which matchListScopeNON-exhaustively and fall through to the UNFILTERED query (field_proposals.rs:117first); craig-cases lists ride the ADR-049 channel. -
Report / referral GETs and eleven other Report sites, investigation create,
check_lifecycle_authzand the adjustment approve / deny check attr-less or id-only refs BEFORE fetching; Report refs come from FOUR duplicate builders + one inline literal;admin_unitlives natively oncases,referrals,reports,foster_homesonly,case.createdcarries it and bothcase_assignmentsprojections drop it; investigations are referral-keyed. -
craig-security owns the vocabulary (
admin_unit_registry: 159 GA / 254 TX counties,unit_typefree TEXT) and its writers rename (PUT, CLI, the xtask seed’s UPSERT); the audit subscriber lifts the actor fromcreated_by | approved_by | user_id | archived_by | suband routes unknownsecurity.*to a catch-all;extract_resource_idknows eight prefix families;validate_admin_unitis case-insensitive.
Decisions (specifics only — each ends with its ADR-077 section; ADR-026 amended, ADR-054 D1 noted)
-
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 → 409ADMIN_UNIT_ALREADY_BOUND(the admin-unit create’sconflict_typedshape); single-rowworker_admin_units_meta (generation BIGINT)bumped inside every assign / revoke tx (thekeyring_metashape). Routes:POST /v1/security/admin/workers/{sub}/admin-units(ADR-062 claimsecurity.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). Eventssecurity.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 thesecurity.catch-all (assign_admin_unit/revoke_admin_unit,resource_type = worker_admin_unit) and a NINTHextract_resource_idfamily onbinding_id. The seed binds rita.regional to Harris and Travis. Surface = API + CLIcraig worker-unit assign|revoke|list(no craig-web page; #1907); the CLI takes--sub <uuid>or--username <name>resolved throughGET /v1/security/workers?search=(exactly one match, else a typed error). Rejected:attrsJSONB;revoked_byas the lifted actor key (#1913). (ADR-077 D1) -
The token is the unit NAME FROZEN AT ASSIGN, counties only. Assign reads the registry row
FOR SHARE, refusesunit_type != 'county'oractive = false(typed 400ADMIN_UNIT_NOT_BINDABLE; parish / borough ⁂) and copiesunit_name/unit_typeonto 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) gainAND NOT EXISTS (live binding): a rename / retype / deactivate of a BOUND row is 409ADMIN_UNIT_BOUND(fips_code/state_fipsstay editable; deactivation never cascades to revocation; the rename procedure + #1911 in the ADR). The stamp-minting creates —CreateCaseRequest,CreateReportRequest, foster-home create / update — validate viavalidate_admin_unit(State::from_jurisdiction_key(..))and PERSIST the canonicalunit.name(typed 400INVALID_ENUM_VALUE; pre-1.0Changed). The token stays a plainStringacrossReady(Vec<String>),ListScope::AdminUnits,ScopeFilter::UnitsandBindValue::TextArray— the primitive IS the concept (the validatedadmin_unitTEXT vocabulary the four native columns already carry); no newtype. Rejected: a registry id as the token; immutable names outright. (ADR-077 D2) -
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)}) onZenAuthzEngineviaAuthzBootSpec(ONE test doublecraig_authz::StaticUnitsSource);compile_fetchedrecordsconsults_unitsonCachedRulesetfrom the D5 census; one helperunits_for(entry, claims, jurisdiction)runs betweenlazy_loadand the input build incheck_typed,auto_scope_list_typedANDresolve_field_permission.claims.admin_unitsis ALWAYS a JSON array ([]for service principals and non-consulting rulesets — an absent key makesi_unit_matchan evaluation error). A consulting ruleset withNotReady→AuthzError::UnitsUnavailable→ typed 503ADMIN_UNITS_UNAVAILABLEon all three paths — never[], neverFieldPermission::None, never collapsed toDeniedby the untypedauto_scope_list. Rejected: a per-request S2S read from every handler. (ADR-077 D3) -
The source is a verified snapshot whose monotonicity is a server-issued generation.
craig_bootstrap::admin_units::SecurityUnitsSource: the service’s own principal readsGET /v1/security/worker-identities/admin-units?jurisdiction=(service-only; ONE{j}-authz-worker_identity1.3.0 rowclaims.is_service && resource.attrs.projection == 'admin_units'ABOVE the service DENY, admitting every engine-bearing service; the mapsub → [unit_name]+registry_generation, no PII,no-store) under a 4 s budget, and reuses and re-documents the existingsecurity_base_urlleaf (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 Criticaladmin-units-verifierre-reads every 60 s AND onsecurity.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 tosecurity.worker_admin_unit.oncraig.events, no inbox, no idempotency row — the handler only callsrefresh_now()); only thecraig.eventsexchange 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 amq-consumerentry incontested-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 whengeneration > held(equal = no-op; lower = refused + WARN); older thanCRAIG_<SVC>ADMIN_UNITSMAX_AGE_SECS(default 300, injectable) =NotReady(Stale). Gaugeadmin_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 #1369BootSpecgainsverify_units. Rejected: fetch-start order; coalescing;/readyzgating. (ADR-077 D4) -
LIST scope is a TYPED filter every handler matches exhaustively; every CHECK on a unit-bearing type sees the row.
-
Wire: the
o_scopecell is exactly{"custom": {"scope": "admin_units"}};parse_scope_outputmaps THATcustompayload toListScope::AdminUnits(units)and leaves every othercustompayload asCustom;compile_fetchedparses the cell as JSON (not a substring) when flaggingconsults_units, and flags the expression tokenclaims.admin_unitswherever it appears in an inputfield; the CHECK input is{"id": "i_unit_match", "name": "UnitMatch", "field": "resource.attrs.admin_unit in claims.admin_units"}(an absentattrs.admin_unitevaluates false — a NULL stamp never matches). -
List:
ListScopegainsAdminUnits(Vec<String>)and#[must_use] fn filter(&self) → ScopeFilter { All, Worker, Supervisor, Units(Vec<String>), Denied, Refused };list_scope_verdict,refuse_custom_scopeandPortalScope::decodeare re-expressed over it; all 46 list handlers matchScopeFilter— the unit-bearing eleven (cases / referrals / reports / investigations / foster_homes / placements ×2 / kinship / payments / adjustments / subsidy_agreements) BINDadmin_unit = ANY($n)(craig-cases viaScopeConstraints::AdminUnits,BindValue::TextArray,push_scope→{col} = ANY($n),admin_unit_column(); no column →Break(PageEmpty);v_investigationsrecreated;ScopeConstraintsbecomesClone); every other handler’sUnitsarm IS its Denied arm; the 13 non-exhaustive sites become exhaustive;validate_authz_coveragegains a BLOCKING rule (if let .*ListScope::/matches!(scopeinside a list handler failsvalidate). -
Check: every
authz.checkon Case / Referral / Report / Investigation / Placement / KinshipOption / FosterHome / Payment / PaymentAdjustment / SubsidyAgreement carriesattrs.admin_unit— from the ROW through the type’s ONE builder fetched BEFORE the check (theget_paymentshape; existence-first 404), from the BODY on report / case / foster-home creates (post-belt), from the pre-checkcase_assignmentsread 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_matchon 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)
-
-
The stamp rides the projection under ONE lock protocol, healed and backfilled unit-only.
-
Columns:
case_assignments.admin_unit TEXT NULL×2, seeded fromcase.created(the seed’sDO NOTHINGbecomesDO UPDATE SET admin_unit = EXCLUDED.admin_unit WHERE admin_unit IS NULL) and fromcase.assignment_changed, whose newadmin_unitkey 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/replayre-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 columnsadmin_unit TEXT NULL+ partial index onplacements,kinship_options,payments,payment_adjustments,subsidy_agreements,investigations. -
Protocol: every ROOT birth with a
case_idtakeslock_case_assignment(pg_advisory_xact_lock(hashtext( 'case-assign:' || case_id)), ported verbatim to placement) BEFORE itsFOR SHAREprojection read — placement / kinship afterclaim_first,create_agreement_activeafter the pay-exclusion lock,create_guardianship_agreementafter 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’sFOR 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 bycase.createdANDassignment_changed; the pair predicates stay byte-identical.backfill-cross-service-assignmentadds an unconditional, revision-independent unit-fill pass after the pair legs (projections, then resources, adjustments via the payments JOIN).investigations.admin_unitis stamped from the referral at create and BACKFILLED (UPDATE … FROM referrals, total:referral_id NOT NULL, plaintext) in the cases migration that recreatesv_investigations— additive, no floor bump. Imports and case-less agreements stay NULL (R3). Rejected: a NULL arm inside the pair predicate. (ADR-077 D6)
-
-
Honest Texas rows on
regional_director(R1), qualified. For a UNIT-BEARING resource the regional row = the TX supervisor row’s actions withi_unit_matchon 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 oni_supervisesand every check ref carriessupervisor_sub: None(~35 types, listed in the ADR) NO regional row is added — a pureregional_directorstays default-deny (the dead supervisor rows are #1912).rule_evaluationkeeps its twoCounty director create (#1624)/Regional director create (#1624)rows byte-identical andtexas_rule_evaluation_directors_create_onlyUNCHANGED;investigationkeeps itsCounty director/Regional directorresponse-deadline override rows (#1748). Thei_regionalinput is DELETED from all 52 files (grep gate: zeroregional_supervisorunderrulesets/); the subsidy DENY flips to the scoped shape;texas_regional_supervisor_role_recognizedand 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_supervisoras a tenth realm role; a resource-less regional grant on the non-unit types. (ADR-077 D7) -
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,behindby 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 |
1 |
U2a |
#1898 |
|
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 |
5 |
U1b |
#1900 |
The service-only snapshot projection ( |
3 |
U3a |
#1901 |
The stamp program: projection column ×2 (seed DO UPDATE, optional |
5 |
U3b |
#1902 |
The check census: the ten unit-bearing builders carry |
3 |
U2 |
#1903 |
craig-authz: |
8 |
U4 |
#1904 |
The Texas re-author: |
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, |
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 underAdminUnits(["Harris"])(the field-proposals leak named first); the lint refuses anif letlist handler; aCustomof any other shape →Refused; a snapshot older thanMAX_AGE→ 503 (injected clock); a hand-insertedregion-typed binding is absent from the snapshot;regional_supervisorinrolesgrants 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 landaction / resource_type / resource_id = binding_id / actorinaudit_logand 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_rewindsextended); 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 firstcase.createdis serialized by the case lock (both interleavings); the backfill is revision-independent and idempotent; theinvestigationsbackfill is total;"harris"stored"Harris"; a retained six-keyassignment_changedenvelope applies the pair and leaves the unit NULL;missing_supervisor_key_fails_loudunchanged. -
Texas rows (happy + evil):
rules check, twin parity,no_texas_authz_file_declares_i_regional(computed), the changed-file set equals thei_regionalset,rule_evaluationdirectors 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 → ScopeFiltertotal; 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 + |
2 |
open — run by the maintainer through another vendor’s model |
open |
open |