Skip to content

Continuous Integration ​

How CI is set up, which checks run where, and how to reproduce and fix each failure locally. The Cadence CLI runs as pnpm cadence <command> (a wrapper for dotnet run --project packages/cli/src/Cadence.Cli.csproj --).

Workflows ​

WorkflowRuns onWhat it does
ci.ymlPull requests and pushes to main, release/*, and v* tagsStyle, lint and frontend builds, quality sentinels, Native AOT and docs builds, workflow and container security audits, .NET tests (including kernel consumer contracts), frontend unit and Playwright E2E accessibility tests, GxP compliance checks, CI Gate, safe automerge, and gated release/docs callers
conflict-check.ymlPull requests (opened, synchronize, reopened)Emits Check for Merge Conflicts and fails when the PR conflicts with its base branch (shallow checkout, no .NET install)
production-pipeline.ymlCalled by ci.yml on pushes to main, release/*, and v* tags, or manual dispatchVulnerability audit, generates stamped GxP RTM and IQ/OQ/PQ reports from verified CI test evidence (gxp snapshot --results-dir TestResults/gxp, or runs tests against pinned PostgreSQL 18 on manual dispatch), with SHA-256 sums and SLSA
deploy-docs.ymlCalled by ci.yml on pushes to main (parallel to release-and-archive), or dispatchBuilds packages/ui, the static VitePress portal (CADENCE_DOCS_SKIP_CHECKS=1 on push calls; runs openapi, schema-doc, markdown, and rtm checks on workflow_dispatch), and the co-hosted staff and participant demos (pnpm docs:stage-demos), enforces the zero-exemption check public-bundle gate before SHA256SUMS and upload-pages-artifact, attests the packaged Pages archive (artifact.tar) with SLSA provenance, and deploys to GitHub Pages

ci.yml jobs ​

  1. Workflow Action Pinning & Actionlint Gate (actionlint): runs rhysd/actionlint (actionlint on PATH in cadence ci) to enforce workflow YAML syntax, while the native workflow-security gate (run in dotnet-quality, pre-commit, and pnpm cadence check) enforces GitHub Actions supply-chain security across .github/workflows/*.{yml,yaml} and .github/actions/**/action.{yml,yaml} (40-character commit SHAs with inline version comments, sha256: digests on docker:// references, persist-credentials: false on actions/checkout, and least-privilege workflow permissions).
  2. Lint and Static Verification (lint-and-static): reuses the cadence-cli-${{ github.run_id }}-${{ github.run_attempt }} artifact from native-aot-build, installs the pnpm workspace and runs pnpm build (compiling packages/ui, apps/web, and apps/subject-portal), runs Prettier across all eligible repository files respecting .prettierignore and ESLint across frontend packages, Hadolint on Dockerfiles, ShellCheck on *.sh scripts, bash tests/test_installer_checksums.sh (verifying .NET installer SHA-256 checksum enforcement), check markdown, and check api-clients (ApiClientValidatorService, typechecking generated web OpenAPI types and clients).
  3. .NET Quality & Sentinel Checks (dotnet-quality): builds Cadence.sln, fetches origin "$BASE_REF" on pull requests, runs cadence check --exclude prettier --exclude eslint --exclude actionlint --exclude hadolint --exclude detect-secrets --exclude api-clients --exclude vulnerabilities --exclude public-bundle with --base "origin/$BASE_REF" on pull requests and --push-before "$BEFORE_SHA" on pushes (executing the remaining 31 gates once, including dotnet-format, dotnet-format-style, yaml, trailing-whitespace, end-of-file, clean-secrets, adrs, codeowners, workflow-security, rulesets, deid, security, schema-doc, openapi, rtm, gxp-snapshot, baseline-ratchet, and duplication), runs Cadence.ArchitectureTests (ArchUnitNET), and uploads duplication_summary.json (duplication-summary-${{ github.run_id }}-${{ github.run_attempt }}).
  4. Native AOT Compilation (native-aot-build) and Documentation Compilation (docs-build): native-aot-build caches ./bin/cadence, publishes Cadence.Cli as a Native AOT linux-x64 binary into ./bin on cache misses (failing on any trim or AOT warning), and uploads the run-scoped cadence-cli-${{ github.run_id }}-${{ github.run_attempt }} artifact reused by lint-and-static, docs-build, security, and compliance; docs-build builds packages/ui, compiles the documentation portal (pnpm docs:build with CADENCE_DOCS_SKIP_CHECKS=1 and isolated child-process environments), stages both interactive demos into /demo/ and /subject-portal/ (pnpm docs:stage-demos), and verifies all three compiled public bundles (docs/.vitepress/dist, apps/web/dist, and apps/subject-portal/dist) with node scripts/run-cli.js check public-bundle.
  5. Security and Vulnerability Audit (security): static security audit (audit-security), fail-closed NuGet, pnpm and Python (pip-audit==2.10.1 in an isolated venv after dotnet restore Cadence.sln) vulnerability audit (check vulnerabilities), non-mutating secret baseline verification (check clean-secrets), fail-closed check detect-secrets (detect-secrets==1.5.0 in an isolated venv) and check deid, both scoped in Cadence.Cli (GitRevisionScopeService) via --base "origin/$BASE_REF" on pull requests and --push-before "$BEFORE_SHA" on pushes (falling back to every tracked file via git ls-files -z when HEAD equals the base ref or when BEFORE_SHA is all zeros, a tag, or a non-ancestor).
  6. Container Build & Vulnerability Scan (container-security): builds gateway, kernel-api, sce-python and sce-r across a parallel matrix and runs fail-closed Trivy (CRITICAL,HIGH, --ignore-unfixed, exit code 1) with distinct SARIF uploads (trivy-<target>) on pushes and on container or dependency pull requests.
  7. .NET 10 C# xUnit Verification (dotnet-tests): dotnet build (warnings are errors), then dotnet test Cadence.sln --configuration Release --no-build --results-directory TestResults/gxp --logger "trx;LogFilePrefix=gxp" (including packages/kernel/consumer-tests/Cadence.Kernel.ConsumerTests) with CADENCE_TEST_EVIDENCE_DIR=${{ github.workspace }}/TestResults/gxp against a PostgreSQL 18 service container pinned to PostgresTestImage.Image (CADENCE_TEST_POSTGRES). Diagnostic TRX reports and *.database.txt fixture metadata are uploaded unconditionally in trx-report-dotnet-${{ github.run_id }}-${{ github.run_attempt }}. Locally either CADENCE_TEST_POSTGRES or CADENCE_TEST_DOCKER=1 works for every database fixture (TESTING.md), and cadence ci runs bash scripts/test-check-database-test-results.sh and fails via DatabaseTestEvidence when any integration or E2E test was skipped or did not execute, unless --allow-skip is given. In GitHub Actions, dotnet-tests runs scripts/test-check-database-test-results.sh and scripts/check-database-test-results.sh, verifying that both tests/Cadence.IntegrationTests and tests/Cadence.E2ETests produced TRX reports and *.database.txt metadata in TestResults/gxp and failing on any NotExecuted database test except the opt-in lineage benchmark and browser correction check (DatabaseTestEvidence.OptInTests). Only after that gate passes does dotnet-tests upload TestResults/gxp as gxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }}; test_outcome waits on both the gate and evidence upload, blocking compliance and downstream release workflows on failure.
  8. Frontend Unit Tests (unit-tests): Vitest across the pnpm workspace (pnpm -r test) plus the VitePress portal navigation suite (pnpm exec vitest run --config vitest.config.mjs, covering docs/.vitepress/navigation.test.mjs).
  9. Parallel E2E Accessibility Testing (accessibility-e2e): runs on pull requests and pushes (main, release/*, and v* tags) and gates ci-gate (and transitively automerge), release-and-archive, and deploy-docs, executing Playwright accessibility E2E suites for subject-portal and web (failing closed with exit code 1 if Playwright browser installation fails three times), plus BrowserCorrectionReachesTheDatabaseWithItsReason (tests/Cadence.IntegrationTests) against PostgreSQL 18 with CADENCE_TEST_BROWSER=1.
  10. GxP Compliance & Qualification Reporting (compliance): downloads the verified gxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }} artifact (TRX reports and *.database.txt fixture evidence) from dotnet-tests into TestResults/gxp, then Generate Compliance Reports runs node scripts/run-cli.js gxp sync --results-dir TestResults/gxp, which writes a preview of the RTM and IQ/OQ/PQ report to TestResults/gxp/preview/ without re-running dotnet test and fails on unknown requirement IDs, failing tagged tests, missing *.database.txt metadata and skipped database tests; it writes docs/SDLC only with CADENCE_GXP_SNAPSHOT=1. Check GxP Snapshot Policy runs node scripts/run-cli.js check gxp-snapshot with --base "origin/$BASE_REF" on pull requests and --push-before "$BEFORE_SHA" on pushes, refusing changes to the committed RTM, IQ/OQ/PQ report or docs/SDLC/runs/ across feature branches and direct pushes to main or release/* unless CADENCE_GXP_SNAPSHOT=1 (ADR-2532). With CADENCE_GXP_SNAPSHOT=1 it instead compares the regenerated documents with the snapshot (cadence gxp diff, which ignores the evidence block naming the tested revision, time, database and runner).
  11. CI Gate (ci-gate): runs with if: always() and depends on all 11 pull-request validation jobs (actionlint, lint-and-static, dotnet-quality, native-aot-build, docs-build, security, container-security, unit-tests, dotnet-tests, accessibility-e2e, compliance). It fails whenever any required upstream job (actionlint, lint-and-static, dotnet-quality, native-aot-build, docs-build, security, unit-tests, dotnet-tests, accessibility-e2e, compliance) fails, cancels, or skips, and fails on container-security failure or cancellation while allowing container-security to skip on pull requests that touch no container or dependency inputs.
  12. Classify Change (classify, pull requests) and Enable Automerge (automerge, pull requests): classify labels documentation-only pull requests (is_safe=true) and detects container/dependency changes (container_scan=true); automerge waits on classify (is_safe == 'true') and ci-gate (needs.ci-gate.result == 'success') before running gh pr merge --auto --squash with GITHUB_TOKEN.

Branch rulesets and local reconciliation ​

.github/rulesets/main.json (refs/heads/main) and .github/rulesets/release_branches.json (refs/heads/release/*) enforce strict_required_status_checks_policy: true and require only two GitHub Actions (integration_id: 15368) checks: CI Gate (ci.yml) and Check for Merge Conflicts (conflict-check.yml), decoupling branch protection rules from internal CI job refactors. .github/rulesets/version_tags.json blocks deletion and force-pushes on refs/tags/v*. The rulesets quality gate (pnpm cadence check rulesets) verifies ruleset JSON schema, strict policy, CI Gate upstream job coverage, and workflow parity. While GitHub Actions runners stay paused until 2027, maintainers reconcile declarative rulesets locally with admin credentials using pnpm cadence rulesets --dry-run (preview) and pnpm cadence rulesets (gh api sync; fails non-zero on API or permission errors).

native-aot-build in ci.yml along with production-pipeline.yml and deploy-docs.yml cache ./bin/cadence via actions/cache (keyed on global MSBuild files, packages/cli/src/**, and all Cadence.Cli ProjectReference trees), while downstream CLI jobs in ci.yml (lint-and-static, docs-build, security, and compliance) download the run-scoped cadence-cli-${{ github.run_id }}-${{ github.run_attempt }} artifact produced by native-aot-build. Every active actions/setup-dotnet step hashes global.json, Directory.Build.props, Directory.Build.targets, Directory.Packages.props, NuGet.Config, and **/*.csproj. Only the release and documentation deployment callers run exclusively on pushes (where cancel-in-progress is disabled so release evidence runs complete): release-and-archive (production-pipeline.yml, on main, release/*, and v* tags, gated on all 11 validation jobs and forwarding gxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }} into gxp snapshot --results-dir TestResults/gxp to publish gxp-release-evidence-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}) and deploy-docs (deploy-docs.yml, on main, gated on all 11 validation jobs independently of release-and-archive so documentation publishing and release archiving run in parallel). While GitHub Actions is paused, verify container changes locally with Hadolint (find docker -type f -name "Dockerfile*" -exec hadolint --failure-threshold error {} +), container builds (docker build -t cadence-gateway:latest -f docker/Dockerfile.dotnet --build-arg APP_NAME=gateway ., docker build -t cadence-kernel-api:latest -f docker/Dockerfile.dotnet --build-arg APP_NAME=kernel-api ., docker build -t cadence-sce-python:latest -f docker/sce/python/Dockerfile docker/sce/python, docker build -t cadence-sce-r:latest -f docker/sce/r/Dockerfile docker/sce/r), and Trivy (trivy image --exit-code 1 --ignore-unfixed --pkg-types os,library --severity CRITICAL,HIGH cadence-gateway:latest). Verify dependency and container pin alignment across MSBuild properties (Directory.Build.props, Directory.Packages.props, Directory.Build.targets), the pnpm-workspace.yaml catalog:, .config/dotnet-tools.json, statistical Dockerfiles, and .github/dependabot.yml (ADR-2527) with dotnet restore Cadence.sln && dotnet build Cadence.sln, pnpm install --frozen-lockfile && pnpm cadence check dependencies, and dotnet test tests/Cadence.UnitTests/Cadence.UnitTests.csproj --filter FullyQualifiedName~ContainerImagePinTests.

IMPORTANT

GitHub Actions does not run jobs for this repository until 2027: every check on a pull request fails within seconds without running. Until then, run pnpm cadence ci (or make ci) before merging. It runs the pull-request jobs above (starting with actionlint) on your machine with the same commands, requires actionlint and hadolint (in .cadence/bin or on PATH), shellcheck, detect-secrets-hook (in .cadence/venv, .venv or on PATH) and bash on PATH plus PostgreSQL for the .NET tests, and fails when any required binary or database is missing unless --allow-skip is passed (cli.md). A full run takes about 20 minutes: CADENCE_TEST_POSTGRES=<connection string> pnpm cadence ci. Without a terminal (an AI agent, a script, a pipe, a git hook) the CLI prints plain text, so its output can be redirected to a file as it is.

Quality gates ​

pnpm cadence check runs every gate in packages/cli/src/Services/QualityGates.cs, the one registry of quality gates. Revision-scoped gates resolve staged, branch (--base <ref>), push (--push-before <sha>), and full-repository (git ls-files -z) scopes in C# through GitRevisionScopeService rather than shell pipelines. The pre-commit hook runs pnpm cadence check --pre-commit (below), and CI partitions the registry across existing runtime jobs with --exclude (actionlint runs in actionlint; prettier, eslint, hadolint, and api-clients run in lint-and-static; detect-secrets and vulnerabilities run in security; public-bundle runs in docs-build and deploy-docs.yml after static bundle compilation; and dotnet-quality runs check --exclude prettier --exclude eslint --exclude actionlint --exclude hadolint --exclude detect-secrets --exclude api-clients --exclude vulnerabilities --exclude public-bundle, passing --base "origin/$BASE_REF" on pull requests and --push-before "$BEFORE_SHA" on pushes). Run one gate with pnpm cadence check <gate>; an unknown gate name (or unknown --exclude gate) fails. While GitHub Actions remains disabled until 2027, contributors running pre-commit hooks, pnpm cadence check or pnpm cadence ci locally must restore Cadence.sln (dotnet restore Cadence.sln), provision local guardrails via ./scripts/setup_wizard.sh --minimal (or ./scripts/setup_wizard.ps1 -Minimal, which installs detect-secrets==1.5.0 and pip-audit==2.10.1 into .cadence/venv and SHA-256-verified actionlint v1.7.12 and hadolint v2.15.1 into .cadence/bin), and build the static bundles (pnpm --filter ui build && pnpm docs:build && pnpm docs:stage-demos) when running check public-bundle (or pass --exclude public-bundle before building), because prettier, eslint, actionlint, hadolint, detect-secrets, vulnerabilities, and public-bundle all fail closed whenever their toolchains or inputs are missing. The table is generated from the registry by pnpm cadence generate-cli-docs, and the cli-docs gate fails when it is stale. cli.md lists each gate's other names and what the pre-commit hook does with it. QualityGateRegistryTests runs every gate against a fixture that must make it fail, so a gate that cannot fail does not get in.

pnpm cadence check runs these 39 gates in this order:

GateWhat it checks
dotnet-formatWhitespace formatting against .editorconfig (dotnet format whitespace)
dotnet-format-styleRoslyn code-style rules (dotnet format style)
prettierPrettier formatting across JS, TS, Vue, CSS, JSON, Markdown and YAML files
eslintESLint and duplicate store identifier checks across JS, TS and Vue files
actionlintGitHub Actions workflow and composite-action static analysis via actionlint from .cadence/bin or PATH (fails closed when missing)
hadolintDockerfile best-practice and syntax linting (hadolint --failure-threshold error) from .cadence/bin or PATH (fails closed when missing)
yamlYAML 1.2 syntax, indentation, quoted scalars, flow brackets and duplicate mapping keys
trailing-whitespaceNo trailing spaces or tabs at the end of lines in text files
end-of-fileNon-empty UTF-8 text files end with a newline character
clean-secretsVerifies .secrets.baseline is valid, normalized JSON with the canonical exclusion filter without mutating it
detect-secretsScans changed or tracked files against .secrets.baseline using detect-secrets-hook from .cadence/venv, PATH or uvx (fails closed when missing)
duplicationDuplicated code blocks over 15 normalized lines involving a C# file
cli-docsdocs/cli.md documents every command in Program.cs, and the gate tables in docs/cli.md and docs/CI.md match this registry
adrsADR schema, docs/adr/index.md consistency, and an ADR for architectural changes
arch-driftdocker/docker-compose.yml exists and declares services; services missing from the architecture docs are warnings
sanitizerRequirement tags in Markdown are upper case (@req:PRD-…); fixes them in normal mode and reports errors read-only during pre-commit
markdownMarkdown structure, links, and paths into .NET test project folders (tests/Cadence.*) that no longer exist
env-varsEnvironment variables read in code are in .env.example and docs/ENVIRONMENT_VARIABLES.md
dev-envService ports in docs/LOCAL_DEV_ENVIRONMENT.md match the gateway and the Aspire AppHost
readmesEach directory under apps/ and packages/ has a README with a title
codeownersPath pattern existence and owner handle syntax in .github/CODEOWNERS
workflow-security40-hex commit SHAs with version comments, sha256: digests on docker:// refs, persist-credentials: false on actions/checkout, and least-privilege permissions across .github/workflows and .github/actions
rulesetsBranch and tag rulesets in .github/rulesets/*.json, strict status check policy, CI Gate upstream job coverage, and workflow check parity
importsNo using of another service's namespace across apps/<service>
securityHard-coded secret patterns across source, Vue templates and build scripts (private keys, cloud keys, API tokens, compliance secrets)
deidPHI/PII in changed or tracked files including authored docs/, root portal docs, .vue templates and stores/ (vendored docs/CDISC/, docs/NCI/ and docs/SDLC/runs/ excluded), ratcheted by .deid-baseline.txt; a line that is not PHI takes a deid-ignore comment
openapidocs/openapi matches what the .NET services serve, and docs/api matches docs/openapi
api-clientsThe web API types are generated from the current docs/openapi, and the web API clients typecheck against them
schema-docdocs/schema matches the EF Core models
path-patternsNo tmp, temp, scratch or old_src directories, .vue files only under apps/, packages/ and docs/.vitepress/, .sh files only under scripts/
query-linterNo interpolated SQL string passed to FromSqlRaw or ExecuteSqlRaw, and no comparison with a boolean literal
vulnerabilitiesNuGet, pnpm and Python dependency vulnerabilities not exempted by a valid docs/SDLC/vulnerability_exclusions_ledger.json entry (fails closed on missing or broken scanners)
dependenciesValid JSON across workspace package.json and .config/dotnet-tools.json manifests, and no client-side crypto package (node-forge, elliptic, jose)
doc-indexEvery Markdown document under docs/ is listed in docs/DOCUMENTATION_INDEX.md
demo-manifestpackages/demo-fixtures matches the canonical demo seed in DevelopmentDemoData.cs, ExecutionDbSeeder.cs and docker/cadence-realm.json
rtmRequirement tags name known requirements and sit on test methods, and the generated documents match their integrity stamps and are not drafts
gxp-snapshotThe branch or push range does not change the generated RTM, IQ/OQ/PQ report or docs/SDLC/runs/ unless CADENCE_GXP_SNAPSHOT=1 (ADR-2532)
baseline-ratchetNo ratchet baseline (*.baseline.txt, .deid-baseline.txt, .secrets.baseline) gained an entry without a Baseline-Growth: <path> - <reason> trailer on the commit that grew it
public-bundleZero-exemption post-build scan of docs/.vitepress/dist, apps/web/dist, and apps/subject-portal/dist for national IDs, unapproved emails, secrets, external assets, executable local URLs, and CSP meta headers

pnpm cadence check rtm (or gxp-rtm-validate) validates the requirement tags and integrity stamps without regenerating the matrix; it requires the matrix's test mapping to be current only with CADENCE_GXP_SNAPSHOT=1. pnpm cadence check gxp-snapshot (or gxp-snapshot-guard) runs the snapshot guard. pnpm cadence check baseline-ratchet (or baselines) runs the baseline ratchet (docs/TESTING.md); it runs inside pnpm cadence check, so CI's Run Cadence quality sentinels step and cadence ci run it too.

Dual-layer source and public bundle gates (ADR-2386, ADR-2497, ADR-2550) ​

  • Layer 1 (deid and security on tracked source): DeidComplianceService scans application code, authored portal docs (docs/), staged root portal documents (README.md, ARCHITECTURE.md, AGENTS.md, CONTEXT.md, CONTRIBUTING.md, SECURITY.md, SUPPORT.md, LICENSE), .vue templates, and stores/ (fulfilling ADR-2386). Only test suites (tests/), tooling/infrastructure folders (scripts/, docker/, packages/deid/), vendored clinical standards (docs/CDISC/, docs/NCI/), generated OpenAPI/EF schema outputs (docs/openapi/, docs/schema/), and GxP qualification snapshots (docs/SDLC/runs/, Requirements_Traceability_Matrix.md, IQ_OQ_PQ_Execution_Report.md) are excluded from source DEID scans to protect snapshot integrity. SecretScanner (check security) scans source files including .vue templates and scripts/ (such as scripts/build-docs.js and scripts/stage-portal-demos.js), and .secrets.baseline (clean-secrets) does not exclude dist/.
  • Layer 2 (public-bundle on built static outputs): PublicBundleValidatorService (pnpm cadence check public-bundle / validate-public-bundle) scans every generated text file in docs/.vitepress/dist (including co-hosted /demo/ and /subject-portal/ subpaths), apps/web/dist, and apps/subject-portal/dist with zero comment or pragma exemptions (deid-ignore, deid: ignore, and pragma: allowlist are ignored), failing closed if any bundle is missing or contains national identifiers, unapproved emails, secrets, external assets, executable local backend URLs (localhost, 127.0.0.1, 0.0.0.0), or missing/permissive Content-Security-Policy <meta> directives.

Pre-commit hook ​

scripts/setup_wizard.sh, scripts/setup_wizard.ps1, and pnpm install (scripts/setup-git-hooks.js) point git at .githooks/ (git config core.hooksPath .githooks), and the setup wizards provision detect-secrets==1.5.0 and pip-audit==2.10.1 in .cadence/venv plus SHA-256-verified actionlint (1.7.12) and hadolint (2.15.1) binaries in .cadence/bin. On Linux, macOS, and Windows (via Git for Windows sh), .githooks/pre-commit is a fail-closed POSIX launcher that verifies node and dotnet are on PATH (preserving $HOME/.dotnet/tools on PATH and setting DOTNET_ROOT to $HOME/.dotnet only when dotnet is absent from PATH and both $HOME/.dotnet/dotnet and $HOME/.dotnet/host/fxr exist) and delegates directly to node scripts/run-cli.js check --pre-commit.

cadence check --pre-commit executes every gate in QualityGates.cs fail-closed against staged Git index blobs (GitIndexReader via git cat-file --batch, without acquiring .git/index.lock or mutating working-tree files), treating deletion-only and clean merge commits (TargetFiles = []) as a no-op across file-scoped gates (with the quick variants listed in cli.md):

  • dotnet-format validates materialized staged C# and .editorconfig blobs, and dotnet-format-style checks staged C# files while failing closed if dotnet is missing or unstaged edits overlap MSBuild inputs.
  • prettier and eslint stream staged JS, TS, Vue, CSS, JSON, Markdown, and YAML blobs over stdin (and fail closed if pnpm or node_modules is missing).
  • actionlint and hadolint validate materialized staged .github/workflows, .github/actions, and Dockerfile* blobs using .cadence/bin or PATH (failing closed when missing).
  • workflow-security (also action-pinning), yaml, trailing-whitespace, end-of-file, sanitizer (read-only error reporting on lowercase @req:prd-… tags), and detect-secrets validate staged index blobs (40-char commit SHAs, sha256: container digests, persist-credentials: false, least-privilege permissions, YAML syntax, whitespace/EOF hygiene, and secrets against .secrets.baseline via .cadence/venv, PATH, or uvx) without touching unstaged working-tree edits.
  • schema-doc runs the drift check when staged files include Entity Framework entities, migrations, configurations, or docs/schema; openapi exports specs only for the services the staged C# files touch (both failing closed if unstaged edits overlap MSBuild/spec inputs); adrs checks staged files for architectural changes while accepting ADRs already added on the branch; and gxp-snapshot and baseline-ratchet check the staged copies against HEAD (baseline-ratchet admits staged growth when CADENCE_BASELINE_GROWTH="<reason>" is set, requiring a matching Baseline-Growth: <path> - <reason> trailer on the commit). pnpm cadence check, make verify, and CI run every gate in full.

There is no pre-push hook. Requirement tags and test results are checked in CI by the compliance job; run pnpm cadence gxp sync before pushing test changes, and commit nothing it generates.

bash
# Verify environment readiness and run all guardrails without committing
pnpm cadence doctor
pnpm cadence check

# Enable the hooks by hand if setup was skipped
git config core.hooksPath .githooks

Don't bypass the hook with --no-verify; fix the failing gate instead.

CI failure runbook ​

CI runs in .github/workflows/ci.yml. pnpm cadence ci reproduces the whole workflow; each check can also be reproduced on its own with the command in the last column.

Failing job or stepUsual causeReproduce and fix locally
Workflow Action Pinning & Actionlint GateAction not pinned, persisted checkout creds, unscoped permissions, or actionlint YAML errorpnpm cadence check workflow-security, pnpm cadence check yaml, actionlint, or pnpm cadence ci --job actionlint
Lint and Static › Build frontend workspaceVite or Rollup build failure in packages/ui, apps/web or apps/subject-portalpnpm build
Lint and Static › Run frontend style and lintESLint or Prettier findings in apps/web, apps/subject-portal or packages/uipnpm format and pnpm -r lint
Lint and Static › Validate web API clientsStale generated OpenAPI TypeScript types or web client type errorpnpm --filter web run generate:api and pnpm cadence check api-clients
Lint and Static › Run Hadolint or ShellCheckDockerfile or shell script findingsfind docker -type f -name "Dockerfile*" -exec hadolint --failure-threshold error {} +, shellcheck <script>
Lint and Static › Run installer checksum testsSHA-256 verification regression in setup_dotnet_env.sh or setup_dotnet_wizard.shbash tests/test_installer_checksums.sh
.NET Quality › Run Cadence quality sentinelsA quality gate (dotnet-format, workflow-security, rulesets, openapi, adrs, etc.) failedpnpm cadence check <gate> (for formatting: dotnet format Cadence.sln, for workflow security: pnpm cadence check workflow-security, for rulesets: pnpm cadence check rulesets and pnpm cadence rulesets --dry-run, for OpenAPI: pnpm cadence sync-openapi-spec && pnpm cadence generate-api-docs, for ADRs: pnpm cadence scaffold adr "<title>")
.NET Quality › Run architecture testsA layer dependency rule was brokendotnet test tests/Cadence.ArchitectureTests/Cadence.ArchitectureTests.csproj
Native AOT Compilation › Publish the CLI as Native AOTThe CLI, or code it calls, raised a trim or AOT warning (IL2xxx/IL3xxx)dotnet publish packages/cli/src/Cadence.Cli.csproj -c Release -r linux-x64; fix the call, never add NoWarn
Documentation CompilationBroken Markdown link, VitePress/demo build error, or public-bundle violation in dist/pnpm --filter ui build && CADENCE_DOCS_SKIP_CHECKS=1 pnpm docs:build && pnpm docs:stage-demos && pnpm cadence check public-bundle and pnpm cadence check markdown
Container Build & Vulnerability ScanBroken Dockerfile build or fixable CRITICAL/HIGH OS or library CVEdocker build -t cadence-gateway:latest -f docker/Dockerfile.dotnet --build-arg APP_NAME=gateway . and trivy image --exit-code 1 --ignore-unfixed --pkg-types os,library --severity CRITICAL,HIGH cadence-gateway:latest
Security › Run dependency auditA vulnerable NuGet, pnpm or Python package, an un-restored Cadence.sln, or missing pip-auditRun dotnet restore Cadence.sln and ./scripts/setup_wizard.sh --minimal (or python3 -m venv .cadence/venv && .cadence/venv/bin/python -m pip install --upgrade pip detect-secrets==1.5.0 pip-audit==2.10.1), then pnpm cadence check vulnerabilities; upgrade in Directory.Packages.props, package.json or pnpm-workspace.yaml
Frontend Unit TestsA workspace or VitePress navigation Vitest failurepnpm test (pnpm -r test && pnpm exec vitest run --config vitest.config.mjs)
.NET 10 C# xUnit VerificationA build warning, xUnit failure, missing TRX or skipped PostgreSQL testdotnet build Cadence.sln, dotnet test Cadence.sln, and bash scripts/check-database-test-results.sh
Parallel E2E Accessibility › Playwright E2E SuitesSubject Portal or Web accessibility/workflow E2E failurepnpm --filter subject-portal test:e2e and pnpm --filter web exec playwright test --project=accessibility
Parallel E2E Accessibility › Browser-to-Database TestBrowser observation correction failed against PostgreSQL 18CADENCE_TEST_POSTGRES=<conn> CADENCE_TEST_BROWSER=1 dotnet test tests/Cadence.IntegrationTests/Cadence.IntegrationTests.csproj --filter FullyQualifiedName~BrowserCorrectionReachesTheDatabaseWithItsReason
GxP Compliance › Generate Compliance ReportsAn unknown requirement ID, a failing tagged test or a skipped database testpnpm cadence gxp sync (or --results-dir TestResults/gxp) with PostgreSQL; fix the tag or test
GxP Compliance › Check GxP Snapshot PolicyThe branch changed the generated RTM, IQ/OQ/PQ report or docs/SDLC/runs/git checkout origin/main -- docs/SDLC/Requirements_Traceability_Matrix.md docs/SDLC/IQ_OQ_PQ_Execution_Report.md docs/SDLC/runs; never commit them on a feature branch
CI GateOne of the upstream pull-request validation jobs failed, cancelled, or skippedReproduce the failing upstream job above, and run pnpm cadence check rulesets to verify CI Gate upstream job coverage and ruleset parity
Check for Merge ConflictsThe PR conflicts with its base branch (main or release/*)git merge origin/main (or the target release/* branch) and resolve