Architecture / Decision records / ADR-HIS-101
ADR-HIS-101 Audit catalogue and intake markers: one 9.5 row may register several event types, the generator writes only the types not yet registered, and a refusal states with a marker of audit.v1 1.2 that it had no decision or no record¶
| Status | Accepted |
| Decided | 2026-11-29 by session RC-1-S28-F14 |
| Record | Drafted 2026-11-29; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | services/ess-audit/ (scripts/catalogue-migration.py; mod-ess-006: V6__event_catalogue_listed_codes.sql, V7__ise_backbone_registration.sql, V8__adm_person_view_change_registration.sql, SubmissionValidator); contracts/ess/schemas/AuditEventSubmission.v1.schema.json (audit.v1 1.2) |
Context¶
The first gate run of slice RC-1 (RC-1-S28) found the event backbone's ise.message.replayed and ise.dead-letter.closed in the audit service's quarantine as unregistered (fix RC-1-S28-F14). D02-ISE 9.5 publishes them, but in a row whose first cell lists three codes. The catalogue generator of ADR-HIS-050 read only rows with one code in that cell. As a result, 30 of the D02 types were never registered. No other domain lists several codes in one cell.
The generator wrote every type each time. A merged migration is never edited, so a later registration had to be cut out of its output by hand.
The same gate run quarantined refusals the intake could not store: record access and authorization events refused because the policy decision point did not answer (they carry no decision, which D10-ESS 9.5 requires), and a refused registration of a new person (it has no record, version or patient, which 9.5 requires of record change). The specification conflicts on both. The Security and Privacy Office with the Domain 10 owner ruled on cema-care/his#220 (and, with the Domain 1 owner, on #224): the fields stay required unless the event states, with an optional marker of a compatible minor version of audit.v1, that no decision was obtained or that the refused action had no record; an outage refusal carries outcome denied. How the markers are shaped and checked is decided here.
Options considered¶
- The generator reads a comma-separated list of codes in the first cell, and writes only the types that no migration of
mod-ess-006registers yet (chosen). Its output is the next migration as it stands, and a run with nothing new says so. - Ask D02 to write one row per code. It would change a specification to fit the code (session rule 3), and the generator would still skip such a row silently if one appeared again.
- Regenerate V2 with every type. A merged migration is never edited; Flyway would refuse the changed checksum.
For the markers:
- Two booleans that may only be
true, valid only with outcomedenied, each waiving a fixed set of fields (chosen). A marker that does not fit is an error, so the waiver cannot be reached by accident. - One field naming the waived fields (for example
waived: ["decisionId"]). It lets an emitter waive any field, which the rulings do not allow. - Booleans that are also accepted as
false, on any outcome. Afalsesays nothing an absent field does not, and a waiver on a success would let a permitted access through without its decision.
Decision¶
- One 9.5 row may list several event type codes, separated by commas in its first cell. Each is a type of the row's category. The generator registers each one, and stops on a first cell that mixes codes with other text instead of skipping it.
- The generator writes only the types that no migration registers yet (on conflict do nothing, as before), so its output is committed unchanged as the next migration.
- The backbone's replay, dead-letter closure and reconciliation closure types are registered not patient-scoped (GAP-ESS-016 point 2). Each acts on a backbone or integration item, which may concern many patients or none. A dead letter's payload is Sensitive and opaque to the backbone (D02-ISE 9.3).
- A test of the unit reads every 9.5 table of the specifications and fails while a published type is not registered, naming the generator as the remedy.
- audit.v1 1.2 adds
decisionUnavailableandrecordNotCreatedto the intake schema, eachconst: true; 1.1 is already taken by the forwarding of RC-3-S01. They are kept in the stored event, as evidence. - The intake waives, for an event with outcome
deniedonly: withdecisionUnavailable, the decision identifier and policy version (record access; authorization and emergency access); withrecordNotCreated, which is valid only on a refused creation (record change, actioncreate), the record reference with its version, the changed field names and the patient reference. No other category waives its patient or item: a refused Break-the-Glass, consent directive, disclosure or record view still names them. The rulings waive the version and changed fields of a record that does not exist; its reference is waived with them, because naming a record that was never created is the option the ruling on #224 rejected. A known patient or record is still sent. Every other field is checked as before. - A marker on any other outcome,
recordNotCreatedon any other category or action, ordecisionUnavailableon an event that carries a decision, makes the event malformed (quarantined with the reason). A decided Deny that leaves out its decision is still caught. - D01's
adm.person.viewandadm.person.changeare registered not patient-scoped (V8, GAP-ESS-016 point 2, ruling on #224 part 1): a refused read of a record that does not exist, a view with no patient in it, and a refused registration of a new person concern no patient. The emitter sends the patient whenever the record exists (point 4).
Consequences¶
- The 30 D02 types are registered (V6, generated); the three closure types are not patient-scoped, with the reason (V7). The catalogue holds 235 types.
- Record change still requires the resource version and changed fields. The backbone's replay and dead-letter events send no
resourceRef.version, so they stay quarantined until the backbone sends one (RC-1-S28-F15, on the same emitter). - A documentation change that adds a 9.5 type runs only the documentation checks. The next build of
services/ess-auditthen fails until the type is registered: the gap is found by the unit that must close it, with the command to run. - The audit service stores an outage refusal and a refused creation once the emitter sends the marker. Until each emitter does, its events stay quarantined: the service template and every unit's kit
AuditEmitter, adm-identity, the gateway plugin, ess-reference, ess-governance and the backbone (their own fix sessions), and adm-patient-administration (RC-1-S28-F18). - The template's unregistered code
access-check-unavailableis not registered: an outage refusal is audited under the event type of the action it refused, with the marker.