Implementation plan / Session plan / Handover RC-1-S28-F5
Handover RC-1-S28-F5 Fix: ess-reference runs as Tier 1¶
Card: RC-1-S28-F5. Issue: cema-care/his#211. Branch: session/RC-1-S28-F5. Slice: RC-1. Round 1 fix of the gate session RC-1-S28, readiness finding F-01. The unit belongs to RC-1-S06. Decision record: ADR-HIS-094.
The failure¶
The gate found that services/ess-reference/app/src/main/resources/application.yaml set his.unit.tier: 2. Architecture 5.2 gives the reference services "Tier 1 read paths", and FR-ISE-PLT-002 records a unit's criticality tier. The kit reads the tier in one place, AuditEmitter.checkBuffer. When the audit buffer is full (DEC-ESS-018), Tier 1 carries on with the outbox as the local durable log, and anything else is refused as unavailable.
What was found on the way¶
Simply setting the tier to 1, as RC-1-S28-F4 did for ess-runtime-decision, would have been wrong for this unit:
- its read paths (lookup, validate, expand, master-data reads) write no audit record, and
PolicyEnforcer's refusal audit is in a try/catch. A full buffer never stopped them, at Tier 2 either; - the actions the tier does govern are authoring, stewardship and approval. NFR-ESS-004 makes those Tier 2 or 3, and DEC-ESS-018 has them block on a full buffer. At unit-wide Tier 1 they would have carried on.
The specification is clear on both points, so this is a design question, not a question for a person. ADR-HIS-094 settles it:
- the unit declares the tier of its most critical paths;
- an audited action of a lower tier declares its own tier on its audit record. An action can only lower its tier, never raise it.
What was changed and where¶
All in services/ess-reference:
app/src/main/resources/application.yaml:his.unit.tier: 1, with a comment.service-kit:AuditRecordhas an optionaltier, which is not part of the audit event.AuditEmitterdecides onmax(record tier, unit tier).mod-ess-004AuthoringService:STEWARDSHIP_TIER = 2on the audit of create, submit, second review, approve, retire, roll back and export.mod-ess-005Governance:STEWARDSHIP_TIER = 2on the audit of change proposals, batches and decisions. The registries of mod-ess-010 go through these.- Three audited actions keep the unit's tier, because the Tier 1 read paths depend on them:
- terminology activation: lookups would otherwise answer from a superseded release;
- publication of a master-data version that takes effect: MasterDataChanged feeds the consumers' local copies and the validity ends from which MOD-ESS-001 suspends roles;
- the start-up seeds of mod-ess-005 and mod-ess-010, including the catalogue registration in
CatalogueService: refusing them would stop the unit from starting during an audit outage.
A first version of the change made the seeds Tier 2. UnitTierTest then failed, because the unit did not start with a full buffer, and that is how this was found.
- Tests:
- app/.../UnitTierTest.java (new): the unit declares Tier 1, and an action without a tier of its own carries on with a full buffer. It reads the unit's own configuration.
- mod-ess-004/.../AuditBufferTierTest.java (new): with a full buffer, a code lookup answers and creating a terminology version is refused 503 unavailable until audit is back; an approved release still becomes current at its effective time.
- mod-ess-005/.../AuditBufferTierTest.java (new): with a full buffer, a facility read answers and a steward's change proposal is refused 503 until audit is back; a version that takes effect is still published (MasterDataChanged).
- service-kit/.../AuditBufferTest.java: in a Tier 1 unit, a record of Tier 2 is refused; a record cannot raise its tier above its unit's.
- README.md: the unit's tier and the rule.
Outside the unit: ADR-HIS-094 and its row in the decision record index, and this handover. No contract changed, no dependency was added, and no lockfile changed. ADR-HIS-092 is taken by two open pull requests (#235 and #238), and one of them will need 093, so this record is 094.
Checks and their results¶
Light profile, in services/ess-reference:
| Check | Result |
|---|---|
./gradlew :app:test --tests '*UnitTierTest' before the fix |
2 tests, 2 failed: expected: 1 but was: 2, and HisException: Audit is unavailable; the action cannot be recorded now. |
The new AuditBufferTierTests with the Tier 2 declarations taken out of Governance and AuthoringService (unit-wide Tier 1 alone) |
Fail: expected: 503 but was: 201 |
| The same with activation and publication declared Tier 2 | Fail: activation and publication tests |
./gradlew build --rerun-tasks after the fix |
Passed, 172 tests: service-kit 30 (1 skipped, the Kafka test of the full profile), mod-ess-004 61, mod-ess-005 37, mod-ess-010 39, app 5 |
python3 docs/implementation_plan/tools/check_links.py |
0 broken |
The build must run without contracts/common/node_modules, or with a Node.js that strips TypeScript; see the follow-ups.
Slice scenario (HIS_SESSION=RC-1-S28-F5 e2e/harness/scenario run e2e/scenarios/RC-1, full profile, after CI=true pnpm install --frozen-lockfile in contracts/common, ess, adm and ise, as in RC-1-S28-F4):
- On the final change (evidence
20261129T085350Z-2945): 12 of 12 passed, RC-1-E2E-001 to 013. The host's load average was 7 to 15. - Two earlier runs were on the first commit (unit-wide Tier 1 only), while the full stacks of RC-1-S28-F2 and RC-3-S09 ran on the same 4-CPU host (load average 18 to 30). They failed 7 and 4 tests (5 and 8 passed). Every failure traced to the policy decision point timing out under load (up to 1881 "did not answer in time" denials, most in adm-identity), and to the 503s that followed. RC-1-E2E-002 also failed with an adm-identity 503. No unit logged "audit buffer full" in any run, so the tier was never consulted. None of these runs is evidence about the tier.
Requirements and test scenarios of the card¶
| Requirement | Test |
|---|---|
| FR-ISE-PLT-002 criticality tiering, for this unit | UnitTierTest "the reference services unit runs as Tier 1" (tags FR-ISE-PLT-002, NFR-ESS-004) |
| NFR-ESS-004 terminology runtime and master-data read are Tier 1; administration and stewardship Tier 2 or 3. DEC-ESS-018 | UnitTierTest "with the audit buffer full, the unit's protected actions carry on"; mod-ess-004 AuditBufferTierTest (2 cases); mod-ess-005 AuditBufferTierTest (2 cases); AuditBufferTest lowerTierActionBlocksWhenFull, cannotRaiseTier (tags NFR-ESS-004, DEC-ESS-018, FR-ISE-PLT-002) |
What the gate line now shows. The line is Criterion 4 (ACC-001), the traceability matrix row of FR-ISE-PLT-002. ess-reference now declares Tier 1. Its tests show that, with a full audit buffer, its Tier 1 read paths and the actions they depend on carry on, while stewardship stays Tier 2. The row stays Not met until two more things are done: adm-identity declares Tier 1 (RC-1-S28-F3, #208), and the RC-1 catalogue entries are registered (runbooks, section 6). The next gate session, RC-1-S28-G2, records it again.
Done differently from the specification or contract¶
Nothing. The rule of ADR-HIS-094 is how the unit meets DEC-ESS-018 and NFR-ESS-004 together.
Questions and follow-ups¶
- No question for a person.
- For RC-1-S28-F3 (#208, adm-identity) and for ess-runtime-decision (RC-1-S16, after RC-1-S28-F4): a unit at Tier 1 that also holds Tier 2 administration should declare the tier of those actions as ADR-HIS-094 does. Since F4, every audited administrative action of ess-runtime-decision carries on with a full buffer.
- For the template (
services/_template, FN-S03): take overAuditRecord.tierso that every unit has it. - For RC-1-S28-F17 (#223, ess-reference audit item version): the same audit call sites in
AuthoringServiceandGovernancenow carryb.tier(STEWARDSHIP_TIER); keep it. - The contract test runner (
ContractTool.localNodein mod-ess-004) uses the host's Node.js whenevercontracts/common/node_modulesexists and Node is 22.18 or later. This host's distribution Node 22.22 is built without TypeScript type stripping (process.features.typescriptis false), so every contract test then fails withERR_UNKNOWN_FILE_EXTENSION. The check should testprocess.features.typescriptand fall back to the pinned image. That is a follow-up for the unit's contract tooling, or for RC-1-S28-F10 (#216), which installscontracts/commonfor the stubs.