Docs Index
governance service.md

Proof Card: Governance Service

Status: production Last verified: 2026-04-28 · git sha 562e3ab4

Claim

GovernanceService is the policy layer that wraps DLP scanning into the platform's authorization, audit, and SOC 2 disclosure surface. After Commit 2 (PR #589), the service no longer maintains its own PII pattern Map — detectPII() routes by input shape to DLPService.scanForPII(data) (objects) or DLPService.scanText(text) (strings), so PII detection has a single registry. The SOC 2 mapping endpoint (GET /api/compliance/soc2-mapping) returns Trust Services Criteria coverage with a machine-readable scope disclosure stating that audit log events persist to audit_logs and that audit details are redacted or omitted before persistence.

Source

Tests

Live vs Fixture

Known Gaps

Verification (60-second AI-reviewer recipe)

npm test -- tests/unit/services/ai/orchestrator/GovernanceService.commit2.test.ts
grep -n "scanForPII\|scanText\|@inject(TYPES.DLPService)" src/services/ai/orchestrator/GovernanceService.ts | head -10
grep -n "scopeDisclosure" src/routes/ComplianceRouter.ts
# Or hit the live endpoint after npm start:
# curl http://localhost:3003/api/compliance/soc2-mapping | jq '.data.scopeDisclosure'

The first grep proves the routing — both scanForPII and scanText are called, and DLPService is injected (no private pattern map). The second grep proves the SOC 2 honesty disclosure ships in the response (not just in docs).