Architecture / Decision records / ADR-HIS-110
ADR-HIS-110 Reconciliation after an outage of the identity interfaces in ess-runtime-decision: the identity source's latest facts against the accounts, the identity provider's sign-in events against those recorded, exceptions queued and never corrected, and every page of the provider's events read¶
| Status | Accepted |
| Decided | 2026-11-30 by session RC-1-S28-F20 |
| Record | Drafted 2026-11-30; approved 2026-11-30 by the Enterprise Architecture Board |
| Where the rule lives | services/ess-runtime-decision/mod-ess-001: feed.SourceFacts, reconcile.Reconciliations, reconcile.IdentitySourceReconciliation, reconcile.AuthenticationReconciliation, auth.SignIns (poll, recover), ports.KeycloakIdentityProvider.signInEvents, IdentityJobs; migration V2__reconciliation.sql |
Context¶
The RC-1 gate (RC-1-S28) failed criterion 6 (ACC-005) for IF-ESS-001 and IF-ESS-002: each interface must show reconciliation, and neither did. D10-ESS 8.6 asks for two: - authentication: after a sign-on outage, "sessions re-established; authentication events reconciled"; - data consistency: "after any outage, reconciliation compares … identity-source state against account state. Exceptions are queued, not silently corrected." DQ-ESS-002 makes it a scheduled reconciliation against the HR and credentialing sources, KPI-ESS-005 counts orphaned access at reconciliation, REP-ESS-001 lists source reconciliation exceptions daily, and FR-ESS-IAM-001 part 10 reconciles manual entries made while the source was out.
MOD-ESS-001 had neither. It also had a defect that made the first impossible: it read Keycloak's sign-in events one page of 500 at a time, and Keycloak answers the newest first. After an outage with more sign-ins than one page, the unit read only the newest 500, moved its cursor past them, and lost the rest for good. And a failed read of the events ended the whole lifecycle run, so while the provider was out no block ended and no assignment expired.
The identity-source contract (identity.v1 submitIdentitySourceEvent) carries events, not a snapshot of the source. The weekly full file of EXT-ESS-001 reaches the unit as events too. identity.v1 has no operation to read a reconciliation, and this card owns no contract.
Decision¶
- The identity source's state is the latest fact each source has stated, per workforce identity and attribute (
source_fact): employment status, organizational unit and account type from the HR system, credential status from the credentialing record (through the feed, or as MasterDataChanged of a practitioner). A fact is kept whatever the event did to the account (applied, quarantined, waiting for approval), because it is what the source said. A leaver statesended. A fact with a later effective time replaces an earlier one, and an earlier one arriving late does not. The migration fills it from the events already received. - The identity-source reconciliation compares those facts with every account and queues each difference, changing nothing. The kinds are:
access-after-employment-ended: the source says employment has ended, and the account can still be used with no suspension scheduled;not-in-source: an account that can be used, for an identity no source has stated anything about;attribute-differs: one of the four attributes differs from the source's fact (a manual entry still waiting for reconciliation says so);no-account: the source says the person is employed and no account that is not deactivated exists.
An exception stays open while later runs still find it, and the first run that no longer finds it clears it. The run keeps its counts: accounts, source identities, accounts matching, manual entries agreeing, quarantined source events.
3. The authentication reconciliation compares the provider's sign-in events of a period with those the module recorded, by the provider's event identifier.
- An event the module missed is recovered. It is recorded, and audited as ess.iam.sign-in at its own time, with recoveredBy set to the run. It changes no account: a failure is not counted towards a block, and a success neither clears the count nor reopens the badge path, because the events after it have been applied already.
- A recovered failure of an account is queued as sign-in-failure-not-counted for the security officer. Whether a block should have followed is for a person, not for a late correction.
- A recovered interactive sign-on attempt with a service identity is audited as misuse with its alert, as when read in time, and queued as service-identity-sign-on-attempt.
- The run keeps the provider's count, the module's count, the number recovered, and the events the module holds that the provider no longer has.
Its exceptions are about events, so a later run does not clear them. The period ends five minutes before the sign-in poll's cursor, so the poll keeps every event it is about to apply.
4. The provider's events are read whole. The port's signInEvents(from, to) answers every event of the period, oldest first. The Keycloak adapter goes page by page from the newest until a page reaches back past the period or is not full. An event pushed onto the next page while the read goes on is kept once. A period with more than 100,000 events is refused, never cut short. The poll reads again from five minutes before its cursor, so an event the provider writes late, just before the newest one read, is still applied.
5. When they run. Each reconciliation runs when its interface returns after an outage, and daily (DQ-ESS-001, REP-ESS-001):
- authentication, when reading the provider's events succeeds again after it failed. The outage is recorded at the first failure, and the period runs from the earlier of the last reconciled time and the outage;
- identity source, when the feed delivers again after the heartbeat recorded it silent (26 hours).
The state (last run, reconciled up to, outage since) is kept in the database, so a restart loses nothing. One lifecycle job failing no longer stops the others.
6. Exceptions are queued in the module, and announced. A run that opens new exceptions raises an alert in the request queue: to the identity administrator and security officer for the identity source, and to the security officer for authentication. MOD-ESS-007 delivers it. The metrics are his.identity.reconciliation.open-exceptions{reconciliation} and his.identity.reconciliation.runs{reconciliation, trigger, outcome} (NFR-ESS-017). Reading the runs and exceptions, and resolving an exception, need identity.v1 operations for UI-ESS-002 and UI-ESS-009. That is a contract change for the ESS contract session (follow-up). Until then the record is in the module's tables, where the operations view reads it.
Consequences¶
- The gate's check of IF-ESS-001 and IF-ESS-002 reconciliation has tests to read:
IdentitySourceReconciliationTest,AuthenticationReconciliationTestandports.KeycloakSignInEventsTestin MOD-ESS-001. not-in-sourcelists every usable account no source has reported, including those that a facility's HR office enters on UI-ESS-002 where there is no HR feed (FR-ESS-IAM-001 part 16). Such a facility will see these exceptions until its entries reach the unit as identity-source events, or until the specification says how such a facility is reconciled.- Recovered sign-in failures are never counted, so a burst of failures the unit missed does not block an account late. The security officer sees each one in the queue.
- The identity provider's own account state (user enabled, sessions) is not reconciled here. The request queue keeps the provider in step after commit and retries (ADR-HIS-061 point 2).
- How long Keycloak keeps its events (the realm's event expiration) bounds what an authentication reconciliation can recover. A deployment keeps them longer than the longest outage it plans for, and at least the daily period.