{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-memory-relationship-proposal-schema.json",
  "title": "MemoryRelationshipProposal",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-openapi.yaml#/components/schemas/MemoryRelationshipProposal",
  "type": "object",
  "properties": {
    "views": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "canonical_id": {
            "type": [
              "string",
              "null"
            ],
            "x-go-type-skip-optional-pointer": false
          },
          "fingerprint": {
            "type": "string"
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resource": {
                  "type": "object",
                  "properties": {
                    "database": {
                      "type": "string"
                    },
                    "namespace": {
                      "type": "string"
                    },
                    "table": {
                      "type": "string"
                    },
                    "table_id": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 18446744073709551615,
                      "format": "uint64",
                      "x-go-type": "uint64"
                    },
                    "storage_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "x-go-type-skip-optional-pointer": false
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "table",
                        "record",
                        "relationship",
                        "trace",
                        "evidence",
                        "assertion",
                        "entity",
                        "outcome",
                        "decision",
                        "operation",
                        "configuration"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 18446744073709551615,
                      "format": "uint64",
                      "x-go-type": "uint64"
                    },
                    "digest": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "x-go-type-skip-optional-pointer": false
                    }
                  },
                  "required": [
                    "table",
                    "table_id",
                    "kind",
                    "id",
                    "revision"
                  ],
                  "additionalProperties": false
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "span": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "start": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 4294967295,
                            "format": "uint32",
                            "x-go-type": "uint32"
                          },
                          "end": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 4294967295,
                            "format": "uint32",
                            "x-go-type": "uint32"
                          }
                        },
                        "required": [
                          "start",
                          "end"
                        ],
                        "additionalProperties": false,
                        "default": null
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "resource",
                "evidence"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "canonical_id",
          "fingerprint",
          "dependencies"
        ],
        "additionalProperties": false
      },
      "default": null
    },
    "id": {
      "type": "string"
    },
    "assertion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "predicate": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "statement": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "semantic",
            "episodic",
            "procedural",
            "decision",
            "rationale",
            "preference",
            "lesson",
            "constraint",
            "open_question",
            "alternative",
            "summary"
          ],
          "default": "semantic",
          "x-go-type-skip-optional-pointer": false
        },
        "scope": {
          "type": "string"
        },
        "task": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "x-go-type-skip-optional-pointer": false
        },
        "environment": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "x-go-type-skip-optional-pointer": false
        },
        "role": {
          "type": "string",
          "enum": [
            "reported",
            "observed",
            "inferred",
            "hypothesized"
          ],
          "default": "reported",
          "x-go-type-skip-optional-pointer": false
        },
        "modality": {
          "type": "string",
          "enum": [
            "actual",
            "planned",
            "desired",
            "conditional",
            "hypothetical"
          ],
          "default": "actual",
          "x-go-type-skip-optional-pointer": false
        },
        "stability": {
          "type": "string",
          "enum": [
            "provisional",
            "settled"
          ],
          "default": "settled",
          "x-go-type-skip-optional-pointer": false
        },
        "valid_from": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": -9223372036854775808,
          "maximum": 9223372036854775807,
          "format": "int64",
          "x-go-type": "int64",
          "default": null,
          "x-go-type-skip-optional-pointer": false
        },
        "valid_to": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": -9223372036854775808,
          "maximum": 9223372036854775807,
          "format": "int64",
          "x-go-type": "int64",
          "default": null,
          "x-go-type-skip-optional-pointer": false
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "span": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "start": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4294967295,
                    "format": "uint32",
                    "x-go-type": "uint32"
                  },
                  "end": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4294967295,
                    "format": "uint32",
                    "x-go-type": "uint32"
                  }
                },
                "required": [
                  "start",
                  "end"
                ],
                "additionalProperties": false,
                "default": null
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          }
        },
        "depends_on": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "support_sets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "evidence": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "span": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "start": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 4294967295,
                          "format": "uint32",
                          "x-go-type": "uint32"
                        },
                        "end": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 4294967295,
                          "format": "uint32",
                          "x-go-type": "uint32"
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ],
                      "additionalProperties": false,
                      "default": null
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              },
              "depends_on": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "evidence"
            ],
            "additionalProperties": false
          }
        },
        "supersedes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "motivates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rejected_in_favor_of": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "preconditions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expected_outcome": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "x-go-type-skip-optional-pointer": false
        },
        "producer": {
          "type": "string"
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "team"
          ],
          "default": "private",
          "x-go-type-skip-optional-pointer": false
        },
        "embedding": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "number",
            "format": "float"
          },
          "default": null
        },
        "embedding_model": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "provider": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "revision": {
              "type": "string"
            },
            "dimensions": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "maximum": 4294967295,
              "format": "uint32",
              "x-go-type": "uint32",
              "default": null,
              "x-go-type-skip-optional-pointer": false
            }
          },
          "required": [
            "provider",
            "model",
            "revision"
          ],
          "additionalProperties": false,
          "default": null
        },
        "reconciliation_reason": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "required": [
        "id",
        "subject",
        "predicate",
        "value",
        "statement",
        "evidence"
      ],
      "additionalProperties": false
    },
    "owner": {
      "type": "string"
    },
    "actor": {
      "type": "string"
    },
    "config_generation": {
      "type": "integer",
      "minimum": 0,
      "maximum": 18446744073709551615,
      "format": "uint64",
      "x-go-type": "uint64"
    },
    "revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 18446744073709551615,
      "format": "uint64",
      "x-go-type": "uint64"
    },
    "recorded_at": {
      "type": "integer",
      "minimum": -9223372036854775808,
      "maximum": 9223372036854775807,
      "format": "int64",
      "x-go-type": "int64"
    },
    "state": {
      "type": "string",
      "enum": [
        "open",
        "accepted",
        "rejected"
      ],
      "default": "open",
      "x-go-type-skip-optional-pointer": false
    },
    "verdict_actor": {
      "type": "string"
    },
    "verdict_principal": {
      "type": "string"
    },
    "verdict_revision": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 18446744073709551615,
      "format": "uint64",
      "x-go-type": "uint64",
      "default": null,
      "x-go-type-skip-optional-pointer": false
    },
    "model": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "revision": {
          "type": "string"
        },
        "dimensions": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 4294967295,
          "format": "uint32",
          "x-go-type": "uint32",
          "default": null,
          "x-go-type-skip-optional-pointer": false
        }
      },
      "required": [
        "provider",
        "model",
        "revision"
      ],
      "additionalProperties": false,
      "default": null
    },
    "verdict_evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "span": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0,
                "maximum": 4294967295,
                "format": "uint32",
                "x-go-type": "uint32"
              },
              "end": {
                "type": "integer",
                "minimum": 0,
                "maximum": 4294967295,
                "format": "uint32",
                "x-go-type": "uint32"
              }
            },
            "required": [
              "start",
              "end"
            ],
            "additionalProperties": false,
            "default": null
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      }
    },
    "reason": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "assertion",
    "owner",
    "actor",
    "config_generation",
    "revision",
    "recorded_at"
  ],
  "additionalProperties": false
}