Decision Gate Docs

Avaluació de portes determinista, reproduïble amb decisions auditable.

Asset Core docs

escenari_inici

Crea un nou estat d’execució per a un escenari i opcionalment emet paquets d’entrada.

Notes clau

  • Requereix RunConfig (tenant_id, run_id, scenario_id, dispatch_targets).
  • Utilitzeu started_at per enregistrar la marca de temps d’inici proporcionada pel que truca.
  • Si issue_entry_packets és cert, els paquets d’entrada es revelen immediatament.
  • Tanca si run_id ja existeix o scenario_id és desconegut.

Inputs

  • issue_entry_packets (required): Emetre paquets d’entrada immediatament.
  • run_config (requerit): Configuració d’execució i objectius de despach.
  • scenario_id (required): Identificador de l’escenari.
  • started_at (requerit): Timestamp d’inici de la execució proporcionat pel cridant.

Input Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "issue_entry_packets": {
      "description": "Issue entry packets immediately.",
      "type": "boolean"
    },
    "run_config": {
      "additionalProperties": false,
      "description": "Run configuration and dispatch targets.",
      "properties": {
        "dispatch_targets": {
          "items": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "agent_id": {
                    "description": "Agent identifier.",
                    "type": "string"
                  },
                  "kind": {
                    "const": "agent"
                  }
                },
                "required": [
                  "kind",
                  "agent_id"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "session"
                  },
                  "session_id": {
                    "description": "Session identifier.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "session_id"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "external"
                  },
                  "system": {
                    "description": "External system name.",
                    "type": "string"
                  },
                  "target": {
                    "description": "External system target.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "system",
                  "target"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "channel": {
                    "description": "Broadcast channel identifier.",
                    "type": "string"
                  },
                  "kind": {
                    "const": "channel"
                  }
                },
                "required": [
                  "kind",
                  "channel"
                ],
                "type": "object"
              }
            ]
          },
          "type": "array"
        },
        "namespace_id": {
          "description": "Namespace identifier.",
          "minimum": 1,
          "type": "integer"
        },
        "policy_tags": {
          "description": "Policy tags applied to the run.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "run_id": {
          "description": "Run identifier.",
          "type": "string"
        },
        "scenario_id": {
          "description": "Scenario identifier.",
          "type": "string"
        },
        "tenant_id": {
          "description": "Tenant identifier.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "tenant_id",
        "run_id",
        "scenario_id",
        "dispatch_targets",
        "policy_tags"
      ],
      "type": "object"
    },
    "scenario_id": {
      "description": "Scenario identifier.",
      "type": "string"
    },
    "started_at": {
      "description": "Caller-supplied run start timestamp.",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "unix_millis"
            },
            "value": {
              "type": "integer"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "logical"
            },
            "value": {
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "type": "object"
        }
      ]
    }
  },
  "required": [
    "scenario_id",
    "run_config",
    "started_at",
    "issue_entry_packets"
  ],
  "type": "object"
}

Sortides

  • current_stage_id (required): Identificador de l’etapa actual.
  • decisions (requerit): Tipus: array.
  • dispatch_targets (required): Tipus: array.
  • gate_evals (requerit): Tipus: array.
  • namespace_id (requerit): Identificador de l’espai de noms.
  • paquets (requerit): Tipus: array.
  • run_id (requerit): Identificador de la execució.
  • scenario_id (required): Identificador de l’escenari.
  • spec_hash (requerit): Tipus: object.
  • stage_entered_at (requerit): Una de les 2 variants d’esquema.
  • status (requerit): Tipus: string.
  • submissions (requerit): Tipus: array.
  • tenant_id (required): Identificador del llogater.
  • tool_calls (required): Tipus: array.
  • triggers (requerit): Tipus: array.

Esquema de sortida

