Skip to content

Implementation plan / Session plan / Handover FN-S05

Handover FN-S05 Foundation: Continuous integration pipeline

Card: FN-S05. Issue: #5. Branch: session/FN-S05. Decision record: ADR-HIS-046.

What was built and where

The pipeline every pull request runs, in GitHub Actions. The workflows only wire scripts together, and every job's logic is a script under platform/delivery-pipeline/, so that the move to GitLab CI rewrites little more than the workflow file (ADR-HIS-038). The reference for later sessions is platform/delivery-pipeline/README.md: what runs when, what stops a change, exceptions, the SBOM, running a job on your own host, and the move to GitLab.

  • .github/workflows/pipeline.yml (new) runs on every pull request and on pushes to main, the merged result (FR-ISE-REL-001, item 2). Its jobs:
  • changes asks bin/changes which jobs the change needs;
  • secret-scan scans the changed files outside the documentation and every commit of the change in the same paths;
  • protected-files stops a session branch that adds a vulnerability exception;
  • static-analysis covers the changed folders and files;
  • build runs one job per changed build folder: build and tests, then the dependency scan and SBOM, the image scan and SBOM for a unit with a Dockerfile, and the report on the test-only images (the integration environment's, the harness's runner);
  • link-check runs the documentation link check when a change deletes or moves a file;
  • pipeline-self-test runs when the pipeline itself changes.

It ignores documentation files, so a documentation-only change does not start it. - .github/workflows/docs.yml (changed) keeps the link check and the site build. It now runs when documentation changes rather than on every pull request, and it gained the secret scan of the changed documentation files. - .github/workflows/web.yml (removed): its job is now the build job of the pipeline, which runs the same pnpm install --frozen-lockfile, pnpm build and pnpm test per web package, and selects packages more narrowly (below). - .github/workflows/sessions.yml: the actions are pinned by commit, and nothing else changed. - Job scripts, in platform/delivery-pipeline/bin/:

Script What it does
changes The jobs a change needs, from lib/plan.py
build-test <folder> Builds the folder by its kind: java with ./gradlew build on the light profile, node with pnpm, opentofu, the folder's own ci.sh, environment (the isolation check), contracts, or none
dependency-scan <folder> Trivy over the lockfiles, development dependencies included; writes the CycloneDX SBOM and gates
image-scan <folder> Builds the unit's image, scans it, writes its SBOM and gates
environment-images Scans and writes an SBOM for each pinned image of the integration environment; reports only
secret-scan code\|docs <base> [<head>] Gitleaks over the files the change adds or modifies, and over every commit of the change (base..head), in that scope
protected-files <base> [<head>] Stops a session branch that adds to a security-exceptions.toml
static-analysis <paths> Semgrep security rules, pinned, plus semgrep/his.yml
contract-check <folder> FN-S04's contract check (his-contract, in contracts/common) against the base commit: conventions, compatibility within a major version, stubs up to date
self-test [--full] The pipeline's own tests, and the "Ends when" check
- Libraries in lib/: plan.py (selection, one source of truth), vulns.py (the vulnerability gate and exceptions), sbom.py (SBOM check) and common.sh.
- tools.env: Trivy 0.76.1, Gitleaks 8.30.1 and Semgrep 1.183.0, each by image digest, and the Semgrep rules commit.
- semgrep/his.yml: the project's own rules, against console output in service code and against container images not pinned by digest.
- test/test_pipeline.py: the self-test.
- CLAUDE.md section 3: FN-S05 is marked as landed, with how the pipeline selects and gates. The documentation line and the FN-S06 line now name the new workflows.
- Decision record index: the row of ADR-HIS-046 and the count of 46, in the form build_adrs.py writes. Checked by running the generator on a scratch copy and diffing: identical. The plan build was not run in the checkout.

Decisions the card left open, all recorded in ADR-HIS-046:

  • Selection is by build folder, with dependents added: the design system or the shell rebuilds every web package, and a workspace also rebuilds the shell.
  • The secret scan of documentation is a step of the documentation job, so a documentation-only change still runs nothing else.
  • Scanners run from containers pinned by digest, with no third-party actions.
  • Semgrep gates on the security rules without the audit rules, at ERROR and WARNING severity.
  • HIGH and CRITICAL vulnerabilities gate. Exceptions live per folder, need a Security Engineer and an expiry, and are refused otherwise.
  • The integration environment's images are reported, not gated.
  • The secret scan reads the whole of every file in the net change, which is what a squash merge brings to main, and every commit of the change, where a secret removed by a later commit can still be read.
  • Only a session branch is stopped from adding an exception. A Security Engineer adds one from a branch of their own.
  • The scanners read only the pipeline's own settings. A .gitleaks.toml, .gitleaksignore or .semgrepignore in a change is never read as settings, so a change cannot switch off its own scan (review round 3).

