AUTHORITATIVE LIMBFORGE MIGRATION CONTRACT ========================================== projects additions ------------------ oi_type TEXT NOT NULL DEFAULT 'none' CHECK oi_type IN ('none', 'dual_cone', 'legacy_abutment') validation ---------- osseointegration = 0 -> oi_type must be 'none' osseointegration = 1 -> oi_type must be 'dual_cone' or 'legacy_abutment' measurement_sessions table -------------------------- id TEXT PRIMARY KEY project_id TEXT NOT NULL status TEXT NOT NULL guide_version TEXT NOT NULL started_at TEXT NOT NULL completed_at TEXT created_at TEXT NOT NULL updated_at TEXT NOT NULL FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE design_forge_measurement_snapshots table ---------------------------------------- id TEXT PRIMARY KEY project_id TEXT NOT NULL session_id TEXT snapshot_json TEXT NOT NULL snapshot_sha256 TEXT NOT NULL created_at TEXT NOT NULL immutable INTEGER NOT NULL DEFAULT 1 FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE RESTRICT FOREIGN KEY(session_id) REFERENCES measurement_sessions(id) ON DELETE RESTRICT required behaviour ------------------ - Existing non-OI records migrate to oi_type='none'. - OI projects cannot save without a valid OI type. - Snapshots are append-only and cannot be overwritten. - Measurement values remain editable until a Design Forge snapshot is created. - No Forge generation is authorised merely by creating a snapshot. - Existing project and measurement APIs remain backward compatible.