{
  "additionalProperties": false,
  "properties": {
    "current_stage_id": {
      "description": "Current stage identifier.",
      "type": "string"
    },
    "decisions": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "correlation_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Correlation identifier.",
                "type": "string"
              }
            ]
          },
          "decided_at": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "unix_millis"
                  },
                  "value": {
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "logical"
                  },
                  "value": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              }
            ]
          },
          "decision_id": {
            "description": "Decision identifier.",
            "type": "string"
          },
          "outcome": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "start"
                  },
                  "stage_id": {
                    "description": "Initial stage identifier.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "stage_id"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "complete"
                  },
                  "stage_id": {
                    "description": "Terminal stage identifier.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "stage_id"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "from_stage": {
                    "description": "Previous stage identifier.",
                    "type": "string"
                  },
                  "kind": {
                    "const": "advance"
                  },
                  "timeout": {
                    "type": "boolean"
                  },
                  "to_stage": {
                    "description": "Next stage identifier.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "from_stage",
                  "to_stage",
                  "timeout"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "hold"
                  },
                  "summary": {
                    "additionalProperties": false,
                    "properties": {
                      "policy_tags": {
                        "description": "Policy tags applied to the summary.",
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "retry_hint": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "description": "Optional retry hint.",
                            "type": "string"
                          }
                        ]
                      },
                      "status": {
                        "description": "Summary status.",
                        "type": "string"
                      },
                      "unmet_gates": {
                        "items": {
                          "description": "Gate identifier.",
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "status",
                      "unmet_gates",
                      "retry_hint",
                      "policy_tags"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "kind",
                  "summary"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "fail"
                  },
                  "reason": {
                    "description": "Failure reason.",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "reason"
                ],
                "type": "object"
              }
            ]
          },
          "seq": {
            "minimum": 0,
            "type": "integer"
          },
          "stage_id": {
            "description": "Stage identifier.",
            "type": "string"
          },
          "trigger_id": {
            "description": "Trigger identifier.",
            "type": "string"
          }
        },
        "required": [
          "decision_id",
          "seq",
          "trigger_id",
          "stage_id",
          "decided_at",
          "outcome",
          "correlation_id"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "dispatch_targets": {
      "items": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "agent_id": {
                "description": "Agent identifier.",
                "type": "string"
              },
              "kind": {
                "const": "agent"
              }
            },
            "required": [
              "kind",
              "agent_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "session"
              },
              "session_id": {
                "description": "Session identifier.",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "session_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "external"
              },
              "system": {
                "description": "External system name.",
                "type": "string"
              },
              "target": {
                "description": "External system target.",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "system",
              "target"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "channel": {
                "description": "Broadcast channel identifier.",
                "type": "string"
              },
              "kind": {
                "const": "channel"
              }
            },
            "required": [
              "kind",
              "channel"
            ],
            "type": "object"
          }
        ]
      },
      "type": "array"
    },
    "gate_evals": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "evaluation": {
            "additionalProperties": false,
            "properties": {
              "gate_id": {
                "description": "Gate identifier.",
                "type": "string"
              },
              "status": {
                "description": "Tri-state evaluation result.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "trace": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "condition_id": {
                      "description": "Condition identifier.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Tri-state evaluation result.",
                      "enum": [
                        "True",
                        "False",
                        "Unknown"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "condition_id",
                    "status"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "gate_id",
              "status",
              "trace"
            ],
            "type": "object"
          },
          "evidence": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "condition_id": {
                  "description": "Condition identifier.",
                  "type": "string"
                },
                "result": {
                  "additionalProperties": false,
                  "properties": {
                    "content_type": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "description": "Evidence content type.",
                          "type": "string"
                        }
                      ]
                    },
                    "error": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "code": {
                              "description": "Stable error code.",
                              "type": "string"
                            },
                            "details": {
                              "oneOf": [
                                {
                                  "type": "null"
                                },
                                {
                                  "description": "Optional structured error details.",
                                  "type": [
                                    "null",
                                    "boolean",
                                    "number",
                                    "string",
                                    "array",
                                    "object"
                                  ]
                                }
                              ]
                            },
                            "message": {
                              "description": "Error message.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message",
                            "details"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "evidence_anchor": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "anchor_type": {
                              "description": "Anchor type identifier.",
                              "type": "string"
                            },
                            "anchor_value": {
                              "description": "Anchor value.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "anchor_type",
                            "anchor_value"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "evidence_hash": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "algorithm": {
                              "enum": [
                                "sha256"
                              ],
                              "type": "string"
                            },
                            "value": {
                              "description": "Lowercase hex digest.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "algorithm",
                            "value"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "evidence_ref": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "uri": {
                              "description": "Evidence reference URI.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "uri"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "lane": {
                      "description": "Trust lane classification for evidence.",
                      "enum": [
                        "verified",
                        "asserted"
                      ],
                      "type": "string"
                    },
                    "signature": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "additionalProperties": false,
                          "properties": {
                            "key_id": {
                              "description": "Signing key identifier.",
                              "type": "string"
                            },
                            "scheme": {
                              "description": "Signature scheme identifier.",
                              "type": "string"
                            },
                            "signature": {
                              "items": {
                                "maximum": 255,
                                "minimum": 0,
                                "type": "integer"
                              },
                              "type": "array"
                            }
                          },
                          "required": [
                            "scheme",
                            "key_id",
                            "signature"
                          ],
                          "type": "object"
                        }
                      ]
                    },
                    "value": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "oneOf": [
                            {
                              "additionalProperties": false,
                              "properties": {
                                "kind": {
                                  "const": "json"
                                },
                                "value": {
                                  "description": "Evidence JSON value.",
                                  "type": [
                                    "null",
                                    "boolean",
                                    "number",
                                    "string",
                                    "array",
                                    "object"
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "value"
                              ],
                              "type": "object"
                            },
                            {
                              "additionalProperties": false,
                              "properties": {
                                "kind": {
                                  "const": "bytes"
                                },
                                "value": {
                                  "items": {
                                    "maximum": 255,
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "type": "array"
                                }
                              },
                              "required": [
                                "kind",
                                "value"
                              ],
                              "type": "object"
                            }
                          ]
                        }
                      ]
                    }
                  },
                  "required": [
                    "value",
                    "lane",
                    "error",
                    "evidence_hash",
                    "evidence_ref",
                    "evidence_anchor",
                    "signature",
                    "content_type"
                  ],
                  "type": "object"
                },
                "status": {
                  "description": "Tri-state evaluation result.",
                  "enum": [
                    "True",
                    "False",
                    "Unknown"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "condition_id",
                "status",
                "result"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "stage_id": {
            "description": "Stage identifier.",
            "type": "string"
          },
          "trigger_id": {
            "description": "Trigger identifier.",
            "type": "string"
          }
        },
        "required": [
          "trigger_id",
          "stage_id",
          "evaluation",
          "evidence"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "namespace_id": {
      "description": "Namespace identifier.",
      "minimum": 1,
      "type": "integer"
    },
    "packets": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "decision_id": {
            "description": "Decision identifier.",
            "type": "string"
          },
          "envelope": {
            "additionalProperties": false,
            "properties": {
              "content_hash": {
                "additionalProperties": false,
                "properties": {
                  "algorithm": {
                    "enum": [
                      "sha256"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Lowercase hex digest.",
                    "type": "string"
                  }
                },
                "required": [
                  "algorithm",
                  "value"
                ],
                "type": "object"
              },
              "content_type": {
                "description": "Packet content type.",
                "type": "string"
              },
              "correlation_id": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "description": "Correlation identifier.",
                    "type": "string"
                  }
                ]
              },
              "expiry": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "oneOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "kind": {
                            "const": "unix_millis"
                          },
                          "value": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "value"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "kind": {
                            "const": "logical"
                          },
                          "value": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "value"
                        ],
                        "type": "object"
                      }
                    ]
                  }
                ]
              },
              "issued_at": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "kind": {
                        "const": "unix_millis"
                      },
                      "value": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "kind",
                      "value"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "kind": {
                        "const": "logical"
                      },
                      "value": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "kind",
                      "value"
                    ],
                    "type": "object"
                  }
                ]
              },
              "packet_id": {
                "description": "Packet identifier.",
                "type": "string"
              },
              "run_id": {
                "description": "Run identifier.",
                "type": "string"
              },
              "scenario_id": {
                "description": "Scenario identifier.",
                "type": "string"
              },
              "schema_id": {
                "description": "Schema identifier.",
                "type": "string"
              },
              "stage_id": {
                "description": "Stage identifier.",
                "type": "string"
              },
              "visibility": {
                "additionalProperties": false,
                "properties": {
                  "labels": {
                    "description": "Visibility labels.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "policy_tags": {
                    "description": "Policy tags.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "labels",
                  "policy_tags"
                ],
                "type": "object"
              }
            },
            "required": [
              "scenario_id",
              "run_id",
              "stage_id",
              "packet_id",
              "schema_id",
              "content_type",
              "content_hash",
              "visibility",
              "expiry",
              "correlation_id",
              "issued_at"
            ],
            "type": "object"
          },
          "payload": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "json"
                  },
                  "value": {
                    "description": "Inline JSON payload.",
                    "type": [
                      "null",
                      "boolean",
                      "number",
                      "string",
                      "array",
                      "object"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "bytes": {
                    "items": {
                      "maximum": 255,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "kind": {
                    "const": "bytes"
                  }
                },
                "required": [
                  "kind",
                  "bytes"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "content_ref": {
                    "additionalProperties": false,
                    "properties": {
                      "content_hash": {
                        "additionalProperties": false,
                        "properties": {
                          "algorithm": {
                            "enum": [
                              "sha256"
                            ],
                            "type": "string"
                          },
                          "value": {
                            "description": "Lowercase hex digest.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "algorithm",
                          "value"
                        ],
                        "type": "object"
                      },
                      "encryption": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "description": "Encryption metadata.",
                            "type": "string"
                          }
                        ]
                      },
                      "uri": {
                        "description": "Content URI.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "uri",
                      "content_hash",
                      "encryption"
                    ],
                    "type": "object"
                  },
                  "kind": {
                    "const": "external"
                  }
                },
                "required": [
                  "kind",
                  "content_ref"
                ],
                "type": "object"
              }
            ]
          },
          "receipts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "dispatch_id": {
                  "description": "Dispatch identifier.",
                  "type": "string"
                },
                "dispatched_at": {
                  "oneOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "const": "unix_millis"
                        },
                        "value": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "kind",
                        "value"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "const": "logical"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "kind",
                        "value"
                      ],
                      "type": "object"
                    }
                  ]
                },
                "dispatcher": {
                  "description": "Dispatcher identifier.",
                  "type": "string"
                },
                "receipt_hash": {
                  "additionalProperties": false,
                  "properties": {
                    "algorithm": {
                      "enum": [
                        "sha256"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Lowercase hex digest.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "algorithm",
                    "value"
                  ],
                  "type": "object"
                },
                "target": {
                  "oneOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "agent_id": {
                          "description": "Agent identifier.",
                          "type": "string"
                        },
                        "kind": {
                          "const": "agent"
                        }
                      },
                      "required": [
                        "kind",
                        "agent_id"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "const": "session"
                        },
                        "session_id": {
                          "description": "Session identifier.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "session_id"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "const": "external"
                        },
                        "system": {
                          "description": "External system name.",
                          "type": "string"
                        },
                        "target": {
                          "description": "External system target.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "system",
                        "target"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "channel": {
                          "description": "Broadcast channel identifier.",
                          "type": "string"
                        },
                        "kind": {
                          "const": "channel"
                        }
                      },
                      "required": [
                        "kind",
                        "channel"
                      ],
                      "type": "object"
                    }
                  ]
                }
              },
              "required": [
                "dispatch_id",
                "target",
                "receipt_hash",
                "dispatched_at",
                "dispatcher"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "envelope",
          "payload",
          "receipts",
          "decision_id"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "run_id": {
      "description": "Run identifier.",
      "type": "string"
    },
    "scenario_id": {
      "description": "Scenario identifier.",
      "type": "string"
    },
    "spec_hash": {
      "additionalProperties": false,
      "properties": {
        "algorithm": {
          "enum": [
            "sha256"
          ],
          "type": "string"
        },
        "value": {
          "description": "Lowercase hex digest.",
          "type": "string"
        }
      },
      "required": [
        "algorithm",
        "value"
      ],
      "type": "object"
    },
    "stage_entered_at": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "unix_millis"
            },
            "value": {
              "type": "integer"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "logical"
            },
            "value": {
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "type": "object"
        }
      ]
    },
    "status": {
      "enum": [
        "active",
        "completed",
        "failed"
      ],
      "type": "string"
    },
    "submissions": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "content_hash": {
            "additionalProperties": false,
            "properties": {
              "algorithm": {
                "enum": [
                  "sha256"
                ],
                "type": "string"
              },
              "value": {
                "description": "Lowercase hex digest.",
                "type": "string"
              }
            },
            "required": [
              "algorithm",
              "value"
            ],
            "type": "object"
          },
          "content_type": {
            "description": "Submission content type.",
            "type": "string"
          },
          "correlation_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Correlation identifier.",
                "type": "string"
              }
            ]
          },
          "payload": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "json"
                  },
                  "value": {
                    "description": "Inline JSON payload.",
                    "type": [
                      "null",
                      "boolean",
                      "number",
                      "string",
                      "array",
                      "object"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "bytes": {
                    "items": {
                      "maximum": 255,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "kind": {
                    "const": "bytes"
                  }
                },
                "required": [
                  "kind",
                  "bytes"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "content_ref": {
                    "additionalProperties": false,
                    "properties": {
                      "content_hash": {
                        "additionalProperties": false,
                        "properties": {
                          "algorithm": {
                            "enum": [
                              "sha256"
                            ],
                            "type": "string"
                          },
                          "value": {
                            "description": "Lowercase hex digest.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "algorithm",
                          "value"
                        ],
                        "type": "object"
                      },
                      "encryption": {
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "description": "Encryption metadata.",
                            "type": "string"
                          }
                        ]
                      },
                      "uri": {
                        "description": "Content URI.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "uri",
                      "content_hash",
                      "encryption"
                    ],
                    "type": "object"
                  },
                  "kind": {
                    "const": "external"
                  }
                },
                "required": [
                  "kind",
                  "content_ref"
                ],
                "type": "object"
              }
            ]
          },
          "run_id": {
            "description": "Run identifier.",
            "type": "string"
          },
          "submission_id": {
            "description": "Submission identifier.",
            "type": "string"
          },
          "submitted_at": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "unix_millis"
                  },
                  "value": {
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "logical"
                  },
                  "value": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "submission_id",
          "run_id",
          "payload",
          "content_type",
          "content_hash",
          "submitted_at",
          "correlation_id"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "tenant_id": {
      "description": "Tenant identifier.",
      "minimum": 1,
      "type": "integer"
    },
    "tool_calls": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "call_id": {
            "description": "Tool-call identifier.",
            "type": "string"
          },
          "called_at": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "unix_millis"
                  },
                  "value": {
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "logical"
                  },
                  "value": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "kind",
                  "value"
                ],
                "type": "object"
              }
            ]
          },
          "correlation_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Correlation identifier.",
                "type": "string"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "description": "Stable error code.",
                    "type": "string"
                  },
                  "details": {
                    "oneOf": [
                      {
                        "type": "null"
                      },
                      {
                        "oneOf": [
                          {
                            "additionalProperties": false,
                            "properties": {
                              "blocked_by_policy": {
                                "type": "boolean"
                              },
                              "kind": {
                                "const": "provider_missing"
                              },
                              "missing_providers": {
                                "description": "Missing provider identifiers.",
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "required_capabilities": {
                                "description": "Required capabilities.",
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              }
                            },
                            "required": [
                              "kind",
                              "missing_providers",
                              "required_capabilities",
                              "blocked_by_policy"
                            ],
                            "type": "object"
                          },
                          {
                            "additionalProperties": false,
                            "properties": {
                              "info": {
                                "description": "Additional error details.",
                                "type": "string"
                              },
                              "kind": {
                                "const": "message"
                              }
                            },
                            "required": [
                              "kind",
                              "info"
                            ],
                            "type": "object"
                          }
                        ]
                      }
                    ]
                  },
                  "message": {
                    "description": "Error message.",
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message",
                  "details"
                ],
                "type": "object"
              }
            ]
          },
          "method": {
            "description": "Tool method name.",
            "type": "string"
          },
          "request_hash": {
            "additionalProperties": false,
            "properties": {
              "algorithm": {
                "enum": [
                  "sha256"
                ],
                "type": "string"
              },
              "value": {
                "description": "Lowercase hex digest.",
                "type": "string"
              }
            },
            "required": [
              "algorithm",
              "value"
            ],
            "type": "object"
          },
          "response_hash": {
            "additionalProperties": false,
            "properties": {
              "algorithm": {
                "enum": [
                  "sha256"
                ],
                "type": "string"
              },
              "value": {
                "description": "Lowercase hex digest.",
                "type": "string"
              }
            },
            "required": [
              "algorithm",
              "value"
            ],
            "type": "object"
          }
        },
        "required": [
          "call_id",
          "method",
          "request_hash",
          "response_hash",
          "called_at",
          "correlation_id",
          "error"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "triggers": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "event": {
            "additionalProperties": false,
            "properties": {
              "correlation_id": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "description": "Correlation identifier.",
                    "type": "string"
                  }
                ]
              },
              "kind": {
                "enum": [
                  "agent_request_next",
                  "tick",
                  "external_event",
                  "backend_event"
                ],
                "type": "string"
              },
              "namespace_id": {
                "description": "Namespace identifier.",
                "minimum": 1,
                "type": "integer"
              },
              "payload": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "oneOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "kind": {
                            "const": "json"
                          },
                          "value": {
                            "description": "Inline JSON payload.",
                            "type": [
                              "null",
                              "boolean",
                              "number",
                              "string",
                              "array",
                              "object"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "value"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "bytes": {
                            "items": {
                              "maximum": 255,
                              "minimum": 0,
                              "type": "integer"
                            },
                            "type": "array"
                          },
                          "kind": {
                            "const": "bytes"
                          }
                        },
                        "required": [
                          "kind",
                          "bytes"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "content_ref": {
                            "additionalProperties": false,
                            "properties": {
                              "content_hash": {
                                "additionalProperties": false,
                                "properties": {
                                  "algorithm": {
                                    "enum": [
                                      "sha256"
                                    ],
                                    "type": "string"
                                  },
                                  "value": {
                                    "description": "Lowercase hex digest.",
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "algorithm",
                                  "value"
                                ],
                                "type": "object"
                              },
                              "encryption": {
                                "oneOf": [
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "description": "Encryption metadata.",
                                    "type": "string"
                                  }
                                ]
                              },
                              "uri": {
                                "description": "Content URI.",
                                "type": "string"
                              }
                            },
                            "required": [
                              "uri",
                              "content_hash",
                              "encryption"
                            ],
                            "type": "object"
                          },
                          "kind": {
                            "const": "external"
                          }
                        },
                        "required": [
                          "kind",
                          "content_ref"
                        ],
                        "type": "object"
                      }
                    ]
                  }
                ]
              },
              "run_id": {
                "description": "Run identifier.",
                "type": "string"
              },
              "source_id": {
                "description": "Trigger source identifier.",
                "type": "string"
              },
              "tenant_id": {
                "description": "Tenant identifier.",
                "minimum": 1,
                "type": "integer"
              },
              "time": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "kind": {
                        "const": "unix_millis"
                      },
                      "value": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "kind",
                      "value"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "kind": {
                        "const": "logical"
                      },
                      "value": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "kind",
                      "value"
                    ],
                    "type": "object"
                  }
                ]
              },
              "trigger_id": {
                "description": "Trigger identifier.",
                "type": "string"
              }
            },
            "required": [
              "trigger_id",
              "tenant_id",
              "namespace_id",
              "run_id",
              "kind",
              "time",
              "source_id"
            ],
            "type": "object"
          },
          "seq": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "seq",
          "event"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "tenant_id",
    "namespace_id",
    "run_id",
    "scenario_id",
    "spec_hash",
    "current_stage_id",
    "stage_entered_at",
    "status",
    "dispatch_targets",
    "triggers",
    "gate_evals",
    "decisions",
    "packets",
    "submissions",
    "tool_calls"
  ],
  "type": "object"
}

