Skip to content

Architecture / Decision records / ADR-HIS-108

ADR-HIS-108 The contract catalogue: a service in the gateways unit, a compatibility check by main's contract tool on commits merged to main, consumers active by registration, and the partner view decided per contract by D10

Status Accepted
Decided 2026-11-30 by session RC-3-S13
Record Drafted 2026-11-30; approved 2026-11-30 by the Enterprise Architecture Board
Where the rule lives platform/gateways/ (catalogue/mod-ise-002/, V1__catalogue.sql; catalogue/checker/check.ts; Dockerfile; ci.sh; model/apis.toml; README.md)

Context

RC-3-S13 builds FR-ISE-GWY-002, the API and event contract catalogue and its compatibility and deprecation policy. It extends the gateways that RC-1-S12 built (ADR-HIS-062).

The contracts of RC-3-S03 (ADR-HIS-085) fix what the unit offers: - contracts/ise contract-catalogue.v1, 10 operations; - the event ContractLifecycleChanged (EVT-ISE-015) on his.ise.contract.v1.

The contract point of contracts/ise/README.md (row RC-3-S13) asks the unit to: - serve the catalogue from the contract folders; - take the compatibility result from his-contract check, and refuse a breaking change under a compatible version; - enforce the deprecation window of CFG-ISE-002; - refuse retirement while consumers are active, unless approved; - serve the capability statement from the facade's /fhir/r4/metadata.

Three facts shape the design: - The gateways keep no state. They run the upstream APISIX image with rendered configuration, and part 13 of FR-ISE-GWY-001 places them in the edge zone with no database. The catalogue needs state: versions, history, consumers and queued notices. - The compatibility check that the contract point names is TypeScript (contracts/common, FN-S04), while the platform's services are Java units made from the service template. - No contract folder holds a contract's owner, purpose, scopes, data classification or support contact (handover RC-3-S12, ADR-HIS-103 point 11).

