{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/not_started_by_design.schema.json",
  "title": "not_started_by_design.v1",
  "description": "task-2613 Track D — 단일 track 의 'by-design 정상 보류' 기록. upstream gate(EVENT_GATED / AUTO_SEQUENCED / DEPENDS_ON) 미충족으로 아직 dispatch되지 않은 것이 SPEC 상 정상인 상태를 명시한다. 이 상태는 사고가 아니며(is_incident=false), Track A adjudicator 가 HOLD 로 격상하면 안 된다. ★ DISPATCH_NOT_RECEIVED(봇 미수신 사고)와 동일 레코드로 표현 불가 — 별개 상태이며 별개 스키마 경로로만 분류된다.",
  "type": "object",
  "required": [
    "schema",
    "track_id",
    "task_id",
    "verdict",
    "gate_kind",
    "gate_satisfied",
    "is_incident",
    "by_design_basis",
    "distinct_from_dispatch_not_received"
  ],
  "properties": {
    "schema": {"const": "not_started_by_design.v1"},
    "track_id": {"type": "string", "minLength": 1},
    "task_id": {"type": "string", "minLength": 1},
    "verdict": {
      "type": "string",
      "enum": ["NOT_STARTED_BY_DESIGN", "WAITING_FOR_DEPENDENCY"],
      "description": "by-design 정상 보류 2종. DISPATCH_NOT_RECEIVED 는 이 enum 에 존재하지 않는다(혼동 금지)."
    },
    "gate_kind": {
      "type": "string",
      "enum": ["EVENT_GATED", "AUTO_SEQUENCED", "DEPENDS_ON"],
      "description": "정상 보류는 반드시 선언된 gate 가 있다. gate 없는 미수신은 by-design 이 아니다."
    },
    "gate_satisfied": {
      "const": false,
      "description": "by-design 정상 보류의 정의 — gate 가 아직 미충족이므로 dispatch 보류가 SPEC 상 정상."
    },
    "is_incident": {
      "const": false,
      "description": "by-design 정상 보류는 절대 사고 아님. 봇 미수신 사고면 이 스키마로 기록 불가."
    },
    "declared_upstream": {"type": "array", "items": {"type": "string"}},
    "upstream_durable_success": {"type": "array", "items": {"type": "string"}},
    "upstream_unmet": {
      "type": "array",
      "items": {"type": "string"},
      "minItems": 1,
      "description": "최소 1개 미충족 upstream 이 있어야 by-design 보류가 성립."
    },
    "by_design_basis": {
      "type": "string",
      "minLength": 1,
      "description": "preflight decision / spec 상 이 보류가 정상임을 보증하는 근거(예: '회장 규칙2 — {A,B,C,D,E} all-settled 후 Track F EVENT_GATED')."
    },
    "distinct_from_dispatch_not_received": {
      "type": "object",
      "required": ["asserted", "rationale"],
      "properties": {
        "asserted": {"const": true},
        "rationale": {
          "type": "string",
          "minLength": 1,
          "description": "gate 미충족 정상 보류와 봇 미수신 사고가 별개 상태인 이유. 예: 'gate 미충족 → dispatch 자체가 SPEC 상 보류됨(fired 아님). DISPATCH_NOT_RECEIVED 는 gate 충족·dispatch fired 후 봇이 미수신한 사고로 전제조건 자체가 상호배타.'"
        }
      },
      "additionalProperties": false
    },
    "reasons": {"type": "array", "items": {"type": "string"}}
  },
  "additionalProperties": false
}
