EvidenceLocker EU Regulatory Persistence

EvidenceLocker owns the durable persistence substrate for EU regulatory artifacts. CRA, NIS2, DORA, RoI, TLPT, and standards-mapping producers should write audit events, retention metadata, and artifact ledger rows here instead of creating module-local regulatory tables.

Contracts

Persistence

The embedded baseline 001_v1_evidencelocker_baseline.sql (line 439 onward; folded in from the pre-1.0 007_regulatory_audit_retention_ledger.sql, now archived and not embedded) creates:

The same migration adds optional regulatory retention/ledger reference columns to evidence_bundles and decision_capsules. The reference columns are indexes only; canonical replay remains driven by the dedicated EU tables.

All three EU tables are tenant scoped and protected by row-level security using app.current_tenant, matching existing EvidenceLocker tables. Startup convergence is handled by the EvidenceLocker embedded migration runner. Migration 019_regulatory_retention_horizon.sql adds the persisted created_at + retention_years horizon check for new and updated retention rows. It is deliberately NOT VALID, so historical rows remain an explicit operator audit before the constraint is validated.

Runtime API

IRegulatoryEvidenceRepository is the local persistence boundary. EvidenceLocker exposes the source-owned HTTP read API GET /api/v1/regulatory/artifact-ledger for downstream services and CLIs. Graph and other consumers must call that API or a typed client over it rather than reaching into these tables directly. The current repository supports:

NIS2 control-register snapshots are projected from Policy as hash-only regulatory artifacts. The ledger stores nis2-control-register-snapshot and nis2-statement-of-applicability records with source refs back to the Policy snapshot/event ids and the EvidenceLocker bundle ref. Policy remains the source of truth for control entries, lifecycle events, and snapshot JSON.

Retention Rules

Privacy Boundary

Audit actor and approver fields must use opaque ids or service references. Human names, email addresses, credentials, and other sensitive details belong in classified properties, where canonicalization hashes Personal values and redacts Sensitive values before persistence.