Apply canonical AI outputs through scoped identity-checked changes
Foundry Go checks / check (push) Successful in 2m56s
Foundry Go checks / check (pull_request) Successful in 2m47s

This commit is contained in:
2026-11-08 00:23:00 +08:00
parent 0d7fc4dbe5
commit fa76773efc
12 changed files with 771 additions and 66 deletions
+4 -1
View File
@@ -83,6 +83,9 @@ func loadCanvasModel(ctx context.Context, tx *sql.Tx, project, workspace, root s
// projection for internal AI readers, never the source of a canonical GET/replay.
func (s *service) saveCanvasModel(r *http.Request, tx *sql.Tx, project, workspace, account string, before, after canvasModel, participants map[string]bool) error {
ctx := r.Context()
if err := invalidateCanonicalAIIdentities(r, tx, project, workspace, before, after); err != nil {
return err
}
if _, err := tx.ExecContext(ctx, `SELECT set_config('foundry.canonical_writer','on',true)`); err != nil {
return err
}
@@ -249,7 +252,7 @@ func projectCanvasModel(model canvasModel) (map[string]json.RawMessage, error) {
}
for _, id := range elements {
element := model.Elements[id]
if element["structure"] != "connection" {
if element["structure"] != "connection" || element["componentId"] != "connection" || modelInt(element["dataVersion"]) != 1 {
continue
}
owner := modelString(element["ownerCanvasId"])