Apply canonical AI outputs through scoped identity-checked changes
This commit is contained in:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user