escenari_seguent
Avalua les portes en resposta a una sol·licitud següent impulsada per un agent.
Notes clau
- Idempotent per trigger_id; les trucades repetides retornen la mateixa decisió.
- Registres de decisió, proves i divulgacions de paquets en estat d’execució.
- Requereix una execució activa; les execucions completades o fallides no avancen.
- El comentari opcional pot incloure el rastreig de la porta o proves quan ho permeti la política de comentaris del servidor.
Inputs
feedback(opcional): Substitució opcional del nivell de retroalimentació per a scenario_next.- request (required): Proper següent del payload d’una agent.
- scenario_id (required): Identificador de l’escenari.
Input Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"feedback": {
"description": "Optional feedback level override for scenario_next.",
"oneOf": [
{
"type": "null"
},
{
"description": "Feedback disclosure level.",
"enum": [
"summary",
"trace",
"evidence"
],
"type": "string"
}
]
},
"request": {
"additionalProperties": false,
"description": "Next request payload from an agent.",
"properties": {
"agent_id": {
"description": "Agent identifier.",
"type": "string"
},
"correlation_id": {
"oneOf": [
{
"type": "null"
},
{
"description": "Correlation identifier.",
"type": "string"
}
]
},
"namespace_id": {
"description": "Namespace identifier.",
"minimum": 1,
"type": "integer"
},
"run_id": {
"description": "Run 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": [
"tenant_id",
"namespace_id",
"run_id",
"trigger_id",
"agent_id",
"time"
],
"type": "object"
},
"scenario_id": {
"description": "Scenario identifier.",
"type": "string"
}
},
"required": [
"scenario_id",
"request"
],
"type": "object"
}
Sortides
- decisió (requerit): Tipus: objecte.
feedback(opcional): Una de les 2 variants d’esquema.- paquets (requerit): Tipus: array.
- status (requerit): Tipus: string.
Esquema de sortida
{
"additionalProperties": false,
"properties": {
"decision": {
"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"
},
"feedback": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"denied_reason": {
"oneOf": [
{
"type": "null"
},
{
"description": "Optional denial reason for requested feedback.",
"type": "string"
}
]
},
"gate_evaluations": {
"oneOf": [
{
"type": "null"
},
{
"items": {
"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"
},
"type": "array"
}
]
},
"gate_records": {
"oneOf": [
{
"type": "null"
},
{
"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"
}
]
},
"level": {
"description": "Feedback disclosure level.",
"enum": [
"summary",
"trace",
"evidence"
],
"type": "string"
}
},
"required": [
"level"
],
"type": "object"
}
]
},
"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"
},
"status": {
"enum": [
"active",
"completed",
"failed"
],
"type": "string"
}
},
"required": [
"decision",
"packets",
"status"
],
"type": "object"
}
Exemples
Avaluar el següent pas impulsat per agents per a una execució.
Input:
{
"request": {
"agent_id": "agent-alpha",
"correlation_id": null,
"namespace_id": 1,
"run_id": "run-0001",
"tenant_id": 1,
"time": {
"kind": "unix_millis",
"value": 1710000000000
},
"trigger_id": "trigger-0001"
},
"scenario_id": "example-scenario"
}
Output:
{
"decision": {
"correlation_id": null,
"decided_at": {
"kind": "unix_millis",
"value": 1710000000000
},
"decision_id": "decision-0001",
"outcome": {
"kind": "complete",
"stage_id": "main"
},
"seq": 0,
"stage_id": "main",
"trigger_id": "trigger-0001"
},
"packets": [],
"status": "completed"
}
Avaluar una execució i sol·licitar comentaris sobre el rastre.
Input:
{
"feedback": "trace",
"request": {
"agent_id": "agent-alpha",
"correlation_id": null,
"namespace_id": 1,
"run_id": "run-0001",
"tenant_id": 1,
"time": {
"kind": "unix_millis",
"value": 1710000000000
},
"trigger_id": "trigger-0001"
},
"scenario_id": "example-scenario"
}
Output:
{
"decision": {
"correlation_id": null,
"decided_at": {
"kind": "unix_millis",
"value": 1710000000000
},
"decision_id": "decision-0001",
"outcome": {
"kind": "complete",
"stage_id": "main"
},
"seq": 0,
"stage_id": "main",
"trigger_id": "trigger-0001"
},
"feedback": {
"gate_evaluations": [],
"level": "trace"
},
"packets": [],
"status": "completed"
}