Skip to content

Implementation plan / Session plan / Handover RC-1-S28-F11

Handover RC-1-S28-F11 Fix: The RC-1 scenario goes through the gateway, and IF-ISE-001 is shown end to end

Card: RC-1-S28-F11. Issue: cema-care/his#217. Branch: session/RC-1-S28-F11. Owner session: RC-1-S26. Decision record: ADR-HIS-095.

Comes after RC-1-S28 and RC-1-S28-F10. The issue's first comment holds the gate's evidence. It said the fix depends on F7 (#213, the gateway's routes), which is still open as #243. This fix does not wait for it: the run renders the gateway from the contracts of the checkout, so its routes are current whatever rendered/reference/ holds (see "Differences").

What was built and where

The gateway in the end-to-end stack (e2e/harness, ADR-HIS-095; harness README, "The gateway"): - A stack names a gateway with "gateway": {"environment": "<file>", "gateway": "internal"}. - Rendering. The runner (lib/runner.py: gateway_spec, gateway_environment, gateway_listeners, Stack.start_gateway) fills in the environment file for the run. It loads platform/gateways' model with that unit's own code and checks it as bin/gateways check checks any environment, so the test bed's overrides are refused. It then renders it to <run>/gateway/rendered/. - How it runs. It runs the gateway in the APISIX image the reference environment pins, read-only as the reference Deployment runs it. The gateway is on the host network and reaches the units, Keycloak and telemetry on loopback. The rendered fixed listeners (9080, 9443, 7085, 9091) are moved, in the run's copy only, to loopback ports of the run, and APISIX's control API is turned off. - Certificate. The server certificate is made for each run. Its key stays outside the run folder, and the runner's Node.js trusts the certificate (NODE_EXTRA_CA_CERTS). - What the run records. run-context.json records the gateway, and logs/gateway.log holds its JSON access log. - Scenario API. gateway("<domain>") (src/index.ts) is a client of a domain's APIs through the gateway. Its correlation identifiers are kept apart from unit()'s (CallLog channel gw), and its calls are attached as gateway-calls.json. Once the stack has a gateway, shell.gateway passes every screen call to it unchanged (via: "gateway"). Endpoints gains gateway, gatewayMetrics and gatewayCa.

The RC-1 stack (e2e/scenarios/RC-1): - stack.json names the internal gateway. - gateway/e2e.toml is the environment, with the specification's settings and clients.toml's registrations. Units outside the stack get a refusing address. - In the provisioning: - identities.json adds the gateway's service identity ise-gateways, which may ask for decisions; - provision.py puts ise-gateways in the audience of the staff sign-on client his-web (put_gateway_audience), because the gateway accepts only a token meant for it. - README.md: the gateway row, the provisioning and the cases.

The scenario (rc-1.scenario.ts): - RC-1-E2E-001: every call of the clerk (search, duplicate check, registration, reads, encounter and its repeat) goes through the gateway. A new step checks that the gateway answered each with its correlation identifier. The audit trail and the telemetry steps then find the units' records under those same identifiers. - RC-1-E2E-006: UI-ADM-001's calls go through the gateway, and the case checks that every one did. - RC-1-E2E-007: UI-ADM-002's work list goes through it too. - RC-1-E2E-009 (new): IF-ISE-001 at the gateway: - acknowledgement: the caller's correlation identifier is kept, and the gateway makes one when there is none (BR-ISE-004); - 401 for no token and for a token not meant for the gateway; - 400 for a malformed correlation identifier and for an unqualified identifier; - 404 for an unknown path and for an unknown version; - 403 for a purpose of use the client is not registered for, and for a facility the clerk holds no role at (the unit enforces again behind the gateway); - 429 with Retry-After for a burst above CFG-ISE-001, then served again; - 503 with Retry-After with adm-identity down, and with the decision service down; served again once each is back; - every error is the standard problem with the call's correlation identifier and no internal detail; - the refusal during the decision outage reaches the audit service; - the gateway's metrics count calls by route and refusals by class. - The other cases still call the units directly. They show that each unit enforces again at its own boundary, and RC-1-E2E-010 to 013 measure the units.

The test that fails before and passes after: e2e/harness/test/test_gateway.py, 7 tests. Against main's stack.json, the 4 tests of the RC-1 stack fail (1 failure, 3 errors): the stack names no gateway, so there is no environment to check, no route to render and no listener to move. With the fix, all pass: - the RC-1 environment checks with the specification's settings, the reference image, and no test-bed overrides; - the rendered registration and identity routes reach the stack's unit addresses; - the listeners move to loopback, and a rendering that changed them stops the run; - the reference forms, and their refusals.

The other evidence is the scenario itself: RC-1-E2E-001, 006 and 009 depend on the stack's gateway and cannot run without it.

ADR-HIS-095 and its row in the decision record index (95 records). The row follows the form build_adrs.py writes. I could not run the generator on a copy in this session: the command was not permitted.

Checks and their result

Check Command Result
The scenario, every case HIS_SESSION=RC-1-S28-F11 e2e/harness/scenario run e2e/scenarios/RC-1 --fresh --strict, full profile, on commit 623f6d4 Run 20261129T142809Z-aed6: 11 of 13 pass in 7.6 minutes. RC-1-E2E-001, 006 and 007 pass through the gateway, and so do 003, 004, 005, 008 and 010 to 013. RC-1-E2E-009 fails only on its soft check of the known audit gap #220 (below); every other step passes. RC-1-E2E-002 failed one call: adm-identity's decision took 308 ms, over the 250 ms budget (CFG-ISE-031), on a host at load 8.7, so the call was refused closed (503). That is the decision-latency shortfall the gate reported, and this change does not touch 002's path. "outcome failed; record complete"
RC-1-E2E-002 again The same with --grep "RC-1-E2E-002" Run 20261129T144128Z-f2f0: passed. "outcome passed; record complete"
What RC-1-E2E-009 recorded The run's attachments Burst of 80: 55 within the limit, 25 rate-limited, Retry-After 1 s. Metrics: apisix_his_gateway_rejected_total by route and class (unauthenticated 2, unauthorized 1, validation-failed 1, unavailable 1, rate-limited 25), with apisix_http_status per route. A correlation identifier made by the gateway: a version 4 UUID. RC-1-E2E-001: 4 calls, each answered with its own correlation identifier. RC-1-E2E-006: 9 screen calls, all via the gateway
Harness self-tests e2e/harness/scenario selftest 13 TypeScript tests pass, after the type check of src, test and ../scenarios. 22 Python tests pass, 7 of them new
Pipeline scans platform/delivery-pipeline/bin/secret-scan code origin/main HEAD, secret-scan docs …, static-analysis e2e/harness, static-analysis e2e/scenarios/RC-1 No secret, and no blocking finding. No dependency was added
Documentation links python3 docs/implementation_plan/tools/check_links.py 0 broken links, 0 duplicate anchors
Documentation site .venv/bin/mkdocs build Builds

The first run put the gateway on the session's bridge network, with published ports, and reached the units through Docker's host-gateway. The host's firewall (UFW, input policy DROP) drops traffic from Docker's bridges to the host, so the gateway's decision and audit calls timed out. It refused every call with 503 "Authorization service unavailable; the action was not saved.", as it must. The host network, as the units' sidecars use, is what the runner now uses (ADR-HIS-095 point 3).

What the gate line now shows

  • Criterion 1 (ACC-002), "the scenario passes … through the gateway": the clerk's registration and encounter, through the API (RC-1-E2E-001) and through UI-ADM-001 (RC-1-E2E-006), go through the internal gateway. The gateway authenticates the token, asks the D10 decision service and passes the call on, and the units' audit and telemetry carry the gateway's correlation identifier.
  • Criterion 6 (ACC-005), IF-ISE-001:
  • acknowledgement, error handling with each error class and outage behaviour (unit, decision service) are shown with the real units, decision service and audit service, at the specification's times (RC-1-E2E-009);
  • monitoring is the gateway's per-route metrics and access log;
  • "Audit event for every external access to patient data" has no case in RC-1, which has no external channel;
  • the gateway's own denial events are submitted, but the audit service quarantines those that have no decision, under #220 (below);
  • replay and reconciliation do not apply to a synchronous ingress. The alert rules are #219's.

Requirements and test scenarios of the card

The card has no requirement of its own; it repairs the gate line above.

Requirement or interface Covered by
IF-ISE-001 RC-1-E2E-001 (correlation identifier), RC-1-E2E-006 (screens through the gateway), RC-1-E2E-009 (every part above); test_gateway.py
FR-ISE-GWY-001 RC-1-E2E-001, RC-1-E2E-009; test_gateway.py. TEST-ISE-007 and TEST-ISE-039 stay with the gateway's test bed (revoked and suspended clients, retired versions, cached Permits, the 15-minute prompt), which RC-1-E2E-009 does not claim
FR-ESS-AUZ-001, IF-ESS-003 RC-1-E2E-009: no grant by default with the decision service down, and a decision again once it is back
IF-ESS-008 RC-1-E2E-009: the gateway's audit submission reaches the intake under the refusal's correlation identifier
BR-ISE-004 RC-1-E2E-009: the correlation identifier is kept, made, and refused when malformed

Differences from the card, specification or contract

  • Not waiting for F7 (#213, PR #243). The issue says this fix depends on F7. The run renders from the contracts of the checkout, so the stale rendered/reference/ that F7 repairs does not reach it. F7's change to model/apis.toml (5 service-only operations excluded, 8 audit actions) touches no call of the scenario. Once F7 merges, the run picks up its model unchanged.
  • The listeners of the run's copy are moved by the runner, which ties it to how platform/gateways renders them. Any change there stops the run with the listener it could not find (follow-up).
  • Upstreams are plain HTTP, as everywhere in the integration environment. The reference environment uses mTLS.
  • No specification, contract or other unit changed.

Questions for a person

None blocks this card.

Follow-ups outside the card

  • #220 (RC-1-S28-F14): the gateway's ise.gateway.denied for a refusal that had no decision is quarantined as schema-invalid ("decisionId and policyVersion are required for authorization and emergency access", D10-ESS 9.5). Examples are a purpose of use not permitted, and the decision service unavailable. It is the gap #220 names for refusals without a decision, with a second emitter, platform/gateways. RC-1-E2E-009 holds it as a soft check naming #220, so the case turns green when #220 is fixed.
  • platform/gateways: a setting for the listener ports in the environment model, so that a non-reference environment does not depend on the runner's gateway_listeners.
  • RC-1-E2E-010 to 013: measure NFR-ISE-001 with the gateway in the path. A burst at twice the peak through one session also meets CFG-ISE-001's interactive limit (20 a second per session), so the load needs one session per simulated clerk.
  • Decision latency on the shared host: RC-1-E2E-002 failed once on a 308 ms decision. The kits' decision cache (CFG-ESS-009) is the gate's follow-up already.
  • Design system: none.