Appearance
ADR-2643: Wire Web CTMS, Study Training, and eTMF Workspaces With Signed Completeness Webhooks
- Status: Accepted
- Date: 2026-11-20
- Authors: @fderuiter
- Deciders: @fderuiter
- Requirements: PRD-SSU-001, PRD-SSU-002, PRD-SSU-003, PRD-CTMS-001, PRD-ETMF-001, UX-9
1. Context & Problem Statement
While the .NET microservices for CTMS (apps/ctms), Study Training & Delegations (apps/knowledge), and eTMF (apps/etmf) already serve OpenAPI-specified GxP endpoints and YARP gateway routes, operational web workspaces remained partially disconnected:
ServiceTopology.csmarkedctms,knowledge, andetmfasCore: false, excluding them from default AppHost / Compose core boot profiles, andgenerate-api-types.jsdid not emit typed TypeScript OpenAPI clients forctmsandetmf.SsuGreenlightConsole.vueused rawfetch()calls, synthesized fallback greenlight matrices andhmac_sha256_token_strings on HTTP errors (violatingUX-9anddocs/ux/CLINICAL_CANVAS.md§6.1), and targeted an unmounted document upload path instead of eTMF QC staging.EtmfIntelligenceEndpoints.cstransitioned staged documents through clinical QC (POST /api/v1/etmf/intelligence/qc-review/{doc_id}), but did not forward signed site document completeness snapshots to Execution (POST /api/v1/execution/webhooks/etmf), leaving unseeded sites such asSITE-102blocked at site activation even after essential documents were approved.CtmsView.vuegated live milestones, monitoring visits, compiled visit letters, and DoA tabs behinddemoBuild, andStudyCanvasView.vuehid Start (documents,greenlight,training) and Conduct (milestones,monitoring) operational sections.
2. Decision Drivers & Constraints
- End-to-End GxP Integrity (
UX-9): Web views must never fabricate greenlight states, approval statuses, or cryptographic tokens in the browser; all mutations and evaluations must flow through authenticated OpenAPI clients withX-Change-Reasonand Part 11X-Sig-Tokenheaders (buildStepUpVerificationPayloadwithSEMANTIC_ACTIONS.CTMS_DOA_SIGN_OFFandctms.letter.compile). - Zero-Trust Service-to-Service Identity (ADR-2256): Completeness updates sent from eTMF to Execution must carry an HMAC-SHA256 forwarded-identity header signed as
PermissionMatrix.EtmfServiceRole(etmf_service) usingIClocktimestamps and preserving caller tenant scope (ADR-2548). - Strict Role Separation (
PermissionMatrix): Site activation (site_compliance:activate), greenlight certification (ctms_greenlight:certify), clinical QC transitions (etmf_document:transition_clinical_qc), CRA visit completion (ctms_monitoring_visit:update), supervisory visit sign-off (ctms_monitoring_visit:sign_off), and PI delegation sign-off must enforce role splits in both backend RBAC and disabled-control UI explanations. - Hide Unbacked Surfaces: Tabs and API calls without
.NETbackend routes (financials, CRA workload, recruitment, RTSM, training progress/quiz heartbeats) must stay uncalled and hidden outside demo builds.
3. Options Considered
Option 1: Promote ctms, knowledge, and etmf to Core Services, Generate OpenAPI Clients, and Publish Signed eTMF Completeness Webhooks (Selected)
- Overview: Mark
ctms,knowledge, andetmfasCore: trueinServiceTopology.cs; generatectms.ts,etmf.ts, andknowledge.tsviagenerate-api-types.js; wirectmsApi.ts,etmf.ts, andtraining.ts(protocol_versionquery parameter) into standalone routes and Clinical CanvasStart/Conductsections; addEtmfCompletenessWebhookPublisherinapps/etmfto compute site activation completeness against required startup artifacts (04.01.02,05.02.02,05.02.03,05.02.12) and POSTX-Cadence-Identity-signed payloads asetmf_serviceto Execution; and grantsponsor_dmetmf_document:transition_clinical_qcalongsidecraandadmininPermissionMatrix.csso sponsor startup leads can complete document QC through site activation. - Pros:
- ✅ Enables unseeded sites (
SITE-102) to progress from document staging and QC approval through greenlight certification, site activation, enrollment, milestones, monitoring visit findings, compiled PDF letters, and supervisory sign-off against live.NETservices. - ✅ Preserves zero-trust service authentication on
/api/v1/execution/webhooks/etmfand compile-time OpenAPI type safety across all three web clients. - ✅ Eliminates browser-synthesized greenlight matrices and tokens (
UX-9).
- ✅ Enables unseeded sites (
- Cons:
- ❌ Increases default core topology container count by three services in full-stack local runs.
Option 2: Poll eTMF Directly From Execution During Site Activation
- Overview: Have
Executionmake synchronous HTTP calls back toeTMFduringPOST /api/v1/execution/sites/{siteId}/activateinstead of receiving signed completeness webhooks. - Pros:
- ✅ Avoids outbound webhook publishing in
apps/etmf.
- ✅ Avoids outbound webhook publishing in
- Cons:
- ❌ Introduces synchronous runtime coupling from Execution to eTMF and bypasses Execution's existing audited
SiteDocumentCompletenessledger and/api/v1/execution/webhooks/etmfcontract.
- ❌ Introduces synchronous runtime coupling from Execution to eTMF and bypasses Execution's existing audited
4. Decision Outcome
- Chosen Option: Option 1
- Justification: Promoting the three operational services to core topology, generating typed OpenAPI clients, and publishing
etmf_service-signed completeness webhooks reuses Execution's existing compliance ledger and zero-trust identity verification while eliminating all synthetic browser fallbacks.
5. Consequences & Trade-offs
- Positive Impact: Full startup-to-conduct clinical operations work end-to-end against live
.NETservices with strict role gating and zero unmounted API calls outside demo mode. - Negative Impact / Technical Debt: Investigator grant financials, CRA workload allocations, recruitment projections, and RTSM inventory remain hidden outside demo builds until their
.NETendpoints land (#4829). - Mitigation Strategy:
docs/web/API_MIGRATION.md,availability.js, andlifecycle.tsexplicitly scope live vs demo-only surfaces and enforce contract parity in automated tests.
6. Implementation & Verification
- Affected Repositories / Services:
packages/topology,packages/security,apps/apphost,apps/etmf,apps/web,docker/docker-compose.yml,docs/web/API_MIGRATION.md,tests/Cadence.UnitTests. - Verification Plan: Verified via
EtmfCompletenessWebhookTests,AppHostModelTests,pnpm --filter web run generate:api -- --check, Vitest suites across CTMS/SSU/Training/eTMF/Canvas, Playwright E2E suites, andpnpm cadence check.