{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "三组决策方案v3实际运行记录",
  "type": "object",
  "required": [
    "run_id",
    "phase",
    "group",
    "task_id",
    "pair_id",
    "execution_mode",
    "attempted",
    "first_outcome",
    "final_outcome",
    "first_oracle_passed",
    "final_oracle_passed",
    "human_interventions",
    "model_call_count",
    "elapsed_ms",
    "agent_claimed_complete",
    "cost",
    "config_hash",
    "task_hash",
    "evidence",
    "benchmark_kind",
    "role_call_counts",
    "independent_checks",
    "model_profile",
    "batch_id",
    "dataset_id",
    "helper_config_hash",
    "flow_gate_id",
    "flow_gate_passed"
  ],
  "properties": {
    "run_id": {
      "type": "string",
      "minLength": 1
    },
    "phase": {
      "type": "string",
      "minLength": 1
    },
    "group": {
      "type": "string"
    },
    "task_id": {
      "type": "string"
    },
    "pair_id": {
      "type": "string"
    },
    "execution_mode": {
      "enum": [
        "live_model",
        "fixed_decision",
        "direct_control",
        "source_review"
      ]
    },
    "attempted": {
      "type": "boolean"
    },
    "first_outcome": {
      "enum": [
        "verified",
        "failed",
        "blocked",
        "unsupported",
        "environment_error",
        "outcome_unknown",
        "not_run"
      ]
    },
    "final_outcome": {
      "enum": [
        "verified",
        "failed",
        "blocked",
        "unsupported",
        "environment_error",
        "outcome_unknown",
        "not_run"
      ]
    },
    "first_oracle_passed": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "final_oracle_passed": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "human_interventions": {
      "type": "integer",
      "minimum": 0
    },
    "model_call_count": {
      "type": "integer",
      "minimum": 0
    },
    "elapsed_ms": {
      "type": "number",
      "minimum": 0
    },
    "agent_claimed_complete": {
      "type": "boolean"
    },
    "cost": {
      "type": "object",
      "required": [
        "currency",
        "known_amount",
        "has_unknown_component"
      ],
      "properties": {
        "currency": {
          "type": "string"
        },
        "known_amount": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "has_unknown_component": {
          "type": "boolean"
        }
      }
    },
    "config_hash": {
      "type": "string"
    },
    "task_hash": {
      "type": "string"
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "models": {
      "type": "object",
      "description": "requested/actual model IDs, provider, role and per-call usage; no credentials"
    },
    "failure": {
      "type": [
        "object",
        "null"
      ]
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "ended_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "benchmark_kind": {
      "enum": [
        "web_e2e",
        "decision_replay"
      ]
    },
    "model_profile": {
      "enum": [
        "llm_only",
        "jev",
        "startlux"
      ]
    },
    "general_llm_exercised": {
      "type": "boolean"
    },
    "role_call_counts": {
      "type": "object",
      "required": [
        "decision",
        "general_llm"
      ],
      "properties": {
        "decision": {
          "type": "integer",
          "minimum": 0
        },
        "general_llm": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "independent_checks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "passed",
          "evidence"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "passed": {
            "type": "boolean"
          },
          "evidence": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "first_independent_checks": {
      "type": "array"
    },
    "dataset_id": {
      "type": "string",
      "minLength": 1
    },
    "oracle_version": {
      "type": "string"
    },
    "recovery_parent_run_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "model_receipts": {
      "type": "array",
      "description": "脱敏回执，按角色记录provider/requested与actual model，未返回实际身份时actual写null"
    },
    "batch_id": {
      "type": "string",
      "minLength": 1
    },
    "helper_config_hash": {
      "type": "string",
      "minLength": 1
    },
    "flow_gate_id": {
      "type": "string",
      "minLength": 1
    },
    "flow_gate_passed": {
      "type": "boolean"
    },
    "timing_ms": {
      "type": "object",
      "properties": {
        "observe": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "decision": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "helper": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "execute": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "site_wait": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "acceptance": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "overhead": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        }
      },
      "description": "请求耗时与纯推理耗时不能混称；缺失填null，不编零值。"
    },
    "completion_claims": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "oracle_passed"
        ],
        "properties": {
          "oracle_passed": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      }
    },
    "timing_eligible": {
      "type": "boolean"
    },
    "execution_pauses": {
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": true,
  "allOf": [
    {
      "if": {
        "properties": {
          "final_outcome": {
            "const": "verified"
          }
        }
      },
      "then": {
        "properties": {
          "final_oracle_passed": {
            "const": true
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "first_outcome": {
            "const": "verified"
          }
        }
      },
      "then": {
        "properties": {
          "first_oracle_passed": {
            "const": true
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "flow_gate_passed": {
            "const": true
          }
        },
        "required": [
          "flow_gate_passed"
        ]
      },
      "then": {
        "properties": {
          "flow_gate_id": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "flow_gate_id"
        ]
      }
    }
  ],
  "$comment": "按职责记decision与general_llm辅助请求，互斥归因；纯大模型承担decision角色，不能因为provider是LLM就把全部调用算辅助。质量门槛与全批计划/真实证据另验。"
}
