From 28798a3ef644b6033efcf619745e4742d8b90383 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Sun, 21 Jun 2026 12:40:43 +0200 Subject: [PATCH] feat(controls): control_pendants table - license-pendant mapping Maps self-written controls to commercially-usable source controls expressing the same obligation (Phase-2 reconcile, embedding-kNN + Haiku 2026-06-15). Additive, idempotent. Salvaged from uncommitted WIP. [migration-approved] Co-Authored-By: Claude Opus 4.7 --- .../migrations/154_control_pendants.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backend-compliance/migrations/154_control_pendants.sql diff --git a/backend-compliance/migrations/154_control_pendants.sql b/backend-compliance/migrations/154_control_pendants.sql new file mode 100644 index 00000000..01a56671 --- /dev/null +++ b/backend-compliance/migrations/154_control_pendants.sql @@ -0,0 +1,18 @@ +-- Migration 154: control_pendants — self-written (license_rule=3) -> sourced +-- (license_rule 1/2) Pendant-Mapping aus dem Phase-2-Reconcile (Embedding-kNN + +-- Haiku-Adjudikation, 2026-06-15). Ein hier gelistetes self-written Atom hat ein +-- kommerziell nutzbares Quell-Control, das DIESELBE Pflicht ausdrueckt -> das +-- Retrieval soll das lizenzierte Quell-Control bevorzugen. Additiv, idempotent. +-- [migration-approved] +SET search_path TO compliance, public; + +CREATE TABLE IF NOT EXISTS control_pendants ( + control_uuid uuid PRIMARY KEY, + pendant_control_uuid uuid NOT NULL, + cosine numeric, + method varchar(40) NOT NULL DEFAULT 'embed_haiku', + created_at timestamptz NOT NULL DEFAULT now() +); + +CREATE INDEX IF NOT EXISTS idx_control_pendants_pendant + ON control_pendants (pendant_control_uuid);