Status: Accepted
Version: 1.0
Date: 2026-01-15
Related ADRs: ADR-004, ADR-006
Related PRDs: PRD-006, PRD-007, PRD-008
SHACL shapes exist for the Knowledge Graph, but runtime enforcement is inconsistent, fail-open in key paths, and not versioned. This creates silent data quality drift and makes safe rollouts difficult.
Adopt a fail-closed, context-aware SHACL enforcement policy with a single configuration source of truth and versioned shape loading:
SHACL_ENFORCEMENT_ENABLED (default: true)SHACL_ENFORCEMENT_CONTEXTS (CSV, empty = all)SHACL_MAINTENANCE_MODE (default: false)SHACL_SHAPES_VERSION (default: v1)ValidationResult type and only raise ShaclValidationError when enforcement is enabled, the context is active, and maintenance mode is false.sea-shapes.vN.shacl) with fallback to sea-shapes.shacl.ontologies/shared/core.shacl and are imported via owl:imports.sea:requiresContext and surfaced in diagnostics.Fail-closed enforcement prevents data corruption, while context scoping and maintenance mode allow safe rollout and emergency operations. Versioned shapes enable compatibility management and impact analysis across releases.