Data Model: Security & Compliance
Overview
The security service is CRAIG’s compliance, audit, and platform-integrity backbone (port 8007,
database craig_security). Its tables back the audit trail (45 CFR § 95.621), the security-review
and NIST SP 800-53 control registries, data archiving/retention (2 CFR § 200.334), the
administrative-unit registry, breach detection (rules + alerts), partner + worker identity
(ADR-017 /
ADR-018 / ADR-026), and the
outbox/inbox/dead-letter durability + idempotency machinery
(ADR-022), the legacy OIDC issuer
record (ADR-085 D7) and the internal token
issuer’s signing-key registry (ADR-085 D8). The migrations create 28
tables (source of truth: services/craig-security/migrations/; the orphaned
idempotency_responses was dropped by &77 BF). This page catalogs 26 of them; the other two,
the per-service background-job ledger background_jobs + background_job_attempts, are
specified by ADR-068 § Amendment — #1571. The
schema carries eight foreign keys — review_evidence.review_id → security_reviews.id,
security_alerts.rule_id → detection_rules.id, partner_api_keys.partner_id → partners.id,
partner_signer_keys.partner_id → partners.id,
worker_admin_units.admin_unit_id → admin_unit_registry.id,
background_job_attempts.job_id → background_jobs.id (ON DELETE CASCADE), and
identity_legacy_issuer_retirements.issuer_id → identity_legacy_issuers.id, and
identity_key_revocations.kid → identity_signing_keys.kid; the durability
tables' cross-table links are logical, by envelope_id.
The endpoint catalog for this service is API: Security & Compliance;
its state machines are in State Machines; its events are in
ADR-003: RabbitMQ Topology (the wildcard # audit
subscriber).
Recorders name the acting worker (#2250). No craig-security recorder (a who-acted column or an event’s actor key)
names the request token’s own sub / preferred_username: under a BFF-lifted token that token is craig-web’s
service principal, so a staff act names claims.acting_worker() (ADR-028,
ADR-062), the lifted worker, or the token’s own subject when nothing is lifted. That covers partners.created_by,
partner_api_keys.created_by (issue and rotation), partner_signer_keys.created_by / approved_by / revoked_by,
security_alerts.acknowledged_by, archive_records.purged_by, nist_controls.assessed_by_name (named only when the
assessor is the acting worker, #2320) and major_changes.reported_by / reported_by_name (#2276), plus the actor key
of every event those acts stage. The ADR-026 identity cache (worker_identities) records the acting worker too
(#2472).
Since #2522 the Claims fields are private and crates/craig-test-lib/tests/acting_identity_census.rs pins it: the
token’s own identity is read only through a bearer_*() accessor, each such read under services/craig-security/src
is pinned with its reason, with no exception (the identity cache reads none since #2472), and a recorded worker is
claims.worker_subject(), which reads the claims.acting_worker() view, never the bare claims (#2740 removed
parse_sub / parse_actor_sub).
Tables
| Table | Purpose |
|---|---|
|
Append-only audit trail of all data access + mutation (45 CFR § 95.621); the wildcard |
|
Biennial / incident / ad-hoc security reviews (45 CFR § 95.621(f)) — findings + remediation plans; soft-deletable. |
|
NIST SP 800-53 control mapping + implementation-status tracking; soft-deletable, partial-unique
on |
|
Data-archiving + purge tracking (2 CFR § 200.334) — retention windows + purge eligibility per source service/table. |
|
Registry of administrative units (states / counties / districts) with jurisdiction + FIPS
mappings; partial-unique on |
|
Breach-detection rule registry (four rule types over |
|
Alerts fired by breached detection rules — FK to |
|
One row: the snapshot of the last committed detection scan, which the next scan locks and counts from (#2771). |
|
Forensic capture of RabbitMQ DLX-dead-lettered messages for causal-chain reconstruction |
|
Transactional outbox for this service’s own staged events (ADR-022), published-only 30-day retention (ADR-058). |
|
Idempotent inbox for subscription handlers — the ADR-062 single-transaction attempt machine (claim + effects + stamp atomic; supersedes ADR-022 §D3.2’s three-statement shape), 31-day retention (ADR-058). |
|
ADR-062 §B convert-class idempotency claims (claim-first inside the domain transaction);
pruned hourly on the fleet-wide |
|
ADR-063 rollback floor singleton — the minimum binary version the schema still serves; destructive contract migrations bump it in the same file. Written only by the migration gate; the verify-only boot SELECTs it. |
|
Identity-collision ledger (ADR-062 §A-4): reused envelope ids with divergent
|
|
Partner organization registry (hospital / school / LE / other) for edge identity (ADR-017);
|
|
SHA-256-hashed partner API credentials (FK → |
|
Per-PERSON ES256 signer keys for mandated-reporter detached JWS (ADR-018; FK → |
|
The client certificates a partner calls CRAIG with (ADR-091; FK → |
|
IdP-neutral worker identity cache (ADR-026) — lazy-populated from the acting worker’s claims by
the auth-after middleware (#2472: the worker a verified |
|
ADR-077 D1 (#1899): the worker→administrative-unit binding LEDGER — one row per
( |
|
Single-row generation counter (the |
|
Uploaded evidence objects attached to security reviews (FK → |
|
CCWIS major-change monitoring (staffing / org / system / policy) with ACF-reporting flags; soft-deletable. |
|
#2739 (ADR-085 D7): one row per distinct |
|
#2739: at most one retirement per recorded issuer (operator, reason, time), written only by the
owner-only |
|
#2741 (ADR-085 D8): one row per public key an issuer replica published (the private half never leaves the replica’s memory). Inserted by the issuer login on five columns; the times are stamped by an owner trigger; at most 64 unrevoked rows inside their publish window. Owner-owned, INSERT-only (§ Signing-key registry). |
|
#2741: one revocation per key, written only through the owner-only |
|
#2741: the one row the stamping trigger locks to serialize the 64-key count. Owner-held; no other role holds any privilege on it. |
Key columns
Source of truth: services/craig-security/migrations/. Every PK is id UUID DEFAULT uuidv7()
unless noted (ADR-002).
audit_log
audit_log is range-partitioned by UTC calendar month on timestamp (#3173, migration
20261127230000_audit_log_month_partitions): one partition a month, audit_log_pYYYYMM, bounds at the 1st 00:00 UTC,
no default partition, so a row whose month has no partition is refused (23514). Its key is PRIMARY KEY (timestamp,
id), since a partitioned table’s unique key must hold the partition key; id alone is no longer unique by
constraint, and no writer relies on it (ids come from the uuidv7() default). Every index is declared on the parent
and copied to each partition under the parent index’s name plus _pYYYYMM: idx_audit_log_user,
idx_audit_log_resource, idx_audit_log_service, idx_audit_log_actor_service, idx_audit_log_actor_user_sub,
idx_audit_log_action, the three detection partials, the two trigram indexes and idx_audit_log_xact_id. The key
serves the time ranges idx_audit_log_timestamp served before. A query bounded by timestamp reads only its months'
partitions; the detection scan’s span statement, bound by xact_id alone, plans against every partition, which is
why the unit is a month and not a day.
The owner’s functions, the app login’s only way to make or drop a partition (it executes these three and no helper; the issuer login executes none):
| Function | Contract |
|---|---|
|
Makes each missing month from |
|
The first day of each partition, oldest first, read from the catalog by the naming rule. |
|
The retention archiver’s drop (ADR-058). Refuses a date that is not a month’s first day, a month that is not
wholly before the current UTC month (22023) and a month with no partition (42P01). Under a 2 s |
The three share owner-only helpers, range_partition_ensure, range_partition_starts and range_partition_drop,
which take the parent and the unit (day or month).
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL, DEFAULT uuidv7(); the primary key with |
|
TIMESTAMPTZ |
the partition key; NOT NULL, DEFAULT now(); the event-audit insert writes |
|
TEXT |
acting worker identity (display); for a service-acted event, the service’s ADR-085 D3 encoding |
|
TEXT |
originating service |
|
TEXT |
e.g. read / create / update / delete |
|
TEXT |
domain resource class: one of the closed |
|
UUID |
nullable |
|
JSONB |
nullable structured context |
|
TEXT |
nullable |
|
BOOLEAN |
NOT NULL, DEFAULT true |
|
TEXT |
NOT NULL, DEFAULT 'unknown' — on-behalf-of service (ADR-028) |
|
UUID |
nullable — on-behalf-of subject |
|
BIGINT |
NOT NULL, DEFAULT the inserting top-level transaction’s id ( |
Where the event-audit columns come from (#2314). handle_inbound_event writes one row per envelope, and
services/craig-security/src/audit_columns.rs derives its columns one of two ways:
-
The envelope carries an audit header (
EventEnvelope.audit, acraig_mq::AuditMetathe publisher stated where it staged the event). The header supplies the columns and the payload is not read:Column From the header actionthe action token (
AuditAction, a closed set of 43)resource_typethe resource token (
AuditResource, a closed set of 85)resource_idthe header’s record id; NULL when it names none
user_idthe actor: a worker’s UUID in hyphenated lower case,
system, or a named actor’s text (service:<name>,system:retention, …) verbatimactor_user_subthe worker’s UUID; NULL for the system and for a named actor
user_rolethe header’s roles joined by a comma;
unknownwhen it states nonesuccessfalse when the header’s outcome is
refused, else trueservice,actor_serviceanddetailsare the envelope’ssource_serviceand payload, as before. A UUID actor written in another spelling (upper case, no hyphens) is stored in the canonical spelling on this path.Who the actor is (#3116). A publisher states the worker whose act, or whose run, caused the event, whenever the staging site holds that worker; a worker a calling service asserts as data is stated only where the endpoint admits that one service and nothing else (the SSN release, whose row names the requesting caseworker while
detailskeeps the service asrequestor). Where a service principal called and no worker is known, the actor is that service in its ADR-085 encoding,service:<name>, the text an authorization denial of the same service carries.systemis left for an event no request causes: a scheduler tick, a reconciler, an inbox consumer acting on another service’s event, or a cache signal. -
The envelope carries no header. The row still lands, degraded, and the payload is not read:
Event type actionresource_typesuccessauthz.access_denieddenyauthz_decisionfalse
any other
security.*systemsecuritytrue
anything else
the text after the first dot of the event type
the text before it (
unknown, with the whole type as the action, when it has no dot)true
In all three,
user_idissystem,user_roleisunknown, andresource_idandactor_user_subare NULL. No actor, record, role or resource type is taken from the payload, which is still stored whole indetails. A denial stays a denial, so a query forsuccess = falsestill finds it. The split halves are publisher-controlled text and pass through the same escaping and capping as every other column.
What an operator sees for a headerless event. Every publisher in the workspace states a header: staging refuses an
envelope without one (Unpublishable::MissingAuditHeader). A headerless delivery is therefore an outbox row written
by a build that stated none, an admin replay of such a row, or a message from a publisher outside the workspace.
Each one increments the label-free counter audit_headerless_events_total (served on /metrics) and logs one WARN
with the stable message audit event carries no header, carrying the envelope id and the capped, escaped
source_service and event_type. The counter should stay at zero. A headerless row is counted by a detection rule
only when the text after the first dot of its event type is exactly a token that rule counts (placement.portal_read
by bulk_access, reporting.afcars_export_generated by data_export); a headerless authz.access_denied is filed
as a refused deny and counted by privilege_escalation. Its actor and record are recoverable only from details.
A degraded header still lands its row. The header is decoded field by field, and a field that cannot be read is
replaced on its own: an unknown or missing action or resource_type is stored as unknown; an unreadable
resource_id is NULL; an unreadable actor is system; an unreadable outcome is a refusal when the action is deny
and a success otherwise; an unreadable role list is empty. Such a delivery increments the label-free counter
audit_degraded_headers_total (served on /metrics) and logs one WARN, audit header degraded. An audit value
that is not a JSON object is no header at all, and the row takes the headerless path above.
Hostile values are degraded, never dropped (#2864). The event-audit insert (handle_inbound_event) records every
envelope it receives. The columns are derived from the raw header or event type, and the stored forms are applied
to the derived values only, whichever path produced them
(services/craig-security/src/audit_text.rs):
-
Displayed identifier columns (
user_id,user_role,service,actor_service,action,resource_type): each NUL and each Unicode format character (Cf: bidirectional overrides and isolates, zero-width joiners, tag characters) is written as the literal text\u{XXXX}, the code point in upper-case hex with at least four digits (\u{202E},\u{E0020};craig_validation::escape_display). The five indexed columns (all butuser_role) are then capped at 1024 bytes, cut on a whole character or escape and suffixed…[truncated N bytes],Nbeing the escaped value’s length minus the kept prefix (craig_validation::cap_bytes). The truncated original is kept nowhere inaudit_log(a value the payload also carries is still whole indetails; the uncapped inbox copy ofsource_service/event_typeexpires with the 31-dayevent_inboxretention). -
details: every NUL in a string leaf or an object key is written as\u{0000}; nothing else changes, so format characters with legitimate uses (ZWNJ in Persian, the soft hyphen, emoji ZWJ sequences, LRM/RLM) stay verbatim. An escaped key that collides with an existing one takes the first free name amonge,e#1,e#2, … after every key that needed no escape. -
The escape is not injective: a value already holding the literal text
\u{202E}reads the same as an escaped U+202E. Other control and separator characters (newline, CR, ESC, U+0085, U+2028 / U+2029) are out of scope and stored as they are.
A clean value (no NUL, no Cf character, an indexed value of at most 1024 bytes) is stored exactly as derived, so the
detection rules (action equality, success) match clean rows as before. One hostile value can take three stored
forms: NUL-escaped in craig-mq’s event_inbox bookkeeping copy (source_service / event_type, otherwise
verbatim); escaped and capped for display here; NUL-escaped with a capped event_type in dead_letter_audit.
security_reviews
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL — the closed |
|
DATE |
NOT NULL |
|
DATE |
nullable |
|
TEXT |
NOT NULL |
|
JSONB |
nullable |
|
TEXT |
NOT NULL, DEFAULT 'scheduled' |
|
BOOLEAN / TIMESTAMPTZ |
soft-delete (active partial index) |
The row names no actor of a change: each update and soft delete stages a security.review.* act naming the acting
worker (#3001, ADR-003).
nist_controls
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL, partial-UNIQUE while |
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL, DEFAULT 'planned' |
|
TEXT |
nullable |
|
TEXT |
nullable (object-store pointer) |
|
DATE |
nullable |
|
TEXT |
nullable (the assessor as submitted + its display name: an API write
stores the acting worker’s username when |
|
BOOLEAN / TIMESTAMPTZ |
soft-delete |
archive_records
#1129 (ADR-058): the durable LOCAL LEDGER of the archive-then-prune engine — one row per archive
batch, written inside the batch’s prune transaction (D8). Also holds craig-rules' fleet
BOOKKEEPING copies (validated from rules.evaluations_archived, D16) — those are outside
security’s purge authority (rules' own archive_ledger drives their lifecycle).
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL — what was archived |
|
INTEGER |
NOT NULL |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now(); the ledger insert writes |
|
DATE |
NULLABLE since #1129: NULL = awaiting the DFCS records-retention schedule (⁂ #1073); purge refuses NULL/future/held at EVERY destructive statement (D14) |
|
BOOLEAN |
NOT NULL, DEFAULT false — purge-time audit fact ONLY (set true at purge; the D14 predicate is the purge authority). #1145 retired the list filter, the web badge, and the |
|
TIMESTAMPTZ / TEXT |
the D15-attributed purge stamp; the acting operator, #2250 (partial index WHERE purged_at IS NULL) |
|
TEXT |
actor sub or |
|
BOOLEAN |
NOT NULL, DEFAULT false — never purged while true (D14) |
|
TEXT |
full object keys (NULL only on pre-engine legacy rows) |
|
TEXT |
sha256 of the data object’s exact bytes |
|
TEXT |
the D9 store identity at archive time |
|
UUID |
the batch’s [min, max] row-id range (D17 candidate lookup; min/max never inverts) |
|
TIMESTAMPTZ |
oldest/newest archived row by the age column |
|
INTEGER |
the window in force when the batch was cut |
admin_unit_registry
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL (state / county / district) |
|
TEXT |
nullable |
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL — partial-UNIQUE |
|
BOOLEAN |
NOT NULL, DEFAULT true |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
The row names no actor: each create, update and deactivation stages a security.admin_unit.* act naming the acting
worker (#3001, ADR-003).
detection_rules
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL, UNIQUE |
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL, CHECK — bulk_access / after_hours_access / privilege_escalation / data_export (see the predicates below) |
|
INTEGER |
NOT NULL, CHECK |
|
TEXT |
NOT NULL, CHECK (info / warning / critical) |
|
BOOLEAN |
NOT NULL, DEFAULT true — scan-participation switch |
|
TEXT |
nullable — critical-severity push target |
|
BOOLEAN |
NOT NULL, DEFAULT true — soft-delete flag |
The row names no actor: each create, update and soft delete stages a security.detection_rule.* act naming the
acting worker (#3001, ADR-003).
Each rule type counts the audit_log rows of its window that satisfy one predicate (#3114). The action lists are
AuditAction variants in services/craig-security/src/detection_sql.rs, compared by exact equality:
rule_type |
Predicate on audit_log |
|---|---|
|
|
|
|
|
|
|
Every row stamped outside the rule’s |
How a scan counts (#2771). A scan is one transaction. It locks the detection_scan_watermark row, so scans run one
at a time and a scan that waits past the statement timeout fails (the route’s 504 db-timeout). It takes its own
snapshot, and a row is new to it when its transaction completed after the watermark’s snapshot and by its own. For
each enabled rule it finds the span in which a new matching row can share a window (by idx_audit_log_xact_id), then
the most matching rows any window [a, a + window_minutes) anchored at a matching row holds with at least one new row
among them. The alerts, their events and the watermark’s move to the scan’s snapshot commit together, so a failed scan
leaves every row new for the next one. Two consequences follow:
-
After an alert is acknowledged, the rule fires again only on a window holding a row no scan had evaluated yet: one committed after the last scan before the acknowledgement. An acknowledged burst does not fire again.
-
A rule created or re-enabled is first evaluated at the next scan, over the windows holding a row committed since the scan before it; a burst that committed wholly before that earlier scan is not reported by it.
The first three are each also served by a partial index on audit_log (timestamp) with the same predicate
(idx_audit_log_det_bulk_access, idx_audit_log_det_export, idx_audit_log_det_privilege), which the largest-window
count reads over the span. No rule type detects a
failed login or an account lockout: those happen at the identity provider, which sends CRAIG no events, so
audit_log holds no row for them. The failed_auth and account_lockout types are refused on create, and migration
20261117120000_detection_closed_tokens (schema_compat_floor bumped) deleted the rules of those types, keeping
their alerts with rule_id NULL.
security_alerts
rule_id → detection_rules.id is one of the schema’s four foreign keys (see Overview). #1172:
uq_security_alerts_standing_rule (partial UNIQUE on rule_id WHERE NOT acknowledged)
DB-enforces the #1156 one-standing-alert-per-rule invariant — the scan’s insert uses it as an
explicit ON CONFLICT arbiter, so overlapping scans produce exactly one alert. Legacy
NULL-rule_id rows are outside the constraint (partial-index NULLs are distinct).
| Column | Type | Notes |
|---|---|---|
|
UUID |
FK → |
|
TEXT |
NOT NULL (severity CHECK: info / warning / critical) |
|
JSONB |
nullable — window count context |
|
BOOLEAN |
NOT NULL, DEFAULT false — partial-unique key domain |
|
TEXT |
nullable — the acting operator’s sub (#2250), or the attributed |
|
TIMESTAMPTZ |
nullable |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
detection_scan_watermark
| Column | Type | Notes |
|---|---|---|
|
BOOLEAN |
PRIMARY KEY, DEFAULT true, CHECK ( |
|
BIGINT |
NOT NULL — the last committed scan’s snapshot: one past the highest transaction id that had completed (not |
|
BIGINT[] |
NOT NULL — the transactions below |
|
TIMESTAMPTZ |
NOT NULL — when that scan moved the row |
Migration 20261126180000_detection_exact_windows seeds the row with its own snapshot. A scan with no row refuses (a
500 naming the table), rather than treating every audit row as new.
Operator notes. Audit rows restored into this database from another PostgreSQL cluster (a logical dump and restore)
keep that cluster’s transaction ids; set their xact_id to 0 after the restore, so no scan takes them for new rows. A
deployment whose scans stopped for long enough that the rows since cannot be counted inside the statement timeout can
move the watermark to now, giving up that backlog on purpose:
UPDATE detection_scan_watermark
SET snapshot_xmax = (pg_snapshot_xmax(s)::text)::bigint,
in_progress = ARRAY(SELECT (x::text)::bigint FROM pg_snapshot_xip(s) AS x),
scanned_at = now()
FROM pg_current_snapshot() AS s;
dead_letter_audit
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL — correlates to |
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL |
|
JSONB |
NOT NULL — the full dead-lettered message |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
|
TEXT |
NULLABLE (#1181): per-occurrence idempotency token ( |
|
TIMESTAMPTZ |
NULLABLE (#1181): when the occurrence happened (when derivable); the #1156 threshold window keys on |
Stored forms (#2864). A capture is recorded whatever it carries: every NUL in envelope (string leaves and keys),
source_service and original_queue is written as the literal text \u{0000}, and event_type is NUL-escaped
and capped at 1024 bytes plus …[truncated N bytes] (it backs idx_dead_letter_event_type_occurred); format
characters are kept. The values are derived once per capture, and the inserts, the per-event_type crossing lock,
the window count, the security.dlq.threshold_exceeded payload and the R7 phantom comparison all read them, so a
redelivered phantom of a NUL or over-cap capture is absorbed. A capture with no NUL and an event_type of at most
1024 bytes is stored byte-identical to the pre-#2864 form; the one residual is a redelivery straddling the deploy
whose event_type is over 1024 bytes (stored whole before), which is quarantined as divergent rather than absorbed.
The escape is not injective and a truncated original is kept nowhere. This table is forensic only, never a replay
source: the ADR-022 §D4 admin replay (crates/craig-api/src/admin_replay.rs) re-stages from the producer’s
event_outbox, so an escaped envelope is never re-published.
event_inbox
PK is envelope_id UUID (the dedup key from the envelope), not a generated id.
| Column | Type | Notes |
|---|---|---|
|
UUID |
PK — dedup key |
|
TEXT |
NOT NULL |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
|
TIMESTAMPTZ |
nullable — set when the handler returns Ok |
|
INT |
NOT NULL, DEFAULT 0 |
|
TEXT |
nullable |
|
TIMESTAMPTZ |
nullable — permanently failed (DLX-surfaced only after a CONFIRMED surface, ADR-062) |
|
TIMESTAMPTZ |
nullable — in-flight marker |
|
TEXT |
NOT NULL (#1273, post-horizon ratchet) — hex SHA-256 of the payload, the third leg of the ADR-062 identity triple (#1053); bound at claim by every writer |
source_service and event_type (and event_inbox_collisions’ `observed_source / observed_type) are stored
NUL-escaped (#2864, craig_validation::escape_nul), otherwise verbatim, by every claim, comparison and collision
write; see the craig-mq inbox module docs for the identity consequences.
event_inbox_collisions
Present in ALL 8 stateful services (like event_inbox; documented here per the transport-table
catalog convention). A reused envelope id whose (source_service, event_type, payload_hash)
triple diverges from the canonical event_inbox claim is recorded here and nacked without
requeue (ADR-062 §A-4, #1053); the canonical row is never mutated. Any row is an alert — the
report-only inbox_identity_collisions_present watchdog fires on presence.
| Column | Type | Notes |
|---|---|---|
|
UUID |
part of the composite PK — the reused id |
|
TEXT |
NOT NULL — the collider’s identity |
|
TEXT |
NOT NULL — part of the composite PK with the two above |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() — the deterministic |
|
INT |
NOT NULL, DEFAULT 1 — repeat observations of the same collider bump this |
partners
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL, CHECK (hospital / school / le / other) |
|
TEXT |
NOT NULL, DEFAULT 'active', CHECK (active / suspended / deleted) — suspended blocks |
|
TEXT |
nullable |
|
INTEGER |
NOT NULL, DEFAULT 60, CHECK > 0 — mirrors intake’s per-partner default |
|
UUID |
NOT NULL — the acting worker (#2250); the creator only: each update and soft delete stages a
|
partner_api_keys
Plaintext keys are never stored — the raw key is returned exactly once at issue time. SHA-256
(not argon2/bcrypt) is deliberate: keys are 256-bit high-entropy random tokens, not passwords,
and the hash must support the indexed hot-path /partners/verify lookup (partial index on
unrevoked key_hash).
| Column | Type | Notes |
|---|---|---|
|
UUID |
FK → |
|
TEXT |
NOT NULL, UNIQUE — SHA-256 hex of the raw key |
|
TEXT |
NOT NULL — first 8 chars, safe to display for revocation UX |
|
TEXT |
nullable |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() + 1 year (F-009 rotation) — expired keys fail verify even if unrevoked |
|
TIMESTAMPTZ |
nullable |
|
UUID |
NOT NULL — the acting worker (#2250) |
partner_signer_keys
ADR-018: one partner carries many signer keys, ONE PER PERSON — mandatory-reporting statute identifies the individual as the accountable reporting party. Scoped to the partner (not the api-key) so credential rotation never orphans signer keys.
| Column | Type | Notes |
|---|---|---|
|
UUID |
FK → |
|
TEXT |
NOT NULL — the person (email, employee id, …) |
|
TEXT |
NOT NULL |
|
JSONB |
NOT NULL (RFC 7517) |
|
TEXT |
NOT NULL, DEFAULT + CHECK 'ES256' |
|
TEXT |
NOT NULL, UNIQUE — the JWS header |
|
TEXT |
NOT NULL, DEFAULT 'pending', CHECK (pending / approved / revoked) — admin review gates approval |
|
UUID / TIMESTAMPTZ |
nullable approval stamp — the acting worker (#2250) |
|
UUID / TIMESTAMPTZ |
nullable revocation stamp — the acting worker (#2250) |
|
TIMESTAMPTZ |
nullable |
|
UUID |
NOT NULL — the acting worker (#2250) |
partner_client_certificates
ADR-091: a partner that calls CRAIG is known by its client certificate. An administrator registers the certificate against the partner and, as a separate act, approves it. The certificate itself is not kept: it is public, and the row holds what was read from it at registration.
| Column | Type | Notes |
|---|---|---|
|
UUID |
FK → |
|
TEXT |
NOT NULL, CHECK 64 lowercase hex digits: the SHA-256 of the certificate’s DER encoding. A caller is looked up by it. Partial UNIQUE index WHERE status is not |
|
TEXT |
NOT NULL, at most 500 characters: the certificate’s subject as text, control characters removed |
|
TEXT |
NOT NULL, 1 to 100 characters: the administrator’s label, control characters removed |
|
TIMESTAMPTZ |
NOT NULL, CHECK |
|
TEXT |
NOT NULL, DEFAULT 'pending', CHECK (pending / approved / revoked). A CHECK ties each status to its stamps: pending has neither, approved has its approval and no revocation, revoked has its revocation |
|
UUID / TIMESTAMPTZ |
nullable, set together: the approving administrator |
|
UUID / TIMESTAMPTZ |
nullable, set together: the revoking administrator |
|
UUID |
NOT NULL: the registering administrator |
The lookup (GET /v1/security/client-certificates/by-fingerprint/{sha256}) answers a row only while it is
approved, its partner is active and the database’s clock is inside the certificate’s validity, so an approval, a
revocation and a suspension each take effect with the statement that makes them.
worker_identities
PK is sub UUID (the IdP subject), not a generated id. Lazy-upserted from the acting worker’s
claims by the auth-after middleware (ADR-026), at most once per worker per debounce window (#1155).
Since #2472 the acting worker is the worker a verified X-Craig-Actor names on a service bearer,
else the bearer when it is a worker’s own token; a bare service call, a portal channel and a lifted
service or portal identity cache nothing. A worker’s own token is authoritative for display_name
and email; a relay keeps a cached value unless it carries a new one.
| Column | Type | Notes |
|---|---|---|
|
UUID |
PK — IdP subject |
|
TEXT |
NOT NULL — deliberately non-unique ( |
|
TEXT |
NOT NULL — trigram-indexed for |
|
TEXT |
nullable — the acting worker’s |
|
TEXT |
nullable, CHECK E.164 ( |
|
JSONB |
NOT NULL, DEFAULT '{}' — reserved JSONB, NOT an authz input since ADR-077 (#1086): worker units live in |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
worker_admin_units
PK id UUID (UUIDv7, handler-minted so the ADR-062 claim binds it before the insert; the DB
default serves the seed). Never deleted — revocation is the pair below.
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL — the bound worker’s IdP subject ( |
|
UUID |
NOT NULL, FK → |
|
TEXT |
NOT NULL — copied from the registry row AT ASSIGN (D2, frozen); |
|
UUID |
NOT NULL — the acting admin (the assign event’s |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT now() |
|
TIMESTAMPTZ / UUID |
nullable, both-or-neither (CHECK |
|
BIGINT |
NOT NULL, DEFAULT 1 — ADR-062 §G3 CAS counter (the revoke requires |
Indexes: UNIQUE worker_admin_units_live_pair (worker_sub, admin_unit_id) WHERE revoked_at IS NULL
(the 23505 discriminator behind 409 ADMIN_UNIT_ALREADY_BOUND), worker_admin_units_live_worker_idx
(worker_sub) WHERE revoked_at IS NULL (the per-worker list + the D4 projection),
worker_admin_units_live_unit_idx (admin_unit_id) WHERE revoked_at IS NULL (the registry’s bound-row
guard).
The D4 snapshot read (#1900, GET /v1/security/worker-identities/admin-units?jurisdiction=) selects
worker_sub, unit_name from the LIVE rows of ONE frozen jurisdiction with unit_type = 'county' (a
directly inserted row of any other type is absent) — never a registry join — AFTER reading
worker_admin_units_meta.generation in the same transaction, so the rows it answers are never older than
the generation it carries. Service-only: a worker bearer, direct or relayed through X-Craig-Actor, is the 403
before the engine (#2339).
worker_admin_units_meta
| Column | Type | Notes |
|---|---|---|
|
BOOLEAN |
PK, DEFAULT TRUE, CHECK ( |
|
BIGINT |
NOT NULL, DEFAULT 0 — +1 per committed assign / revoke (and once per seed load), never on a replay; the D4 snapshot reads it FIRST, then the rows (#1900) |
review_evidence
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL, FK → |
|
TEXT |
NOT NULL |
|
TEXT |
NOT NULL — object-store pointer (bytes live in the store, never here) |
|
TEXT |
NOT NULL |
major_changes
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL, CHECK (worker_assignment / supervisor_change / org_restructure / system_upgrade / policy_change) |
|
TEXT |
NOT NULL |
|
DATE |
NOT NULL |
|
BOOLEAN |
NOT NULL, DEFAULT false |
|
DATE |
nullable |
|
TEXT |
NOT NULL / nullable — the sub and username of the worker who recorded
the change (the create’s |
|
BOOLEAN / TIMESTAMPTZ |
soft-delete |
identity_legacy_issuers
PK id UUID (UUIDv7, supplied by identity_record_legacy_issuer through uuidv7(); no column
default). Never updated, deleted or truncated (§ Identity records).
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL, UNIQUE — the configured |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT |
identity_legacy_issuer_retirements
PK id UUID (UUIDv7, supplied by identity_retire_legacy_issuer). Never updated, deleted or
truncated.
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL, UNIQUE (one retirement per issuer), FK → |
|
TEXT |
NOT NULL — who retired it; CHECK not blank, at most 256 characters, no control character (it is logged) |
|
TEXT |
NOT NULL — CHECK not blank, at most 2048 characters |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT |
identity_signing_keys
PK kid TEXT (the key’s RFC 7638 thumbprint; an ADR-085 D2 exception to the UUIDv7 rule). Never
updated, deleted or truncated. The issuer supplies the first five columns; the stamping trigger
sets the rest from clock_timestamp(), overwriting any value a caller (the owner) supplied.
| Column | Type | Notes |
|---|---|---|
|
TEXT |
PK — CHECK canonical unpadded base64url of 32 bytes, and equal to the SHA-256 thumbprint of |
|
TEXT |
NOT NULL — the P-256 point, each CHECK canonical unpadded base64url of 32 bytes |
|
UUID |
NOT NULL — the publishing replica, a UUIDv7 minted at its boot |
|
INTEGER |
NOT NULL — CHECK 600–21600 (a replica’s first key 600, every later key 21600) |
|
TIMESTAMPTZ |
NOT NULL — stamped |
|
TIMESTAMPTZ |
NOT NULL — stamped; CHECK |
|
TIMESTAMPTZ |
NOT NULL — stamped; CHECK |
|
TIMESTAMPTZ |
NOT NULL — stamped; CHECK |
identity_key_revocations
PK kid TEXT, FK → identity_signing_keys.kid ON DELETE RESTRICT. Never updated, deleted or
truncated; a key is revoked once.
| Column | Type | Notes |
|---|---|---|
|
TIMESTAMPTZ |
NOT NULL — |
|
TEXT |
NOT NULL — who revoked it; CHECK not blank, at most 256 characters, no control character (it is logged) |
|
TEXT |
NOT NULL — CHECK not blank, at most 2048 characters |
|
TEXT |
NOT NULL — the session’s login ( |
identity_key_cap_guard
PK id INTEGER CHECK id = 1 (the guard’s one row, an ADR-085 D2 exception), and generation
BIGINT, which every key insert increments.
identity_jti
PK (client_id TEXT, jti TEXT) (the client picks the jti; an ADR-085 D2 exception to the UUIDv7
rule). A spent client-assertion jti (#2743). Never updated or truncated; rows leave only through
identity_purge_client_assertions. The issuer’s issuance-log writer inserts the rows, in the same
transaction as the batch’s log rows, with a bare ON CONFLICT DO NOTHING, so its INSERT-only login
learns a replay from the rows affected (#3151).
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL — CHECK |
|
TEXT |
NOT NULL — CHECK 1–256 visible ASCII characters |
|
TIMESTAMPTZ |
NOT NULL — the assertion’s |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT |
identity_client_status
PK id UUID (UUIDv7, supplied by the writer). Runtime client disablement (#2743): INSERT-only,
the latest row per client (recorded_at, then id) winning. Never updated, deleted or truncated.
| Column | Type | Notes |
|---|---|---|
|
TEXT |
NOT NULL — CHECK as |
|
BOOLEAN |
NOT NULL |
|
TEXT |
NOT NULL — as |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT |
|
TEXT |
NOT NULL, DEFAULT |
identity_issuance_log
Every mint and refusal (#2743). Never updated or truncated; archived a closed UTC day at a time, each day’s partition then dropped (ADR-058).
The log is range-partitioned by UTC day on recorded_at (#3173, migration
20261128010000_identity_issuance_log_day_partitions): one partition a day,
identity_issuance_log_pYYYYMMDD, bounds at 00:00 UTC, no default partition, so a row whose day has
no partition is refused (23514) and its mint answers 503. Its key is PRIMARY KEY (recorded_at, id),
which replaced both PRIMARY KEY (id) and identity_issuance_log_recorded_at_idx: a partitioned
table’s unique key must hold the partition key. id alone is no longer unique by constraint, and no
writer relies on it (ids are the issuer’s UUIDv7s). Each partition’s key index is named
identity_issuance_log_pkey_pYYYYMMDD. The app login reads the log through the parent; it holds no
privilege on a partition, and nor does any runtime login.
| Column | Type | Notes |
|---|---|---|
|
UUID |
NOT NULL — UUIDv7, supplied by the issuer; the primary key with |
|
TIMESTAMPTZ |
NOT NULL, DEFAULT |
|
TEXT |
NOT NULL — stamped: hex SHA-256 of the row’s other columns in order, the stored |
|
UUID |
NOT NULL — the issuer replica |
|
TEXT |
NOT NULL — CHECK |
|
TEXT |
the grant, the authenticated client, the audience URN, the subject and the scopes; bounded by CHECKs |
|
TEXT, TEXT, TIMESTAMPTZ |
the released token’s id, signing key and expiry; NOT NULL for a mint, NULL for a refusal (CHECK) |
|
TEXT |
the refusal code, CHECK |
|
TEXT[] |
a worker token’s hops (later units) |
Identity records (ADR-085 D2 / D7, #2739)
The identity_ objects follow ADR-085 D2’s rules, set by these first ones for every later
identity_ function: owned by craig_security_owner, SECURITY DEFINER,
SET search_path = pg_catalog, public, pg_temp (this database’s schema is public), and
REVOKE ALL … FROM PUBLIC before any grant. The migration
(20261026120000_identity_legacy_issuers.sql) names the roles in unconditional statements, so it
fails when craig_security_owner or craig_security_app is absent: craig-security’s role names
are required (ADR-085 § Amendment — #2739; deployment guide § Per-service DB roles).
-
INSERT-only. One statement-level trigger function,
refuse_legacy_issuer_mutation(), refuses every UPDATE, DELETE and TRUNCATE on both tables, the owner’s included, with SQLSTATE23000(a statement trigger also fires on an empty table and on TRUNCATE, which a row trigger does not). -
identity_record_legacy_issuer(p_issuer text) → booleaninserts the issuer when absent (ON CONFLICT (issuer) DO NOTHING) and returns whether this call inserted it. Re-recording a retired issuer returns false and leaves it retired. It refuses an issuer outside 1–2048 bytes or holding a control character with22023. -
identity_retire_legacy_issuer(p_issuer text, p_operator text, p_reason text) → uuid, owner-only, inserts the retirement row of a recorded issuer that never validated a token and returns its id; it logs the retirement (RAISE LOGandRAISE NOTICE, naming the issuer and the operator). Refusals:22023a blank or over-long operator or reason,P0002an issuer not recorded,23505one already retired.
The privilege matrix for these objects. The migration first revokes everything on them from every
grantee but the owner, PUBLIC included, read from their ACLs, so a role holding the owner’s default
privileges under any name keeps nothing, then makes the one grant. The blocking invariant
identity_execute_matrix compares every grantee’s rights on every identity_ object (from the
ACLs) and PUBLIC’s and the app login’s effective rights with the matrix, and flags any grant option
a grantee but the owner holds (the matrix grants none); later units extend both:
| Object | craig_security_app |
PUBLIC |
|---|---|---|
|
none |
none |
|
EXECUTE, until the switch’s migration revokes it (ADR-085 U17) |
none |
|
none (owner only) |
none |
The boot step (services/craig-security/src/identity.rs, in run() after the verify-only boot,
before serving):
-
The boot check (
identity/app_probe.rs) reads the app pool’s session in one statement and refuses to boot, naming each unmet requirement and the remedy, unlesssession_userandcurrent_userarecraig_security_app; everyidentity_object it names exists (a missing one is a refusal, never "no privilege"); no role the login belongs to (itself and PUBLIC included) holds a privilege on either table or onidentity_key_cap_guard, anything beyond SELECT onidentity_signing_keysoridentity_key_revocations(#2741), EXECUTE onidentity_retire_legacy_issueroridentity_revoke_key, or a grant option on anyidentity_object; and the login owns, directly or through a membership (pg_database_ownerincluded), neither the database, thepublicschema nor anidentity_object. It names the objects with schema-qualified names and argument types, and every catalog function, type and operatorpg_catalog-qualified, so an object created in a schema the login searches cannot hide a privilege. A pass logs INFOidentity privilege check passed. -
The record. With EXECUTE on
identity_record_legacy_issuerheld, craig-security records itsOIDC_ISSUER(identity/legacy_issuer.rs) and logs INFOlegacy issuer recordedorlegacy issuer already recorded, naming the issuer. Without the grant it logs a WARN and records nothing; a failed call logs a WARN naming the error and its SQLSTATE. Neither stops the boot, so a prior release redeployed during the soak, after the switch revokes the grant, still boots (D7).
Signing-key registry (ADR-085 D2 / D8, #2741)
The internal token issuer (plan Internal Token Issuer U4) runs as craig-security’s issuer
process mode on its own login, craig_security_issuer, and publishes each replica’s in-memory
ES256 public keys here. Nothing trusts the keys until the switch (ADR-085 D15). The migration
(20261105120000_identity_signing_keys.sql) follows the rules above and fails when
craig_security_owner, craig_security_app or craig_security_issuer is absent.
-
Stamping and the cap.
identity_signing_keys_stamp(), an ownerSECURITY DEFINERBEFORE INSERT row trigger, stampscreated_atfromclock_timestamp()and derives the three windows (stagedcreated_at–sign_from, primarysign_from–sign_until− 5 s, retiring untilpublish_until). It then increments the guard row, so concurrent inserters queue, and counts the unrevoked rows whosepublish_untilis ahead: at 64 it refuses with54000(program_limit_exceeded). A revoked row frees its slot. The CHECKs repeat the arithmetic and the thumbprint, so they hold with the triggers bypassed. -
INSERT-only.
identity_registry_immutable(), a statement trigger, refuses every UPDATE, DELETE and TRUNCATE on both tables, the owner’s included, with23514. -
identity_revoke_key(p_kid text, p_operator text, p_reason text) → timestamptz, owner-only, inserts the key’s revocation (withrevoked_by = session_user), logs it (RAISE LOG) and returns its time. Refusals:22023a blank or over-long operator or reason,P0002an unknown kid,23505a key already revoked. A revoked key leaves the published set; its row stays. -
TEMPORARY. The migration revokes TEMPORARY on
craig_securityfrom PUBLIC (no craig-security code uses temporary tables) and TEMPORARY and CREATE from the issuer, and CREATE onpublic; a closing audit fails it when the issuer still holds either by any path, which happens when the migrator does not own the database (the REVOKE then only warns).
The matrix for the issuer and the app login on the identity objects (ADR-085 D2); PUBLIC holds nothing. No runtime login holds UPDATE, DELETE or TRUNCATE, or EXECUTE on a function created here:
| Object | craig_security_issuer |
craig_security_app |
|---|---|---|
|
SELECT; INSERT on |
SELECT |
|
SELECT |
SELECT |
|
none (the owner trigger takes it) |
none |
|
SELECT |
none |
|
SELECT |
as before |
|
none |
none |
identity_execute_matrix now holds the issuer login to this matrix as well (its effective rights,
memberships and PUBLIC included).
The issuer probe (services/craig-security/src/identity/issuer/probe.rs) runs at the issuer’s
boot, after the pool and before the schema check, and refuses to serve, naming each unmet
requirement, unless session_user and current_user are craig_security_issuer; neither it nor a
role it belongs to holds SUPERUSER, CREATEROLE, CREATEDB, REPLICATION or BYPASSRLS; every object it
names exists; it holds the matrix above (SELECT on each table, INSERT on each of the five columns)
and nothing beyond it, directly, through PUBLIC or through a membership; it executes no
identity_ function (found by catalog scan); it holds no grant option; it owns neither the
database, the public schema nor a checked object; and it holds neither TEMPORARY nor CREATE on
the database nor CREATE on public. A craig_security_app pool is refused by name.
Key rotation (identity/keys/): each replica holds its keys in memory only. Its first key after
boot requests 600 s and every later one 21600 s; the next is inserted 120 s before the current
sign_until; a key signs from its sign_from to 5 s before its sign_until, both mapped once onto
the monotonic clock from the database’s own times; a failed insert retries after 1 s, doubling to
30 s, and one whose outcome is unknown reads back its own kid first; when the database clock and
monotonic time diverge by more than 5 s (a suspend, a VM pause, a clock step), the replica drops its
keys and publishes a fresh one. A cap refusal is a WARN and counts in
identity_key_cap_refusals_total and the issuer’s /readyz.
Issuance stores (ADR-085 D2 / D11 / D13 / D16, #2743)
The token endpoint (plan Internal Token Issuer U6) adds three tables, migration
20261107120000_identity_issuance_stores.sql, which follows the rules above.
-
INSERT-only.
identity_issuance_stores_immutable()refuses UPDATE and TRUNCATE on all three tables, and DELETE onidentity_client_status, the owner’s included, with23514. On the partitioned log (#3173) it runs as a row-level BEFORE UPDATE trigger on the parent, which every partition inherits, and as a BEFORE TRUNCATE statement trigger on the parent and on each partition, since a statement trigger is not inherited. -
identity_issuance_log_stamp(), a BEFORE INSERT row trigger, stampsrow_digestover the row’s stored values, overwriting anything supplied. Since #3173 it no longer assignsrecorded_at, which comes from the column default (a BEFORE INSERT trigger may not move a row to another partition); an inserter that may namerecorded_at, the owner, gets a digest over the time it named. -
identity_purge_client_assertions(p_limit integer) → integer, ownerSECURITY DEFINER, deletes at mostp_limit(1–1000, else22023) jti rows whoseexpires_atis over 60 s past, oldest first,FOR UPDATE SKIP LOCKED, and returns the count. The issuer sweeps with it. -
The partition functions (#3173), the app login’s only way to make or drop a partition, over the owner-only
range_partition_*helpers thataudit_logshares (audit_log). Likeaudit_log’s, they are owned by the migrating role, `craig_security_ownerin a deployment, because they create tables inpublic:-
identity_issuance_log_ensure_partitions(from_day date, to_day date) → integer,SECURITY DEFINER: makes each missing day fromfrom_daythroughto_day, at most 400 a call (22023 beyond); idempotent; returns how many it made. A partition is created standalone with aCHECKequal to its bounds, then attached, so it never waits on an insert. Each new partition then has every privilege revoked from every grantee but the owner, read from its ACL (a name-free sweep, as eachidentity_migration makes), and from PUBLIC,craig_security_appandcraig_security_issuerby name: the owner’s default privileges would otherwise give the app login, or a role under any name, DML on it. It also gets the truncate guard. craig-security’spartition-maintenanceworker calls it for yesterday through 30 days ahead, at start and hourly. -
identity_issuance_log_partition_days() → SETOF date,SECURITY DEFINER: the day of each partition, oldest first. -
identity_issuance_log_drop_partition(day date, expected bigint) → bigint,SECURITY DEFINER: the retention archiver’s drop (ADR-058). Refuses a day that is not before the current UTC date (22023) and a day with no partition (42P01). Under a 2 slock_timeoutit locks the partitionSHARE(writers wait, readers do not), counts it, and drops it only when the count equalsexpected; it returns the count either way. The drop takesACCESS EXCLUSIVEon the parent, so the issuer’s inserts queue behind it for at most the lock timeout, after which it gives up until the next pass (55P03).
-
-
identity_prune_issuance_log(p_ids uuid[])was the archive engine’s row prune; the partitioning migration dropped it, and the count-checked partition drop replaces it.
| Object | craig_security_issuer |
craig_security_app |
|---|---|---|
|
INSERT on |
none |
|
SELECT |
SELECT |
|
INSERT on every column but |
SELECT |
|
none |
none |
|
EXECUTE |
none |
|
none |
EXECUTE |
The issuer probe requires exactly these grants beside U4’s and refuses any read of the two
append-only tables; the app probe refuses the app login anything on identity_jti or EXECUTE on
the purge; identity_execute_matrix lists them all.
Related
-
API: Security & Compliance — the endpoint catalog.
-
ADR-022 — the outbox/inbox/DLQ durability model
event_inbox+dead_letter_auditimplement. -
ADR-028 — the on-behalf-of identity the
actor_*audit columns capture. -
ADR-085 — the internal token issuer whose D7 adoption rule reads the legacy issuer record.