Checks and their result

Host: Docker 29.9.3, OpenJDK 21.0.13, Python 3.14. Node.js is not on this host; the node path ran on GitHub (below). The integration environment ran only under HIS_SESSION=FN-S05.

Check Command Result
Self-test platform/delivery-pipeline/bin/self-test 35 tests, all passed. 3 skipped on this host: the Java build (below), and the 2 contract tests, which need Node.js. Those 2 passed in a node:22 container and on the runner
Java build with a planted failing test HIS_SESSION=FN-S05 platform/delivery-pipeline/bin/self-test --full test_pipeline.JavaBuildTest Passed. The template's unit builds and its tests pass on the light profile, and the planted failing JUnit test stops it. The environment was reset afterwards, and no container was left
Dependency scan of the template bin/dependency-scan services/_template Stops, as it should: 3 HIGH findings (follow-ups). SBOM of 527 components, 464 of them with a licence, all with a version and an origin
Image scan of the template ./gradlew assemble in services/_template, then bin/image-scan services/_template Stops, on the same 3 findings in the jar; the Temurin base image has no HIGH or CRITICAL finding. SBOM of 237 components. The test image was removed
Integration environment images bin/environment-images Six images scanned, each with an SBOM, findings reported; exit 0
End-to-end harness (FN-S07, merged after round 2) bin/build-test e2e/harness, bin/dependency-scan e2e/harness, bin/environment-images harness Selftest passed in the runner image. Lockfile: 6 components, no finding. Runner image: 661 components in its SBOM, 10 critical or high reported, not gated
Secret scan and static analysis of this change bin/secret-scan code origin/main, bin/secret-scan docs origin/main, bin/static-analysis <the static list of bin/changes> No secret and no blocking finding, after the actions of the existing workflows were pinned by commit (Semgrep found them by tag)
Link check of docs/ python3 docs/implementation_plan/tools/check_links.py 0 broken, 0 duplicate anchors
Links in CLAUDE.md and the pipeline README (outside docs/) One-off script applying the same rule 0 broken
Documentation site mkdocs build Builds

On GitHub, the "Ends when" of the card ran on the pull request of this session. One demonstration commit planted, all at once:

  • a secret in services/adm-identity/;
  • a Log4Shell lockfile in services/adm-identity/;
  • a failing test in the example screen of web/domains/adm;
  • a one-line change to services/_template, so that the Java unit job ran on a runner.

A second commit reverted it. Results:

Run 45428054799 of the demonstration commit was stopped. Each job failed at the intended step and for the intended reason:

Job Result
secret-scan Failed: generic-api-key in services/adm-identity/demo-planted.properties, line 2, with the instruction to rotate the secret
services/adm-identity (kind none) Build passed (nothing to build). Dependency scan failed: CVE-2021-44228 and CVE-2021-45046 (CRITICAL) and CVE-2021-45105 (HIGH) in log4j-core 2.14.1
web/domains/adm Build and tests failed on the planted Vitest test ("expected 2 to be 3"). Dependency scan failed: CRITICAL tinypool 1.1.1 (follow-up)
web/shell Build and tests passed. Dependency scan failed on the same tinypool findings
services/_template Build and tests passed on the runner: JDK 21, the light profile under a session name of its own, ./gradlew build, 4m46s in total. The dependency and image scans failed on the template's HIGH findings (follow-up)
static-analysis, pipeline-self-test, changes, docs-check Passed. The self-test ran its 24 tests on the runner with the real scanners

The SBOMs and scan reports of each build job are kept as the artifacts pipeline-<folder> of the run. The run of the revert commit, with only this card's files changed, was the clean case. It ran changes, secret-scan, static-analysis, pipeline-self-test and docs-check, and no build job, since no build folder changed.

After review round 2, the secret scan also reads every commit of the change. It then stopped this branch on the demonstration's made-up token in commit 3cea4e4, even though the revert had removed it from the files. That is the case the review raised. The remedy for a session is to rotate the secret and remove the commit from its branch. So the two demonstration commits were taken out of the branch, which was rebuilt on main and force-pushed. Run 45428054799 and its logs remain the record of the demonstration. The token was made up and opens nothing.