Decision

  1. The catalogue is a service of the gateways unit, made from the service template. It lives in platform/gateways/catalogue/: unit ise-gateways, module mod-ise-002, schema mod_ise_002, database ise_gateways.
  2. It runs in the platform zone, and is reached through the internal gateway at /ise/v1/... like any other unit (model/apis.toml).
  3. The gateways themselves stay stateless in the edge zone.
  4. The Gradle build sits in a subfolder, so the unit folder keeps its ci.sh, which the pipeline runs. ci.sh now builds and tests the catalogue too.
  5. The root Dockerfile builds the unit's one image, his/gateways, so the pipeline's image scan covers it.

  6. The compatibility check is the repository's contract tool as merged to main, on commits merged to main. A submission's schemaRef names a file of the contract folders at a commit.

  7. The service runs catalogue/checker/check.ts once per submission, as a subprocess. The checker unpacks contracts/ and the event catalogue of the commits it reads from a git mirror of the repository (his.catalogue.repository).
  8. A submitted commit that is not an ancestor of main (his.catalogue.checker.main-ref, by default main) is refused. A contract is published only as it was reviewed and merged, which is when the pipeline submits it.
  9. The contract tool that runs is main's, never the submitted commit's. A submitter therefore cannot make a breaking change pass PR-GWY-002-1 with a tool of its own, and no unreviewed code runs in the catalogue service (review round 1 of RC-3-S13).
  10. It loads the owning domain's folder at the submitted commit, and lints it.
  11. It checks that the file is listed in contract.yaml, under the contract's name, version and topic.
  12. It compares the contract with the same contract at the commit of the previous published version, using the tool's compareContracts.
  13. The result is what his-contract check says of that change. The tool's libraries come from the checker's own lockfile, at the same versions as contracts/common.
  14. A check that cannot run (no mirror, an unknown commit, a timeout) answers 503. It is never a pass.
  15. A new major is compared with the previous version as if it replaced it, so that the record says what it breaks.

  16. The catalogue takes what is submitted; it does not invent what the folders lack. Owner, purpose, scopes, data classification, partner visibility and support contact come with the submission.

  17. The service checks every submission against the contract folders (point 2), so the catalogue cannot list a contract that is not in them.
  18. Loading every existing contract in bulk waits for the place where that metadata lives (handover RC-3-S12's follow-up).

  19. Versions and the lifecycle. A version must be greater than every version of the contract. A rejected version (Draft) may be submitted again.

  20. The previous version, the one compared with, is the greatest lower version that was published: Active, Deprecated or Retired.
  21. Breaking under the same major as that version is refused (PR-GWY-002-1).
  22. Deprecation needs a later version that is Active (D02-ISE 4.3), and a sunset no earlier than now plus the minimum window. The window is 12 months for a contract visible to partners or used by a partner or third-party application, and 6 months otherwise (CFG-ISE-002). PR-GWY-002-2 allows an earlier sunset with an approved exception, but no record of approved exceptions exists to check a reference against, and the specification names no approver. A bare reference would let the deprecating caller skip the window alone, so any exceptionRef is refused until that is settled (question Q3 on issue #69; review round 2 of RC-3-S13).
  23. Retirement always waits for the sunset. While a consumer is active, it also needs the approvals of the interface owner and the Release Manager.
  24. Each approval is verified as services/adm-identity verifies the second person of a merge (StepUp.verifySecond, ADR-HIS-087 point 6). Its signatureId is the access token of the approver's own step-up. It is validated like any bearer token, and must be a person other than the caller, at aal2 within the step-up window (5 minutes, his.catalogue.step-up.window).
  25. The decision point then decides ise.contract.approve-retirement for that person, with approvalRole interface-owner or release-manager.
  26. The two approvals are by two different people. A step-up signs one approval only (step_up_use, V2__step_up_use.sql).
  27. The approvers and the step-up identifiers, never the tokens, are recorded in the history and the audit. Every refused approval is audited.

  28. A consumer is active by registration. Registering again returns the entry and refreshes its lastSeenAt. A consumer is active while that time is within the contract's minimum deprecation window.

  29. The catalogue has no feed of who calls which version yet. Taking calls from the gateway's access log is a follow-up.
  30. Until then a consumer that stops registering ages out of "active" only after a whole window, which errs toward refusing a retirement.

  31. Notices. Each registered consumer gets a deprecation or retirement notice of type ise.deprecation-notice (contracts/ise README) through D10 notification.v1. It is addressed to the consumer's contact as a team.

  32. Notices are queued in the transaction of the change, sent after it, and sent again by a sweep until the notification service takes them.
  33. The notice key is digested into the Idempotency-Key, so a resent notice is one notification.

  34. The partner view comes from the gateway, and which contracts a partner may use is decided by D10, per contract. A request that the partner gateway forwards carries X-His-Gateway: partner and the calling client in X-His-Client. The gateway removes any X-His-* header a caller sends (ADR-HIS-062).

  35. Such a request sees only the Active and Deprecated versions marked partner-visible (part 13), and no consumer inventory.
  36. Of those, it sees only the contracts the partner may use (sections 3 and 13). Which ones is an authorization decision, which section 5.2.2 leaves to Domain 10.
  37. So the decision point is asked ise.contract.read on ise.Contract with the contract's name, partnerView and partnerClient. A read of one contract is refused (403) when it denies. A listing leaves out each contract it denies, at one decision per contract.
  38. An outage is 503, as for any read.
  39. D10 registers no obligation for a "partner view", so the catalogue does not use one.

  40. The capability statement is read from the facade when it is asked for. It is not copied, so the catalogue never shows a statement the facade does not keep. Until the facade of RC-3-S15 answers, the operation is 503.

  41. Policy actions on ise.Contract:

  42. ise.contract.read, ise.contract.submit, ise.contract.decide, ise.contract.deprecate, ise.contract.retire;
  43. ise.contract-consumer.read, ise.contract-consumer.register.

The request carries the owning domain, so that a Domain Service Team submits only its own domain's contracts. Every change, and every refused submission or retirement, is audited as ise.config.changed.

Consequences

  • The gateways unit has a build of each kind: the Python model and rendering, the APISIX plugin, the Java service and the TypeScript checker. ci.sh runs them all, and the pipeline keeps treating the folder as one unit.
  • The image carries git and Node.js beside the JRE. The image scan reads them like the rest.
  • A check takes tens of seconds: unpacking two commits, loading and linting a domain's contracts. That is acceptable for a submission. The checker's timeout is 2 minutes.
  • Deploying the catalogue needs a read-only mirror of the repository beside it, a writable temporary folder, and a service identity with introspection, the decision service and notification rights. Its Kubernetes objects are not rendered yet (follow-up).
  • The gateway's own Deprecation and Sunset headers still come from its reviewed model (model/apis.toml, ADR-HIS-062). Feeding them from the catalogue's lifecycle, as FR-ISE-GWY-001 part 11 suggests ("routes follow the lifecycle of the API version they expose"), is a follow-up.