Exemples

Inicieu una execució per a l’escenari d’exemple i emeteu paquets d’entrada.

Input:

{
  "issue_entry_packets": true,
  "run_config": {
    "dispatch_targets": [
      {
        "agent_id": "agent-alpha",
        "kind": "agent"
      }
    ],
    "namespace_id": 1,
    "policy_tags": [],
    "run_id": "run-0001",
    "scenario_id": "example-scenario",
    "tenant_id": 1
  },
  "scenario_id": "example-scenario",
  "started_at": {
    "kind": "unix_millis",
    "value": 1710000000000
  }
}

Output:

{
  "current_stage_id": "main",
  "decisions": [],
  "dispatch_targets": [
    {
      "agent_id": "agent-alpha",
      "kind": "agent"
    }
  ],
  "gate_evals": [],
  "namespace_id": 1,
  "packets": [],
  "run_id": "run-0001",
  "scenario_id": "example-scenario",
  "spec_hash": {
    "algorithm": "sha256",
    "value": "5c3a5b6bce0f4a2c9e22c4fa6a1e6d8d90b0f2dfed1b7f1e9b3d3b3d1f0c9b21"
  },
  "stage_entered_at": {
    "kind": "unix_millis",
    "value": 1710000000000
  },
  "status": "active",
  "submissions": [],
  "tenant_id": 1,
  "tool_calls": [],
  "triggers": []
}