Requirements and test scenarios

The card names no requirement. The pipeline's behaviour follows D02-ISE, and the tests are named by it:

Requirement, scenario What Test (platform/delivery-pipeline/test/test_pipeline.py)
FR-ISE-REL-001 TEST-ISE-023, AC-04, PR-REL-001-2 A secret in a change stops it, also when a later commit of the change removed it SecretScanTest (code, documentation, committed and removed again in each, clean)
FR-ISE-REL-001 AC-04, PR-REL-001-1 and -2 Scanner settings added by a change (an allow-all .gitleaks.toml, a .gitleaksignore of its findings, .semgrepignore files) do not switch off its scans ScannerSettingsTest; all three passed the change before the fix
FR-ISE-REL-001, section 3 Only a Security Engineer approves an exception: a session branch cannot add one, and may remove one ProtectedFilesTest
FR-ISE-REL-001 TEST-ISE-023, AC-02, PR-REL-001-1 A critical or high finding stops it DependencyScanTest.test_a_vulnerable_dependency_stops_the_change
FR-ISE-REL-001 PR-REL-001-3; FR-ISE-SUP-002 TEST-ISE-037, rule 6 An approved exception lets the finding through and is named; an expired or unapproved one does not DependencyScanTest (exception tests)
FR-ISE-REL-001, item 2 (static analysis, unit tests, contract tests) A static analysis finding, a failing test and an incompatible contract each stop the change StaticAnalysisTest, BuildTest, JavaBuildTest (--full)
FR-ISE-REL-001, section 10 The pipeline fails closed when a scanner is unavailable Each script exits non-zero when its scanner cannot run. There is no test of an outage itself
FR-ISE-SUP-001 TEST-ISE-036, items 1 and 2 An SBOM for every build, with version, licence, origin and vulnerability status DependencyScanTest.test_a_clean_dependency_passes_and_is_in_the_sbom; the build job keeps the SBOMs as artifacts
FN-S05 card Each job runs only when its files change; a documentation-only change runs the documentation jobs alone; a deleted or moved file runs the link check SelectionTest (12 tests, including that the workflow filters match plan.py)
Session rule 4, FR-ISE-REL-001 item 2 (contract tests) FN-S04's contract check stops a breaking change and passes an unchanged contract ContractCheckTest (needs Node.js; runs in the workflow's self-test job)

Differences from the card or specification

  • Severity is the scanner's, not the rule of CFG-ISE-030 (CVSS v4.0 bands, raised for internet-facing and Tier 1 components, Critical for known exploited vulnerabilities). That rule belongs to the vulnerability register of MOD-ISE-010, where a Security Engineer confirms severity. Until the register exists, a medium finding in a Tier 1 component is reported but not gated.
  • Not in the pipeline yet, for the sessions that bring them:
  • validation of clinical schemas, FHIR profiles, terminology bindings and templates (FR-ISE-REL-001, item 3; part of TEST-ISE-023);
  • automated policy checks on infrastructure code (item 6);
  • the release steps: cosign, Harbor and archiving the SBOM of each release (FR-ISE-REL-002, FR-ISE-SUP-001, item 1);
  • the vulnerability register and its escalation (FR-ISE-SUP-002).
  • Branch protection and a refused direct push (TEST-ISE-023, first step) are not available on the free tier of a private repository (ADR-HIS-038). The launcher's merge waits for the checks instead.
  • The integration environment's images are not gated. They hold 2 to 145 critical or high findings each, many without a fix, and are part of no release. Gating them would freeze the environment. The ADR records this and asks a Security Engineer to confirm it.
  • FN-S07's asks (its handover, "FN-S05"): e2e/harness is a job of kind harness. It runs scenario selftest, scans pnpm-lock.yaml and writes its SBOM, and scans the Playwright runner image, reported only like the environment's images.
  • Renumbered. This record was drafted as ADR-HIS-045. FN-S04 merged first with that number, so this one is ADR-HIS-046, with every reference to it.
  • The contract check came with FN-S04, while this pull request was open. The pipeline runs it as FN-S04's handover asks:
  • for contracts/common: pnpm install --frozen-lockfile, pnpm build, pnpm test, then check-common and the check of the example against the base commit;
  • for a domain's folder: the tools in contracts/common installed first, then pnpm install --frozen-lockfile, pnpm build and pnpm test (with HIS_CONTRACT_BASE set to the base commit) when it has a package.json, or his-contract check when it has only a contract.yaml;
  • a folder with neither has nothing to check yet, and passes with a note.

