Skip to content

Implementation plan / Session plan / Handover RC-1-S05

Handover RC-1-S05 Build: Governance services

Card: RC-1-S05. Issue: cema-care/his#19. Branch: session/RC-1-S05. Slice: RC-1. Decision record: ADR-HIS-052.

What was built and where

The unit services/ess-governance, made from the service template with new-unit.sh ess-governance MOD-ESS-011 MOD-ESS-012. mod-ess-011 is the template's empty module, for a later card. The unit's services/ess-governance/README.md lists its packages and settings.

MOD-ESS-012 in mod-ess-012 serves every operation of the two ESS contracts written by RC-1-S01: - configuration.v1 (IF-ESS-012): 29 operations; - api-catalogue.v1 (IF-ESS-014): 11 operations.

It covers:

  • Configuration lifecycle (FR-ESS-CFG-001, WF-ESS-006, BR-ESS-028 to 030):
  • item type registration;
  • versions from Draft through In Review, Approved and Active, then Superseded, Rolled Back or Retired;
  • validation against the type's JSON Schema 2020-12, with a check for secrets (SEC-009), configuration references and the owning domain's hook;
  • test evidence;
  • submission, routed to the type's approval authority as an IF-ESS-010 task;
  • approval or return, never by the author;
  • promotion by content hash, with the dependency check;
  • activation now or at a set time;
  • rollback request and decision;
  • retirement, comparison, resolution by scope and as-of time, and the export.
  • Emergency path (part 6.11):
  • only for clinical-content types;
  • the PDP decides the requester's clinical authority and the second person;
  • the second person is never the requester;
  • the version is active at once;
  • the review is due 5 working days later, as an IF-ESS-010 task, and is closed by TaskStateChanged.
  • ConfigurationChanged (EVT-ESS-011) on his.ess.configurationitem.v1 in the transaction of every activation and rollback.
  • Extension points, extensions and feature flags (FR-ESS-CFG-002):
  • an extension point names a contract in the catalogue and needs an active owner;
  • the lifecycle is Proposed, Approved, Deprecated, Retired, and approval is never by the registrant;
  • a plug-in extension is refused without sandboxing, compatibility and security-review evidence;
  • the feature-flag register reports flags past their removal date;
  • extensions without an active support owner are reported;
  • a flag change is audited with actor, scope, before and after.
  • Catalogue and decision register (FR-ESS-CFG-003, CFG-ESS-023):
  • publish, where an identical republish is a no-op and different content under an existing version is 409;
  • an unresolvable schema is refused;
  • search, with the partner view;
  • consumers, and migration tracking;
  • deprecation notifies each consumer;
  • the notice periods, retirement with consumers, and exceptions approved by an accepted decision record;
  • the compatibility policy read from CFG-ESS-023;
  • decision records of both record types: complete fields, decided by the approver and never the author, supersededBy, links, and review tasks at the review date.
  • Domain 10's own item types, registered at start with their first values from section 13 (contract point 12):
  • 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-flag;
  • ess.api-deprecation-notice (CFG-ESS-023).
  • Cross-cutting duties:
  • the policy decision before every action, and before any facility-bound lookup;
  • facility scoping of facility and department versions (architecture 7.5);
  • audit ess.cfg.item, ess.cfg.extension and ess.cfg.catalogue (D10-ESS 9.5) in the action's transaction;
  • Idempotency-Key replay, and ETag with If-Match;
  • correlation and telemetry from the kit.
  • Migration V1__configuration_lifecycle.sql. A trigger keeps content and hash immutable outside Draft.

Unit-wide changes beside the module: - json-schema-validator 3.0.9 (networknt, Apache-2.0, Jackson 3), added to gradle/libs.versions.toml and mod-ess-012; - constraints in buildSrc/.../his.java-module.gradle.kts to lz4-java 1.11.4 and snappy-java 1.1.10.9, for three high CVEs the dependency scan reports in what kafka-clients brings; - the unit's kit: HisException carries Problem errors and a status override, and ProblemAdvice answers a missing query parameter as validation-failed.

All lockfiles were rewritten with ./gradlew dependencies --write-locks.

ADR-HIS-052 and its row in the decision record index (52 records).

Checks and their result

The integration environment ran as HIS_SESSION=RC-1-S05 (his-rc-1-s05), light profile.

Check Command Result
Build and every test of the unit ./gradlew build in services/ess-governance passed: 110 tests (MOD-ESS-012 79, kit 27, app 3, MOD-ESS-011 1)
Provider contract test ./gradlew :mod-ess-012:test --tests '*ConfigurationContractTest' passed: all 40 operations pass his-contract verify contracts/ess, 137 cases, with the facility cases of every facility-owned operation. The 2 published ConfigurationChanged events pass his-contract validate-event
Dependency scan and SBOM platform/delivery-pipeline/bin/dependency-scan services/ess-governance 0 blocking (5 medium); the first run found 12 blocking, all three CVEs above, fixed by the constraints
Image scan platform/delivery-pipeline/bin/image-scan services/ess-governance 0 blocking (15 low, 38 medium)
Static analysis platform/delivery-pipeline/bin/static-analysis services/ess-governance no blocking finding
Secret scan, protected files platform/delivery-pipeline/bin/secret-scan code origin/main HEAD and docs; protected-files no secret; no exception file added
Documentation check_links.py; mkdocs build 0 broken links, 0 duplicate anchors; site builds, with no new warning

