Appearance
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
| Workflow | Runs on | What it does |
|---|---|---|
ci.yml | Pull requests and pushes to main, release/*, and v* tags | Style, 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.yml | Pull 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.yml | Called by ci.yml on pushes to main, release/*, and v* tags, or manual dispatch | Vulnerability 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.yml | Called by ci.yml on pushes to main (parallel to release-and-archive), or dispatch | Builds 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
- Workflow Action Pinning & Actionlint Gate (
actionlint): runsrhysd/actionlint(actionlintonPATHincadence ci) to enforce workflow YAML syntax, while the nativeworkflow-securitygate (run indotnet-quality, pre-commit, andpnpm 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 ondocker://references,persist-credentials: falseonactions/checkout, and least-privilege workflow permissions). - Lint and Static Verification (
lint-and-static): reuses thecadence-cli-${{ github.run_id }}-${{ github.run_attempt }}artifact fromnative-aot-build, installs the pnpm workspace and runspnpm build(compilingpackages/ui,apps/web, andapps/subject-portal), runs Prettier across all eligible repository files respecting.prettierignoreand ESLint across frontend packages, Hadolint on Dockerfiles, ShellCheck on*.shscripts,bash tests/test_installer_checksums.sh(verifying.NETinstaller SHA-256 checksum enforcement),check markdown, andcheck api-clients(ApiClientValidatorService, typechecking generated web OpenAPI types and clients). - .NET Quality & Sentinel Checks (
dotnet-quality): buildsCadence.sln, fetchesorigin "$BASE_REF"on pull requests, runscadence check --exclude prettier --exclude eslint --exclude actionlint --exclude hadolint --exclude detect-secrets --exclude api-clients --exclude vulnerabilities --exclude public-bundlewith--base "origin/$BASE_REF"on pull requests and--push-before "$BEFORE_SHA"on pushes (executing the remaining 31 gates once, includingdotnet-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, andduplication), runsCadence.ArchitectureTests(ArchUnitNET), and uploadsduplication_summary.json(duplication-summary-${{ github.run_id }}-${{ github.run_attempt }}). - Native AOT Compilation (
native-aot-build) and Documentation Compilation (docs-build):native-aot-buildcaches./bin/cadence, publishesCadence.Clias a Native AOTlinux-x64binary into./binon cache misses (failing on any trim or AOT warning), and uploads the run-scopedcadence-cli-${{ github.run_id }}-${{ github.run_attempt }}artifact reused bylint-and-static,docs-build,security, andcompliance;docs-buildbuildspackages/ui, compiles the documentation portal (pnpm docs:buildwithCADENCE_DOCS_SKIP_CHECKS=1and 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, andapps/subject-portal/dist) withnode scripts/run-cli.js check public-bundle. - Security and Vulnerability Audit (
security): static security audit (audit-security), fail-closed NuGet, pnpm and Python (pip-audit==2.10.1in an isolatedvenvafterdotnet restore Cadence.sln) vulnerability audit (check vulnerabilities), non-mutating secret baseline verification (check clean-secrets), fail-closedcheck detect-secrets(detect-secrets==1.5.0in an isolatedvenv) andcheck deid, both scoped inCadence.Cli(GitRevisionScopeService) via--base "origin/$BASE_REF"on pull requests and--push-before "$BEFORE_SHA"on pushes (falling back to every tracked file viagit ls-files -zwhenHEADequals the base ref or whenBEFORE_SHAis all zeros, a tag, or a non-ancestor). - Container Build & Vulnerability Scan (
container-security): buildsgateway,kernel-api,sce-pythonandsce-racross a parallel matrix and runs fail-closed Trivy (CRITICAL,HIGH,--ignore-unfixed, exit code1) with distinct SARIF uploads (trivy-<target>) on pushes and on container or dependency pull requests. - .NET 10 C# xUnit Verification (
dotnet-tests):dotnet build(warnings are errors), thendotnet test Cadence.sln --configuration Release --no-build --results-directory TestResults/gxp --logger "trx;LogFilePrefix=gxp"(includingpackages/kernel/consumer-tests/Cadence.Kernel.ConsumerTests) withCADENCE_TEST_EVIDENCE_DIR=${{ github.workspace }}/TestResults/gxpagainst a PostgreSQL 18 service container pinned toPostgresTestImage.Image(CADENCE_TEST_POSTGRES). Diagnostic TRX reports and*.database.txtfixture metadata are uploaded unconditionally intrx-report-dotnet-${{ github.run_id }}-${{ github.run_attempt }}. Locally eitherCADENCE_TEST_POSTGRESorCADENCE_TEST_DOCKER=1works for every database fixture (TESTING.md), andcadence cirunsbash scripts/test-check-database-test-results.shand fails viaDatabaseTestEvidencewhen any integration or E2E test was skipped or did not execute, unless--allow-skipis given. In GitHub Actions,dotnet-testsrunsscripts/test-check-database-test-results.shandscripts/check-database-test-results.sh, verifying that bothtests/Cadence.IntegrationTestsandtests/Cadence.E2ETestsproduced TRX reports and*.database.txtmetadata inTestResults/gxpand failing on anyNotExecuteddatabase test except the opt-in lineage benchmark and browser correction check (DatabaseTestEvidence.OptInTests). Only after that gate passes doesdotnet-testsuploadTestResults/gxpasgxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }};test_outcomewaits on both the gate and evidence upload, blockingcomplianceand downstream release workflows on failure. - 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, coveringdocs/.vitepress/navigation.test.mjs). - Parallel E2E Accessibility Testing (
accessibility-e2e): runs on pull requests and pushes (main,release/*, andv*tags) and gatesci-gate(and transitivelyautomerge),release-and-archive, anddeploy-docs, executing Playwright accessibility E2E suites forsubject-portalandweb(failing closed with exit code1if Playwright browser installation fails three times), plusBrowserCorrectionReachesTheDatabaseWithItsReason(tests/Cadence.IntegrationTests) against PostgreSQL 18 withCADENCE_TEST_BROWSER=1. - GxP Compliance & Qualification Reporting (
compliance): downloads the verifiedgxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }}artifact (TRX reports and*.database.txtfixture evidence) fromdotnet-testsintoTestResults/gxp, thenGenerate Compliance Reportsrunsnode scripts/run-cli.js gxp sync --results-dir TestResults/gxp, which writes a preview of the RTM and IQ/OQ/PQ report toTestResults/gxp/preview/without re-runningdotnet testand fails on unknown requirement IDs, failing tagged tests, missing*.database.txtmetadata and skipped database tests; it writesdocs/SDLConly withCADENCE_GXP_SNAPSHOT=1.Check GxP Snapshot Policyrunsnode scripts/run-cli.js check gxp-snapshotwith--base "origin/$BASE_REF"on pull requests and--push-before "$BEFORE_SHA"on pushes, refusing changes to the committed RTM, IQ/OQ/PQ report ordocs/SDLC/runs/across feature branches and direct pushes tomainorrelease/*unlessCADENCE_GXP_SNAPSHOT=1(ADR-2532). WithCADENCE_GXP_SNAPSHOT=1it instead compares the regenerated documents with the snapshot (cadence gxp diff, which ignores the evidence block naming the tested revision, time, database and runner). - CI Gate (
ci-gate): runs withif: 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 oncontainer-securityfailure or cancellation while allowingcontainer-securityto skip on pull requests that touch no container or dependency inputs. - Classify Change (
classify, pull requests) and Enable Automerge (automerge, pull requests):classifylabels documentation-only pull requests (is_safe=true) and detects container/dependency changes (container_scan=true);automergewaits onclassify(is_safe == 'true') andci-gate(needs.ci-gate.result == 'success') before runninggh pr merge --auto --squashwithGITHUB_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:
| Gate | What it checks |
|---|---|
dotnet-format | Whitespace formatting against .editorconfig (dotnet format whitespace) |
dotnet-format-style | Roslyn code-style rules (dotnet format style) |
prettier | Prettier formatting across JS, TS, Vue, CSS, JSON, Markdown and YAML files |
eslint | ESLint and duplicate store identifier checks across JS, TS and Vue files |
actionlint | GitHub Actions workflow and composite-action static analysis via actionlint from .cadence/bin or PATH (fails closed when missing) |
hadolint | Dockerfile best-practice and syntax linting (hadolint --failure-threshold error) from .cadence/bin or PATH (fails closed when missing) |
yaml | YAML 1.2 syntax, indentation, quoted scalars, flow brackets and duplicate mapping keys |
trailing-whitespace | No trailing spaces or tabs at the end of lines in text files |
end-of-file | Non-empty UTF-8 text files end with a newline character |
clean-secrets | Verifies .secrets.baseline is valid, normalized JSON with the canonical exclusion filter without mutating it |
detect-secrets | Scans changed or tracked files against .secrets.baseline using detect-secrets-hook from .cadence/venv, PATH or uvx (fails closed when missing) |
duplication | Duplicated code blocks over 15 normalized lines involving a C# file |
cli-docs | docs/cli.md documents every command in Program.cs, and the gate tables in docs/cli.md and docs/CI.md match this registry |
adrs | ADR schema, docs/adr/index.md consistency, and an ADR for architectural changes |
arch-drift | docker/docker-compose.yml exists and declares services; services missing from the architecture docs are warnings |
sanitizer | Requirement tags in Markdown are upper case (@req:PRD-…); fixes them in normal mode and reports errors read-only during pre-commit |
markdown | Markdown structure, links, and paths into .NET test project folders (tests/Cadence.*) that no longer exist |
env-vars | Environment variables read in code are in .env.example and docs/ENVIRONMENT_VARIABLES.md |
dev-env | Service ports in docs/LOCAL_DEV_ENVIRONMENT.md match the gateway and the Aspire AppHost |
readmes | Each directory under apps/ and packages/ has a README with a title |
codeowners | Path pattern existence and owner handle syntax in .github/CODEOWNERS |
workflow-security | 40-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 |
rulesets | Branch and tag rulesets in .github/rulesets/*.json, strict status check policy, CI Gate upstream job coverage, and workflow check parity |
imports | No using of another service's namespace across apps/<service> |
security | Hard-coded secret patterns across source, Vue templates and build scripts (private keys, cloud keys, API tokens, compliance secrets) |
deid | PHI/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 |
openapi | docs/openapi matches what the .NET services serve, and docs/api matches docs/openapi |
api-clients | The web API types are generated from the current docs/openapi, and the web API clients typecheck against them |
schema-doc | docs/schema matches the EF Core models |
path-patterns | No tmp, temp, scratch or old_src directories, .vue files only under apps/, packages/ and docs/.vitepress/, .sh files only under scripts/ |
query-linter | No interpolated SQL string passed to FromSqlRaw or ExecuteSqlRaw, and no comparison with a boolean literal |
vulnerabilities | NuGet, pnpm and Python dependency vulnerabilities not exempted by a valid docs/SDLC/vulnerability_exclusions_ledger.json entry (fails closed on missing or broken scanners) |
dependencies | Valid JSON across workspace package.json and .config/dotnet-tools.json manifests, and no client-side crypto package (node-forge, elliptic, jose) |
doc-index | Every Markdown document under docs/ is listed in docs/DOCUMENTATION_INDEX.md |
demo-manifest | packages/demo-fixtures matches the canonical demo seed in DevelopmentDemoData.cs, ExecutionDbSeeder.cs and docker/cadence-realm.json |
rtm | Requirement tags name known requirements and sit on test methods, and the generated documents match their integrity stamps and are not drafts |
gxp-snapshot | The 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-ratchet | No 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-bundle | Zero-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 (
deidandsecurityon tracked source):DeidComplianceServicescans 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),.vuetemplates, andstores/(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.vuetemplates andscripts/(such asscripts/build-docs.jsandscripts/stage-portal-demos.js), and.secrets.baseline(clean-secrets) does not excludedist/. - Layer 2 (
public-bundleon built static outputs):PublicBundleValidatorService(pnpm cadence check public-bundle/validate-public-bundle) scans every generated text file indocs/.vitepress/dist(including co-hosted/demo/and/subject-portal/subpaths),apps/web/dist, andapps/subject-portal/distwith zero comment or pragma exemptions (deid-ignore,deid: ignore, andpragma: allowlistare 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/permissiveContent-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-formatvalidates materialized staged C# and.editorconfigblobs, anddotnet-format-stylechecks staged C# files while failing closed ifdotnetis missing or unstaged edits overlap MSBuild inputs.prettierandeslintstream staged JS, TS, Vue, CSS, JSON, Markdown, and YAML blobs overstdin(and fail closed ifpnpmornode_modulesis missing).actionlintandhadolintvalidate materialized staged.github/workflows,.github/actions, andDockerfile*blobs using.cadence/binorPATH(failing closed when missing).workflow-security(alsoaction-pinning),yaml,trailing-whitespace,end-of-file,sanitizer(read-only error reporting on lowercase@req:prd-…tags), anddetect-secretsvalidate 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.baselinevia.cadence/venv,PATH, oruvx) without touching unstaged working-tree edits.schema-docruns the drift check when staged files include Entity Framework entities, migrations, configurations, ordocs/schema;openapiexports specs only for the services the staged C# files touch (both failing closed if unstaged edits overlap MSBuild/spec inputs);adrschecks staged files for architectural changes while accepting ADRs already added on the branch; andgxp-snapshotandbaseline-ratchetcheck the staged copies againstHEAD(baseline-ratchetadmits staged growth whenCADENCE_BASELINE_GROWTH="<reason>"is set, requiring a matchingBaseline-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 .githooksDon'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 step | Usual cause | Reproduce and fix locally |
|---|---|---|
| Workflow Action Pinning & Actionlint Gate | Action not pinned, persisted checkout creds, unscoped permissions, or actionlint YAML error | pnpm cadence check workflow-security, pnpm cadence check yaml, actionlint, or pnpm cadence ci --job actionlint |
| Lint and Static › Build frontend workspace | Vite or Rollup build failure in packages/ui, apps/web or apps/subject-portal | pnpm build |
| Lint and Static › Run frontend style and lint | ESLint or Prettier findings in apps/web, apps/subject-portal or packages/ui | pnpm format and pnpm -r lint |
| Lint and Static › Validate web API clients | Stale generated OpenAPI TypeScript types or web client type error | pnpm --filter web run generate:api and pnpm cadence check api-clients |
| Lint and Static › Run Hadolint or ShellCheck | Dockerfile or shell script findings | find docker -type f -name "Dockerfile*" -exec hadolint --failure-threshold error {} +, shellcheck <script> |
| Lint and Static › Run installer checksum tests | SHA-256 verification regression in setup_dotnet_env.sh or setup_dotnet_wizard.sh | bash tests/test_installer_checksums.sh |
| .NET Quality › Run Cadence quality sentinels | A quality gate (dotnet-format, workflow-security, rulesets, openapi, adrs, etc.) failed | pnpm 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 tests | A layer dependency rule was broken | dotnet test tests/Cadence.ArchitectureTests/Cadence.ArchitectureTests.csproj |
| Native AOT Compilation › Publish the CLI as Native AOT | The 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 Compilation | Broken 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 Scan | Broken Dockerfile build or fixable CRITICAL/HIGH OS or library CVE | docker 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 audit | A vulnerable NuGet, pnpm or Python package, an un-restored Cadence.sln, or missing pip-audit | Run 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 Tests | A workspace or VitePress navigation Vitest failure | pnpm test (pnpm -r test && pnpm exec vitest run --config vitest.config.mjs) |
| .NET 10 C# xUnit Verification | A build warning, xUnit failure, missing TRX or skipped PostgreSQL test | dotnet build Cadence.sln, dotnet test Cadence.sln, and bash scripts/check-database-test-results.sh |
| Parallel E2E Accessibility › Playwright E2E Suites | Subject Portal or Web accessibility/workflow E2E failure | pnpm --filter subject-portal test:e2e and pnpm --filter web exec playwright test --project=accessibility |
| Parallel E2E Accessibility › Browser-to-Database Test | Browser observation correction failed against PostgreSQL 18 | CADENCE_TEST_POSTGRES=<conn> CADENCE_TEST_BROWSER=1 dotnet test tests/Cadence.IntegrationTests/Cadence.IntegrationTests.csproj --filter FullyQualifiedName~BrowserCorrectionReachesTheDatabaseWithItsReason |
| GxP Compliance › Generate Compliance Reports | An unknown requirement ID, a failing tagged test or a skipped database test | pnpm cadence gxp sync (or --results-dir TestResults/gxp) with PostgreSQL; fix the tag or test |
| GxP Compliance › Check GxP Snapshot Policy | The 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 Gate | One of the upstream pull-request validation jobs failed, cancelled, or skipped | Reproduce the failing upstream job above, and run pnpm cadence check rulesets to verify CI Gate upstream job coverage and ruleset parity |
| Check for Merge Conflicts | The PR conflicts with its base branch (main or release/*) | git merge origin/main (or the target release/* branch) and resolve |