Two parts of that handover are not done. The base is the pull request's base commit, not origin/main, so that a run on main compares with the commit before the push. Registering schemas on merge waits for a shared registry, which does not exist yet (follow-up). - Fewer web jobs. web.yml built all twelve web packages on any change under web/. The pipeline builds only the changed workspace and the shell, and every package only when the shell or the design system changes. - ADR-HIS-042 still names .github/workflows/web.yml. Accepted records are not edited; ADR-HIS-046 records the replacement.

Questions for a person

None that stops the session. Under "Needs a person" in the pull request:

  • The Enterprise Architecture Board approves ADR-HIS-046.
  • A Security Engineer (FR-ISE-REL-001, section 3, "Update scanning policy") confirms the scanning policy: HIGH and CRITICAL gate; audit rules are left out; the integration environment's images are reported only.
  • A Security Engineer decides on the open findings below, or a person schedules the upgrades. Until then every pull request that changes a web package, a contract folder, the service template or a unit made from it is stopped by the dependency scan.

Follow-ups outside the card

  • Web packages (owner of web/, FN-S06's folders): CRITICAL CVE-2026-104848 and CVE-2026-104849 in tinypool 1.1.1 (fixed in 2.1.2), which comes through vitest 3.2.7 in all twelve web packages.
  • Upgrade Vitest, or pin tinypool through pnpm.overrides, in every package and its lockfile, together with the shell's version check.
  • A screen session may not change its workspace's package.json, so this needs a session that owns the web packages, before the first screen session of RC-1.
  • Service template (FN-S03's folder): HIGH CVE-2026-106451 in at.yawk.lz4:lz4-java 1.11.2 (fixed in 1.11.4), and CVE-2026-108106 and CVE-2026-93451 in org.xerial.snappy:snappy-java 1.1.10.7 (fixed in 1.1.10.9). Both come through the Kafka client.
  • Constrain both in the template's buildSrc convention and rewrite the locks.
  • Until then, the first build session of each unit made from the template adds the constraint in its own unit, which it owns.
  • Contract tools (FN-S04's folder): CRITICAL CVE-2026-104848 and CVE-2026-104849 in tinypool 1.1.1, through vitest 3.2.7 in contracts/common, the same finding as the web packages. The next change to contracts/ is stopped by it until Vitest is upgraded there or a Security Engineer approves an exception.
  • Contract tools (FN-S04's folder): two static analysis findings of javascript.lang.security.html-in-template-string, in contracts/common/src/contract.ts line 140 and src/lint.ts line 29. Both are false positives: error messages such as `not a <major>.<minor> version: ${v}` look like HTML to the rule. They predate the pipeline, and they will stop the next change to contracts/common until the owner marks each line with nosemgrep: javascript.lang.security.html-in-template-string and the reason.
  • Schema registration on merge (FN-S04 handover): his-contract register of each changed domain against the shared registry, a release step once that registry exists (event backbone, MOD-ISE-004, and FR-ISE-REL-002).
  • FN-S06 (web/shell): web/shell/scripts/ci.sh and the shell README still name web.yml. The script can stay for local use or be removed.
  • FN-S03 follow-ups to this card:
  • Done: build Java units with JDK 21 and the light profile; scan the Temurin base image and enter it in the SBOM.
  • Not done: services/_template/check.sh on the full profile when services/_template/ changes. It is too heavy for a standard runner on every template change, and is better suited to a nightly or manual job.
  • Not done: drift between a unit's service-kit/ and the template's.
  • FN-S02 follow-up:
  • Done: the six pinned images are scanned and entered in an SBOM.
  • Done: test/isolation-check.sh light runs when platform/dev-environment/ changes.
  • FN-S01 follow-up: a report of version drift across units. Not done; it becomes useful once there are several units.
  • Caching. The Trivy databases (about 3 GB with the Java database) and the pnpm store are downloaded in each job. An actions/cache step keyed by day would shorten the jobs.
  • Licences. Some components still lack one in the SBOM: OS packages without licence metadata in the integration environment's images, and Gradle dependencies whose POM is not in the cache. The dependency register of FR-ISE-SUP-001, item 3, needs a licence source for those.