Document Service — Service Readiness
Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · DEFINITION_OF_DONE.md
1. Readiness Gate Checklist
Documentation
- All 17 docs complete (not stubs)
-
SERVICE_OVERVIEW.mdreviewed by tech lead -
API_CONTRACTS.mdreviewed; OpenAPI spec generated -
SECURITY_MODEL.mdreviewed by security team -
MIGRATION_PLAN.mdapproved by platform team
Code Quality
- TypeScript strict mode, zero errors
- ESLint: domain layer import restrictions pass
-
synchronize: falsein ORM config - All env vars validated via Zod at startup
- No hardcoded secrets or object storage credentials
Tests
- Unit test coverage ≥ 80 % (statement + branch)
-
test/integration/tenant-isolation.spec.ts— all scenarios pass -
test/integration/outbox.spec.ts— all scenarios pass -
test/integration/inbox.spec.ts— all scenarios pass - Pact consumer contracts green against Pact broker (FHIR gateway + config-service)
- Event schema conformance tests green for all 9 event types
- PDF contract tests: General Test Requisition golden hash match
- Performance test: sync generation p95 < 5 s at 10 rps
Security
- Virus scan integration verified (EICAR test file quarantined)
- Platform template immutability enforced (403 on edit attempt)
- Tenant isolation confirmed: zero cross-tenant document access
- Presigned URL TTL enforced (expired URL returns 403)
- No PHI in AI prompt payloads (review AI-DOC-01/02/03)
Observability
- OpenTelemetry traces visible in Grafana/Tempo for staging
- SLO alerts configured with runbooks
- Dashboard: Document Service Overview live in Grafana
- Dashboard: Render Job Queue live in Grafana
Deployment
- Docker images (API + render worker) built and pushed to registry
- Helm charts / K8s manifests reviewed
- Health check endpoints verified
- MinIO bucket creation automated in deployment scripts
- Canary deploy (5 % / 30 min) completed in staging
- Rollback procedure verified
- On-call rotation assigned
Migrations
- Database migrations applied to staging without errors
- Platform reference template seed verified in staging
- Rollback migration tested
Sign-off
| Role | Name | Date |
|---|---|---|
| Tech Lead | TBD | — |
| SRE | TBD | — |
| Security | TBD | — |
| Clinical Informatics | TBD | — |