Implementation plan / Session plan / Handover RC-1-S20
Handover RC-1-S20 Build: Platform: deployment topology¶
Card: RC-1-S20. Issue: cema-care/his#34. Branch: session/RC-1-S20. Slice: RC-1. Decision record: ADR-HIS-068.
What was built and where¶
Everything is in platform/deployment-topology/, except the decision record, its row in the decision record index, and this handover. The unit's README.md has every command, setting, rule and file.
Scope as read. The card covers MOD-ISE-001 for three requirements: - FR-ISE-PLT-001: hosting under hospital control and isolated environments; - FR-ISE-PLT-002: the service catalogue, tiering and redundant Tier 1 deployment; - FR-ISE-PLT-004: time integrity, with its safety-critical function "Time synchronization".
It also carries the contract point RC-1-S02 left in contracts/ise/README.md:
- serve the environment inventory and drift report;
- publish EnvironmentDriftDetected for each drift found;
- feed the Tier 1 redundancy finding (PR-PLT-002-1) into readDependencyGraph.
The gateways' route model already sends service-catalogue.v1 here, except the state board. FR-ISE-PLT-003 (scaling, quotas, capacity) is not on this card.
What was built:
- The service
ise-deployment-topology, made from the service template into this folder. It has one modulemod-ise-001, schemamod_ise_001, migrationV1__topology.sql, and topichis.ise.environment.v1. It subscribes tohis.ise.service.v1asservice-states. - Service catalogue. It serves
listServices,registerService,readService,updateService,admitService,readDependencyGraphandreadAvailabilityReport.- Registration validates DE-ISE-001 and the tier targets of CFG-ISE-017 and CFG-ISE-018.
- Admission refuses an incomplete entry with one entry per gap.
- Tier approval, retirement and history are the unit's own API.
- Every revision is kept and audited with its values before and after.
- The graph. Its findings are PR-PLT-002-2, PR-PLT-001-3 and PR-PLT-002-1. The last is judged on the placements that drift checks observe in production.
- Availability. It is computed per service and tier from
ServiceStateChanged, without approved maintenance windows. The windows are recorded with their change record. - Environment inventory. It serves
listEnvironments,readEnvironmentandreadDriftReport. A definition is recorded only by a service identity, from the reviewed definition, and checked again with section 10's rules. Shared credentials and network ranges are flagged inGET /v1/topology/isolation. - Drift. Each new difference of a drift check is an Open finding, published as
EnvironmentDriftDetected, audited and alerted. A finding that is gone becomes Reverted, or Adopted when the definition changed. - Data-load guard. Unmasked patient data outside Production and DR is refused, recorded, logged and audited, unless the definition carries an approved, unexpired exception. Training never takes it.
- Clock guard. It reads every node's offset from Prometheus (node exporter timex) and judges it against CFG-ISE-020. Beyond 1 s it taints the node
his.cema.care/clock-skew:NoExecute, so that Tier 1 pods leave it and its routing, until the node is back within 100 ms. Every removal and restoration is audited. - The unit's own API is
api/topology.v1.openapi.yaml(10 operations); a test keeps it and the controllers in step. - The unit's copy of the kit has
PolicyCheck.withAttributesand theerrorsextension ofHisException, asplatform/delivery-pipelinehas.buildSrchas the same lz4 and snappy constraint. - The environment model
environments/: sites.toml: two sites, their availability zones and their two time servers each;prod,dr,preprod,devintandtraining, each with its own credential scopes and private ranges.bin/topology(lib/topology/, Python standard library):check: the rules of section 10, BR-ISE-013 and FR-ISE-PLT-004 section 7;render: intorendered/<env>/, committed: the inventory record, namespaces with zone labels and the ConfigMaphis-environment(training banner,TZ=UTC), the node clock exporter, this unit's workload with a node-only ClusterRole, the RKE2 settings with Cilium, and chrony with NTS;record, with the definition version from git;drift: Kubernetes objects and OpenTofu plans, with placements;gate: the Tier 1 deployment gate;load-data: runs a load only when the guard authorizes it.- Time on the nodes:
ansible/time.ymlwith the rolechrony, andobservability/clock-drift.rules.yaml(six Prometheus alert rules) with its promtool test. - Checks:
./gradlew buildalso runstopologyChecks: the model check, the rendering check, the Python tests and promtool;scripts/ends-when.shis this card's check;scripts/lib/isolated.pyandisolated_workflow.pyare its isolated run, andscripts/lib/failure_domain.pyits failure-domain exercise.
Dependencies: none added beyond the template's. The lockfiles were written with ./gradlew dependencies --write-locks and are the same as platform/delivery-pipeline's. Three images are pinned by digest:
- prom/prometheus:v3.7.3: promtool in tests;
- quay.io/prometheus/node-exporter:v1.10.2: the rendered clock exporter;
- python:3.12-slim: the isolated run, the same as platform/gateways' test bed.
Their register entries are under "Follow-ups".
Checks and their result¶
The integration environment ran as HIS_SESSION=RC-1-S20 (his-rc-1-s20), light and full profiles, and was reset at the end.
| Check | Command | Result |
|---|---|---|
| Unit build and every test | ./gradlew build in platform/deployment-topology |
Passed. 81 JUnit tests: the module's 51 (catalogue 13, environments 10, graph and availability 5, clock guard 6, clock adapters 4, own API 1, module 1, contract 11), the kit's 27 and the unit's 3; 1 skipped (the kit's Kafka adapter test, full profile only, as in the template). Then topologyChecks: 37 Python tests and promtool |
| Provider contract test | contract/ServiceCatalogueContractTest, part of the build |
his-contract verify contracts/ise on the 10 operations served: 23 cases, none failed. validate-event on the published EnvironmentDriftDetected: passed |
| Environment model | bin/topology check; bin/topology render --all --check |
5 environments, 2 sites, no problem; rendering current |
| Clock drift rules | promtool test rules test/clock-drift.rules.test.yaml (in the build) |
SUCCESS |
| IaC policy checks | platform/delivery-pipeline/bin/iac-policy platform/deployment-topology |
0 blocking; 55 medium (a ConfigMap heuristic on his-environment, and the trusted-registry check on the placeholder image names) |
| Static analysis | platform/delivery-pipeline/bin/static-analysis platform/deployment-topology |
No blocking finding; no clinical artifact |
| Dependency scan, register gate | platform/delivery-pipeline/bin/dependency-scan platform/deployment-topology |
0 blocking (4 medium); gate --coverage passed over 527 components |
| Image scan | platform/delivery-pipeline/bin/image-scan platform/deployment-topology |
0 blocking (116 medium, 15 low) |
| Secret scan | platform/delivery-pipeline/bin/secret-scan code origin/main HEAD |
No secret found |
| Ends when | HIS_SESSION=RC-1-S20 platform/deployment-topology/scripts/ends-when.sh |
Passed, all five steps (below) |
| Links, documentation site | check_links.py; mkdocs build |
0 broken links, 0 duplicate anchors; the site builds with no new warning (the four warnings are earlier records' links to code folders) |
Requirements and test scenarios¶
Every test names its requirement, and its test scenario where one exists: JUnit @Tag and display name, or the Python test name and docstring. Java tests are in platform/deployment-topology/mod-ise-001/src/test/java/care/cema/his/ise/mod001/, Python tests in platform/deployment-topology/test/.
| Requirement, criterion or scenario | Covered by |
|---|---|
| FR-ISE-PLT-001 behaviour 1, section 11: environments defined declaratively, created and changed only from versioned definitions | test_model.Committed; test_render_gate_drift.Rendering...committed_rendering; EnvironmentTest.inventory, onlyThroughReviewedDefinitions (a person is refused, a definition without its reviewed change is refused) |
| FR-ISE-PLT-001 behaviours 2 to 6, section 10 (DR independent, training banner, data classification) | test_model.Refused (DR on production's site, training without banner, real data in development, exception approved and expired, training with real data); EnvironmentTest.drIndependent, trainingBanner, phiClassification; Rendering...training_environment_shows_its_banner |
| FR-ISE-PLT-001 behaviour 7, AC-03 (nothing shared between environments) | test_model...no_credential_or_network_path_is_shared, ...credential_reused..., ...network_path_shared...; EnvironmentTest.isolation; Rendering...own_networks_and_issuer |
| FR-ISE-PLT-001 AC-04, PR-PLT-001-2 (unmasked PHI load refused and logged) | EnvironmentTest.phiLoadRefused, loadsAuthorized; test_rules_cli.LoadData (the load command does not run when refused) |
| FR-ISE-PLT-001 PR-PLT-001-1, EVT-ISE-012 (drift detected, alerted, reverted or adopted) | EnvironmentTest.driftDetectedAndReverted, driftAdopted; test_render_gate_drift.Drift (Kubernetes fields, missing and unexpected objects, OpenTofu plan); contract test validate-event |
| FR-ISE-PLT-001 behaviour 8, PR-PLT-001-3 (external runtime dependencies of Tier 1) | GraphAndAvailabilityTest.externalDependencyInventory; CatalogueTest.internetDependencyNeedsException, incompleteAdmissionRefused |
| FR-ISE-PLT-001 AC-01, AC-02 | ends-when.sh step 3, for this unit: the image on a Docker network with no route out, with only open-source backing services. Nothing reaches an outside address or resolves an outside name, and the inventory, catalogue, drift and data-load workflows run to completion. See "Differences" for the system-wide run |
| FR-ISE-PLT-001 AC-05, behaviour 9 (rebuild and restore without vendor-only access; portable definitions) | The definitions and renderings are in the organization's repository, use only RKE2, Cilium, chrony and the node exporter, and are rebuilt from it with bin/topology. The release is reproducible from its tag (RC-1-S19). The DR restore exercise is FR-ISE-BCR-002's (see "Differences") |
| TEST-ISE-001: core workflows with no commercial licences, internet or external control planes | ends-when.sh step 3 (this unit's part); the dependency scan's register gate passed over every component (no unregistered, so no unapproved commercial, component) |
| TEST-ISE-002: unmasked PHI load into development; credentials and network paths across environments | EnvironmentTest.phiLoadRefused, isolation; test_model.Committed; ends-when.sh step 3 (the load refused through bin/topology load-data; nothing shared among the five recorded definitions) |
| FR-ISE-PLT-002 behaviour 1, section 7, section 10 (attributes, unknown dependency, SLO below tier minimum) | CatalogueTest.registers, unknownDependency, weakerObjectives, missingAttributes |
| FR-ISE-PLT-002 behaviour 2, AC-03, BR-ISE-017, PR-OBS-001-1 | CatalogueTest.incompleteAdmissionRefused, admittedStaysComplete |
| TEST-ISE-004: production admission of an incomplete entry | CatalogueTest.incompleteAdmissionRefused; ends-when.sh step 3 |
| FR-ISE-PLT-002 AC-01, section 3 (approved tier and dependency graph) | CatalogueTest.approvedAndAdmitted, policy; GraphAndAvailabilityTest.lowerTierDependency |
| FR-ISE-PLT-002 behaviour 3, PR-PLT-002-2 | GraphAndAvailabilityTest.lowerTierDependency |
| FR-ISE-PLT-002 behaviour 4, PR-PLT-002-1, AC-02 | GraphAndAvailabilityTest.tierOneRedundancy; test_render_gate_drift.DeploymentGate; test_model...production_needs_two_availability_zones; Drift...placements |
| TEST-ISE-003: one failure domain removed under a Tier 1 service | ends-when.sh step 4 (scripts/lib/failure_domain.py): on a k3s cluster in Docker, one node per room of site-a, a Tier 1 stand-in that passes the gate (three replicas) is called every 200 ms while room 1's node is killed. The service continued (96.8% of requests answered while the lost instance was still in routing, all answered in the last 30 seconds); RTO 90.0 s against Tier 1's 1 hour (CFG-ISE-017); RPO 0, the stand-in being stateless. GraphAndAvailabilityTest.tierOneRedundancy covers the PR-PLT-002-1 finding. The RPO of stateful Tier 1 data is under "Needs a person" |
| FR-ISE-PLT-002 behaviour 6, PR-PLT-002-3, AC-04 | GraphAndAvailabilityTest.availabilityReport, maintenanceWindow |
| FR-ISE-PLT-002 sections 11 and 12 (lifecycle, versioning, audit) | CatalogueTest.tierChangeNeedsReapproval, retirement, idempotent |
| FR-ISE-PLT-004 behaviour 1, section 7 (two internal sources) | test_model...every_site_has_two_internal_time_sources, ...one_time_source_or_an_internet_one_is_refused; Rendering...nodes_follow_the_sites_two_time_servers_with_nts |
| FR-ISE-PLT-004 behaviour 2 (each node reports its offset) | ClockAdaptersTest.prometheus; Rendering...clock_exporter_runs_on_removed_nodes_too; ClockGuardTest.report |
| FR-ISE-PLT-004 behaviour 3, AC-02, section 10 | ClockGuardTest.thresholds, unsynchronized, failures; test_rules_cli.ClockDriftRules (promtool) |
| FR-ISE-PLT-004 PR-PLT-004-1 | ClockGuardTest.inducedDrift, oneReplicaAtATime; ClockAdaptersTest.kubernetes, conflictRetried, foreignExclusionKept; DeploymentGate...tolerating_the_clock_taint_fails |
| TEST-ISE-006: drift induced beyond the threshold on a node | ClockGuardTest.inducedDrift (alert raised, node removed from Tier 1 routing, restored when corrected); test_rules_cli.ClockDriftRules (the alerts fire on induced drift) |
| FR-ISE-PLT-004 AC-01 (every production node within threshold) | ClockGuardTest.report and the NodeClockDrift* rules give the inspection. The production nodes do not exist yet |
| FR-ISE-PLT-004 behaviour 4, AC-03 (UTC) | Every record of this unit is a UTC instant with Z (the contract test checks the Instant pattern); Rendering...workloads_run_in_utc; the image's TZ=UTC -Duser.timezone=UTC; the role sets nodes to UTC |
Contract service-catalogue.v1 |
contract/ServiceCatalogueContractTest |
Safety-critical function: time synchronization (D02-ISE 11.1). The control this card implements is three parts: - synchronized clocks: two internal sources with NTS on every node; - drift alerts: the guard and the Prometheus rules; - UTC storage.
Its verification is the "drift injection test" of 11.1. It passes: drift induced on a node through the source the guard reads raises the alert and removes the node from Tier 1 service, and the node returns once corrected (ClockGuardTest.inducedDrift); promtool fires the alerts on induced drift. Drift on a real node needs the clusters (follow-up).
The hazard log is the clinical safety register (architecture section 13). This card builds the specified control and changes no existing one, so it makes no hazard log entry.
Non-functional targets:
- NFR-ISE-005, security:
- definitions only from a service identity and reviewed source;
- fail closed on the decision point;
- the guard's account may patch nodes only;
- refusals audited;
- Pod Security restricted namespaces, and non-root, read-only workloads.
- NFR-ISE-009, interoperability: the provider contract test; validate-event; Kubernetes, OpenTofu plan and Prometheus formats as they are.
- NFR-ISE-012, observability: the template's correlation and telemetry; the metrics his_environment_drift_open, his_environment_isolation_findings, his_catalogue_graph_findings, his_node_clock_offset_seconds, his_node_clock_removed and the guard's counters; ALERT log lines.
- NFR-ISE-016, time integrity: FR-ISE-PLT-004 above.
- NFR-ISE-018, localization: the unit has no screen. Its times are UTC; the facility time zone is the D10 facility register's timeZone.
Differences from the card or specification¶
- The unit's own API.
service-catalogue.v1has no operation for tier approval, retirement, history, maintenance windows, recording a definition or a drift check, the isolation evidence, the data-load guard or the clock offsets. They areapi/topology.v1.openapi.yaml, under/v1/topology/, until an ISE contract session takes them in. No contract file changed (session rule 4). - "Incomplete" at admission. The contract's
ServiceDefinitionrequires owner, runbook and the other core attributes, so registration already refuses an entry without them, naming each. Admission refuses what the schema cannot see: tier approval, Tier 1 alert rules and external-dependency flags, approvals of internet dependencies, unresolved dependencies and references (ADR-HIS-068 point 3). - Resolving references. DE-ISE-001 says runbook, recovery procedure, dashboards and alert rules "resolve". With
his.topology.references.resolveon, admission fetches each; it is off by default, because the integration environment has no runbook server. Production turns it on. - Availability counts Degraded as available. A degraded service still serves; only Unavailable is down. Maintenance windows are this unit's record until MOD-ISE-009's downtime window (DE-ISE-021) exists.
- TEST-ISE-001 at system level. "Core and Tier 1 workflows run locally" with every unit needs the whole HIS deployed. This session runs this unit's part: its image with no route out (step 3). The system-wide run is on no card yet; it is under "Needs a person".
- TEST-ISE-003 on k3s, with a stateless stand-in. The exercise runs on k3s, a conformant Kubernetes from the same maker as RKE2, because no RKE2 cluster exists yet; the scheduling, spread, endpoint and node-lifecycle behaviour it relies on is Kubernetes', not the distribution's. The stand-in has no data, so RPO is 0 by construction. The RPO of a stateful Tier 1 service rests on PostgreSQL's streaming replication, which FR-ISE-BCR-002's exercise measures; it is under "Needs a person". The RTO was 90.0 s in the recorded run, and between 44 s and 106 s in earlier ones: it is mostly the node controller's grace before it marks a lost node NotReady (40 s by default), which the Tier 1 objective leaves far room for.
- AC-05 (DR exercise without vendor-only access). The build and deploy part is the reproducible release (RC-1-S19) and the definitions in this repository. The restore part is FR-ISE-BCR-001 and FR-ISE-BCR-002 (MOD-ISE-009).
- Behaviour 5 of FR-ISE-PLT-004 (facility time zone). The D10 facility register already holds each facility's
timeZone(contracts/ess, master data), and the sharedZonedInstanttype carries it. This unit adds none of its own. - Behaviour 6 of FR-ISE-PLT-004 (offline clients record device time and offset). That is the offline edge client's (FR-ISE-EVT-004, MOD-ISE-004 and the portal), not this unit's.
- The interface rule of section 10 ("timestamp without zone or offset quarantined") belongs to the integration engine (MOD-ISE-003).
- Audit type. Every action is
ise.config.changed(D02-ISE 9.5, platform configuration), with the action naming it. A data-load refusal is not strictly configuration; 9.5 has no closer type (follow-up for the audit catalogue). - No OpenTofu code. The private-cloud product under RKE2 is not selected, so there is nothing to write a provider against.
driftalready reads OpenTofu plans (ADR-HIS-068, alternatives). - Real sites, rooms, addresses and time servers are synthetic placeholders until the hospital names them.
Review round 1¶
- TEST-ISE-003 was not run. It now is:
ends-when.shstep 4 removes one failure domain under a Tier 1 service on a multi-node cluster and measures continuity and RTO (above). TEST-ISE-001 at system level and the stateful RPO are now under "Needs a person", not described as done elsewhere. - Node patches could drop a taint written in between.
KubernetesNodeRoutingnow sends theresourceVersionit read with every patch, so the API server answers 409 if the node changed, and it reads and patches again, up to five times.ClockAdaptersTest.conflictRetried: an unreachable taint added between read and patch is kept, on removal and restoration. - Every replica ran the guard's cycle. A cycle now runs in one transaction holding a PostgreSQL advisory lock (
pg_try_advisory_xact_lock); a replica that does not get it skips the cycle. So one replica judges, removes, restores and audits at a time, and the state innode_clockis read and written under the lock.ClockGuardTest.oneReplicaAtATime. - Restoring cleared a load-balancer exclusion it had not set. Removal now adds
node.kubernetes.io/exclude-from-external-load-balancersonly when absent, and marks that it did with the annotationhis.cema.care/clock-set-exclude-label; restoration removes the label only with that mark.ClockAdaptersTest.foreignExclusionKept. - The k3s image is pinned by digest (
rancher/k3s:v1.33.5-k3s1), for the exercise only; its register entry is under "Follow-ups".
Questions for a person¶
None blocks this session. Under "Needs a person" in the pull request:
- ADR-HIS-068, for the Enterprise Architecture Board.
- TEST-ISE-001 for the whole system (owner of the session plan): this session ran it for this unit only. Which card runs the core and Tier 1 workflows of every unit with internet and external control planes disconnected? RC-1-S26 (integrate) or the slice gate are the natural places, but neither card says so.
- The RPO half of TEST-ISE-003 for stateful Tier 1 services (owner of the session plan, with the backup and recovery owner): losing a failure domain under a Tier 1 service with data, and measuring RPO against CFG-ISE-017's 5 minutes, needs PostgreSQL replication across zones. That is FR-ISE-BCR-002's (MOD-ISE-009) exercise; confirm it is assigned there.
Follow-ups outside the card¶
- ISE contract session: take
api/topology.v1.openapi.yamlintocontracts/isecompatibly. - Event backbone (
platform/event-backbone): addise-deployment-topology.service-statesto the authorized consumers ofhis.ise.service.v1in its topic register. The producer ofhis.ise.environment.v1is alreadyise-deployment-topology. - Observability (
platform/observability): - load
observability/clock-drift.rules.yamlinto its rule set; - scrape the node clock exporter (
his-ise/node-clock-exporter, port 9100) with the node's name as the labelnode; - expose its Prometheus to this unit at
his.topology.clock.prometheus-url; - alert on the
ALERT environment drift,ALERT environment isolation,ALERT data load refusedandALERT clock driftlog lines. - Gateways (
platform/gateways): route/v1/topology/todeployment-topology. - D10 decision service (ess-runtime-decision): register the resource types
ise.Service,ise.Environment,ise.MaintenanceWindowandise.Node, with the actions in this unit's README. Approval of a tier belongs to the clinical governance committee with the CIO; the Domain 2 roles are RC-1-S17's question Q3. - D10 audit catalogue: the actions this unit records under
ise.config.changed. A data-load refusal may deserve a type of its own. - Supply-chain register (
platform/supply-chain): propose entries for the node exporter, Prometheus and k3s images (the Python image is platform/gateways' already). - Network protection (
platform/network-protection): - an environment file of its form for each environment here (
rendered/<env>/inventory.jsonhas the ranges); - flows from every zone to the site time servers (NTP and NTS-KE, UDP 123 and TCP 4460), and none from elsewhere (FR-ISE-PLT-004 section 13).
- Every Tier 1 unit's manifests: label pods
his.cema.care/tier: "1"andhis.cema.care/service: <unit>, and passbin/topology gatebefore Argo CD applies them. Lower tiers toleratehis.cema.care/clock-skew. - Web shell (FN-S06's successors): show the training banner when
HIS_TRAINING_BANNERis true. - Earlier follow-ups addressed to RC-1-S20 that are outside this card stay open for a later card on this unit or for slice integration:
- RC-1-S10: manifests for observability and the Grafana sign-in;
- RC-1-S11: Cilium settings applied, zone-edge firewalls, Ansible on the edges;
- RC-1-S14: the OpenBao deployment and bootstrap;
- RC-1-S19: Argo CD verifying signatures, the admission policy, the release signing key.
This card does give them the namespaces with zone labels, Cilium as the CNI in RKE2, and the per-environment credential scopes they need.
- Real hardware: the drift injection on a real node, bin/topology drift on a schedule in each cluster, and a DR exercise per tier (FR-ISE-BCR-002).
Final check results¶
HIS_SESSION=RC-1-S20 platform/deployment-topology/scripts/ends-when.sh, on 2026-11-26, after review round 1:
- The unit's build on the light profile: every test, the contract test, the model, rendering and Python tests, and promtool.
- The image
his/deployment-topology:ends-whenbuilt; the deployment gate passes on the unit's rendered workloads. - On the full profile, the image on an internal Docker network with PostgreSQL, Kafka, Keycloak and a stub decision point only:
- no outside address or name was reachable;
- five definitions were recorded through
bin/topology record, with nothing shared; - an entry without an approved tier was refused, and two Tier 1 entries were approved and admitted;
- the graph answered;
- drift was recorded through
bin/topology driftand shown Open; - an unmasked load into
devintwas refused throughbin/topology load-data; - the clock offsets answered.
- TEST-ISE-003: on a k3s cluster of one control-plane node and three agents in site-a's three rooms, the Tier 1 stand-in passed the gate and ran in all three rooms. Room 1's node was killed: 96.8% of the requests over the next 240 seconds answered, all answered in the last 30 seconds; RTO 90.0 s against 1 hour; placements afterwards in rooms 2 and 3.
- Only
platform/deployment-topology/, this handover, ADR-HIS-068 and the decision record index changed.