How the contract test works (ADR-HIS-052 point 11): - The unit starts on a random port. - his-contract verify runs in node:22.18-bookworm, pinned by digest, on the host network, one operation at a time. - Before each operation the test writes a fixture in which the records the operation's examples name are in the state it needs. - A later unit can copy the pattern.

Review round 1

The pipeline's Java build failed in the contract test. On a runner without the Node.js image cached, docker run -d printed its pull progress into the output that the test read as the container id. The test now pulls the image first (docker pull -q) and takes the id from the last line, refusing anything that is not an id. With the image removed from the host, the test passed again from a cold start: 40 operations, 137 cases.

Bringing the branch up to date

main took ADR-HIS-050 (the audit unit, session RC-1-S04), and later ADR-HIS-051 (the terminology module, session RC-1-S06), each after this branch had taken that number. This session's record is now ADR-HIS-052, with every reference changed: this handover, the unit README, and the code comments. The index has all three rows (52 records). Nothing else on main touches this unit, the ESS contracts or the template.

Review round 2

  • The emergency path's second person. The review found that secondApproval was taken from the body with only the "not the requester" check. These checks are added, with the test ConfigurationLifecycleTest.emergencySecondPerson:
  • the policy decides for the second person in their own right;
  • approvedAt is not in the future;
  • a signature identifier is used only once.

