Appearance
ADR-2429: Unified GxP Traceability and Tooling Pipeline for .NET 10 Migration
Also known as: ADR-2235 (former number)
- Status: Accepted
- Date: 2026-09-02
- Authors: @fderuiter
- Deciders: @fderuiter
1. Context & Problem Statement
Cadence Clinical Research Software is executing a clean-break architectural transition to .NET 10 (C# 14 / ASP.NET Core 10) per ADR-2233 and ADR-2428. As documented in docs/MIGRATION_WORKFLOW.md, microservices are systematically transcribed using a 6-step SOP from Python 3.14+ to .NET 10.
However, a comprehensive infrastructure and workflow audit identified critical gaps across developer and CI pipelines:
- GxP Compliance & RTM Generation Gap:
scripts/generate_rtm.pyandscripts/sync_gxp.pyonly scan.pytest files with pytest, ignoring.cstest files ([GxPRequirement("...")],/// @req:...) and failing to ingest xUnit/TRX test execution results. As tests transition to .NET, the Requirements Traceability Matrix (docs/SDLC/Requirements_Traceability_Matrix.md) drops requirement coverage. - Git Hook Desynchronization:
.githooks/pre-commitandpre-commit.ps1enforcedotnet formatand ADR validation, butgit config core.hooksPathis not set by default. Meanwhile, the project's.pre-commit-config.yaml(installed viapnpm setup:dev/make setup) exclusively checks Python and frontend assets, allowing unformatted C# code to bypass local commit gates. - Developer CLI Packaging & Command Routing:
packages/cli/src/Program.cslacks execution implementations fortest,gxp sync,doctor, andcheck. Furthermore,Cadence.Cliis not registered in a.config/dotnet-tools.jsonlocal manifest, causing documenteddotnet cadencecommands to fail upon execution. - CI/CD Runtime Mismatch:
.github/workflows/ci.ymlsets up Python 3.12, which triggers an immediate fatal failure inscripts/runtime_guard.py(which requires Python 3.14+) when runningscripts/sync_gxp.py. - Docker Compose Environment:
docker/Dockerfile.dotnetexists, butdocker/docker-compose.ymllacks a correspondingdotnetprofile service.
2. Decision Drivers & Constraints
- 21 CFR Part 11 Regulatory Continuity (PRD-SYS-053): Requirements Traceability Matrix (RTM) generation must reflect both legacy Python tests and new .NET 10 xUnit tests simultaneously throughout the phased migration without coverage drops.
- Deterministic Developer Experience: A single command invocation (
dotnet cadence/pnpm sync-gxp) must work identically on Windows and POSIX developer environments. - Zero Commit Drift: C# code style (
.editorconfig), Roslyn analyzer rules, and ADR validation must be enforced on every commit. - CI/CD Hermeticity: GitHub Actions CI workflows must execute against compliant Python 3.14+ and .NET 10 runtimes without environment failures.
3. Options Considered
Option 1: Unified Dual-Stack Pipeline & Local Pre-Commit Integration (Selected)
- Extend
scripts/generate_rtm.pyandscripts/sync_gxp.pyto scan.csfiles for[GxPRequirement("...")]and/// @req:...docstrings, merging xUnit test results (.trx/ JUnit XML) with pytestreport.xml. - Integrate
dotnet format Cadence.sln --verify-no-changesdirectly into.pre-commit-config.yamlalongside existing Python linters. - Establish a
.config/dotnet-tools.jsonlocal tool manifest and complete the command dispatcher inCadence.Cli. - Update
.github/workflows/ci.ymlto Python 3.14+ and expand PR triggers. - Add the
dotnetservice profile indocker/docker-compose.yml.
- Pros:
- ✅ Addresses requirements
- Cons:
- ❌ Trade-offs accepted
Option 2: Split Python and .NET Pipelines (Rejected)
- Build completely isolated CLI and RTM reporting tools in .NET (
dotnet cadence gxp sync) that generate separate documentation files from the Python pipeline. - Trade-off: Fractures SDLC audit documentation into dual disparate reports, violating 21 CFR Part 11 unified validation ledger standards.
- Pros:
- ✅ Addresses requirements
- Cons:
- ❌ Trade-offs accepted
4. Decision Outcome
Chosen Option: Option 1 (Unified Dual-Stack Pipeline & Local Pre-Commit Integration).
Concrete Implementation Blueprint
Dual-Stack GxP Traceability (
scripts/generate_rtm.py&scripts/sync_gxp.py):- Update
scan_tests()ingenerate_rtm.pyto traverse.csfiles acrosstests/,apps/, andpackages/, extracting requirement tags from[GxPRequirement("...")]attributes and/// @req:...XML doc comments. - Update
parse_test_results()to parse.trx(Visual Studio / xUnit TRX format) as well as JUnit XML test outputs. - Update
step_run_tests()insync_gxp.pyto executedotnet test Cadence.sln --logger "trx;LogFileName=test_results.trx"in addition topytest.
- Update
Pre-Commit Hook Consolidation (
.pre-commit-config.yaml):- Add a local pre-commit hook executing
dotnet format Cadence.sln --verify-no-changes. - Add ADR and architecture sentinels so that any
git commitautomatically validates C# style and architectural rules.
- Add a local pre-commit hook executing
Developer CLI (
Cadence.Cli&.config/dotnet-tools.json):- Implement
Cadence.Clihandlers forcheck(running ArchUnitNET tests and dotnet format),doctor(verifying .NET 10 SDK, Postgres, Neo4j, Python runtime),gxp sync(delegating tosync_gxp.py), andtest(running xUnit suites). - Add local tool manifest
.config/dotnet-tools.json.
- Implement
CI/CD Workflow Alignment (
.github/workflows/ci.yml):- Update Python setup step:
python-version: "3.14". - Add
dotnet testwith TRX logger and diff verification against updated GxP docs. - Expand PR triggers to all branches targeting
main,master, anddotnet-migration.
- Update Python setup step:
Docker Compose Dev Profile (
docker/docker-compose.yml):- Define a
dotnet-devservice targetingdocker/Dockerfile.dotnetunderprofiles: ["dotnet"]to support containerized hot-reloading development.
- Define a
5. Consequences & Trade-offs
- Positive Impact:
- Complete, unbroken regulatory traceability across the entire migration lifespan.
- Local developers receive immediate feedback on C# formatting and ADR integrity prior to committing.
- Unified commands (
dotnet cadence/pnpm sync-gxp) maintain identical behavior across human and AI agents.
- Negative Impact & Liabilities:
- Requires maintaining regex/parsing logic for both Python docstrings and C# attributes in
generate_rtm.py.
- Requires maintaining regex/parsing logic for both Python docstrings and C# attributes in
- Mitigation:
- The C# parser uses clean, deterministic regular expressions matching the standardized
[GxPRequirement("...")]and/// @req:...syntax enforced by Roslyn Analyzers and pre-commit checks.
- The C# parser uses clean, deterministic regular expressions matching the standardized
6. Implementation & Verification
- Target files:
scripts/generate_rtm.py,scripts/sync_gxp.py.pre-commit-config.yamlpackages/cli/src/Program.cs,packages/cli/src/Cadence.Cli.csproj,.config/dotnet-tools.json.github/workflows/ci.ymldocker/docker-compose.yml
- Verification:
- Run
python scripts/validate_adrs.pyto ensure ADR index integrity. - Verify
generate_rtm.pyscanstests/Cadence.UnitTests/SecurityAndDomainTests.csand mapsPRD-SYS-053.
- Run