{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arkova-ai/json-schema/arkova-ai-agent-log-anchor-receipt-with-statements-schema.json",
  "title": "AgentLogAnchorReceiptWithStatements",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arkova-ai-openapi.json#/components/schemas/AgentLogAnchorReceiptWithStatements",
  "type": "object",
  "required": [
    "subject_type",
    "subject_id",
    "log_day",
    "subject_root",
    "leaf_count",
    "first_seq",
    "last_seq",
    "first_prev_hash",
    "chain_head_hash",
    "org_leaf",
    "org_leaf_index",
    "org_proof",
    "org_root",
    "anchor_public_id",
    "seal_status",
    "secured_at",
    "schema",
    "organization",
    "org_leaf_count",
    "org_leaves",
    "seal",
    "anchor",
    "measured",
    "asserted",
    "not_asserted"
  ],
  "properties": {
    "subject_type": {
      "type": "string",
      "enum": [
        "agent"
      ]
    },
    "subject_id": {
      "type": "string",
      "format": "uuid",
      "description": "The agent id."
    },
    "log_day": {
      "type": "string",
      "format": "date"
    },
    "subject_root": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "leaf_count": {
      "type": "integer",
      "minimum": 1
    },
    "first_seq": {
      "type": "integer",
      "minimum": 1
    },
    "last_seq": {
      "type": "integer",
      "minimum": 1
    },
    "first_prev_hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "chain_head_hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "org_leaf": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "org_leaf_index": {
      "type": "integer",
      "minimum": 0
    },
    "org_proof": {
      "type": "array",
      "description": "The branch from this agent's leaf to org_root, one sibling per level.",
      "items": {
        "type": "object",
        "required": [
          "hash",
          "position"
        ],
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "position": {
            "type": "string",
            "enum": [
              "left",
              "right"
            ]
          }
        }
      }
    },
    "org_root": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$"
    },
    "anchor_public_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public id of the anchor carrying org_root. Null until the day has been submitted."
    },
    "seal_status": {
      "type": "string",
      "enum": [
        "sealing",
        "sealed",
        "submitted",
        "deferred",
        "secured",
        "empty"
      ]
    },
    "secured_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "schema": {
      "type": "string",
      "enum": [
        "arkova.action_log_receipt_bundle.v1"
      ]
    },
    "exported_at": {
      "type": "string",
      "format": "date-time",
      "description": "Informational; not covered by any fingerprint."
    },
    "organization": {
      "type": "object",
      "required": [
        "public_id"
      ],
      "description": "The organization's public id. Never an internal organization id.",
      "properties": {
        "public_id": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "org_leaf_count": {
      "type": "integer",
      "minimum": 1,
      "description": "How many subject leaves the day root covers; derived from org_leaves."
    },
    "org_leaves": {
      "type": "array",
      "minItems": 1,
      "description": "Every subject leaf of the day, as a commitment only: its position and its leaf, in leaf order (the (subject_type, subject_id) code-unit order the day root was built in). A sibling's subject type and id are never returned. The day root is the fold of these leaves in index order; this agent's own entry is org_leaf at org_leaf_index.",
      "items": {
        "type": "object",
        "required": [
          "index",
          "leaf"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "Position of the leaf in the day, from 0."
          },
          "leaf": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      }
    },
    "seal": {
      "type": "object",
      "required": [
        "status",
        "secured_at"
      ],
      "description": "Where the day stands. Informational: a verifier gates on the anchor, not on this.",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "sealing",
            "sealed",
            "submitted",
            "deferred",
            "secured",
            "empty"
          ]
        },
        "secured_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "anchor": {
      "type": [
        "object",
        "null"
      ],
      "description": "The anchor carrying org_root as the public verification API reports it. Null until the day is submitted.",
      "required": [
        "public_id",
        "fingerprint",
        "status",
        "network_observed_time"
      ],
      "properties": {
        "public_id": {
          "type": "string"
        },
        "fingerprint": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "status": {
          "type": "string"
        },
        "network_observed_time": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Network Observed Time; null while the anchor is not yet secured."
        },
        "proof_packet": {
          "type": "object",
          "description": "The packet GET /verify/{publicId}/proof returns for this anchor, plus merkle_index and leaf_count (the position and size of its batch, null when not known) at the top level. Absent while the record has no batch proof yet."
        }
      }
    },
    "subjects": {
      "type": "array",
      "minItems": 1,
      "description": "This agent's receipt with its rows for the day. Absent (see bundle_omitted) above ACTION_LOG_BUNDLE_MAX_ROWS rows.",
      "items": {
        "type": "object",
        "required": [
          "subject_type",
          "subject_id",
          "log_day",
          "subject_root",
          "leaf_count",
          "first_seq",
          "last_seq",
          "first_prev_hash",
          "chain_head_hash",
          "org_leaf",
          "org_leaf_index",
          "org_proof",
          "rows"
        ],
        "properties": {
          "subject_type": {
            "type": "string",
            "enum": [
              "agent"
            ]
          },
          "subject_id": {
            "type": "string",
            "format": "uuid",
            "description": "The agent id."
          },
          "log_day": {
            "type": "string",
            "format": "date"
          },
          "subject_root": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "leaf_count": {
            "type": "integer",
            "minimum": 1
          },
          "first_seq": {
            "type": "integer",
            "minimum": 1
          },
          "last_seq": {
            "type": "integer",
            "minimum": 1
          },
          "first_prev_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "chain_head_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "org_leaf": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "org_leaf_index": {
            "type": "integer",
            "minimum": 0
          },
          "org_proof": {
            "type": "array",
            "description": "The branch from this agent's leaf to org_root, one sibling per level.",
            "items": {
              "type": "object",
              "required": [
                "hash",
                "position"
              ],
              "properties": {
                "hash": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "position": {
                  "type": "string",
                  "enum": [
                    "left",
                    "right"
                  ]
                }
              }
            }
          },
          "rows": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "seq",
                "occurred_at_ms",
                "action",
                "payload_hash",
                "prev_hash",
                "row_hash"
              ],
              "properties": {
                "seq": {
                  "type": "integer",
                  "minimum": 1
                },
                "occurred_at_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Whole milliseconds since the epoch, UTC: the value the fingerprint covers."
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Display form of occurred_at_ms."
                },
                "action": {
                  "type": "string"
                },
                "payload_hash": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "prev_hash": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "row_hash": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "self_reported",
                    "arkova_observed"
                  ],
                  "description": "Informational: covered by no fingerprint."
                },
                "recorded_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Informational: covered by no fingerprint; only the UTC day is sealed."
                }
              }
            }
          },
          "previous_day": {
            "type": "object",
            "description": "The subject's receipt for its most recent sealed day before this one, so a bundle is self-continuous. Absent when there is none, and absent when that day does not link: its chain_head_hash must equal this receipt's first_prev_hash (a day that was never sealed in between breaks the link).",
            "required": [
              "log_day",
              "org_root",
              "anchor_public_id",
              "subject_root",
              "leaf_count",
              "chain_head_hash",
              "org_leaf_index",
              "org_proof"
            ],
            "properties": {
              "log_day": {
                "type": "string",
                "format": "date"
              },
              "org_root": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{64}$"
              },
              "anchor_public_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "subject_root": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "leaf_count": {
                "type": "integer",
                "minimum": 1
              },
              "chain_head_hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "org_leaf_index": {
                "type": "integer",
                "minimum": 0
              },
              "org_proof": {
                "type": "array",
                "description": "The branch from this agent's leaf to org_root, one sibling per level.",
                "items": {
                  "type": "object",
                  "required": [
                    "hash",
                    "position"
                  ],
                  "properties": {
                    "hash": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "position": {
                      "type": "string",
                      "enum": [
                        "left",
                        "right"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "bundle_omitted": {
      "type": "string",
      "description": "Present instead of subjects when the subject recorded more rows on the day than a bundle carries."
    },
    "previous_day": {
      "type": "object",
      "description": "The subject's receipt for its most recent sealed day before this one, so a bundle is self-continuous. Absent when there is none, and absent when that day does not link: its chain_head_hash must equal this receipt's first_prev_hash (a day that was never sealed in between breaks the link).",
      "required": [
        "log_day",
        "org_root",
        "anchor_public_id",
        "subject_root",
        "leaf_count",
        "chain_head_hash",
        "org_leaf_index",
        "org_proof"
      ],
      "properties": {
        "log_day": {
          "type": "string",
          "format": "date"
        },
        "org_root": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9a-f]{64}$"
        },
        "anchor_public_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "subject_root": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "leaf_count": {
          "type": "integer",
          "minimum": 1
        },
        "chain_head_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "org_leaf_index": {
          "type": "integer",
          "minimum": 0
        },
        "org_proof": {
          "type": "array",
          "description": "The branch from this agent's leaf to org_root, one sibling per level.",
          "items": {
            "type": "object",
            "required": [
              "hash",
              "position"
            ],
            "properties": {
              "hash": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "position": {
                "type": "string",
                "enum": [
                  "left",
                  "right"
                ]
              }
            }
          }
        }
      }
    },
    "statements": {
      "type": "object",
      "properties": {
        "measured": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What the receipt measures."
        },
        "asserted": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What is asserted by the submitter and not verified by Arkova."
        },
        "not_asserted": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What the receipt does NOT assert."
        }
      }
    },
    "measured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What the receipt measures."
    },
    "asserted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What is asserted by the submitter and not verified by Arkova."
    },
    "not_asserted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What the receipt does NOT assert."
    }
  }
}