The rest of the gap is disclosed under "Done differently", as Q4 and as a follow-up. - The pull request description named ADR-HIS-050 (RC-1-S04's audit record). It now names this session's record (ADR-HIS-051 then, ADR-HIS-052 since the second update from main).

Requirements and test scenarios

Every test carries @Tag with its requirement and scenario, and its display name starts with them.

Requirement, criterion Test (in mod-ess-012/src/test/java/care/cema/his/ess/mod012/)
FR-ESS-CFG-001 AC-01 promotion recorded with approver, hash, time ConfigurationLifecycleTest.promotionRecorded
FR-ESS-CFG-001 AC-02 rollback restores prior behaviour, both histories intact ConfigurationLifecycleTest.rollbackRestoresPriorBehaviour
FR-ESS-CFG-001 AC-03 facility override resolves per facility ConfigurationLifecycleTest.facilityOverride
FR-ESS-CFG-001 AC-04 as-of resolution ConfigurationLifecycleTest.asOfResolution
FR-ESS-CFG-001 AC-05 hash mismatch refused ConfigurationLifecycleTest.hashMismatchRefused
FR-ESS-CFG-001 AC-06 export parses ConfigurationLifecycleTest.exportParses; schema of the answer in the contract test
FR-ESS-CFG-001 PR-CFG-001-1, -3, -4 activationSupersedes; missingDependencyRefused; activationNeedsPromotion and immutableOutsideDraft
FR-ESS-CFG-001 parts 6.3, 6.4, 6.7, 6.11, 10, 12 submitNeedsValidationAndEvidence; scheduledActivation; emergencyPath; authorDoesNotApprove, overlapRefused; lifecycleAudited; facilityScoping, idempotentDraft, essTypesSeeded
FR-ESS-CFG-002 AC-01 extension leaves unrelated core unchanged ExtensionPointsTest.extensionLeavesCoreUnchanged
FR-ESS-CFG-002 AC-02 feature flag change audited (PR-CFG-002-2) ExtensionPointsTest.featureFlagChangeAudited
FR-ESS-CFG-002 AC-03 plug-in without review refused (PR-CFG-002-1) ExtensionPointsTest.plugInWithoutReviewRefused
FR-ESS-CFG-002 parts 6.5, 10, 11, PR-CFG-002-3 registrationChecks; pointLifecycle; exceptionReports; flagOwnerActive
FR-ESS-CFG-003 AC-01 search shows schema, scopes, versions, lifecycle CatalogueAndDecisionsTest.search
FR-ESS-CFG-003 AC-02 consumers notified with the deprecation date CatalogueAndDecisionsTest.deprecationNotifies
FR-ESS-CFG-003 AC-03 ADR fields present; incomplete refused CatalogueAndDecisionsTest.recordCompleteness
FR-ESS-CFG-003 AC-04 retirement with active consumers refused (PR-CFG-003-2) CatalogueAndDecisionsTest.retirementWithConsumersRefused
FR-ESS-CFG-003 PR-CFG-003-1, -3; parts 6.2, 6.3, 6.7, 10, 11, 13 noticePeriod; reviewTask; compatibilityPolicy; migrationTracked; linksAndPartnerView; publishRules; recordLifecycle
IF-ESS-012, IF-ESS-014, EVT-ESS-011 (all three requirements) contract/ConfigurationContractTest

Scenarios: - TEST-ESS-030 is the class ConfigurationLifecycleTest. It covers promotion, rollback, scoped override, as-of resolution, hash mismatch and export. - TEST-ESS-031 is ExtensionPointsTest. It covers an extension with core regression, a feature-flag change and a plug-in without review. - TEST-ESS-037 is CatalogueAndDecisionsTest. It covers search, deprecation notice, retirement with consumers, ADR completeness and a retirement date inside the notice.

All pass.

Done differently from the specification or contract, and why

  • The scope levels of ess.break-glass-session-window. The contract's draft and emergency examples use facility scope. CFG-ESS-007 is "Enterprise / Department", and the seeded type follows CFG-ESS-007. The contract test uses a fixture type with every level, so the examples verify. Follow-up below.
  • Department scope. A department scope's unit is not checked as an active DE-ESS-010 entity (DE-ESS-018 addition): the master-data location API is not built (RC-1-S07). A follow-up.
  • The second person on the emergency path is not proven to have signed (FR-ESS-CFG-001 part 6.11, CUX-64). secondApproval comes in the request body, and IF-ESS-002 offers no way to verify a step-up by its identifier. The unit checks what it can:
  • the second person is a person, never the requester;
  • the policy decision point decides for the second person in their own right (ess.cfg.emergency.second-approve, through the kit's new PolicyEnforcer.requireFor);
  • approvedAt is not in the future;
  • a signature identifier signs one approval only.

What remains open: a requester who holds the authority can name a colleague who holds it too, without that colleague's step-up. Question Q4 is on the issue, with a follow-up for the contract. Ordinary approvals are not affected: there the approver is the authenticated caller. - Migration tracking. The contract has no operation to mark a consumer migrated. A consumer that registers on a newer version of the same contract is marked migrated on the deprecated older versions. That is how part 6.3 "tracks their migration" in version 1. - Deprecation notices are recorded, not sent. They are recorded on the consumer (notifiedAt), in audit and in a log, as contract point 10 says, until IF-ESS-009 (RC-2). - Other domains' validation hooks fail closed (ADR-HIS-052 point 7). No contract fixes how they are called. - The kit's audit wire format. The provisional format of the template is unchanged in this unit (RC-1-S01 follow-ups T1 to T7). Before and after values are in details as changedFields, before and after, ready for T3's beforeAfter.

Questions for a person

None blocks this session. Each takes the restrictive reading and is listed under "Needs a person" in the pull request.

# Question Owner What the unit does now
Q1 FR-ESS-CFG-001 part 6.11: do the "5 working days" of the retrospective review skip public holidays, and in which calendar? Owner of D10-ESS, clinical governance Monday to Friday in Asia/Jakarta, no holidays: the due date is never later than with holidays
Q2 PR-CFG-003-1 reads "deprecation date earlier than the policy's minimum notice", and part 6.2 measures the notice from the deprecation date to retirement. Is a deprecation date in the past refused as well? Enterprise Architecture Board Both are refused without an approved exception: a past deprecation date, and a retirement date before deprecation date plus notice
Q3 Who approves versions of the seeded item types? Security and Privacy Office, Enterprise Architecture Board security-officer for CFG-ESS-006 and 007, privacy-officer for CFG-ESS-008, change-approver for feature flags, enterprise-architect for CFG-ESS-023. A type's registration can be changed by registering it again
Q4 FR-ESS-CFG-001 part 6.11, CUX-64: is an emergency change acceptable with the second person decided by policy but not proven to have signed, until a step-up can be verified? Should signatureId become a signed step-up assertion, or should IF-ESS-002 offer a check? (comment on #19) Security and Privacy Office, clinical governance; owner of D10-ESS for the contract The checks above; the change stays flagged with its retrospective review due within 5 working days

Follow-ups outside the card

  • Service template (services/_template):
  • apply the same lz4-java and snappy-java constraints: the template's lockfiles have the vulnerable versions;
  • take up HisException errors and status override, and the missing query parameter, from this unit's kit;
  • add an outbound service credential (this unit has its own ServiceTokens).
  • RC-1-S15 (task service): register the task types ess.configuration-approval, ess.emergency-change-review and ess.decision-record-review, and the assignee roles of ADR-HIS-052 point 5.
  • RC-1-S16 and RC-1-S17 (policy): register the resource types and actions of ADR-HIS-052 point 6, the item types' approval roles and clinical authority, the MFA rule on subjectAssurance, and the partner-view obligation.
  • RC-1-S07 (master data):
  • the Domain 10 bodies as organizations; the seed's owner identifiers are placeholders;
  • the location API, for the active check of a department scope's unit.
  • ESS contract session (next minor version):
  • a facility-scope example consistent with CFG-ESS-007, or a facility level for it;
  • a consumer migration update operation;
  • a call contract for owning domains' validation hooks.
  • a verifiable second approval on the emergency path: a signed step-up assertion in secondApproval, or a step-up check in IF-ESS-002 (Q4).
  • RC-1-S26 (integrate): add ess-governance to e2e/scenarios/RC-1/stack.json, with his.governance.workflow-url and master-data-url set.
  • RC-2: deprecation notices through IF-ESS-009.