Architecture / Decision records / ADR-HIS-052
ADR-HIS-052 Governance services: the configuration lifecycle controller, content hash and references, resolution, and the provider contract test¶
| Status | Accepted |
| Decided | 2026-11-25 by session RC-1-S05 |
| Record | Drafted 2026-11-25; approved 2026-11-25 by the Enterprise Architecture Board |
| Where the rule lives | services/ess-governance/ (module mod-ess-012, its migrations, governance/ess-item-types.json, the contract test in mod-ess-012/src/test/java/care/cema/his/ess/mod012/contract/) |
Context¶
Session RC-1-S05 builds MOD-ESS-012 in the governance unit services/ess-governance. That covers the configuration lifecycle (FR-ESS-CFG-001), extension points and feature flags (FR-ESS-CFG-002), and the API catalogue with the decision register (FR-ESS-CFG-003). It serves configuration.v1 and api-catalogue.v1 of the ESS contracts (ADR-HIS-048).
Every domain puts its configuration under this lifecycle, so the choices below bind every later session that registers an item type, reads configuration, publishes a contract or records a decision. The specification leaves these points to the design:
- where configuration lives (DEC-ESS-016);
- what "production" and "promotion" mean for this one service;
- how content names the items it depends on (PR-CFG-001-3);
- how a package is identified;
- how resolution "as of" a past time works;
- how "5 working days" is counted;
- how a provider unit passes his-contract verify, whose cases use the contract's examples as they stand.
Decision¶
- One lifecycle controller.
- The governance service holds the lifecycle of every configuration version: draft to active, superseded, rolled back or retired.
- It records each promotion of an approved package to an environment.
- Its
his.governance.activation-environment(defaultproduction) names the environment whose live configuration it controls. A version is activated only after its approved package was promoted to that environment with the same content hash (BR-ESS-029). - With DEC-ESS-016 hybrid by item type, a domain may keep content locally (
contentStore: domain). The version still carries the content as its package. - Where a deployment is production itself,
his.governance.authoring-enabled=falserefuses drafts, so production is changed only by promotion or by the emergency path (PR-CFG-001-4). - Versions outside Draft are immutable. The service refuses the change, and a database trigger blocks any change to content or hash outside Draft.
- Package identity.
contentHashissha256:followed by the SHA-256 of the content's canonical JSON: object members sorted by name, no insignificant whitespace, values as JSON writes them. Any consumer can recompute it from an export (AC-06). - References between items.
- Content names another configuration item it depends on as
{"configurationRef": {"itemType": "<type>", "itemKey": "<key>"}}, anywhere in the content. - Validation reports a reference to an unregistered type.
- Promotion to an environment is refused, with one
errorsentry per missing item, unless a version of each referenced item (enterprise or the same facility) is approved, active or superseded and was promoted to that environment (PR-CFG-001-3). - Resolution.
- Each activation opens an in-force period for the version, and supersession, rollback or retirement closes it. A rollback opens a new period for the restored version, and nothing is deleted (BR-ESS-030).
resolveConfigurationanswers the version in force atasOf(default now) for the caller's facility. The order is department (theunit), then facility, then enterprise, limited to the levels the type permits.- Overlap (part 10) is refused against another version of the same item and scope that is active or approved with a scheduled activation. The version active now is not counted: it is superseded when the new one starts (BR-ESS-028).
- An activation with a future effective time is scheduled. The unit's scheduler activates it at that time, and each activation locks its row, so several replicas are safe.
- The emergency path and review tasks.
- Retrospective reviews of emergency changes (part 6.11), decision-record reviews (PR-CFG-003-3) and the approval route of a submitted version (part 6.5) are tasks of the task service (IF-ESS-010). Their task types are
ess.emergency-change-review,ess.decision-record-reviewandess.configuration-approval, assigned to a role. - Each task has an idempotency key derived from its subject, so a retry creates no second task.
- The unit subscribes to TaskStateChanged: a completed review task closes the emergency flag, or records the decision record's review.
- "5 working days" counts Monday to Friday in
his.governance.working-day-zone(default Asia/Jakarta), with no holiday calendar. - Authorization and MFA.
- Every operation asks the policy decision point first, before any facility-bound lookup, so a facility the caller is not permitted answers 403 before 404 (architecture 7.5).
- Action codes are
ess.cfg.<record>.<verb>. Resource types areess.ConfigurationItemType,ess.ConfigurationVersion,ess.ConfigurationRollbackRequest,ess.ConfigurationExport,ess.ExtensionPoint,ess.Extension,ess.FeatureFlag,ess.CatalogueEntry,ess.CompatibilityPolicyandess.DecisionRecord. - The request carries the item type's approval role, whether clinical authority is required, whether the content is clinical, the scope level and, on the emergency path, the second approver. The decision point decides who holds that authority, because roles are not in the token (DEC-ESS-008).
- The token's
acris sent assubjectAssurance, and the decision point requires MFA for these administrative functions (NFR-ESS-007). - On the emergency path the decision point also decides for the named second person in their own right (
ess.cfg.emergency.second-approve, withrequesterId). A step-up signature identifier signs one approval only, and the second approval cannot be dated in the future. IF-ESS-002 cannot yet prove the second person's step-up: that is question Q4 of the handover. - Separation of duties is checked in the unit, since it depends on the record: author against approver, requester against rollback approver and second person, registrant against extension approver, publisher against catalogue status change, author against decision record approver. A service identity never approves.
- A partner caller is marked by the Permit's obligation
partner-viewwith attributepartner. It then sees only entries offered to that partner and may not publish or change them (FR-ESS-CFG-003 part 13). - Validation hooks. The hook of Domain 10's own types (
ess.configuration/ validateConfigurationVersion) runs in the unit. No contract yet fixes how another domain's hook is called, so a type whose hook belongs to another domain fails validation with a finding that says so (fail closed) until one does. - Domain 10's own item types.
- At start the unit registers
ess.break-glass-permitted-roles(CFG-ESS-006),ess.break-glass-session-window(CFG-ESS-007),ess.break-glass-review-timeframe(CFG-ESS-008),ess.feature-flagandess.api-deprecation-notice(CFG-ESS-023). - Each gets a first enterprise version under item key
default, holding the value section 13 sets, in force from the date it was set (2026-11-17). - The seed only adds what is missing.
readCompatibilityPolicyreads the version ofess.api-deprecation-noticein force. - Catalogue and register rules.
- An entry the release pipeline publishes starts
active, because it reflects deployed contracts (part 6.5). One a person publishes startsproposed. - The notice period is 12 months when the entry is offered to partners or any consumer is external, otherwise 6 (CFG-ESS-023).
- A deprecation date in the past, or a planned retirement date inside the notice, is refused (PR-CFG-003-1). So are retirement before the retirement date, a retirement inside the notice, and a retirement with consumers not yet migrated (PR-CFG-003-2).
- An exception is accepted only if its
approvalRefnames an accepted decision record. - Decision record identifiers are
<prefix>-NNNper record type:ADR-HISfor architecture decisions andGDR-HISfor governance decisions (his.governance.architecture-prefix,governance-prefix). - Storage and commands.
- Each record keeps its API representation in a
jsonbcolumn beside its key and filter columns.revisionis the ETag. - A command runs its change, audit event, domain event and Idempotency-Key record in one transaction. A repeated key from the same caller answers the stored outcome.
- Absent fields are left out, never null.
- Each record keeps its API representation in a
- The provider contract test.
his-contract verifyruns in the Node.js imagenode:22.18-bookworm, pinned by digest, on the host network, against the unit started on a random port.- It runs one operation at a time. Before each, the test writes a fixture in which the records named by that operation's examples are in the state the operation needs (revision 3, matching the examples'
If-Match). - The test then checks the events published during the run with
his-contract validate-event. A later unit can copy this pattern; the host needs only Docker, as the pipeline's Java build already does.
- The unit's copy of the kit gains a Problem
errorslist and a status override onHisException:version-conflictanswers 409 whereapi-catalogue.v1names it for different content under an existing version. Missing required query parameters answervalidation-failed. This follows the template README: a unit's kit is its own code.
Consequences¶
- Owning domains register their item types with
registerConfigurationItemType. They read configuration withresolveConfigurationand follow ConfigurationChanged, and they name dependencies withconfigurationRef. - The release pipeline (D02) promotes by hash before an approver activates.
- The policy decision service (RC-1-S16, RC-1-S17) registers the resource types and actions above, the approval roles of each item type, the MFA rule on
subjectAssuranceand thepartner-viewobligation. - The task service (RC-1-S15) registers the three task types and the roles
enterprise-architecture-boardanddata-governance-council. - A hook contract for other domains' validation, a holiday calendar for working days, and a notification channel for deprecation notices (IF-ESS-009, RC-2) are follow-ups. Until then hooks fail closed, working days skip weekends only, and notices are recorded on the consumer and in audit.
- The seeded owner organizations are placeholders until the master-data register (RC-1-S07) holds the Domain 10 bodies.
Alternatives considered¶
- One governance instance per environment, with packages imported into the next. Rejected:
configuration.v1has no import operation, and promotion is recorded on the version the pipeline promotes. - A content hash over the stored bytes. Rejected: it depends on member order and whitespace, so an independent consumer could not recompute it.
- Dependencies declared on the item type. Rejected: a type cannot know which instances of other items a given version refers to. A reference inside the content can be checked per package.
- One verify run against one fixture for every operation. Impossible: the examples name the same version in Draft, In Review, Approved and Active.