From a734bf1a472b19d63341769d26a66628575df7f4 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Wed, 4 Feb 2026 01:07:14 +0000
Subject: Add chain checkpoint contracts

---
 .../migrations/20260204000000_checkpoint_validation.sql  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 makima/migrations/20260204000000_checkpoint_validation.sql

(limited to 'makima/migrations/20260204000000_checkpoint_validation.sql')

diff --git a/makima/migrations/20260204000000_checkpoint_validation.sql b/makima/migrations/20260204000000_checkpoint_validation.sql
new file mode 100644
index 0000000..debcfac
--- /dev/null
+++ b/makima/migrations/20260204000000_checkpoint_validation.sql
@@ -0,0 +1,16 @@
+-- Add validation configuration for checkpoint contracts
+-- Checkpoint contracts validate outputs of upstream dependencies before allowing downstream to proceed
+
+-- Add validation column to store checkpoint validation config as JSON
+ALTER TABLE chain_contract_definitions ADD COLUMN IF NOT EXISTS validation JSONB DEFAULT NULL;
+
+-- Add comment explaining the validation schema
+COMMENT ON COLUMN chain_contract_definitions.validation IS 'Validation config for checkpoint contracts: {checkDeliverables: bool, runTests: bool, checkContent: string, onFailure: "block"|"retry"|"warn", maxRetries: int}';
+
+-- Add validation_status to chain_contracts to track checkpoint pass/fail
+ALTER TABLE chain_contracts ADD COLUMN IF NOT EXISTS validation_status VARCHAR(32) DEFAULT NULL;
+COMMENT ON COLUMN chain_contracts.validation_status IS 'For checkpoint contracts: "pending", "passed", "failed"';
+
+-- Add validation_result to store detailed validation output
+ALTER TABLE chain_contracts ADD COLUMN IF NOT EXISTS validation_result JSONB DEFAULT NULL;
+COMMENT ON COLUMN chain_contracts.validation_result IS 'Detailed validation results from checkpoint contract';
-- 
cgit v1.2.3

