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¶
- The catalogue is a service of the gateways unit, made from the service template. It lives in
platform/gateways/catalogue/: unitise-gateways, modulemod-ise-002, schemamod_ise_002, databaseise_gateways. - It runs in the platform zone, and is reached through the internal gateway at
/ise/v1/...like any other unit (model/apis.toml). - The gateways themselves stay stateless in the edge zone.
- The Gradle build sits in a subfolder, so the unit folder keeps its
ci.sh, which the pipeline runs.ci.shnow builds and tests the catalogue too. -
The root
Dockerfilebuilds the unit's one image,his/gateways, so the pipeline's image scan covers it. -
The compatibility check is the repository's contract tool as merged to main, on commits merged to main. A submission's
schemaRefnames a file of the contract folders at a commit. - The service runs
catalogue/checker/check.tsonce per submission, as a subprocess. The checker unpackscontracts/and the event catalogue of the commits it reads from a git mirror of the repository (his.catalogue.repository). - A submitted commit that is not an ancestor of main (
his.catalogue.checker.main-ref, by defaultmain) is refused. A contract is published only as it was reviewed and merged, which is when the pipeline submits it. - 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).
- It loads the owning domain's folder at the submitted commit, and lints it.
- It checks that the file is listed in
contract.yaml, under the contract's name, version and topic. - It compares the contract with the same contract at the commit of the previous published version, using the tool's
compareContracts. - The result is what
his-contract checksays of that change. The tool's libraries come from the checker's own lockfile, at the same versions ascontracts/common. - A check that cannot run (no mirror, an unknown commit, a timeout) answers 503. It is never a pass.
-
A new major is compared with the previous version as if it replaced it, so that the record says what it breaks.
-
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.
- The service checks every submission against the contract folders (point 2), so the catalogue cannot list a contract that is not in them.
-
Loading every existing contract in bulk waits for the place where that metadata lives (handover RC-3-S12's follow-up).
-
Versions and the lifecycle. A version must be greater than every version of the contract. A rejected version (Draft) may be submitted again.
- The previous version, the one compared with, is the greatest lower version that was published: Active, Deprecated or Retired.
- Breaking under the same major as that version is refused (PR-GWY-002-1).
- 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
exceptionRefis refused until that is settled (question Q3 on issue #69; review round 2 of RC-3-S13). - Retirement always waits for the sunset. While a consumer is active, it also needs the approvals of the interface owner and the Release Manager.
- Each approval is verified as services/adm-identity verifies the second person of a merge (
StepUp.verifySecond, ADR-HIS-087 point 6). ItssignatureIdis 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). - The decision point then decides
ise.contract.approve-retirementfor that person, withapprovalRoleinterface-owner or release-manager. - The two approvals are by two different people. A step-up signs one approval only (
step_up_use,V2__step_up_use.sql). -
The approvers and the step-up identifiers, never the tokens, are recorded in the history and the audit. Every refused approval is audited.
-
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. - The catalogue has no feed of who calls which version yet. Taking calls from the gateway's access log is a follow-up.
-
Until then a consumer that stops registering ages out of "active" only after a whole window, which errs toward refusing a retirement.
-
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. - Notices are queued in the transaction of the change, sent after it, and sent again by a sweep until the notification service takes them.
-
The notice key is digested into the Idempotency-Key, so a resent notice is one notification.
-
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: partnerand the calling client inX-His-Client. The gateway removes anyX-His-*header a caller sends (ADR-HIS-062). - Such a request sees only the Active and Deprecated versions marked partner-visible (part 13), and no consumer inventory.
- 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.
- So the decision point is asked
ise.contract.readonise.Contractwith the contract's name,partnerViewandpartnerClient. A read of one contract is refused (403) when it denies. A listing leaves out each contract it denies, at one decision per contract. - An outage is 503, as for any read.
-
D10 registers no obligation for a "partner view", so the catalogue does not use one.
-
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.
-
Policy actions on
ise.Contract: ise.contract.read,ise.contract.submit,ise.contract.decide,ise.contract.deprecate,ise.contract.retire;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.shruns 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.