-- Cortex ADR anchors:
-- - docs/adr/0020-outcome-bound-salience.md
-- - docs/adr/0026-policy-engine-enforcement-lattice.md
-- - docs/design/PHASE_2_6_truth_vs_utility_separation_audit.md (D1 closure)
--
-- ADR 0020 §6 scoped-payload fields for outcome_memory_relations. The schema-v2
-- side table (003_schema_v2_expand) shipped the structural shape of the relation
-- edge but not the scoped-validation payload that ADR 0020 §4 requires before a
-- `Validated` edge may advance memories.validation_epoch / last_validation_at.
--
-- D1 closure (Phase 2.6 truth-vs-utility audit): `record_outcome_relation` now
-- composes a PolicyDecision whose contributor envelope binds these three
-- columns. The columns are nullable so legacy rows written before this
-- migration remain readable; new `Validated` writes MUST populate all three.
-- Non-validation relations (Used / Contradicted / Superseded / Rejected) leave
-- the columns NULL — they do not move the validation axis.

ALTER TABLE outcome_memory_relations ADD COLUMN validation_scope TEXT NULL
    CHECK (validation_scope IS NULL OR length(validation_scope) > 0);
ALTER TABLE outcome_memory_relations ADD COLUMN validating_principal_id TEXT NULL
    CHECK (validating_principal_id IS NULL OR length(validating_principal_id) > 0);
ALTER TABLE outcome_memory_relations ADD COLUMN evidence_ref TEXT NULL
    CHECK (evidence_ref IS NULL OR length(evidence_ref) > 0);
