Resolve canonical AI targets at their current canvas owner
Foundry Go checks / check (push) Failing after 2m49s
Foundry Go checks / check (pull_request) Failing after 2m41s

This commit is contained in:
2026-11-08 01:16:28 +08:00
parent cdf48f1691
commit 56b6181598
12 changed files with 273 additions and 66 deletions
+9
View File
@@ -0,0 +1,9 @@
BEGIN;
-- The frozen board remains the plan origin; result versions belong to the board
-- that actually received the output after any owner-only move.
ALTER TABLE canvas_ai_steps ADD COLUMN applied_board_id uuid;
ALTER TABLE canvas_ai_steps ADD FOREIGN KEY(project,workspace_id,applied_board_id) REFERENCES materials(project,workspace_id,id);
UPDATE canvas_ai_steps SET applied_board_id=board_id WHERE applied_version IS NOT NULL;
CREATE UNIQUE INDEX canvas_ai_canonical_target_busy ON canvas_ai_steps(project,workspace_id,(frozen_input->>'canonical_root'),node_id,(frozen_input->>'target_incarnation'))
WHERE status IN('queued','running') AND frozen_input->>'canonical_root' IS NOT NULL;
COMMIT;