{
  "allOf": [
    {
      "type": "object",
      "required": [
        "timestamp"
      ],
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "runId": {
          "type": "string"
        },
        "timestamp": {
          "type": "string"
        }
      }
    },
    {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "type",
            "sessionId"
          ],
          "properties": {
            "type": {
              "const": "session:start",
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "sessionId",
            "result"
          ],
          "properties": {
            "type": {
              "const": "session:end",
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "result": {
              "type": "object",
              "required": [
                "status",
                "summary"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "const": "completed",
                      "type": "string"
                    },
                    {
                      "const": "failed",
                      "type": "string"
                    },
                    {
                      "const": "skipped",
                      "type": "string"
                    }
                  ]
                },
                "summary": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "profileName",
            "source",
            "scope",
            "config"
          ],
          "properties": {
            "type": {
              "const": "session:profile",
              "type": "string"
            },
            "profileName": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "source": {
              "anyOf": [
                {
                  "const": "local",
                  "type": "string"
                },
                {
                  "const": "project",
                  "type": "string"
                },
                {
                  "const": "user-local",
                  "type": "string"
                },
                {
                  "const": "missing",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "override",
                  "type": "string"
                }
              ]
            },
            "scope": {
              "anyOf": [
                {
                  "const": "local",
                  "type": "string"
                },
                {
                  "const": "project",
                  "type": "string"
                },
                {
                  "const": "user",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "config": {
              "anyOf": [
                {},
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "planSet",
            "command"
          ],
          "properties": {
            "type": {
              "const": "phase:start",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "planSet": {
              "type": "string"
            },
            "command": {
              "anyOf": [
                {
                  "const": "compile",
                  "type": "string"
                },
                {
                  "const": "build",
                  "type": "string"
                },
                {
                  "const": "continue-repair",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "result"
          ],
          "properties": {
            "type": {
              "const": "phase:end",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "result": {
              "type": "object",
              "required": [
                "status",
                "summary"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "const": "completed",
                      "type": "string"
                    },
                    {
                      "const": "failed",
                      "type": "string"
                    },
                    {
                      "const": "skipped",
                      "type": "string"
                    }
                  ]
                },
                "summary": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "message",
            "source"
          ],
          "properties": {
            "type": {
              "const": "config:warning",
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "details": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "message",
            "source"
          ],
          "properties": {
            "type": {
              "const": "planning:warning",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "details": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "moduleId",
            "reason",
            "errors"
          ],
          "properties": {
            "type": {
              "const": "planning:module:build-config:invalid",
              "type": "string"
            },
            "moduleId": {
              "type": "string"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "invalid-json",
                  "type": "string"
                },
                {
                  "const": "invalid-schema",
                  "type": "string"
                }
              ]
            },
            "errors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "pattern",
            "triggeringEventType",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:event-handler:failed",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "pattern": {
              "type": "string"
            },
            "triggeringEventType": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "pattern",
            "triggeringEventType",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:event-handler:timeout",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "pattern": {
              "type": "string"
            },
            "triggeringEventType": {
              "type": "string"
            },
            "timeoutMs": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "invocationId",
            "actionId",
            "extensionName",
            "extensionPath",
            "requestedBy"
          ],
          "properties": {
            "type": {
              "const": "extension:action:start",
              "type": "string"
            },
            "invocationId": {
              "type": "string"
            },
            "actionId": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "requestedBy": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "host"
              ],
              "properties": {
                "host": {
                  "anyOf": [
                    {
                      "const": "console",
                      "type": "string"
                    },
                    {
                      "const": "pi",
                      "type": "string"
                    },
                    {
                      "const": "claude",
                      "type": "string"
                    },
                    {
                      "const": "mcp",
                      "type": "string"
                    },
                    {
                      "const": "cli",
                      "type": "string"
                    }
                  ]
                },
                "surface": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "commandId": {
                  "type": "string"
                },
                "deepLinkId": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "invocationId",
            "actionId",
            "extensionName",
            "extensionPath",
            "requestedBy",
            "durationMs"
          ],
          "properties": {
            "type": {
              "const": "extension:action:complete",
              "type": "string"
            },
            "invocationId": {
              "type": "string"
            },
            "actionId": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "requestedBy": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "host"
              ],
              "properties": {
                "host": {
                  "anyOf": [
                    {
                      "const": "console",
                      "type": "string"
                    },
                    {
                      "const": "pi",
                      "type": "string"
                    },
                    {
                      "const": "claude",
                      "type": "string"
                    },
                    {
                      "const": "mcp",
                      "type": "string"
                    },
                    {
                      "const": "cli",
                      "type": "string"
                    }
                  ]
                },
                "surface": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "commandId": {
                  "type": "string"
                },
                "deepLinkId": {
                  "type": "string"
                }
              }
            },
            "durationMs": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "invocationId",
            "actionId",
            "extensionName",
            "extensionPath",
            "requestedBy",
            "durationMs",
            "errorCode",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:action:failed",
              "type": "string"
            },
            "invocationId": {
              "type": "string"
            },
            "actionId": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "requestedBy": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "host"
              ],
              "properties": {
                "host": {
                  "anyOf": [
                    {
                      "const": "console",
                      "type": "string"
                    },
                    {
                      "const": "pi",
                      "type": "string"
                    },
                    {
                      "const": "claude",
                      "type": "string"
                    },
                    {
                      "const": "mcp",
                      "type": "string"
                    },
                    {
                      "const": "cli",
                      "type": "string"
                    }
                  ]
                },
                "surface": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "commandId": {
                  "type": "string"
                },
                "deepLinkId": {
                  "type": "string"
                }
              }
            },
            "durationMs": {
              "type": "number"
            },
            "errorCode": {
              "anyOf": [
                {
                  "const": "invalid-input",
                  "type": "string"
                },
                {
                  "const": "daemon-unavailable",
                  "type": "string"
                },
                {
                  "const": "handler-error",
                  "type": "string"
                },
                {
                  "const": "invalid-output",
                  "type": "string"
                },
                {
                  "const": "output-schema-failed",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            },
            "validationErrors": {
              "type": "array",
              "items": {
                "additionalProperties": {
                  "$id": "TypeBoxRecursive0",
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "TypeBoxRecursive0"
                      }
                    },
                    {
                      "type": "object",
                      "patternProperties": {
                        "^(.*)$": {
                          "$ref": "TypeBoxRecursive0"
                        }
                      }
                    }
                  ]
                },
                "type": "object",
                "required": [
                  "path",
                  "message"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "invocationId",
            "actionId",
            "extensionName",
            "extensionPath",
            "requestedBy",
            "durationMs",
            "timeoutMs",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:action:timeout",
              "type": "string"
            },
            "invocationId": {
              "type": "string"
            },
            "actionId": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "requestedBy": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "host"
              ],
              "properties": {
                "host": {
                  "anyOf": [
                    {
                      "const": "console",
                      "type": "string"
                    },
                    {
                      "const": "pi",
                      "type": "string"
                    },
                    {
                      "const": "claude",
                      "type": "string"
                    },
                    {
                      "const": "mcp",
                      "type": "string"
                    },
                    {
                      "const": "cli",
                      "type": "string"
                    }
                  ]
                },
                "surface": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "commandId": {
                  "type": "string"
                },
                "deepLinkId": {
                  "type": "string"
                }
              }
            },
            "durationMs": {
              "type": "number"
            },
            "timeoutMs": {
              "type": "number"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "taskId",
            "taskKind",
            "extensionName",
            "status"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-task:start",
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "taskKind": {
              "const": "eforge-plan.planning-draft",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "status": {
              "const": "running",
              "type": "string"
            },
            "metadata": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "progressMessage": {
                  "type": "string"
                },
                "outputSectionCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "warningCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "sectionProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "currentSection": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "coveredSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    },
                    "remainingSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    }
                  }
                },
                "backlogCurationProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "total",
                    "cacheHits",
                    "misses",
                    "running",
                    "completed",
                    "remaining",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cacheHits": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "misses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "running": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "completed": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "items": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "itemId",
                          "status"
                        ],
                        "properties": {
                          "itemId": {
                            "minLength": 1,
                            "maxLength": 240,
                            "type": "string"
                          },
                          "title": {
                            "maxLength": 300,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "cache-hit",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "cancelled",
                                "type": "string"
                              }
                            ]
                          },
                          "outcome": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "verdict": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "summary": {
                            "maxLength": 500,
                            "type": "string"
                          },
                          "startedAt": {
                            "maxLength": 120,
                            "type": "string"
                          },
                          "completedAt": {
                            "maxLength": 120,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "activityLog": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "timestamp",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "minLength": 1,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                        "type": "string"
                      },
                      "message": {
                        "minLength": 1,
                        "maxLength": 500,
                        "pattern": "\\S",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "taskId",
            "taskKind",
            "extensionName",
            "status",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-task:progress",
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "taskKind": {
              "const": "eforge-plan.planning-draft",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "status": {
              "const": "running",
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "metadata": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "progressMessage": {
                  "type": "string"
                },
                "outputSectionCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "warningCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "sectionProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "currentSection": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "coveredSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    },
                    "remainingSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    }
                  }
                },
                "backlogCurationProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "total",
                    "cacheHits",
                    "misses",
                    "running",
                    "completed",
                    "remaining",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cacheHits": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "misses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "running": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "completed": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "items": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "itemId",
                          "status"
                        ],
                        "properties": {
                          "itemId": {
                            "minLength": 1,
                            "maxLength": 240,
                            "type": "string"
                          },
                          "title": {
                            "maxLength": 300,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "cache-hit",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "cancelled",
                                "type": "string"
                              }
                            ]
                          },
                          "outcome": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "verdict": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "summary": {
                            "maxLength": 500,
                            "type": "string"
                          },
                          "startedAt": {
                            "maxLength": 120,
                            "type": "string"
                          },
                          "completedAt": {
                            "maxLength": 120,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "activityLog": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "timestamp",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "minLength": 1,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                        "type": "string"
                      },
                      "message": {
                        "minLength": 1,
                        "maxLength": 500,
                        "pattern": "\\S",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "taskId",
            "taskKind",
            "extensionName",
            "status",
            "durationMs"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-task:complete",
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "taskKind": {
              "const": "eforge-plan.planning-draft",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "status": {
              "const": "completed",
              "type": "string"
            },
            "durationMs": {
              "minimum": 0,
              "type": "integer"
            },
            "metadata": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "progressMessage": {
                  "type": "string"
                },
                "outputSectionCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "warningCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "sectionProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "currentSection": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "coveredSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    },
                    "remainingSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    }
                  }
                },
                "backlogCurationProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "total",
                    "cacheHits",
                    "misses",
                    "running",
                    "completed",
                    "remaining",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cacheHits": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "misses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "running": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "completed": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "items": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "itemId",
                          "status"
                        ],
                        "properties": {
                          "itemId": {
                            "minLength": 1,
                            "maxLength": 240,
                            "type": "string"
                          },
                          "title": {
                            "maxLength": 300,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "cache-hit",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "cancelled",
                                "type": "string"
                              }
                            ]
                          },
                          "outcome": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "verdict": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "summary": {
                            "maxLength": 500,
                            "type": "string"
                          },
                          "startedAt": {
                            "maxLength": 120,
                            "type": "string"
                          },
                          "completedAt": {
                            "maxLength": 120,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "activityLog": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "timestamp",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "minLength": 1,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                        "type": "string"
                      },
                      "message": {
                        "minLength": 1,
                        "maxLength": 500,
                        "pattern": "\\S",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "taskId",
            "taskKind",
            "extensionName",
            "status",
            "errorCode",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-task:failed",
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "taskKind": {
              "const": "eforge-plan.planning-draft",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "status": {
              "const": "failed",
              "type": "string"
            },
            "durationMs": {
              "minimum": 0,
              "type": "integer"
            },
            "errorCode": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "metadata": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "progressMessage": {
                  "type": "string"
                },
                "outputSectionCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "warningCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "sectionProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "currentSection": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "coveredSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    },
                    "remainingSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    }
                  }
                },
                "backlogCurationProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "total",
                    "cacheHits",
                    "misses",
                    "running",
                    "completed",
                    "remaining",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cacheHits": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "misses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "running": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "completed": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "items": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "itemId",
                          "status"
                        ],
                        "properties": {
                          "itemId": {
                            "minLength": 1,
                            "maxLength": 240,
                            "type": "string"
                          },
                          "title": {
                            "maxLength": 300,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "cache-hit",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "cancelled",
                                "type": "string"
                              }
                            ]
                          },
                          "outcome": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "verdict": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "summary": {
                            "maxLength": 500,
                            "type": "string"
                          },
                          "startedAt": {
                            "maxLength": 120,
                            "type": "string"
                          },
                          "completedAt": {
                            "maxLength": 120,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "activityLog": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "timestamp",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "minLength": 1,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                        "type": "string"
                      },
                      "message": {
                        "minLength": 1,
                        "maxLength": 500,
                        "pattern": "\\S",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "taskId",
            "taskKind",
            "extensionName",
            "status"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-task:cancelled",
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "taskKind": {
              "const": "eforge-plan.planning-draft",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "status": {
              "const": "cancelled",
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "metadata": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "progressMessage": {
                  "type": "string"
                },
                "outputSectionCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "warningCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "sectionProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "currentSection": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "coveredSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    },
                    "remainingSections": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "maxLength": 500,
                        "type": "string"
                      }
                    }
                  }
                },
                "backlogCurationProgress": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "total",
                    "cacheHits",
                    "misses",
                    "running",
                    "completed",
                    "remaining",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cacheHits": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "misses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "running": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "completed": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "remaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "items": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "itemId",
                          "status"
                        ],
                        "properties": {
                          "itemId": {
                            "minLength": 1,
                            "maxLength": 240,
                            "type": "string"
                          },
                          "title": {
                            "maxLength": 300,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "cache-hit",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "cancelled",
                                "type": "string"
                              }
                            ]
                          },
                          "outcome": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "verdict": {
                            "maxLength": 80,
                            "type": "string"
                          },
                          "summary": {
                            "maxLength": 500,
                            "type": "string"
                          },
                          "startedAt": {
                            "maxLength": 120,
                            "type": "string"
                          },
                          "completedAt": {
                            "maxLength": 120,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "activityLog": {
                  "maxItems": 50,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "timestamp",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "minLength": 1,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                        "type": "string"
                      },
                      "message": {
                        "minLength": 1,
                        "maxLength": 500,
                        "pattern": "\\S",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "role",
            "profile",
            "promptCharCount",
            "fragmentCount"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-context:applied",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "role": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tier": {
              "type": "string"
            },
            "phase": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "promptCharCount": {
              "minimum": 0,
              "type": "integer"
            },
            "fragmentCount": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "role",
            "profile",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-context:failed",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "role": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tier": {
              "type": "string"
            },
            "phase": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "role",
            "profile",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-context:timeout",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "role": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tier": {
              "type": "string"
            },
            "phase": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "role",
            "profile",
            "fields"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-context:unsupported",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "role": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tier": {
              "type": "string"
            },
            "phase": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "fields": {
              "minItems": 1,
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "const": "tools",
                    "type": "string"
                  },
                  {
                    "const": "allowedTools",
                    "type": "string"
                  },
                  {
                    "const": "disallowedTools",
                    "type": "string"
                  }
                ]
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionName",
            "extensionPath",
            "role",
            "profile",
            "toolNames",
            "effectiveToolNames",
            "registeredToolNames",
            "inlineToolNames",
            "allowedToolsAdded",
            "disallowedToolsAdded",
            "excludedToolNames",
            "toolCount",
            "allowedToolCount",
            "disallowedToolCount",
            "excludedToolCount"
          ],
          "properties": {
            "type": {
              "const": "extension:agent-tools:applied",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "role": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tier": {
              "type": "string"
            },
            "phase": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "projectMcpServerNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "toolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "effectiveToolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "registeredToolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "inlineToolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "allowedToolsAdded": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "disallowedToolsAdded": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "excludedToolNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "toolCount": {
              "minimum": 0,
              "type": "integer"
            },
            "allowedToolCount": {
              "minimum": 0,
              "type": "integer"
            },
            "disallowedToolCount": {
              "minimum": 0,
              "type": "integer"
            },
            "excludedToolCount": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "profile",
            "baseProfile",
            "routerName",
            "extensionName",
            "extensionPath"
          ],
          "properties": {
            "type": {
              "const": "queue:profile:selected",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "baseProfile": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "routerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "low",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "routerName",
            "extensionName",
            "extensionPath",
            "message"
          ],
          "properties": {
            "type": {
              "const": "queue:profile:router-failed",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "routerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "routerName",
            "extensionName",
            "extensionPath",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "queue:profile:router-timeout",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "routerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "routerName",
            "extensionName",
            "extensionPath",
            "requestedProfile",
            "reason",
            "message"
          ],
          "properties": {
            "type": {
              "const": "queue:profile:invalid-selection",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "routerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "requestedProfile": {
              "type": "string"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "not-found",
                  "type": "string"
                },
                {
                  "const": "load-error",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "prdId",
            "decision"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "queue-dispatch",
              "type": "string"
            },
            "method": {
              "const": "beforeQueueDispatch",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "decision": {
              "const": "allow",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "prdId",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "queue-dispatch",
              "type": "string"
            },
            "method": {
              "const": "beforeQueueDispatch",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "decision": {
              "const": "block",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "prdId",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "queue-dispatch",
              "type": "string"
            },
            "method": {
              "const": "beforeQueueDispatch",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "decision": {
              "const": "require-approval",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "planId",
            "decision"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "plan-merge",
              "type": "string"
            },
            "method": {
              "const": "beforePlanMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "planId": {
              "type": "string"
            },
            "decision": {
              "const": "allow",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "planId",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "plan-merge",
              "type": "string"
            },
            "method": {
              "const": "beforePlanMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "planId": {
              "type": "string"
            },
            "decision": {
              "const": "block",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "planId",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "plan-merge",
              "type": "string"
            },
            "method": {
              "const": "beforePlanMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "planId": {
              "type": "string"
            },
            "decision": {
              "const": "require-approval",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "featureBranch",
            "baseBranch",
            "decision"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "final-merge",
              "type": "string"
            },
            "method": {
              "const": "beforeFinalMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "decision": {
              "const": "allow",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "featureBranch",
            "baseBranch",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "final-merge",
              "type": "string"
            },
            "method": {
              "const": "beforeFinalMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "decision": {
              "const": "block",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "featureBranch",
            "baseBranch",
            "decision",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:decision",
              "type": "string"
            },
            "gateKind": {
              "const": "final-merge",
              "type": "string"
            },
            "method": {
              "const": "beforeFinalMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "decision": {
              "const": "require-approval",
              "type": "string"
            },
            "reason": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "prdId",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:failed",
              "type": "string"
            },
            "gateKind": {
              "const": "queue-dispatch",
              "type": "string"
            },
            "method": {
              "const": "beforeQueueDispatch",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "planId",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:failed",
              "type": "string"
            },
            "gateKind": {
              "const": "plan-merge",
              "type": "string"
            },
            "method": {
              "const": "beforePlanMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "planId": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "featureBranch",
            "baseBranch",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:failed",
              "type": "string"
            },
            "gateKind": {
              "const": "final-merge",
              "type": "string"
            },
            "method": {
              "const": "beforeFinalMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "prdId",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:timeout",
              "type": "string"
            },
            "gateKind": {
              "const": "queue-dispatch",
              "type": "string"
            },
            "method": {
              "const": "beforeQueueDispatch",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "prdId": {
              "type": "string"
            },
            "prdTitle": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "planId",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:timeout",
              "type": "string"
            },
            "gateKind": {
              "const": "plan-merge",
              "type": "string"
            },
            "method": {
              "const": "beforePlanMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "planId": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "gateKind",
            "method",
            "extensionName",
            "extensionPath",
            "registrationIndex",
            "failurePolicy",
            "featureBranch",
            "baseBranch",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:policy:timeout",
              "type": "string"
            },
            "gateKind": {
              "const": "final-merge",
              "type": "string"
            },
            "method": {
              "const": "beforeFinalMerge",
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "registrationIndex": {
              "minimum": 0,
              "type": "integer"
            },
            "failurePolicy": {
              "anyOf": [
                {
                  "const": "fail-open",
                  "type": "string"
                },
                {
                  "const": "fail-closed",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionPath",
            "extensionName",
            "adapterName",
            "sourceId",
            "contentLength"
          ],
          "properties": {
            "type": {
              "const": "extension:input-source:fetched",
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "adapterName": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "contentLength": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionPath",
            "extensionName",
            "adapterName",
            "sourceId",
            "reason",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:input-source:failed",
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "adapterName": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "not-found",
                  "type": "string"
                },
                {
                  "const": "error",
                  "type": "string"
                },
                {
                  "const": "timeout",
                  "type": "string"
                },
                {
                  "const": "invalid-result",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionPath",
            "extensionName",
            "enricherName",
            "sourceId",
            "changed",
            "inputLength",
            "outputLength"
          ],
          "properties": {
            "type": {
              "const": "extension:prd-enricher:applied",
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "enricherName": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "changed": {
              "type": "boolean"
            },
            "inputLength": {
              "minimum": 0,
              "type": "integer"
            },
            "outputLength": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionPath",
            "extensionName",
            "enricherName",
            "sourceId",
            "reason",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:prd-enricher:failed",
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "enricherName": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "error",
                  "type": "string"
                },
                {
                  "const": "timeout",
                  "type": "string"
                },
                {
                  "const": "invalid-result",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "extensionPath",
            "extensionName",
            "perspectiveKey",
            "perspectiveLabel"
          ],
          "properties": {
            "type": {
              "const": "extension:reviewer-perspective:applied",
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "perspectiveKey": {
              "pattern": "^[a-z][a-z0-9-]{0,63}$",
              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
              "type": "string"
            },
            "perspectiveLabel": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "type",
                "extensionPath",
                "extensionName",
                "perspectiveKey",
                "reason"
              ],
              "properties": {
                "type": {
                  "const": "extension:reviewer-perspective:skipped",
                  "type": "string"
                },
                "extensionPath": {
                  "type": "string"
                },
                "extensionName": {
                  "type": "string"
                },
                "perspectiveKey": {
                  "pattern": "^[a-z][a-z0-9-]{0,63}$",
                  "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                  "type": "string"
                },
                "reason": {
                  "anyOf": [
                    {
                      "const": "not-applicable",
                      "type": "string"
                    },
                    {
                      "const": "applicability-error",
                      "type": "string"
                    },
                    {
                      "const": "applicability-timeout",
                      "type": "string"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                },
                "planId": {
                  "type": "string"
                },
                "timeoutMs": {
                  "minimum": 0,
                  "type": "integer"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "type",
                "perspectiveKey",
                "reason"
              ],
              "properties": {
                "type": {
                  "const": "extension:reviewer-perspective:skipped",
                  "type": "string"
                },
                "extensionPath": {
                  "type": "string"
                },
                "extensionName": {
                  "type": "string"
                },
                "perspectiveKey": {
                  "pattern": "^[a-z][a-z0-9-]{0,63}$",
                  "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                  "type": "string"
                },
                "reason": {
                  "const": "unknown-key",
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "planId": {
                  "type": "string"
                }
              }
            }
          ]
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "providerName",
            "extensionName",
            "extensionPath",
            "kind"
          ],
          "properties": {
            "type": {
              "const": "extension:validation-provider:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "providerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "kind": {
              "anyOf": [
                {
                  "const": "validate",
                  "type": "string"
                },
                {
                  "const": "commands",
                  "type": "string"
                }
              ]
            },
            "commandCount": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "providerName",
            "extensionName",
            "extensionPath",
            "status"
          ],
          "properties": {
            "type": {
              "const": "extension:validation-provider:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "providerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "passed",
                  "type": "string"
                },
                {
                  "const": "skipped",
                  "type": "string"
                }
              ]
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "providerName",
            "extensionName",
            "extensionPath",
            "status",
            "message"
          ],
          "properties": {
            "type": {
              "const": "extension:validation-provider:error",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "providerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "status": {
              "const": "failed",
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "details": {
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "exitCode": {
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "providerName",
            "extensionName",
            "extensionPath",
            "timeoutMs"
          ],
          "properties": {
            "type": {
              "const": "extension:validation-provider:timeout",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "providerName": {
              "type": "string"
            },
            "extensionName": {
              "type": "string"
            },
            "extensionPath": {
              "type": "string"
            },
            "timeoutMs": {
              "minimum": 0,
              "type": "integer"
            },
            "command": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "source"
          ],
          "properties": {
            "type": {
              "const": "planning:start",
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "summary"
          ],
          "properties": {
            "type": {
              "const": "planning:inspection-summary",
              "type": "string"
            },
            "summary": {
              "type": "object",
              "required": [
                "kind",
                "version",
                "source",
                "relevantFiles",
                "observedFacts",
                "importantFindings",
                "inferredImplementationAreas",
                "unresolvedQuestions",
                "sourceBuildContext",
                "budgetDiagnostics",
                "caveats",
                "omittedCounts"
              ],
              "properties": {
                "kind": {
                  "const": "planner-inspection-handoff",
                  "type": "string"
                },
                "version": {
                  "const": 1,
                  "type": "number"
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "sourceId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "sourceName": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "sourcePath": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "buildId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "planSetName": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "runId": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  }
                },
                "relevantFiles": {
                  "maxItems": 40,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "observedFacts": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "importantFindings": {
                  "maxItems": 12,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "inferredImplementationAreas": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "unresolvedQuestions": {
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "sourceBuildContext": {
                  "type": "object",
                  "properties": {
                    "sourceSummary": {
                      "maxLength": 3000,
                      "type": "string"
                    },
                    "buildGoal": {
                      "maxLength": 3000,
                      "type": "string"
                    },
                    "promptSourceSnippet": {
                      "maxLength": 3000,
                      "type": "string"
                    }
                  }
                },
                "budgetDiagnostics": {
                  "type": "object",
                  "required": [
                    "maxObservedInputTokens",
                    "softInputTokenThreshold",
                    "plannerMaxTurns",
                    "inspectionTurnBudget",
                    "softInputTokenRatio",
                    "softTurnRatio",
                    "observed",
                    "toolUseCount",
                    "toolResultCount"
                  ],
                  "properties": {
                    "maxObservedInputTokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "softInputTokenThreshold": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "plannerMaxTurns": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "inspectionTurnBudget": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "softInputTokenRatio": {
                      "minimum": 0,
                      "maximum": 1,
                      "type": "number"
                    },
                    "softTurnRatio": {
                      "minimum": 0,
                      "maximum": 1,
                      "type": "number"
                    },
                    "guardDiagnostics": {
                      "type": "object",
                      "required": [
                        "metadataSource",
                        "outputReserveTokens",
                        "overheadReserveTokens",
                        "safetyMargin",
                        "limits"
                      ],
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "modelId": {
                          "type": "string"
                        },
                        "metadataSource": {
                          "anyOf": [
                            {
                              "const": "registry",
                              "type": "string"
                            },
                            {
                              "const": "builtin",
                              "type": "string"
                            },
                            {
                              "const": "synthetic",
                              "type": "string"
                            },
                            {
                              "const": "fallback",
                              "type": "string"
                            }
                          ]
                        },
                        "fallbackReason": {
                          "maxLength": 2000,
                          "type": "string"
                        },
                        "contextWindow": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "outputReserveTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "overheadReserveTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "safetyMargin": {
                          "exclusiveMinimum": 0,
                          "maximum": 1,
                          "type": "number"
                        },
                        "limits": {
                          "type": "object",
                          "required": [
                            "maxPromptBytes",
                            "maxObservedInputTokens",
                            "maxExplanationBytes"
                          ],
                          "properties": {
                            "maxPromptBytes": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedInputTokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedTurns": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxExplanationBytes": {
                              "minimum": 1,
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "observed": {
                      "type": "object",
                      "required": [
                        "inputTokens",
                        "outputTokens",
                        "turns",
                        "promptBytes"
                      ],
                      "properties": {
                        "inputTokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "outputTokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "turns": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "promptBytes": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      }
                    },
                    "toolUseCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "toolResultCount": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                },
                "caveats": {
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "omittedCounts": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "relevantFiles": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "observedFacts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "importantFindings": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inferredImplementationAreas": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unresolvedQuestions": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "toolUses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "toolResults": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "toolUseSummaryBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "toolResultSnippetBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "importantFindingBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "messageBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inferredImplementationAreaBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceIdBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceNameBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourcePathBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "buildIdBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "planSetNameBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "runIdBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceSummaryBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "buildGoalBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "promptSourceSnippetBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "relevantFileBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "caveatBytes": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "artifactPath": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "planning:skip",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planCount",
            "totalBodySize",
            "hasMigrations"
          ],
          "properties": {
            "type": {
              "const": "planning:submission",
              "type": "string"
            },
            "planCount": {
              "type": "number"
            },
            "totalBodySize": {
              "type": "number"
            },
            "hasMigrations": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "planning:error",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "failure"
          ],
          "properties": {
            "type": {
              "const": "planning:scope-context:failure",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "failure": {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "source",
                    "failureKind",
                    "stage",
                    "explanation",
                    "recovery",
                    "artifacts"
                  ],
                  "properties": {
                    "source": {
                      "anyOf": [
                        {
                          "const": "live-context-guard",
                          "type": "string"
                        },
                        {
                          "const": "provider",
                          "type": "string"
                        },
                        {
                          "const": "decomposition",
                          "type": "string"
                        }
                      ]
                    },
                    "failureKind": {
                      "anyOf": [
                        {
                          "const": "context-budget",
                          "type": "string"
                        },
                        {
                          "const": "context-window",
                          "type": "string"
                        },
                        {
                          "const": "context-length",
                          "type": "string"
                        },
                        {
                          "const": "scope-too-broad",
                          "type": "string"
                        },
                        {
                          "const": "decomposition-exhausted",
                          "type": "string"
                        }
                      ]
                    },
                    "stage": {
                      "anyOf": [
                        {
                          "const": "planner",
                          "type": "string"
                        },
                        {
                          "const": "compile",
                          "type": "string"
                        },
                        {
                          "const": "planning-decomposition",
                          "type": "string"
                        }
                      ]
                    },
                    "explanation": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "observed": {
                      "type": "object",
                      "properties": {
                        "inputTokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "outputTokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "turns": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "promptBytes": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      }
                    },
                    "guardDiagnostics": {
                      "type": "object",
                      "required": [
                        "metadataSource",
                        "outputReserveTokens",
                        "overheadReserveTokens",
                        "safetyMargin",
                        "limits"
                      ],
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "modelId": {
                          "type": "string"
                        },
                        "metadataSource": {
                          "anyOf": [
                            {
                              "const": "registry",
                              "type": "string"
                            },
                            {
                              "const": "builtin",
                              "type": "string"
                            },
                            {
                              "const": "synthetic",
                              "type": "string"
                            },
                            {
                              "const": "fallback",
                              "type": "string"
                            }
                          ]
                        },
                        "fallbackReason": {
                          "maxLength": 2000,
                          "type": "string"
                        },
                        "contextWindow": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "outputReserveTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "overheadReserveTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "safetyMargin": {
                          "exclusiveMinimum": 0,
                          "maximum": 1,
                          "type": "number"
                        },
                        "limits": {
                          "type": "object",
                          "required": [
                            "maxPromptBytes",
                            "maxObservedInputTokens",
                            "maxExplanationBytes"
                          ],
                          "properties": {
                            "maxPromptBytes": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedInputTokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedTurns": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxExplanationBytes": {
                              "minimum": 1,
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "decompositionEvidence": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "unitId",
                        "depth",
                        "budgets",
                        "observed",
                        "assignedCriteriaIds",
                        "unresolvedCriteria",
                        "blockers",
                        "splitAttempts"
                      ],
                      "properties": {
                        "unitId": {
                          "maxLength": 2000,
                          "type": "string"
                        },
                        "parentUnitId": {
                          "maxLength": 2000,
                          "type": "string"
                        },
                        "depth": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "budgets": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "maxRecursiveDepth",
                            "maxPromptSourceBytes",
                            "maxPromptBytes",
                            "maxObservedInputTokens",
                            "maxCompactHandoffBytes",
                            "maxLocalExplorationToolUses",
                            "maxCriteriaPerUnit",
                            "maxSubsystemsPerUnit",
                            "maxSplitAttemptsPerUnit"
                          ],
                          "properties": {
                            "maxRecursiveDepth": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "maxPromptSourceBytes": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxPromptBytes": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedInputTokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxObservedTurns": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxCompactHandoffBytes": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxLocalExplorationToolUses": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxCriteriaPerUnit": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxSubsystemsPerUnit": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "maxSplitAttemptsPerUnit": {
                              "minimum": 1,
                              "type": "integer"
                            }
                          }
                        },
                        "observed": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "triggeredLimitKeys"
                          ],
                          "properties": {
                            "promptSourceBytes": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "promptBytes": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "observedInputTokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "observedTurns": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "compactHandoffBytes": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "localExplorationToolUses": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "criteriaCount": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "subsystemCount": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "splitAttempts": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "triggeredLimitKeys": {
                              "maxItems": 32,
                              "type": "array",
                              "items": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            }
                          }
                        },
                        "assignedCriteriaIds": {
                          "maxItems": 64,
                          "type": "array",
                          "items": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        },
                        "unresolvedCriteria": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "reason"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "reason": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "evidence": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            }
                          }
                        },
                        "blockers": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        },
                        "splitAttempts": {
                          "maxItems": 8,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "attempt",
                              "reason",
                              "resultingUnitIds"
                            ],
                            "properties": {
                              "unitId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "attempt": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "reason": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "resultingUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "observed": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "triggeredLimitKeys"
                                ],
                                "properties": {
                                  "promptSourceBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "promptBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "observedInputTokens": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "observedTurns": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "compactHandoffBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "localExplorationToolUses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "criteriaCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "subsystemCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "splitAttempts": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "triggeredLimitKeys": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "recovery": {
                      "type": "object",
                      "required": [
                        "action",
                        "eligible",
                        "attempted",
                        "attempt",
                        "maxAttempts",
                        "reason"
                      ],
                      "properties": {
                        "action": {
                          "anyOf": [
                            {
                              "const": "none",
                              "type": "string"
                            },
                            {
                              "const": "bounded-decomposition",
                              "type": "string"
                            },
                            {
                              "const": "manual-reduce-scope",
                              "type": "string"
                            },
                            {
                              "const": "repair-existing-artifacts",
                              "type": "string"
                            }
                          ]
                        },
                        "eligible": {
                          "type": "boolean"
                        },
                        "attempted": {
                          "type": "boolean"
                        },
                        "attempt": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxAttempts": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "reason": {
                          "maxLength": 2000,
                          "type": "string"
                        }
                      }
                    },
                    "artifacts": {
                      "type": "object",
                      "required": [
                        "orchestrationExists",
                        "validPlanCount",
                        "invalidPlanCount",
                        "missingPlanFileCount",
                        "missingPlanFiles",
                        "invalidPlanFiles"
                      ],
                      "properties": {
                        "orchestrationExists": {
                          "type": "boolean"
                        },
                        "validPlanCount": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "invalidPlanCount": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "missingPlanFileCount": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "missingPlanFiles": {
                          "maxItems": 12,
                          "type": "array",
                          "items": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        },
                        "invalidPlanFiles": {
                          "maxItems": 12,
                          "type": "array",
                          "items": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "source",
                        "failureKind",
                        "stage",
                        "decompositionEvidence"
                      ],
                      "properties": {
                        "source": {
                          "const": "decomposition",
                          "type": "string"
                        },
                        "failureKind": {
                          "const": "decomposition-exhausted",
                          "type": "string"
                        },
                        "stage": {
                          "const": "planning-decomposition",
                          "type": "string"
                        },
                        "decompositionEvidence": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "unitId",
                            "depth",
                            "budgets",
                            "observed",
                            "assignedCriteriaIds",
                            "unresolvedCriteria",
                            "blockers",
                            "splitAttempts"
                          ],
                          "properties": {
                            "unitId": {
                              "maxLength": 2000,
                              "type": "string"
                            },
                            "parentUnitId": {
                              "maxLength": 2000,
                              "type": "string"
                            },
                            "depth": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "budgets": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "maxRecursiveDepth",
                                "maxPromptSourceBytes",
                                "maxPromptBytes",
                                "maxObservedInputTokens",
                                "maxCompactHandoffBytes",
                                "maxLocalExplorationToolUses",
                                "maxCriteriaPerUnit",
                                "maxSubsystemsPerUnit",
                                "maxSplitAttemptsPerUnit"
                              ],
                              "properties": {
                                "maxRecursiveDepth": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "maxPromptSourceBytes": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxPromptBytes": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxObservedInputTokens": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxObservedTurns": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxCompactHandoffBytes": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxLocalExplorationToolUses": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxCriteriaPerUnit": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxSubsystemsPerUnit": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "maxSplitAttemptsPerUnit": {
                                  "minimum": 1,
                                  "type": "integer"
                                }
                              }
                            },
                            "observed": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "triggeredLimitKeys"
                              ],
                              "properties": {
                                "promptSourceBytes": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "promptBytes": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "observedInputTokens": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "observedTurns": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "compactHandoffBytes": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "localExplorationToolUses": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "criteriaCount": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "subsystemCount": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "splitAttempts": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "triggeredLimitKeys": {
                                  "maxItems": 32,
                                  "type": "array",
                                  "items": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "assignedCriteriaIds": {
                              "maxItems": 64,
                              "type": "array",
                              "items": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            },
                            "unresolvedCriteria": {
                              "maxItems": 32,
                              "type": "array",
                              "items": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "criterionId",
                                  "reason"
                                ],
                                "properties": {
                                  "criterionId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "reason": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "evidence": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "blockers": {
                              "maxItems": 32,
                              "type": "array",
                              "items": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            },
                            "splitAttempts": {
                              "maxItems": 8,
                              "type": "array",
                              "items": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "attempt",
                                  "reason",
                                  "resultingUnitIds"
                                ],
                                "properties": {
                                  "unitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "attempt": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "reason": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "resultingUnitIds": {
                                    "maxItems": 128,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "observed": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "triggeredLimitKeys"
                                    ],
                                    "properties": {
                                      "promptSourceBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "promptBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "observedInputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "observedTurns": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "compactHandoffBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "localExplorationToolUses": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "criteriaCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "subsystemCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "splitAttempts": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "triggeredLimitKeys": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "source",
                        "failureKind"
                      ],
                      "properties": {
                        "source": {
                          "anyOf": [
                            {
                              "const": "live-context-guard",
                              "type": "string"
                            },
                            {
                              "const": "provider",
                              "type": "string"
                            }
                          ]
                        },
                        "failureKind": {
                          "anyOf": [
                            {
                              "const": "context-budget",
                              "type": "string"
                            },
                            {
                              "const": "context-window",
                              "type": "string"
                            },
                            {
                              "const": "context-length",
                              "type": "string"
                            },
                            {
                              "const": "scope-too-broad",
                              "type": "string"
                            }
                          ]
                        },
                        "decompositionEvidence": {
                          "not": {}
                        }
                      }
                    }
                  ]
                }
              ],
              "properties": {
                "source": {
                  "anyOf": [
                    {
                      "const": "live-context-guard",
                      "type": "string"
                    },
                    {
                      "const": "provider",
                      "type": "string"
                    },
                    {
                      "const": "decomposition",
                      "type": "string"
                    }
                  ]
                },
                "failureKind": {
                  "anyOf": [
                    {
                      "const": "context-budget",
                      "type": "string"
                    },
                    {
                      "const": "context-window",
                      "type": "string"
                    },
                    {
                      "const": "context-length",
                      "type": "string"
                    },
                    {
                      "const": "scope-too-broad",
                      "type": "string"
                    },
                    {
                      "const": "decomposition-exhausted",
                      "type": "string"
                    }
                  ]
                },
                "stage": {
                  "anyOf": [
                    {
                      "const": "planner",
                      "type": "string"
                    },
                    {
                      "const": "compile",
                      "type": "string"
                    },
                    {
                      "const": "planning-decomposition",
                      "type": "string"
                    }
                  ]
                },
                "explanation": {
                  "maxLength": 2000,
                  "type": "string"
                },
                "observed": {
                  "type": "object",
                  "properties": {
                    "inputTokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "outputTokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "turns": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "promptBytes": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                },
                "guardDiagnostics": {
                  "type": "object",
                  "required": [
                    "metadataSource",
                    "outputReserveTokens",
                    "overheadReserveTokens",
                    "safetyMargin",
                    "limits"
                  ],
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "modelId": {
                      "type": "string"
                    },
                    "metadataSource": {
                      "anyOf": [
                        {
                          "const": "registry",
                          "type": "string"
                        },
                        {
                          "const": "builtin",
                          "type": "string"
                        },
                        {
                          "const": "synthetic",
                          "type": "string"
                        },
                        {
                          "const": "fallback",
                          "type": "string"
                        }
                      ]
                    },
                    "fallbackReason": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "contextWindow": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "outputReserveTokens": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "overheadReserveTokens": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "safetyMargin": {
                      "exclusiveMinimum": 0,
                      "maximum": 1,
                      "type": "number"
                    },
                    "limits": {
                      "type": "object",
                      "required": [
                        "maxPromptBytes",
                        "maxObservedInputTokens",
                        "maxExplanationBytes"
                      ],
                      "properties": {
                        "maxPromptBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedInputTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedTurns": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxExplanationBytes": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "decompositionEvidence": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "unitId",
                    "depth",
                    "budgets",
                    "observed",
                    "assignedCriteriaIds",
                    "unresolvedCriteria",
                    "blockers",
                    "splitAttempts"
                  ],
                  "properties": {
                    "unitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "parentUnitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "depth": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgets": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "maxRecursiveDepth",
                        "maxPromptSourceBytes",
                        "maxPromptBytes",
                        "maxObservedInputTokens",
                        "maxCompactHandoffBytes",
                        "maxLocalExplorationToolUses",
                        "maxCriteriaPerUnit",
                        "maxSubsystemsPerUnit",
                        "maxSplitAttemptsPerUnit"
                      ],
                      "properties": {
                        "maxRecursiveDepth": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxPromptSourceBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxPromptBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedInputTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedTurns": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCompactHandoffBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxLocalExplorationToolUses": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCriteriaPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSubsystemsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSplitAttemptsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      }
                    },
                    "observed": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "triggeredLimitKeys"
                      ],
                      "properties": {
                        "promptSourceBytes": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "promptBytes": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "observedInputTokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "observedTurns": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "compactHandoffBytes": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "localExplorationToolUses": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "criteriaCount": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "subsystemCount": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "splitAttempts": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "triggeredLimitKeys": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "assignedCriteriaIds": {
                      "maxItems": 64,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "unresolvedCriteria": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "criterionId",
                          "reason"
                        ],
                        "properties": {
                          "criterionId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "evidence": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "blockers": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "splitAttempts": {
                      "maxItems": 8,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "attempt",
                          "reason",
                          "resultingUnitIds"
                        ],
                        "properties": {
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "resultingUnitIds": {
                            "maxItems": 128,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "observed": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "triggeredLimitKeys"
                            ],
                            "properties": {
                              "promptSourceBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "promptBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedInputTokens": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedTurns": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "compactHandoffBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "localExplorationToolUses": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "criteriaCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "subsystemCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "splitAttempts": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "triggeredLimitKeys": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "recovery": {
                  "type": "object",
                  "required": [
                    "action",
                    "eligible",
                    "attempted",
                    "attempt",
                    "maxAttempts",
                    "reason"
                  ],
                  "properties": {
                    "action": {
                      "anyOf": [
                        {
                          "const": "none",
                          "type": "string"
                        },
                        {
                          "const": "bounded-decomposition",
                          "type": "string"
                        },
                        {
                          "const": "manual-reduce-scope",
                          "type": "string"
                        },
                        {
                          "const": "repair-existing-artifacts",
                          "type": "string"
                        }
                      ]
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "attempted": {
                      "type": "boolean"
                    },
                    "attempt": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "maxAttempts": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "reason": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  }
                },
                "artifacts": {
                  "type": "object",
                  "required": [
                    "orchestrationExists",
                    "validPlanCount",
                    "invalidPlanCount",
                    "missingPlanFileCount",
                    "missingPlanFiles",
                    "invalidPlanFiles"
                  ],
                  "properties": {
                    "orchestrationExists": {
                      "type": "boolean"
                    },
                    "validPlanCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "invalidPlanCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "missingPlanFileCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "missingPlanFiles": {
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "invalidPlanFiles": {
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "graphId",
            "rootUnitId",
            "unitCount",
            "edgeCount",
            "limits"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:start",
              "type": "string"
            },
            "graphId": {
              "maxLength": 2000,
              "type": "string"
            },
            "rootUnitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "unitCount": {
              "minimum": 0,
              "type": "integer"
            },
            "edgeCount": {
              "minimum": 0,
              "type": "integer"
            },
            "limits": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "parallelism",
                "maxDepth",
                "maxPromptSourceBytes",
                "maxPromptBytes",
                "maxObservedInputTokens",
                "maxCompactHandoffBytes",
                "maxLocalExplorationToolUses",
                "maxCriteriaPerUnit",
                "maxSubsystemsPerUnit",
                "maxSplitAttemptsPerUnit"
              ],
              "properties": {
                "parallelism": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxDepth": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxPromptSourceBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxPromptBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxObservedInputTokens": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxObservedTurns": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxCompactHandoffBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxLocalExplorationToolUses": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxCriteriaPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxSubsystemsPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxSplitAttemptsPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unit"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:queued",
              "type": "string"
            },
            "unit": {
              "type": "object",
              "allOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "unitId",
                    "depth",
                    "sourceSlices",
                    "coverage",
                    "subsystemHints",
                    "dependencies",
                    "interfaceConstraints",
                    "sharedFileConstraints",
                    "budgets",
                    "status"
                  ],
                  "properties": {
                    "unitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "parentUnitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "depth": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceSlices": {
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "kind",
                          "sourceHash",
                          "criteriaIds",
                          "byteLength"
                        ],
                        "properties": {
                          "kind": {
                            "anyOf": [
                              {
                                "const": "prd",
                                "type": "string"
                              },
                              {
                                "const": "artifact",
                                "type": "string"
                              },
                              {
                                "const": "file",
                                "type": "string"
                              },
                              {
                                "const": "criteria",
                                "type": "string"
                              },
                              {
                                "const": "other",
                                "type": "string"
                              }
                            ]
                          },
                          "sourceHash": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "headingPath": {
                            "maxItems": 32,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "startLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "endLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "byteStart": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "byteEnd": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "criteriaIds": {
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "byteLength": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "coverage": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "coveredCriteria",
                        "unresolvedCriteria"
                      ],
                      "properties": {
                        "totalCriteria": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "omittedCriteriaCount": {
                          "minimum": 0,
                          "maximum": 10000,
                          "type": "integer"
                        },
                        "coveredCriteria": {
                          "maxItems": 64,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "coveredByUnitIds"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "sourceHash": {
                                "pattern": "^[a-f0-9]{64}$",
                                "type": "string"
                              },
                              "coveredByUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "unresolvedCriteria": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "reason"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "reason": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "evidence": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "subsystemHints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "dependencies": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "interfaceConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "sharedFileConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "budgets": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "maxRecursiveDepth",
                        "maxPromptSourceBytes",
                        "maxPromptBytes",
                        "maxObservedInputTokens",
                        "maxCompactHandoffBytes",
                        "maxLocalExplorationToolUses",
                        "maxCriteriaPerUnit",
                        "maxSubsystemsPerUnit",
                        "maxSplitAttemptsPerUnit"
                      ],
                      "properties": {
                        "maxRecursiveDepth": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxPromptSourceBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxPromptBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedInputTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedTurns": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCompactHandoffBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxLocalExplorationToolUses": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCriteriaPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSubsystemsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSplitAttemptsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      }
                    },
                    "status": {
                      "anyOf": [
                        {
                          "const": "queued",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "completed",
                          "type": "string"
                        },
                        {
                          "const": "skipped",
                          "type": "string"
                        },
                        {
                          "const": "failed",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "queued",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitId"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:running",
              "type": "string"
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitId",
            "message"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:progress",
              "type": "string"
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "message": {
              "maxLength": 2000,
              "type": "string"
            },
            "observed": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "triggeredLimitKeys"
              ],
              "properties": {
                "promptSourceBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "promptBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "observedInputTokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "observedTurns": {
                  "minimum": 0,
                  "type": "integer"
                },
                "compactHandoffBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "localExplorationToolUses": {
                  "minimum": 0,
                  "type": "integer"
                },
                "criteriaCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "subsystemCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "splitAttempts": {
                  "minimum": 0,
                  "type": "integer"
                },
                "triggeredLimitKeys": {
                  "maxItems": 32,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unit"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:completed",
              "type": "string"
            },
            "unit": {
              "type": "object",
              "allOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "unitId",
                    "depth",
                    "sourceSlices",
                    "coverage",
                    "subsystemHints",
                    "dependencies",
                    "interfaceConstraints",
                    "sharedFileConstraints",
                    "budgets",
                    "status"
                  ],
                  "properties": {
                    "unitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "parentUnitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "depth": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceSlices": {
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "kind",
                          "sourceHash",
                          "criteriaIds",
                          "byteLength"
                        ],
                        "properties": {
                          "kind": {
                            "anyOf": [
                              {
                                "const": "prd",
                                "type": "string"
                              },
                              {
                                "const": "artifact",
                                "type": "string"
                              },
                              {
                                "const": "file",
                                "type": "string"
                              },
                              {
                                "const": "criteria",
                                "type": "string"
                              },
                              {
                                "const": "other",
                                "type": "string"
                              }
                            ]
                          },
                          "sourceHash": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "headingPath": {
                            "maxItems": 32,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "startLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "endLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "byteStart": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "byteEnd": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "criteriaIds": {
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "byteLength": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "coverage": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "coveredCriteria",
                        "unresolvedCriteria"
                      ],
                      "properties": {
                        "totalCriteria": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "omittedCriteriaCount": {
                          "minimum": 0,
                          "maximum": 10000,
                          "type": "integer"
                        },
                        "coveredCriteria": {
                          "maxItems": 64,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "coveredByUnitIds"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "sourceHash": {
                                "pattern": "^[a-f0-9]{64}$",
                                "type": "string"
                              },
                              "coveredByUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "unresolvedCriteria": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "reason"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "reason": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "evidence": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "subsystemHints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "dependencies": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "interfaceConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "sharedFileConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "budgets": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "maxRecursiveDepth",
                        "maxPromptSourceBytes",
                        "maxPromptBytes",
                        "maxObservedInputTokens",
                        "maxCompactHandoffBytes",
                        "maxLocalExplorationToolUses",
                        "maxCriteriaPerUnit",
                        "maxSubsystemsPerUnit",
                        "maxSplitAttemptsPerUnit"
                      ],
                      "properties": {
                        "maxRecursiveDepth": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxPromptSourceBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxPromptBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedInputTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedTurns": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCompactHandoffBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxLocalExplorationToolUses": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCriteriaPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSubsystemsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSplitAttemptsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      }
                    },
                    "status": {
                      "anyOf": [
                        {
                          "const": "queued",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "completed",
                          "type": "string"
                        },
                        {
                          "const": "skipped",
                          "type": "string"
                        },
                        {
                          "const": "failed",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "completed",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitId",
            "reason"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:skipped",
              "type": "string"
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "reason": {
              "maxLength": 2000,
              "type": "string"
            },
            "unit": {
              "type": "object",
              "allOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "unitId",
                    "depth",
                    "sourceSlices",
                    "coverage",
                    "subsystemHints",
                    "dependencies",
                    "interfaceConstraints",
                    "sharedFileConstraints",
                    "budgets",
                    "status"
                  ],
                  "properties": {
                    "unitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "parentUnitId": {
                      "maxLength": 2000,
                      "type": "string"
                    },
                    "depth": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "sourceSlices": {
                      "maxItems": 16,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "kind",
                          "sourceHash",
                          "criteriaIds",
                          "byteLength"
                        ],
                        "properties": {
                          "kind": {
                            "anyOf": [
                              {
                                "const": "prd",
                                "type": "string"
                              },
                              {
                                "const": "artifact",
                                "type": "string"
                              },
                              {
                                "const": "file",
                                "type": "string"
                              },
                              {
                                "const": "criteria",
                                "type": "string"
                              },
                              {
                                "const": "other",
                                "type": "string"
                              }
                            ]
                          },
                          "sourceHash": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "headingPath": {
                            "maxItems": 32,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "startLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "endLine": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "byteStart": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "byteEnd": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "criteriaIds": {
                            "maxItems": 64,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          },
                          "byteLength": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "coverage": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "coveredCriteria",
                        "unresolvedCriteria"
                      ],
                      "properties": {
                        "totalCriteria": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "omittedCriteriaCount": {
                          "minimum": 0,
                          "maximum": 10000,
                          "type": "integer"
                        },
                        "coveredCriteria": {
                          "maxItems": 64,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "coveredByUnitIds"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "sourceHash": {
                                "pattern": "^[a-f0-9]{64}$",
                                "type": "string"
                              },
                              "coveredByUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "unresolvedCriteria": {
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "criterionId",
                              "reason"
                            ],
                            "properties": {
                              "criterionId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "reason": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "evidence": {
                                "maxLength": 2000,
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "subsystemHints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "dependencies": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "interfaceConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "sharedFileConstraints": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "description"
                        ],
                        "properties": {
                          "path": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "description": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "budgets": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "maxRecursiveDepth",
                        "maxPromptSourceBytes",
                        "maxPromptBytes",
                        "maxObservedInputTokens",
                        "maxCompactHandoffBytes",
                        "maxLocalExplorationToolUses",
                        "maxCriteriaPerUnit",
                        "maxSubsystemsPerUnit",
                        "maxSplitAttemptsPerUnit"
                      ],
                      "properties": {
                        "maxRecursiveDepth": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxPromptSourceBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxPromptBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedInputTokens": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxObservedTurns": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCompactHandoffBytes": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxLocalExplorationToolUses": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxCriteriaPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSubsystemsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "maxSplitAttemptsPerUnit": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      }
                    },
                    "status": {
                      "anyOf": [
                        {
                          "const": "queued",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "completed",
                          "type": "string"
                        },
                        {
                          "const": "skipped",
                          "type": "string"
                        },
                        {
                          "const": "failed",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "skipped",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitId",
            "reason",
            "evidence"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:unit:failed",
              "type": "string"
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "reason": {
              "maxLength": 2000,
              "type": "string"
            },
            "evidence": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "unitId",
                "depth",
                "budgets",
                "observed",
                "assignedCriteriaIds",
                "unresolvedCriteria",
                "blockers",
                "splitAttempts"
              ],
              "properties": {
                "unitId": {
                  "maxLength": 2000,
                  "type": "string"
                },
                "parentUnitId": {
                  "maxLength": 2000,
                  "type": "string"
                },
                "depth": {
                  "minimum": 0,
                  "type": "integer"
                },
                "budgets": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "maxRecursiveDepth",
                    "maxPromptSourceBytes",
                    "maxPromptBytes",
                    "maxObservedInputTokens",
                    "maxCompactHandoffBytes",
                    "maxLocalExplorationToolUses",
                    "maxCriteriaPerUnit",
                    "maxSubsystemsPerUnit",
                    "maxSplitAttemptsPerUnit"
                  ],
                  "properties": {
                    "maxRecursiveDepth": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "maxPromptSourceBytes": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxPromptBytes": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxObservedInputTokens": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxObservedTurns": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxCompactHandoffBytes": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxLocalExplorationToolUses": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxCriteriaPerUnit": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxSubsystemsPerUnit": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxSplitAttemptsPerUnit": {
                      "minimum": 1,
                      "type": "integer"
                    }
                  }
                },
                "observed": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "triggeredLimitKeys"
                  ],
                  "properties": {
                    "promptSourceBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "promptBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "observedInputTokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "observedTurns": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "compactHandoffBytes": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "localExplorationToolUses": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "criteriaCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "subsystemCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "splitAttempts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "triggeredLimitKeys": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    }
                  }
                },
                "assignedCriteriaIds": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "unresolvedCriteria": {
                  "maxItems": 32,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "criterionId",
                      "reason"
                    ],
                    "properties": {
                      "criterionId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "reason": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "evidence": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    }
                  }
                },
                "blockers": {
                  "maxItems": 32,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "splitAttempts": {
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "attempt",
                      "reason",
                      "resultingUnitIds"
                    ],
                    "properties": {
                      "unitId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "attempt": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "reason": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "resultingUnitIds": {
                        "maxItems": 128,
                        "type": "array",
                        "items": {
                          "maxLength": 2000,
                          "type": "string"
                        }
                      },
                      "observed": {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "triggeredLimitKeys"
                        ],
                        "properties": {
                          "promptSourceBytes": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "promptBytes": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "observedInputTokens": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "observedTurns": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "compactHandoffBytes": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "localExplorationToolUses": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "criteriaCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "subsystemCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "splitAttempts": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "triggeredLimitKeys": {
                            "maxItems": 32,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "decision"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:schedule",
              "type": "string"
            },
            "decision": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "readyUnitIds",
                "runningUnitIds",
                "waitingUnitIds",
                "waitingReasons",
                "selectedBatchUnitIds",
                "parallelism",
                "blockedPairs"
              ],
              "properties": {
                "readyUnitIds": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "runningUnitIds": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "waitingUnitIds": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "waitingReasons": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "unitId",
                      "reasons"
                    ],
                    "properties": {
                      "unitId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "reasons": {
                        "maxItems": 32,
                        "type": "array",
                        "items": {
                          "maxLength": 2000,
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "selectedBatchUnitIds": {
                  "maxItems": 128,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "parallelism": {
                  "minimum": 1,
                  "type": "integer"
                },
                "blockedPairs": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "unitId",
                      "blockedByUnitId"
                    ],
                    "properties": {
                      "unitId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "blockedByUnitId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "reason": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "limits",
            "unitId",
            "unitBudgets"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:budget",
              "type": "string"
            },
            "limits": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "parallelism",
                "maxDepth",
                "maxPromptSourceBytes",
                "maxPromptBytes",
                "maxObservedInputTokens",
                "maxCompactHandoffBytes",
                "maxLocalExplorationToolUses",
                "maxCriteriaPerUnit",
                "maxSubsystemsPerUnit",
                "maxSplitAttemptsPerUnit"
              ],
              "properties": {
                "parallelism": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxDepth": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxPromptSourceBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxPromptBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxObservedInputTokens": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxObservedTurns": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxCompactHandoffBytes": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxLocalExplorationToolUses": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxCriteriaPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxSubsystemsPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                },
                "maxSplitAttemptsPerUnit": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "unitBudgets": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "unitId",
                  "budget"
                ],
                "properties": {
                  "unitId": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "budget": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "maxRecursiveDepth",
                      "maxPromptSourceBytes",
                      "maxPromptBytes",
                      "maxObservedInputTokens",
                      "maxCompactHandoffBytes",
                      "maxLocalExplorationToolUses",
                      "maxCriteriaPerUnit",
                      "maxSubsystemsPerUnit",
                      "maxSplitAttemptsPerUnit"
                    ],
                    "properties": {
                      "maxRecursiveDepth": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "maxPromptSourceBytes": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxPromptBytes": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxObservedInputTokens": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxObservedTurns": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxCompactHandoffBytes": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxLocalExplorationToolUses": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxCriteriaPerUnit": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxSubsystemsPerUnit": {
                        "minimum": 1,
                        "type": "integer"
                      },
                      "maxSplitAttemptsPerUnit": {
                        "minimum": 1,
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            },
            "observed": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "triggeredLimitKeys"
              ],
              "properties": {
                "promptSourceBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "promptBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "observedInputTokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "observedTurns": {
                  "minimum": 0,
                  "type": "integer"
                },
                "compactHandoffBytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "localExplorationToolUses": {
                  "minimum": 0,
                  "type": "integer"
                },
                "criteriaCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "subsystemCount": {
                  "minimum": 0,
                  "type": "integer"
                },
                "splitAttempts": {
                  "minimum": 0,
                  "type": "integer"
                },
                "triggeredLimitKeys": {
                  "maxItems": 32,
                  "type": "array",
                  "items": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitId",
            "artifactPath",
            "byteLength",
            "contentHash",
            "omittedUnitIds"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:compact-handoff",
              "type": "string"
            },
            "unitId": {
              "maxLength": 2000,
              "type": "string"
            },
            "artifactPath": {
              "maxLength": 2000,
              "type": "string"
            },
            "byteLength": {
              "minimum": 0,
              "type": "integer"
            },
            "contentHash": {
              "pattern": "^[a-f0-9]{64}$",
              "type": "string"
            },
            "omittedUnitIds": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "maxLength": 2000,
                "type": "string"
              }
            }
          }
        },
        {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "timestamp",
            "type",
            "unitCount",
            "completedUnitCount",
            "failedUnitCount",
            "skippedUnitCount",
            "coverage",
            "artifactPaths"
          ],
          "properties": {
            "timestamp": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "type": {
              "const": "planning:decomposition:synthesis:complete",
              "type": "string"
            },
            "unitCount": {
              "minimum": 0,
              "type": "integer"
            },
            "completedUnitCount": {
              "minimum": 0,
              "type": "integer"
            },
            "failedUnitCount": {
              "minimum": 0,
              "type": "integer"
            },
            "skippedUnitCount": {
              "minimum": 0,
              "type": "integer"
            },
            "coverage": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "coveredCriteria",
                "unresolvedCriteria"
              ],
              "properties": {
                "totalCriteria": {
                  "minimum": 0,
                  "type": "integer"
                },
                "omittedCriteriaCount": {
                  "minimum": 0,
                  "maximum": 10000,
                  "type": "integer"
                },
                "coveredCriteria": {
                  "maxItems": 64,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "criterionId",
                      "coveredByUnitIds"
                    ],
                    "properties": {
                      "criterionId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "sourceHash": {
                        "pattern": "^[a-f0-9]{64}$",
                        "type": "string"
                      },
                      "coveredByUnitIds": {
                        "maxItems": 128,
                        "type": "array",
                        "items": {
                          "maxLength": 2000,
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "unresolvedCriteria": {
                  "maxItems": 32,
                  "type": "array",
                  "items": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "criterionId",
                      "reason"
                    ],
                    "properties": {
                      "criterionId": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "reason": {
                        "maxLength": 2000,
                        "type": "string"
                      },
                      "evidence": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "artifactPaths": {
              "maxItems": 32,
              "type": "array",
              "items": {
                "maxLength": 2000,
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "questions"
          ],
          "properties": {
            "type": {
              "const": "planning:clarification",
              "type": "string"
            },
            "questions": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "question"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "question": {
                    "type": "string"
                  },
                  "context": {
                    "type": "string"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "default": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "answers"
          ],
          "properties": {
            "type": {
              "const": "planning:clarification:answer",
              "type": "string"
            },
            "answers": {
              "type": "object",
              "patternProperties": {
                "^(.*)$": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "message"
          ],
          "properties": {
            "type": {
              "const": "planning:progress",
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "attempt",
            "maxContinuations"
          ],
          "properties": {
            "type": {
              "const": "planning:continuation",
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxContinuations": {
              "type": "number"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "max_turns",
                  "type": "string"
                },
                {
                  "const": "dropped_submission",
                  "type": "string"
                },
                {
                  "const": "compact_inspection",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "compile",
            "defaultBuild",
            "defaultReview",
            "rationale"
          ],
          "properties": {
            "type": {
              "const": "planning:pipeline",
              "type": "string"
            },
            "compile": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "defaultBuild": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              }
            },
            "defaultReview": {
              "type": "object",
              "required": [
                "strategy",
                "perspectives",
                "maxRounds",
                "evaluatorStrictness"
              ],
              "properties": {
                "strategy": {
                  "anyOf": [
                    {
                      "const": "auto",
                      "type": "string"
                    },
                    {
                      "const": "single",
                      "type": "string"
                    },
                    {
                      "const": "parallel",
                      "type": "string"
                    }
                  ]
                },
                "perspectives": {
                  "type": "array",
                  "items": {
                    "pattern": "^[a-z][a-z0-9-]{0,63}$",
                    "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                    "type": "string"
                  }
                },
                "maxRounds": {
                  "type": "number"
                },
                "evaluatorStrictness": {
                  "anyOf": [
                    {
                      "const": "strict",
                      "type": "string"
                    },
                    {
                      "const": "standard",
                      "type": "string"
                    },
                    {
                      "const": "lenient",
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "rationale": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "plans"
          ],
          "properties": {
            "type": {
              "const": "planning:complete",
              "type": "string"
            },
            "plans": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "dependsOn",
                  "branch",
                  "body",
                  "filePath"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "dependsOn": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "branch": {
                    "type": "string"
                  },
                  "migrations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "timestamp",
                        "description"
                      ],
                      "properties": {
                        "timestamp": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "agents": {
                    "type": "object",
                    "patternProperties": {
                      "^(.*)$": {
                        "type": "object",
                        "properties": {
                          "effort": {
                            "type": "string"
                          },
                          "thinking": {
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "object",
                                "patternProperties": {
                                  "^(.*)$": {}
                                }
                              }
                            ]
                          },
                          "rationale": {
                            "type": "string"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "shards": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "roots": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "files": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "body": {
                    "type": "string"
                  },
                  "filePath": {
                    "type": "string"
                  },
                  "warnings": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "planConfigs": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "build": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "review": {
                    "type": "object",
                    "required": [
                      "strategy",
                      "perspectives",
                      "maxRounds",
                      "evaluatorStrictness"
                    ],
                    "properties": {
                      "strategy": {
                        "anyOf": [
                          {
                            "const": "auto",
                            "type": "string"
                          },
                          {
                            "const": "single",
                            "type": "string"
                          },
                          {
                            "const": "parallel",
                            "type": "string"
                          }
                        ]
                      },
                      "perspectives": {
                        "type": "array",
                        "items": {
                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                          "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                          "type": "string"
                        }
                      },
                      "maxRounds": {
                        "type": "number"
                      },
                      "evaluatorStrictness": {
                        "anyOf": [
                          {
                            "const": "strict",
                            "type": "string"
                          },
                          {
                            "const": "standard",
                            "type": "string"
                          },
                          {
                            "const": "lenient",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  },
                  "testOwnership": {
                    "description": "Exclusive owner of new acceptance-test authoring for a plan",
                    "anyOf": [
                      {
                        "const": "builder",
                        "type": "string"
                      },
                      {
                        "const": "test-writer",
                        "type": "string"
                      },
                      {
                        "const": "existing-only",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "planning:review:start",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "issues"
          ],
          "properties": {
            "type": {
              "const": "planning:review:complete",
              "type": "string"
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "severity",
                  "category",
                  "file",
                  "description"
                ],
                "properties": {
                  "issueId": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "\\S",
                    "type": "string"
                  },
                  "severity": {
                    "anyOf": [
                      {
                        "const": "critical",
                        "type": "string"
                      },
                      {
                        "const": "warning",
                        "type": "string"
                      },
                      {
                        "const": "suggestion",
                        "type": "string"
                      }
                    ]
                  },
                  "category": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  },
                  "line": {
                    "type": "number"
                  },
                  "description": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  },
                  "retryGuidance": {
                    "type": "string"
                  },
                  "failureKind": {
                    "type": "string"
                  },
                  "repairClass": {
                    "anyOf": [
                      {
                        "const": "narrow",
                        "type": "string"
                      },
                      {
                        "const": "structural",
                        "type": "string"
                      },
                      {
                        "const": "manual",
                        "type": "string"
                      },
                      {
                        "const": "followup",
                        "type": "string"
                      }
                    ]
                  },
                  "metadata": {
                    "type": "object",
                    "patternProperties": {
                      "^(.*)$": {
                        "$id": "TypeBoxRecursive1",
                        "anyOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "maxLength": 4096,
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "$ref": "TypeBoxRecursive1"
                            }
                          },
                          {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {
                                "$ref": "TypeBoxRecursive1"
                              }
                            }
                          }
                        ]
                      }
                    }
                  },
                  "validationProviderName": {
                    "type": "string"
                  },
                  "runtimeFailureKind": {
                    "anyOf": [
                      {
                        "const": "result",
                        "type": "string"
                      },
                      {
                        "const": "command",
                        "type": "string"
                      },
                      {
                        "const": "timeout",
                        "type": "string"
                      },
                      {
                        "const": "exception",
                        "type": "string"
                      },
                      {
                        "const": "unexpected-return",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "planning:evaluate:start",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "attempt",
            "maxContinuations"
          ],
          "properties": {
            "type": {
              "const": "planning:evaluate:continuation",
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxContinuations": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "accepted",
            "rejected"
          ],
          "properties": {
            "type": {
              "const": "planning:evaluate:complete",
              "type": "string"
            },
            "accepted": {
              "type": "number"
            },
            "rejected": {
              "type": "number"
            },
            "verdicts": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "file",
                  "action",
                  "reason"
                ],
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "action": {
                    "anyOf": [
                      {
                        "const": "accept",
                        "type": "string"
                      },
                      {
                        "const": "reject",
                        "type": "string"
                      },
                      {
                        "const": "review",
                        "type": "string"
                      }
                    ]
                  },
                  "reason": {
                    "type": "string"
                  },
                  "hunk": {
                    "minimum": 1,
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "graphId",
            "atomCount",
            "edgeCount",
            "atoms",
            "edges"
          ],
          "properties": {
            "type": {
              "const": "planning:map-reduce:atoms",
              "type": "string"
            },
            "graphId": {
              "maxLength": 2000,
              "type": "string"
            },
            "atomCount": {
              "minimum": 0,
              "type": "integer"
            },
            "edgeCount": {
              "minimum": 0,
              "type": "integer"
            },
            "atoms": {
              "maxItems": 1024,
              "type": "array",
              "items": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "atomId",
                  "title",
                  "reason",
                  "criterionIds",
                  "dependencyAtomIds"
                ],
                "properties": {
                  "atomId": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "title": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "const": "foundation-contract",
                        "type": "string"
                      },
                      {
                        "const": "subsystem",
                        "type": "string"
                      },
                      {
                        "const": "oversized-criterion",
                        "type": "string"
                      },
                      {
                        "const": "general",
                        "type": "string"
                      },
                      {
                        "const": "rescope-split",
                        "type": "string"
                      },
                      {
                        "const": "risk-split",
                        "type": "string"
                      }
                    ]
                  },
                  "criterionIds": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  },
                  "dependencyAtomIds": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  }
                }
              }
            },
            "edges": {
              "maxItems": 2048,
              "type": "array",
              "items": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "fromAtomId",
                  "toAtomId",
                  "reason"
                ],
                "properties": {
                  "fromAtomId": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "toAtomId": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "reason": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "atomId",
            "status"
          ],
          "properties": {
            "type": {
              "const": "planning:map-reduce:atom:status",
              "type": "string"
            },
            "atomId": {
              "maxLength": 2000,
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "queued",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "completed",
                  "type": "string"
                },
                {
                  "const": "skipped",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "maxLength": 2000,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "graphId",
            "maxDepth",
            "nodeCount",
            "nodes"
          ],
          "properties": {
            "type": {
              "const": "planning:map-reduce:reduce-tree",
              "type": "string"
            },
            "graphId": {
              "maxLength": 2000,
              "type": "string"
            },
            "rootNodeId": {
              "maxLength": 2000,
              "type": "string"
            },
            "maxDepth": {
              "minimum": 0,
              "type": "integer"
            },
            "nodeCount": {
              "minimum": 0,
              "type": "integer"
            },
            "nodes": {
              "maxItems": 1024,
              "type": "array",
              "items": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "nodeId",
                  "depth",
                  "inputAtomIds",
                  "inputNodeIds"
                ],
                "properties": {
                  "nodeId": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "depth": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "inputAtomIds": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  },
                  "inputNodeIds": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxLength": 2000,
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "nodeId",
            "status"
          ],
          "properties": {
            "type": {
              "const": "planning:map-reduce:reduce:status",
              "type": "string"
            },
            "nodeId": {
              "maxLength": 2000,
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "queued",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "completed",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "incomplete",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "maxLength": 2000,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:implement:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "message"
          ],
          "properties": {
            "type": {
              "const": "plan:build:implement:progress",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "attempt",
            "maxContinuations"
          ],
          "properties": {
            "type": {
              "const": "plan:build:implement:continuation",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxContinuations": {
              "type": "number"
            },
            "shardId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:implement:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "files"
          ],
          "properties": {
            "type": {
              "const": "plan:build:files_changed",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "files": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "diffs": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "path",
                  "diff"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "diff": {
                    "type": "string"
                  }
                }
              }
            },
            "baseBranch": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "issues"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "severity",
                  "category",
                  "file",
                  "description"
                ],
                "properties": {
                  "issueId": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "\\S",
                    "type": "string"
                  },
                  "severity": {
                    "anyOf": [
                      {
                        "const": "critical",
                        "type": "string"
                      },
                      {
                        "const": "warning",
                        "type": "string"
                      },
                      {
                        "const": "suggestion",
                        "type": "string"
                      }
                    ]
                  },
                  "category": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  },
                  "line": {
                    "type": "number"
                  },
                  "description": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  },
                  "retryGuidance": {
                    "type": "string"
                  },
                  "failureKind": {
                    "type": "string"
                  },
                  "repairClass": {
                    "anyOf": [
                      {
                        "const": "narrow",
                        "type": "string"
                      },
                      {
                        "const": "structural",
                        "type": "string"
                      },
                      {
                        "const": "manual",
                        "type": "string"
                      },
                      {
                        "const": "followup",
                        "type": "string"
                      }
                    ]
                  },
                  "metadata": {
                    "type": "object",
                    "patternProperties": {
                      "^(.*)$": {
                        "$id": "TypeBoxRecursive1",
                        "anyOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "maxLength": 4096,
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "$ref": "TypeBoxRecursive1"
                            }
                          },
                          {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {
                                "$ref": "TypeBoxRecursive1"
                              }
                            }
                          }
                        ]
                      }
                    }
                  },
                  "validationProviderName": {
                    "type": "string"
                  },
                  "runtimeFailureKind": {
                    "anyOf": [
                      {
                        "const": "result",
                        "type": "string"
                      },
                      {
                        "const": "command",
                        "type": "string"
                      },
                      {
                        "const": "timeout",
                        "type": "string"
                      },
                      {
                        "const": "exception",
                        "type": "string"
                      },
                      {
                        "const": "unexpected-return",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "perspectives"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:parallel:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "perspectives": {
              "type": "array",
              "items": {
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                "type": "string"
              }
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "perspective"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:parallel:perspective:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "perspective": {
              "pattern": "^[a-z][a-z0-9-]{0,63}$",
              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
              "type": "string"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "perspective",
            "issues"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:parallel:perspective:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "perspective": {
              "pattern": "^[a-z][a-z0-9-]{0,63}$",
              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
              "type": "string"
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "severity",
                  "category",
                  "file",
                  "description"
                ],
                "properties": {
                  "issueId": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "\\S",
                    "type": "string"
                  },
                  "severity": {
                    "anyOf": [
                      {
                        "const": "critical",
                        "type": "string"
                      },
                      {
                        "const": "warning",
                        "type": "string"
                      },
                      {
                        "const": "suggestion",
                        "type": "string"
                      }
                    ]
                  },
                  "category": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  },
                  "line": {
                    "type": "number"
                  },
                  "description": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  },
                  "retryGuidance": {
                    "type": "string"
                  },
                  "failureKind": {
                    "type": "string"
                  },
                  "repairClass": {
                    "anyOf": [
                      {
                        "const": "narrow",
                        "type": "string"
                      },
                      {
                        "const": "structural",
                        "type": "string"
                      },
                      {
                        "const": "manual",
                        "type": "string"
                      },
                      {
                        "const": "followup",
                        "type": "string"
                      }
                    ]
                  },
                  "metadata": {
                    "type": "object",
                    "patternProperties": {
                      "^(.*)$": {
                        "$id": "TypeBoxRecursive1",
                        "anyOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "maxLength": 4096,
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "$ref": "TypeBoxRecursive1"
                            }
                          },
                          {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {
                                "$ref": "TypeBoxRecursive1"
                              }
                            }
                          }
                        ]
                      }
                    }
                  },
                  "validationProviderName": {
                    "type": "string"
                  },
                  "runtimeFailureKind": {
                    "anyOf": [
                      {
                        "const": "result",
                        "type": "string"
                      },
                      {
                        "const": "command",
                        "type": "string"
                      },
                      {
                        "const": "timeout",
                        "type": "string"
                      },
                      {
                        "const": "exception",
                        "type": "string"
                      },
                      {
                        "const": "unexpected-return",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "perspective",
            "error"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:parallel:perspective:error",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "perspective": {
              "pattern": "^[a-z][a-z0-9-]{0,63}$",
              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "issueCount"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:fix:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "issueCount": {
              "type": "number"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:fix:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            },
            "issueReferences": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "issueId",
                  "status"
                ],
                "properties": {
                  "issueId": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "\\S",
                    "type": "string"
                  },
                  "status": {
                    "anyOf": [
                      {
                        "const": "addressed",
                        "type": "string"
                      },
                      {
                        "const": "deferred",
                        "type": "string"
                      },
                      {
                        "const": "obsolete",
                        "type": "string"
                      }
                    ]
                  },
                  "note": {
                    "minLength": 1,
                    "maxLength": 4096,
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "attempt",
            "maxContinuations"
          ],
          "properties": {
            "type": {
              "const": "plan:build:review:fix:continuation",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxContinuations": {
              "type": "number"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:evaluate:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "attempt",
            "maxContinuations"
          ],
          "properties": {
            "type": {
              "const": "plan:build:evaluate:continuation",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxContinuations": {
              "type": "number"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "accepted",
            "rejected"
          ],
          "properties": {
            "type": {
              "const": "plan:build:evaluate:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "accepted": {
              "type": "number"
            },
            "rejected": {
              "type": "number"
            },
            "round": {
              "minimum": 0,
              "type": "integer"
            },
            "resolvedIssueOutcomes": {
              "type": "number"
            },
            "falsePositiveIssueOutcomes": {
              "type": "number"
            },
            "unresolvedIssueOutcomes": {
              "type": "number"
            },
            "unresolvedNonBlockingIssueOutcomes": {
              "type": "number"
            },
            "needsHumanReviewIssueOutcomes": {
              "type": "number"
            },
            "acceptedRiskIssueOutcomes": {
              "type": "number"
            },
            "splitToFollowupIssueOutcomes": {
              "type": "number"
            },
            "blockingIssueOutcomes": {
              "type": "number"
            },
            "verdicts": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "file",
                  "action",
                  "reason"
                ],
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "action": {
                    "anyOf": [
                      {
                        "const": "accept",
                        "type": "string"
                      },
                      {
                        "const": "reject",
                        "type": "string"
                      },
                      {
                        "const": "review",
                        "type": "string"
                      }
                    ]
                  },
                  "reason": {
                    "type": "string"
                  },
                  "hunk": {
                    "minimum": 1,
                    "type": "integer"
                  },
                  "issueOutcome": {
                    "description": "Evaluator issue disposition separate from patch action. Missing values are interpreted conservatively by the engine.",
                    "anyOf": [
                      {
                        "const": "resolved",
                        "type": "string"
                      },
                      {
                        "const": "false_positive",
                        "type": "string"
                      },
                      {
                        "const": "unresolved",
                        "type": "string"
                      },
                      {
                        "const": "unresolved_blocking",
                        "type": "string"
                      },
                      {
                        "const": "unresolved_nonblocking",
                        "type": "string"
                      },
                      {
                        "const": "needs_human_review",
                        "type": "string"
                      },
                      {
                        "const": "accepted_risk",
                        "type": "string"
                      },
                      {
                        "const": "split_to_followup",
                        "type": "string"
                      }
                    ]
                  },
                  "retryGuidance": {
                    "type": "string"
                  },
                  "issueIds": {
                    "type": "array",
                    "items": {
                      "minLength": 1,
                      "maxLength": 4096,
                      "pattern": "\\S",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:doc-author:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "docsAuthored"
          ],
          "properties": {
            "type": {
              "const": "plan:build:doc-author:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "docsAuthored": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:doc-sync:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "docsSynced"
          ],
          "properties": {
            "type": {
              "const": "plan:build:doc-sync:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "docsSynced": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "stage",
            "declaredOwner",
            "changedPaths",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "plan:build:test:ownership:violation",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "stage": {
              "anyOf": [
                {
                  "const": "implement",
                  "type": "string"
                },
                {
                  "const": "test-write",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "declaredOwner": {
              "anyOf": [
                {
                  "description": "Exclusive owner of new acceptance-test authoring for a plan",
                  "anyOf": [
                    {
                      "const": "builder",
                      "type": "string"
                    },
                    {
                      "const": "test-writer",
                      "type": "string"
                    },
                    {
                      "const": "existing-only",
                      "type": "string"
                    }
                  ]
                },
                {
                  "const": "unspecified",
                  "type": "string"
                }
              ]
            },
            "changedPaths": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:test:write:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "testsWritten"
          ],
          "properties": {
            "type": {
              "const": "plan:build:test:write:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "testsWritten": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:test:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "passed",
            "failed",
            "testBugsFixed",
            "productionIssues"
          ],
          "properties": {
            "type": {
              "const": "plan:build:test:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "passed": {
              "type": "number"
            },
            "failed": {
              "type": "number"
            },
            "testBugsFixed": {
              "type": "number"
            },
            "productionIssues": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "severity",
                  "category",
                  "file",
                  "testFile",
                  "description"
                ],
                "properties": {
                  "severity": {
                    "anyOf": [
                      {
                        "const": "critical",
                        "type": "string"
                      },
                      {
                        "const": "warning",
                        "type": "string"
                      }
                    ]
                  },
                  "category": {
                    "anyOf": [
                      {
                        "const": "production-bug",
                        "type": "string"
                      },
                      {
                        "const": "missing-behavior",
                        "type": "string"
                      },
                      {
                        "const": "regression",
                        "type": "string"
                      }
                    ]
                  },
                  "file": {
                    "type": "string"
                  },
                  "testFile": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "testOutput": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:build:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "blockerKind",
            "issueCount",
            "maxAttempts",
            "attemptsRemaining"
          ],
          "properties": {
            "type": {
              "const": "plan:build:recovery:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "blockerKind": {
              "anyOf": [
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "issueCount": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            },
            "attemptsRemaining": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "blockerKind",
            "attempt",
            "maxAttempts",
            "attemptsRemaining"
          ],
          "properties": {
            "type": {
              "const": "plan:build:recovery:attempt:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "blockerKind": {
              "anyOf": [
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "attempt": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            },
            "attemptsRemaining": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "blockerKind",
            "attempt",
            "maxAttempts",
            "blockersCleared",
            "attemptsRemaining"
          ],
          "properties": {
            "type": {
              "const": "plan:build:recovery:attempt:result",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "blockerKind": {
              "anyOf": [
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "attempt": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            },
            "blockersCleared": {
              "type": "boolean"
            },
            "attemptsRemaining": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "blockerKind",
            "reason",
            "details",
            "attemptsRemaining"
          ],
          "properties": {
            "type": {
              "const": "plan:build:recovery:skip",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "blockerKind": {
              "anyOf": [
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "const": "not-active-plan",
                  "type": "string"
                },
                {
                  "const": "manual-gate",
                  "type": "string"
                },
                {
                  "const": "human-review-gate",
                  "type": "string"
                },
                {
                  "const": "cross-plan-blocker",
                  "type": "string"
                },
                {
                  "const": "upstream-or-base-owned",
                  "type": "string"
                },
                {
                  "const": "low-confidence",
                  "type": "string"
                },
                {
                  "const": "incomplete-classification",
                  "type": "string"
                },
                {
                  "const": "unsupported-blocker",
                  "type": "string"
                },
                {
                  "const": "unsafe-worktree",
                  "type": "string"
                },
                {
                  "const": "budget-exhausted",
                  "type": "string"
                },
                {
                  "const": "stale-pass-data",
                  "type": "string"
                }
              ]
            },
            "details": {
              "type": "string"
            },
            "attemptsRemaining": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "blockerKind",
            "attemptsUsed",
            "maxAttempts",
            "details"
          ],
          "properties": {
            "type": {
              "const": "plan:build:recovery:exhausted",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "blockerKind": {
              "anyOf": [
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                }
              ]
            },
            "attemptsUsed": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            },
            "details": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "error"
          ],
          "properties": {
            "type": {
              "const": "plan:build:failed",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "terminalSubtype": {
              "anyOf": [
                {
                  "const": "error_max_turns",
                  "type": "string"
                },
                {
                  "const": "error_max_budget_usd",
                  "type": "string"
                },
                {
                  "const": "error_max_structured_output_retries",
                  "type": "string"
                },
                {
                  "const": "error_during_execution",
                  "type": "string"
                },
                {
                  "const": "error_pi_tool_infrastructure",
                  "type": "string"
                },
                {
                  "const": "error_context_window",
                  "type": "string"
                },
                {
                  "const": "error_transient_transport",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "message"
          ],
          "properties": {
            "type": {
              "const": "plan:build:progress",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "status"
          ],
          "properties": {
            "type": {
              "const": "plan:status:change",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "pending",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "completed",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "blocked",
                  "type": "string"
                },
                {
                  "const": "merged",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "error"
          ],
          "properties": {
            "type": {
              "const": "plan:error:set",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:error:clear",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planIds"
          ],
          "properties": {
            "type": {
              "const": "schedule:start",
              "type": "string"
            },
            "planIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "plan:schedule:ready",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:merge:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:merge:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "commitSha": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId"
          ],
          "properties": {
            "type": {
              "const": "plan:merge:resolve:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "resolved"
          ],
          "properties": {
            "type": {
              "const": "plan:merge:resolve:complete",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "resolved": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "baseBranch"
          ],
          "properties": {
            "type": {
              "const": "merge:finalize:start",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "baseBranch"
          ],
          "properties": {
            "type": {
              "const": "merge:finalize:complete",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "commitSha": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "baseBranch",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "merge:finalize:skipped",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "action",
            "featureBranch",
            "baseBranch"
          ],
          "properties": {
            "type": {
              "const": "landing:start",
              "type": "string"
            },
            "action": {
              "anyOf": [
                {
                  "const": "pr",
                  "type": "string"
                },
                {
                  "const": "merge",
                  "type": "string"
                },
                {
                  "const": "leave",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "trunkBranch": {
              "type": "string"
            },
            "workflow": {
              "anyOf": [
                {
                  "const": "trunk-pr",
                  "type": "string"
                },
                {
                  "const": "trunk-local-merge",
                  "type": "string"
                },
                {
                  "const": "feature-pr",
                  "type": "string"
                },
                {
                  "const": "feature-local-merge",
                  "type": "string"
                },
                {
                  "const": "leave-branch",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "action",
            "featureBranch",
            "baseBranch"
          ],
          "properties": {
            "type": {
              "const": "landing:complete",
              "type": "string"
            },
            "action": {
              "anyOf": [
                {
                  "const": "pr",
                  "type": "string"
                },
                {
                  "const": "merge",
                  "type": "string"
                },
                {
                  "const": "leave",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "commitSha": {
              "type": "string"
            },
            "prUrl": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "action",
            "featureBranch",
            "baseBranch",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "landing:skipped",
              "type": "string"
            },
            "action": {
              "anyOf": [
                {
                  "const": "pr",
                  "type": "string"
                },
                {
                  "const": "merge",
                  "type": "string"
                },
                {
                  "const": "leave",
                  "type": "string"
                }
              ]
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "prUrl"
          ],
          "properties": {
            "type": {
              "const": "landing:auto-merge:start",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "prUrl": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "prUrl"
          ],
          "properties": {
            "type": {
              "const": "landing:auto-merge:complete",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "prUrl": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "featureBranch",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "landing:auto-merge:skipped",
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "prUrl": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "path"
          ],
          "properties": {
            "type": {
              "const": "merge:worktree:set",
              "type": "string"
            },
            "path": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "merge:worktree:clear",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "model",
            "harness",
            "harnessSource",
            "tier",
            "tierSource",
            "runtimeChoice",
            "runtimeChoiceQualified",
            "runtimeChoiceSource"
          ],
          "properties": {
            "type": {
              "const": "agent:start",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "model": {
              "type": "string"
            },
            "harness": {
              "anyOf": [
                {
                  "const": "claude-sdk",
                  "type": "string"
                },
                {
                  "const": "pi",
                  "type": "string"
                }
              ]
            },
            "harnessSource": {
              "const": "tier",
              "type": "string"
            },
            "tier": {
              "type": "string"
            },
            "tierSource": {
              "anyOf": [
                {
                  "const": "tier",
                  "type": "string"
                },
                {
                  "const": "role",
                  "type": "string"
                },
                {
                  "const": "plan",
                  "type": "string"
                }
              ]
            },
            "runtimeChoice": {
              "type": "string"
            },
            "runtimeChoiceQualified": {
              "type": "string"
            },
            "runtimeChoiceSource": {
              "anyOf": [
                {
                  "const": "default",
                  "type": "string"
                },
                {
                  "const": "rule",
                  "type": "string"
                },
                {
                  "const": "extension-router",
                  "type": "string"
                },
                {
                  "const": "fallback",
                  "type": "string"
                }
              ]
            },
            "runtimeChoiceRule": {
              "type": "string"
            },
            "runtimeChoiceRouter": {
              "type": "string"
            },
            "runtimeChoiceFallbackReason": {
              "anyOf": [
                {
                  "const": "no-match",
                  "type": "string"
                },
                {
                  "const": "router-declined",
                  "type": "string"
                },
                {
                  "const": "router-timeout",
                  "type": "string"
                },
                {
                  "const": "router-error",
                  "type": "string"
                },
                {
                  "const": "router-invalid-choice",
                  "type": "string"
                }
              ]
            },
            "effort": {
              "type": "string"
            },
            "effortSource": {
              "anyOf": [
                {
                  "const": "tier",
                  "type": "string"
                },
                {
                  "const": "role",
                  "type": "string"
                },
                {
                  "const": "plan",
                  "type": "string"
                }
              ]
            },
            "thinking": {
              "type": "object",
              "patternProperties": {
                "^(.*)$": {}
              }
            },
            "thinkingSource": {
              "anyOf": [
                {
                  "const": "tier",
                  "type": "string"
                },
                {
                  "const": "role",
                  "type": "string"
                },
                {
                  "const": "plan",
                  "type": "string"
                }
              ]
            },
            "effortClamped": {
              "type": "boolean"
            },
            "effortOriginal": {
              "type": "string"
            },
            "thinkingCoerced": {
              "type": "boolean"
            },
            "thinkingOriginal": {
              "type": "object",
              "patternProperties": {
                "^(.*)$": {}
              }
            },
            "perspective": {
              "pattern": "^[a-z][a-z0-9-]{0,63}$",
              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
              "type": "string"
            },
            "toolbelt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "toolbeltSource": {
              "anyOf": [
                {
                  "const": "tier",
                  "type": "string"
                },
                {
                  "const": "role",
                  "type": "string"
                },
                {
                  "const": "plan",
                  "type": "string"
                },
                {
                  "const": "default",
                  "type": "string"
                }
              ]
            },
            "projectMcpSelection": {
              "anyOf": [
                {
                  "const": "all",
                  "type": "string"
                },
                {
                  "const": "none",
                  "type": "string"
                },
                {
                  "const": "toolbelt",
                  "type": "string"
                }
              ]
            },
            "projectMcpServerNames": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "code",
            "message"
          ],
          "properties": {
            "type": {
              "const": "agent:warning",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent"
          ],
          "properties": {
            "type": {
              "const": "agent:stop",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "usage",
            "costUsd",
            "numTurns"
          ],
          "properties": {
            "type": {
              "const": "agent:usage",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "usage": {
              "type": "object",
              "required": [
                "input",
                "output",
                "total",
                "cacheRead",
                "cacheCreation"
              ],
              "properties": {
                "input": {
                  "type": "number"
                },
                "output": {
                  "type": "number"
                },
                "total": {
                  "type": "number"
                },
                "cacheRead": {
                  "type": "number"
                },
                "cacheCreation": {
                  "type": "number"
                }
              }
            },
            "costUsd": {
              "type": "number"
            },
            "numTurns": {
              "type": "number"
            },
            "final": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "content"
          ],
          "properties": {
            "type": {
              "const": "agent:message",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "content": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "tool",
            "toolUseId",
            "input"
          ],
          "properties": {
            "type": {
              "const": "agent:tool_use",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tool": {
              "type": "string"
            },
            "toolUseId": {
              "type": "string"
            },
            "input": {}
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "tool",
            "toolUseId",
            "output"
          ],
          "properties": {
            "type": {
              "const": "agent:tool_result",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "tool": {
              "type": "string"
            },
            "toolUseId": {
              "type": "string"
            },
            "output": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agent",
            "result"
          ],
          "properties": {
            "type": {
              "const": "agent:result",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "result": {
              "type": "object",
              "required": [
                "durationMs",
                "durationApiMs",
                "numTurns",
                "totalCostUsd",
                "usage",
                "modelUsage"
              ],
              "properties": {
                "durationMs": {
                  "type": "number"
                },
                "durationApiMs": {
                  "type": "number"
                },
                "numTurns": {
                  "type": "number"
                },
                "totalCostUsd": {
                  "type": "number"
                },
                "usage": {
                  "type": "object",
                  "required": [
                    "input",
                    "output",
                    "total",
                    "cacheRead",
                    "cacheCreation"
                  ],
                  "properties": {
                    "input": {
                      "type": "number"
                    },
                    "output": {
                      "type": "number"
                    },
                    "total": {
                      "type": "number"
                    },
                    "cacheRead": {
                      "type": "number"
                    },
                    "cacheCreation": {
                      "type": "number"
                    }
                  }
                },
                "modelUsage": {
                  "type": "object",
                  "patternProperties": {
                    "^(.*)$": {
                      "type": "object",
                      "required": [
                        "inputTokens",
                        "outputTokens",
                        "cacheReadInputTokens",
                        "cacheCreationInputTokens",
                        "costUSD"
                      ],
                      "properties": {
                        "inputTokens": {
                          "type": "number"
                        },
                        "outputTokens": {
                          "type": "number"
                        },
                        "cacheReadInputTokens": {
                          "type": "number"
                        },
                        "cacheCreationInputTokens": {
                          "type": "number"
                        },
                        "costUSD": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "harness": {
                  "anyOf": [
                    {
                      "const": "claude-sdk",
                      "type": "string"
                    },
                    {
                      "const": "pi",
                      "type": "string"
                    }
                  ]
                },
                "provider": {
                  "type": "string"
                },
                "resultText": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agentId",
            "agent",
            "attribution"
          ],
          "properties": {
            "type": {
              "const": "agent:activity",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "files": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "path"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "additions": {
                    "type": "number"
                  },
                  "deletions": {
                    "type": "number"
                  },
                  "binary": {
                    "type": "boolean"
                  }
                }
              }
            },
            "totals": {
              "type": "object",
              "required": [
                "filesChanged",
                "additions",
                "deletions"
              ],
              "properties": {
                "filesChanged": {
                  "type": "number"
                },
                "additions": {
                  "type": "number"
                },
                "deletions": {
                  "type": "number"
                }
              }
            },
            "attribution": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "best_effort",
                  "type": "string"
                },
                {
                  "const": "unavailable",
                  "type": "string"
                }
              ]
            },
            "notes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "agent",
            "attempt",
            "maxAttempts",
            "subtype",
            "label"
          ],
          "properties": {
            "type": {
              "const": "agent:retry",
              "type": "string"
            },
            "agent": {
              "anyOf": [
                {
                  "const": "planner",
                  "type": "string"
                },
                {
                  "const": "builder",
                  "type": "string"
                },
                {
                  "const": "reviewer",
                  "type": "string"
                },
                {
                  "const": "review-fixer",
                  "type": "string"
                },
                {
                  "const": "evaluator",
                  "type": "string"
                },
                {
                  "const": "plan-reviewer",
                  "type": "string"
                },
                {
                  "const": "plan-evaluator",
                  "type": "string"
                },
                {
                  "const": "validation-fixer",
                  "type": "string"
                },
                {
                  "const": "merge-conflict-resolver",
                  "type": "string"
                },
                {
                  "const": "staleness-assessor",
                  "type": "string"
                },
                {
                  "const": "formatter",
                  "type": "string"
                },
                {
                  "const": "doc-author",
                  "type": "string"
                },
                {
                  "const": "doc-syncer",
                  "type": "string"
                },
                {
                  "const": "test-writer",
                  "type": "string"
                },
                {
                  "const": "tester",
                  "type": "string"
                },
                {
                  "const": "prd-validator",
                  "type": "string"
                },
                {
                  "const": "dependency-detector",
                  "type": "string"
                },
                {
                  "const": "gap-closer",
                  "type": "string"
                },
                {
                  "const": "recovery-analyst",
                  "type": "string"
                }
              ]
            },
            "attempt": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            },
            "subtype": {
              "anyOf": [
                {
                  "const": "error_max_turns",
                  "type": "string"
                },
                {
                  "const": "error_max_budget_usd",
                  "type": "string"
                },
                {
                  "const": "error_max_structured_output_retries",
                  "type": "string"
                },
                {
                  "const": "error_during_execution",
                  "type": "string"
                },
                {
                  "const": "error_pi_tool_infrastructure",
                  "type": "string"
                },
                {
                  "const": "error_context_window",
                  "type": "string"
                },
                {
                  "const": "error_transient_transport",
                  "type": "string"
                }
              ]
            },
            "label": {
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "shardId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "commands"
          ],
          "properties": {
            "type": {
              "const": "validation:start",
              "type": "string"
            },
            "commands": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "command"
          ],
          "properties": {
            "type": {
              "const": "validation:command:start",
              "type": "string"
            },
            "command": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "command",
            "exitCode",
            "output"
          ],
          "properties": {
            "type": {
              "const": "validation:command:complete",
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "exitCode": {
              "type": "number"
            },
            "output": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "command",
            "timeoutMs",
            "pid"
          ],
          "properties": {
            "type": {
              "const": "validation:command:timeout",
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "timeoutMs": {
              "type": "number"
            },
            "pid": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "passed"
          ],
          "properties": {
            "type": {
              "const": "validation:complete",
              "type": "string"
            },
            "passed": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "validation:fix:start",
              "type": "string"
            },
            "attempt": {
              "type": "number"
            },
            "maxAttempts": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "attempt"
          ],
          "properties": {
            "type": {
              "const": "validation:fix:complete",
              "type": "string"
            },
            "attempt": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "prd_validation:start",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "passed",
            "gaps"
          ],
          "properties": {
            "type": {
              "const": "prd_validation:complete",
              "type": "string"
            },
            "passed": {
              "type": "boolean"
            },
            "gaps": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "requirement",
                  "explanation"
                ],
                "properties": {
                  "requirement": {
                    "type": "string"
                  },
                  "explanation": {
                    "type": "string"
                  },
                  "complexity": {
                    "anyOf": [
                      {
                        "const": "trivial",
                        "type": "string"
                      },
                      {
                        "const": "moderate",
                        "type": "string"
                      },
                      {
                        "const": "significant",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            },
            "completionPercent": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "gap_close:start",
              "type": "string"
            },
            "gapCount": {
              "type": "number"
            },
            "completionPercent": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planBody",
            "gaps"
          ],
          "properties": {
            "type": {
              "const": "gap_close:plan_ready",
              "type": "string"
            },
            "planBody": {
              "type": "string"
            },
            "gaps": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "requirement",
                  "explanation"
                ],
                "properties": {
                  "requirement": {
                    "type": "string"
                  },
                  "explanation": {
                    "type": "string"
                  },
                  "complexity": {
                    "anyOf": [
                      {
                        "const": "trivial",
                        "type": "string"
                      },
                      {
                        "const": "moderate",
                        "type": "string"
                      },
                      {
                        "const": "significant",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "passed"
          ],
          "properties": {
            "type": {
              "const": "gap_close:complete",
              "type": "string"
            },
            "passed": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "passed",
            "verdicts",
            "source"
          ],
          "properties": {
            "type": {
              "const": "acceptance_validation:complete",
              "type": "string"
            },
            "passed": {
              "type": "boolean"
            },
            "verdicts": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "criterion",
                  "verdict",
                  "evidence"
                ],
                "properties": {
                  "criterion": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "verdict": {
                    "anyOf": [
                      {
                        "const": "pass",
                        "type": "string"
                      },
                      {
                        "const": "fail",
                        "type": "string"
                      },
                      {
                        "const": "unknown",
                        "type": "string"
                      }
                    ]
                  },
                  "evidence": {
                    "minLength": 1,
                    "type": "string"
                  }
                }
              }
            },
            "waivers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "acceptanceConflicts": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "criterion",
                  "evidence",
                  "conflictsWith",
                  "scope",
                  "recommendedAction"
                ],
                "properties": {
                  "criterion": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "evidence": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "conflictsWith": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "scope": {
                    "anyOf": [
                      {
                        "const": "narrow",
                        "type": "string"
                      },
                      {
                        "const": "broad",
                        "type": "string"
                      },
                      {
                        "const": "unknown",
                        "type": "string"
                      }
                    ]
                  },
                  "recommendedAction": {
                    "anyOf": [
                      {
                        "const": "revise_acceptance_criteria",
                        "type": "string"
                      },
                      {
                        "const": "manual_review",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            },
            "source": {
              "minLength": 1,
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "reconciliation:start",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "report"
          ],
          "properties": {
            "type": {
              "const": "reconciliation:complete",
              "type": "string"
            },
            "report": {
              "type": "object",
              "required": [
                "valid",
                "missing",
                "corrupt",
                "cleared"
              ],
              "properties": {
                "valid": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "missing": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "corrupt": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "cleared": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planSet"
          ],
          "properties": {
            "type": {
              "const": "cleanup:start",
              "type": "string"
            },
            "planSet": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planSet"
          ],
          "properties": {
            "type": {
              "const": "cleanup:complete",
              "type": "string"
            },
            "planSet": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "action",
            "details"
          ],
          "properties": {
            "type": {
              "const": "approval:needed",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "action": {
              "type": "string"
            },
            "details": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "approved"
          ],
          "properties": {
            "type": {
              "const": "approval:response",
              "type": "string"
            },
            "approved": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "source"
          ],
          "properties": {
            "type": {
              "const": "enqueue:start",
              "type": "string"
            },
            "source": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "id",
            "filePath",
            "title",
            "planSet"
          ],
          "properties": {
            "type": {
              "const": "enqueue:complete",
              "type": "string"
            },
            "id": {
              "type": "string"
            },
            "filePath": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "planSet": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "error"
          ],
          "properties": {
            "type": {
              "const": "enqueue:failed",
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "error"
          ],
          "properties": {
            "type": {
              "const": "enqueue:commit-failed",
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName"
          ],
          "properties": {
            "type": {
              "const": "recovery:start",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "summary"
          ],
          "properties": {
            "type": {
              "const": "recovery:summary",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "summary": {
              "type": "object",
              "required": [
                "prdId",
                "setName",
                "featureBranch",
                "baseBranch",
                "plans",
                "failingPlan",
                "landedCommits",
                "diffStat",
                "modelsUsed",
                "failedAt"
              ],
              "properties": {
                "prdId": {
                  "type": "string"
                },
                "setName": {
                  "type": "string"
                },
                "featureBranch": {
                  "type": "string"
                },
                "baseBranch": {
                  "type": "string"
                },
                "plans": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "planId",
                      "status"
                    ],
                    "properties": {
                      "planId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "mergedAt": {
                        "type": "string"
                      },
                      "error": {
                        "type": "string"
                      },
                      "terminalSubtype": {
                        "type": "string"
                      },
                      "commitSha": {
                        "type": "string"
                      },
                      "testPassed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "testFailed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "completedAt": {
                        "type": "string"
                      },
                      "toolUseCount": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    }
                  }
                },
                "failingPlan": {
                  "type": "object",
                  "required": [
                    "planId"
                  ],
                  "properties": {
                    "planId": {
                      "type": "string"
                    },
                    "agentId": {
                      "type": "string"
                    },
                    "agentRole": {
                      "type": "string"
                    },
                    "errorMessage": {
                      "type": "string"
                    },
                    "terminalSubtype": {
                      "type": "string"
                    },
                    "toolUseCount": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                },
                "landedCommits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "sha",
                      "subject",
                      "author",
                      "date"
                    ],
                    "properties": {
                      "sha": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "author": {
                        "type": "string"
                      },
                      "date": {
                        "type": "string"
                      }
                    }
                  }
                },
                "diffStat": {
                  "type": "string"
                },
                "modelsUsed": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "failedAt": {
                  "type": "string"
                },
                "partial": {
                  "type": "boolean"
                },
                "prdContent": {
                  "type": "string"
                },
                "terminalFailure": {
                  "type": "object",
                  "properties": {
                    "scope": {
                      "anyOf": [
                        {
                          "const": "plan",
                          "type": "string"
                        },
                        {
                          "const": "post-merge-validation",
                          "type": "string"
                        },
                        {
                          "const": "prd-validation",
                          "type": "string"
                        },
                        {
                          "const": "acceptance-validation",
                          "type": "string"
                        },
                        {
                          "const": "artifact-recording",
                          "type": "string"
                        },
                        {
                          "const": "landing",
                          "type": "string"
                        },
                        {
                          "const": "daemon",
                          "type": "string"
                        },
                        {
                          "const": "compile",
                          "type": "string"
                        },
                        {
                          "const": "unknown",
                          "type": "string"
                        }
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "authoritative": {
                      "type": "boolean"
                    },
                    "planId": {
                      "type": "string"
                    },
                    "terminalSubtype": {
                      "anyOf": [
                        {
                          "const": "error_max_turns",
                          "type": "string"
                        },
                        {
                          "const": "error_max_budget_usd",
                          "type": "string"
                        },
                        {
                          "const": "error_max_structured_output_retries",
                          "type": "string"
                        },
                        {
                          "const": "error_during_execution",
                          "type": "string"
                        },
                        {
                          "const": "error_pi_tool_infrastructure",
                          "type": "string"
                        },
                        {
                          "const": "error_context_window",
                          "type": "string"
                        },
                        {
                          "const": "error_transient_transport",
                          "type": "string"
                        }
                      ]
                    },
                    "stage": {
                      "type": "string"
                    },
                    "phaseSummary": {
                      "type": "string"
                    },
                    "phaseStatus": {
                      "type": "string"
                    },
                    "eventType": {
                      "type": "string"
                    },
                    "sourceEventType": {
                      "type": "string"
                    },
                    "sourceEventId": {
                      "type": "integer"
                    },
                    "sourceEventTimestamp": {
                      "type": "string"
                    },
                    "landing": {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      }
                    },
                    "validationPassed": {
                      "type": "boolean"
                    },
                    "prdValidationPassed": {
                      "type": "boolean"
                    },
                    "acceptanceValidationPassed": {
                      "type": "boolean"
                    }
                  }
                },
                "acceptanceValidation": {
                  "type": "object",
                  "required": [
                    "passed",
                    "total",
                    "pass",
                    "fail",
                    "unknown",
                    "verdicts"
                  ],
                  "properties": {
                    "passed": {
                      "type": "boolean"
                    },
                    "total": {
                      "type": "number"
                    },
                    "pass": {
                      "type": "number"
                    },
                    "fail": {
                      "type": "number"
                    },
                    "unknown": {
                      "type": "number"
                    },
                    "verdicts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "criterion",
                          "verdict",
                          "evidence"
                        ],
                        "properties": {
                          "criterion": {
                            "minLength": 1,
                            "type": "string"
                          },
                          "verdict": {
                            "anyOf": [
                              {
                                "const": "pass",
                                "type": "string"
                              },
                              {
                                "const": "fail",
                                "type": "string"
                              },
                              {
                                "const": "unknown",
                                "type": "string"
                              }
                            ]
                          },
                          "evidence": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      }
                    },
                    "waivers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "conflicts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "criterion",
                          "evidence",
                          "conflictsWith",
                          "scope",
                          "recommendedAction"
                        ],
                        "properties": {
                          "criterion": {
                            "minLength": 1,
                            "type": "string"
                          },
                          "evidence": {
                            "minLength": 1,
                            "type": "string"
                          },
                          "conflictsWith": {
                            "minLength": 1,
                            "type": "string"
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "const": "narrow",
                                "type": "string"
                              },
                              {
                                "const": "broad",
                                "type": "string"
                              },
                              {
                                "const": "unknown",
                                "type": "string"
                              }
                            ]
                          },
                          "recommendedAction": {
                            "anyOf": [
                              {
                                "const": "revise_acceptance_criteria",
                                "type": "string"
                              },
                              {
                                "const": "manual_review",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "validationCommands": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "command",
                      "exitCode"
                    ],
                    "properties": {
                      "command": {
                        "type": "string"
                      },
                      "exitCode": {
                        "type": "number"
                      },
                      "output": {
                        "type": "string"
                      }
                    }
                  }
                },
                "landing": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                },
                "failingPlans": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "planId"
                    ],
                    "properties": {
                      "planId": {
                        "type": "string"
                      },
                      "agentId": {
                        "type": "string"
                      },
                      "agentRole": {
                        "type": "string"
                      },
                      "errorMessage": {
                        "type": "string"
                      },
                      "terminalSubtype": {
                        "type": "string"
                      },
                      "toolUseCount": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    }
                  }
                },
                "reviewFailure": {
                  "type": "object",
                  "required": [
                    "planId",
                    "issues"
                  ],
                  "properties": {
                    "planId": {
                      "type": "string"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "severity",
                          "category",
                          "file",
                          "description"
                        ],
                        "properties": {
                          "issueId": {
                            "minLength": 1,
                            "maxLength": 4096,
                            "pattern": "\\S",
                            "type": "string"
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "const": "critical",
                                "type": "string"
                              },
                              {
                                "const": "warning",
                                "type": "string"
                              },
                              {
                                "const": "suggestion",
                                "type": "string"
                              }
                            ]
                          },
                          "category": {
                            "type": "string"
                          },
                          "file": {
                            "type": "string"
                          },
                          "line": {
                            "type": "number"
                          },
                          "description": {
                            "type": "string"
                          },
                          "fix": {
                            "type": "string"
                          },
                          "retryGuidance": {
                            "type": "string"
                          },
                          "failureKind": {
                            "type": "string"
                          },
                          "repairClass": {
                            "anyOf": [
                              {
                                "const": "narrow",
                                "type": "string"
                              },
                              {
                                "const": "structural",
                                "type": "string"
                              },
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "followup",
                                "type": "string"
                              }
                            ]
                          },
                          "metadata": {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {
                                "$id": "TypeBoxRecursive1",
                                "anyOf": [
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "maxLength": 4096,
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "TypeBoxRecursive1"
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "patternProperties": {
                                      "^(.*)$": {
                                        "$ref": "TypeBoxRecursive1"
                                      }
                                    }
                                  }
                                ]
                              }
                            }
                          },
                          "validationProviderName": {
                            "type": "string"
                          },
                          "runtimeFailureKind": {
                            "anyOf": [
                              {
                                "const": "result",
                                "type": "string"
                              },
                              {
                                "const": "command",
                                "type": "string"
                              },
                              {
                                "const": "timeout",
                                "type": "string"
                              },
                              {
                                "const": "exception",
                                "type": "string"
                              },
                              {
                                "const": "unexpected-return",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "evaluation": {
                      "type": "object",
                      "required": [
                        "accepted",
                        "rejected",
                        "review",
                        "verdicts"
                      ],
                      "properties": {
                        "accepted": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "rejected": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "review": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "verdicts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "file",
                              "action",
                              "reason"
                            ],
                            "properties": {
                              "file": {
                                "type": "string"
                              },
                              "action": {
                                "anyOf": [
                                  {
                                    "const": "accept",
                                    "type": "string"
                                  },
                                  {
                                    "const": "reject",
                                    "type": "string"
                                  },
                                  {
                                    "const": "review",
                                    "type": "string"
                                  }
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "hunk": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "issueOutcome": {
                                "description": "Evaluator issue disposition separate from patch action. Missing values are interpreted conservatively by the engine.",
                                "anyOf": [
                                  {
                                    "const": "resolved",
                                    "type": "string"
                                  },
                                  {
                                    "const": "false_positive",
                                    "type": "string"
                                  },
                                  {
                                    "const": "unresolved",
                                    "type": "string"
                                  },
                                  {
                                    "const": "unresolved_blocking",
                                    "type": "string"
                                  },
                                  {
                                    "const": "unresolved_nonblocking",
                                    "type": "string"
                                  },
                                  {
                                    "const": "needs_human_review",
                                    "type": "string"
                                  },
                                  {
                                    "const": "accepted_risk",
                                    "type": "string"
                                  },
                                  {
                                    "const": "split_to_followup",
                                    "type": "string"
                                  }
                                ]
                              },
                              "retryGuidance": {
                                "type": "string"
                              },
                              "issueIds": {
                                "type": "array",
                                "items": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "pattern": "\\S",
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "verdict"
          ],
          "properties": {
            "type": {
              "const": "recovery:complete",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "verdict": {
              "type": "object",
              "required": [
                "verdict",
                "confidence",
                "rationale",
                "completedWork",
                "remainingWork",
                "risks"
              ],
              "properties": {
                "verdict": {
                  "anyOf": [
                    {
                      "const": "retry",
                      "type": "string"
                    },
                    {
                      "const": "continue-repair",
                      "type": "string"
                    },
                    {
                      "const": "abandon",
                      "type": "string"
                    },
                    {
                      "const": "manual",
                      "type": "string"
                    }
                  ]
                },
                "confidence": {
                  "anyOf": [
                    {
                      "const": "low",
                      "type": "string"
                    },
                    {
                      "const": "medium",
                      "type": "string"
                    },
                    {
                      "const": "high",
                      "type": "string"
                    }
                  ]
                },
                "rationale": {
                  "type": "string"
                },
                "completedWork": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "remainingWork": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "risks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "partial": {
                  "type": "boolean"
                },
                "recoveryError": {
                  "type": "string"
                },
                "recommendationSource": {
                  "anyOf": [
                    {
                      "const": "deterministic",
                      "type": "string"
                    },
                    {
                      "const": "analyst",
                      "type": "string"
                    },
                    {
                      "const": "manual-fallback",
                      "type": "string"
                    }
                  ]
                },
                "recommendationRationale": {
                  "type": "string"
                },
                "verdictInvalidationReason": {
                  "type": "string"
                }
              }
            },
            "sidecarMdPath": {
              "type": "string"
            },
            "sidecarJsonPath": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "error"
          ],
          "properties": {
            "type": {
              "const": "recovery:error",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "rawOutput": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName",
            "enabled",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "recovery:auto-resume:evaluate",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "attempt": {
              "minimum": 0,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 0,
              "maximum": 3,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName",
            "action",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "recovery:auto-resume:queued",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            },
            "action": {
              "const": "continue-repair",
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "maximum": 3,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName",
            "reason",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "recovery:auto-resume:stopped",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            },
            "reason": {
              "anyOf": [
                {
                  "const": "disabled",
                  "type": "string"
                },
                {
                  "const": "attempt-budget-exhausted",
                  "type": "string"
                },
                {
                  "const": "not-continue-repair",
                  "type": "string"
                },
                {
                  "const": "not-high-confidence",
                  "type": "string"
                },
                {
                  "const": "not-eligible",
                  "type": "string"
                },
                {
                  "const": "manual-confirmation-required",
                  "type": "string"
                },
                {
                  "const": "partial-sidecar",
                  "type": "string"
                },
                {
                  "const": "malformed-sidecar",
                  "type": "string"
                },
                {
                  "const": "missing-sidecar",
                  "type": "string"
                },
                {
                  "const": "ineligible-artifacts",
                  "type": "string"
                },
                {
                  "const": "dirty-worktree",
                  "type": "string"
                },
                {
                  "const": "conflicting-worktree",
                  "type": "string"
                },
                {
                  "const": "queue-preflight-blocked",
                  "type": "string"
                },
                {
                  "const": "conflicting-applied-marker",
                  "type": "string"
                },
                {
                  "const": "active-gate-or-hold",
                  "type": "string"
                },
                {
                  "const": "repeated-failure-signature",
                  "type": "string"
                },
                {
                  "const": "error",
                  "type": "string"
                }
              ]
            },
            "attempt": {
              "minimum": 0,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 0,
              "maximum": 3,
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId"
          ],
          "properties": {
            "type": {
              "const": "recovery:apply:start",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "verdict",
            "noAction"
          ],
          "properties": {
            "type": {
              "const": "recovery:apply:complete",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "verdict": {
              "anyOf": [
                {
                  "const": "retry",
                  "type": "string"
                },
                {
                  "const": "continue-repair",
                  "type": "string"
                },
                {
                  "const": "abandon",
                  "type": "string"
                },
                {
                  "const": "manual",
                  "type": "string"
                }
              ]
            },
            "noAction": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "message"
          ],
          "properties": {
            "type": {
              "const": "recovery:apply:error",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "run"
          ],
          "properties": {
            "type": {
              "const": "daemon:run:upsert",
              "type": "string"
            },
            "run": {
              "type": "object",
              "required": [
                "id",
                "planSet",
                "command",
                "status",
                "startedAt",
                "cwd"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "planSet": {
                  "type": "string"
                },
                "command": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "startedAt": {
                  "type": "string"
                },
                "completedAt": {
                  "type": "string"
                },
                "cwd": {
                  "type": "string"
                },
                "pid": {
                  "type": "number"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:paused",
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "pid",
            "port",
            "version",
            "mode"
          ],
          "properties": {
            "type": {
              "const": "daemon:lifecycle:starting",
              "type": "string"
            },
            "pid": {
              "type": "number"
            },
            "port": {
              "type": "number"
            },
            "version": {
              "type": "string"
            },
            "mode": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "pid",
            "port",
            "version",
            "mode",
            "recoveryDurationMs"
          ],
          "properties": {
            "type": {
              "const": "daemon:lifecycle:ready",
              "type": "string"
            },
            "pid": {
              "type": "number"
            },
            "port": {
              "type": "number"
            },
            "version": {
              "type": "string"
            },
            "mode": {
              "type": "string"
            },
            "recoveryDurationMs": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "signal",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "daemon:lifecycle:shutdown:start",
              "type": "string"
            },
            "signal": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "durationMs"
          ],
          "properties": {
            "type": {
              "const": "daemon:lifecycle:shutdown:complete",
              "type": "string"
            },
            "durationMs": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "uptime",
            "queueDepth",
            "runningBuilds",
            "autoBuild",
            "subscribers"
          ],
          "properties": {
            "type": {
              "const": "daemon:heartbeat",
              "type": "string"
            },
            "uptime": {
              "type": "number"
            },
            "queueDepth": {
              "type": "number"
            },
            "runningBuilds": {
              "type": "number"
            },
            "autoBuild": {
              "type": "object",
              "required": [
                "enabled",
                "paused"
              ],
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "paused": {
                  "type": "boolean"
                },
                "desired": {
                  "anyOf": [
                    {
                      "const": "enabled",
                      "type": "string"
                    },
                    {
                      "const": "disabled",
                      "type": "string"
                    }
                  ]
                },
                "mode": {
                  "anyOf": [
                    {
                      "const": "disabled",
                      "type": "string"
                    },
                    {
                      "const": "starting",
                      "type": "string"
                    },
                    {
                      "const": "running",
                      "type": "string"
                    },
                    {
                      "const": "paused",
                      "type": "string"
                    },
                    {
                      "const": "stopping",
                      "type": "string"
                    },
                    {
                      "const": "restarting",
                      "type": "string"
                    },
                    {
                      "const": "faulted",
                      "type": "string"
                    }
                  ]
                },
                "scheduler": {
                  "type": "object",
                  "required": [
                    "alive",
                    "paused"
                  ],
                  "properties": {
                    "alive": {
                      "type": "boolean"
                    },
                    "paused": {
                      "type": "boolean"
                    },
                    "lastMutationReason": {
                      "type": "string"
                    },
                    "runningCount": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "lastTransition": {
                  "type": "object",
                  "required": [
                    "at",
                    "previousMode",
                    "nextMode",
                    "desired",
                    "source"
                  ],
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "previousMode": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "starting",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "paused",
                          "type": "string"
                        },
                        {
                          "const": "stopping",
                          "type": "string"
                        },
                        {
                          "const": "restarting",
                          "type": "string"
                        },
                        {
                          "const": "faulted",
                          "type": "string"
                        }
                      ]
                    },
                    "nextMode": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "starting",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "paused",
                          "type": "string"
                        },
                        {
                          "const": "stopping",
                          "type": "string"
                        },
                        {
                          "const": "restarting",
                          "type": "string"
                        },
                        {
                          "const": "faulted",
                          "type": "string"
                        }
                      ]
                    },
                    "desired": {
                      "anyOf": [
                        {
                          "const": "enabled",
                          "type": "string"
                        },
                        {
                          "const": "disabled",
                          "type": "string"
                        }
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                },
                "reason": {
                  "type": "string"
                },
                "recoveryAutoResume": {
                  "type": "object",
                  "required": [
                    "enabled",
                    "maxAttempts",
                    "attempts"
                  ],
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "maxAttempts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attempts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "lastDecision": {
                      "anyOf": [
                        {
                          "const": "evaluate",
                          "type": "string"
                        },
                        {
                          "const": "queued",
                          "type": "string"
                        },
                        {
                          "const": "stopped",
                          "type": "string"
                        }
                      ]
                    },
                    "prdId": {
                      "type": "string"
                    },
                    "setName": {
                      "type": "string"
                    },
                    "stopReason": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "attempt-budget-exhausted",
                          "type": "string"
                        },
                        {
                          "const": "not-continue-repair",
                          "type": "string"
                        },
                        {
                          "const": "not-high-confidence",
                          "type": "string"
                        },
                        {
                          "const": "not-eligible",
                          "type": "string"
                        },
                        {
                          "const": "manual-confirmation-required",
                          "type": "string"
                        },
                        {
                          "const": "partial-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "malformed-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "missing-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "ineligible-artifacts",
                          "type": "string"
                        },
                        {
                          "const": "dirty-worktree",
                          "type": "string"
                        },
                        {
                          "const": "conflicting-worktree",
                          "type": "string"
                        },
                        {
                          "const": "queue-preflight-blocked",
                          "type": "string"
                        },
                        {
                          "const": "conflicting-applied-marker",
                          "type": "string"
                        },
                        {
                          "const": "active-gate-or-hold",
                          "type": "string"
                        },
                        {
                          "const": "repeated-failure-signature",
                          "type": "string"
                        },
                        {
                          "const": "error",
                          "type": "string"
                        }
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "subscribers": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "queueDepth",
            "capacityRemaining"
          ],
          "properties": {
            "type": {
              "const": "daemon:scheduler:dequeued",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "queueDepth": {
              "type": "number"
            },
            "capacityRemaining": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "queueDepth",
            "runningCount",
            "limit"
          ],
          "properties": {
            "type": {
              "const": "daemon:scheduler:capacity-blocked",
              "type": "string"
            },
            "queueDepth": {
              "type": "number"
            },
            "runningCount": {
              "type": "number"
            },
            "limit": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "blockedBy"
          ],
          "properties": {
            "type": {
              "const": "daemon:scheduler:dependency-blocked",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "blockedBy": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:scheduler:paused",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:scheduler:resumed",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:enabled",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:disabled",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:resumed",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "trigger",
            "prdsEnqueued"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:triggered",
              "type": "string"
            },
            "trigger": {
              "type": "string"
            },
            "prdsEnqueued": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "previousMode",
            "nextMode",
            "desired",
            "source"
          ],
          "properties": {
            "type": {
              "const": "daemon:auto-build:transition",
              "type": "string"
            },
            "previousMode": {
              "anyOf": [
                {
                  "const": "disabled",
                  "type": "string"
                },
                {
                  "const": "starting",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "paused",
                  "type": "string"
                },
                {
                  "const": "stopping",
                  "type": "string"
                },
                {
                  "const": "restarting",
                  "type": "string"
                },
                {
                  "const": "faulted",
                  "type": "string"
                }
              ]
            },
            "nextMode": {
              "anyOf": [
                {
                  "const": "disabled",
                  "type": "string"
                },
                {
                  "const": "starting",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "paused",
                  "type": "string"
                },
                {
                  "const": "stopping",
                  "type": "string"
                },
                {
                  "const": "restarting",
                  "type": "string"
                },
                {
                  "const": "faulted",
                  "type": "string"
                }
              ]
            },
            "desired": {
              "anyOf": [
                {
                  "const": "enabled",
                  "type": "string"
                },
                {
                  "const": "disabled",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "type": "string"
            },
            "source": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "daemon:recovery:start",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "planSet",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "daemon:recovery:run-marked-failed",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "planSet": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "path",
            "pid"
          ],
          "properties": {
            "type": {
              "const": "daemon:recovery:lock-removed",
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "pid": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "path",
            "pid",
            "prdId"
          ],
          "properties": {
            "type": {
              "const": "daemon:recovery:lock-adopted",
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "pid": {
              "type": "number"
            },
            "prdId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runsFailed",
            "locksRemoved",
            "durationMs"
          ],
          "properties": {
            "type": {
              "const": "daemon:recovery:complete",
              "type": "string"
            },
            "runsFailed": {
              "type": "number"
            },
            "locksRemoved": {
              "type": "number"
            },
            "durationMs": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "sessionId",
            "planSet",
            "pid"
          ],
          "properties": {
            "type": {
              "const": "daemon:orphan:reaped",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "planSet": {
              "type": "string"
            },
            "pid": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "failedEnqueue"
          ],
          "properties": {
            "type": {
              "const": "daemon:failed-enqueue:upsert",
              "type": "string"
            },
            "failedEnqueue": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "runId",
                "sourceLabel",
                "failureReason",
                "failedAt",
                "canReenqueue",
                "nextCommand"
              ],
              "properties": {
                "runId": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "sourceLabel": {
                  "type": "string"
                },
                "provenance": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "label"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    }
                  }
                },
                "failureReason": {
                  "type": "string"
                },
                "failedAt": {
                  "type": "string"
                },
                "canReenqueue": {
                  "type": "boolean"
                },
                "disabledReason": {
                  "type": "string"
                },
                "nextCommand": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "executable",
                    "args"
                  ],
                  "properties": {
                    "executable": {
                      "type": "string"
                    },
                    "args": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "resolvedAt": {
                  "type": "string"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "resolvedAt"
          ],
          "properties": {
            "type": {
              "const": "daemon:failed-enqueue:resolved",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "resolvedAt": {
              "type": "string"
            },
            "spawnedSessionId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "source",
            "message"
          ],
          "properties": {
            "type": {
              "const": "daemon:warning",
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "details": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "source",
            "message"
          ],
          "properties": {
            "type": {
              "const": "daemon:error",
              "type": "string"
            },
            "source": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdCount",
            "dir"
          ],
          "properties": {
            "type": {
              "const": "queue:start",
              "type": "string"
            },
            "prdCount": {
              "type": "number"
            },
            "dir": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:start",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:discovered",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "dependsOn": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title",
            "removedDependency",
            "previousDependsOn",
            "currentDependsOn"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:dependency-overridden",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "removedDependency": {
              "type": "string"
            },
            "previousDependsOn": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "currentDependsOn": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "previousStatus"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:removed",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "previousStatus": {
              "anyOf": [
                {
                  "const": "pending",
                  "type": "string"
                },
                {
                  "const": "waiting",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "skipped",
                  "type": "string"
                }
              ]
            },
            "removedSidecars": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title",
            "verdict",
            "justification"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:stale",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "verdict": {
              "anyOf": [
                {
                  "const": "proceed",
                  "type": "string"
                },
                {
                  "const": "revise",
                  "type": "string"
                },
                {
                  "const": "obsolete",
                  "type": "string"
                }
              ]
            },
            "justification": {
              "type": "string"
            },
            "revision": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:skip",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title",
            "reason",
            "stage"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:dispatch-failed",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "stage": {
              "anyOf": [
                {
                  "const": "stacking-validation",
                  "type": "string"
                },
                {
                  "const": "policy-gate",
                  "type": "string"
                },
                {
                  "const": "profile-routing",
                  "type": "string"
                },
                {
                  "const": "dispatch",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "title",
            "error"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:commit-failed",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "status"
          ],
          "properties": {
            "type": {
              "const": "queue:prd:complete",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "completed",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "skipped",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "processed",
            "skipped"
          ],
          "properties": {
            "type": {
              "const": "queue:complete",
              "type": "string"
            },
            "processed": {
              "type": "number"
            },
            "skipped": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "planId",
            "decision"
          ],
          "properties": {
            "type": {
              "const": "plan:build:decision",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "decision": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "strategy",
                    "source"
                  ],
                  "properties": {
                    "kind": {
                      "const": "review-strategy",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "strategy": {
                      "anyOf": [
                        {
                          "const": "single",
                          "type": "string"
                        },
                        {
                          "const": "parallel",
                          "type": "string"
                        }
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "const": "config",
                          "type": "string"
                        },
                        {
                          "const": "auto-threshold",
                          "type": "string"
                        }
                      ]
                    },
                    "auto": {
                      "type": "object",
                      "required": [
                        "files",
                        "lines",
                        "threshold"
                      ],
                      "properties": {
                        "files": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "lines": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "threshold": {
                          "type": "object",
                          "required": [
                            "files",
                            "lines"
                          ],
                          "properties": {
                            "files": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "lines": {
                              "minimum": 0,
                              "type": "integer"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "perspectives",
                    "categories",
                    "rules"
                  ],
                  "properties": {
                    "kind": {
                      "const": "perspectives-inferred",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "perspectives": {
                      "type": "array",
                      "items": {
                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                        "type": "string"
                      }
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "round",
                    "reason",
                    "issuesRemaining"
                  ],
                  "properties": {
                    "kind": {
                      "const": "cycle-terminated",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "round": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "const": "no-issues",
                          "type": "string"
                        },
                        {
                          "const": "max-rounds",
                          "type": "string"
                        }
                      ]
                    },
                    "issuesRemaining": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "lastReviewIssueCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationAccepted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationRejected": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationRan": {
                      "type": "boolean"
                    },
                    "finalEvaluationResolved": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationFalsePositive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationUnresolved": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationNeedsHumanReview": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "finalEvaluationBlocking": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "round",
                    "perspectives",
                    "dropped"
                  ],
                  "properties": {
                    "kind": {
                      "const": "perspectives-respawned",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "round": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "perspectives": {
                      "type": "array",
                      "items": {
                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                        "type": "string"
                      }
                    },
                    "dropped": {
                      "type": "array",
                      "items": {
                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                        "type": "string"
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "strictness",
                    "source"
                  ],
                  "properties": {
                    "kind": {
                      "const": "evaluator-strictness",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "strictness": {
                      "anyOf": [
                        {
                          "const": "strict",
                          "type": "string"
                        },
                        {
                          "const": "standard",
                          "type": "string"
                        },
                        {
                          "const": "lenient",
                          "type": "string"
                        }
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "const": "config",
                          "type": "string"
                        },
                        {
                          "const": "default",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "perspective",
                    "round"
                  ],
                  "properties": {
                    "kind": {
                      "const": "review-perspective-degraded",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "perspective": {
                      "type": "string"
                    },
                    "round": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "previousBlockingIssueOutcomes",
                    "lastBlockingIssueOutcomes",
                    "maxAttempts"
                  ],
                  "properties": {
                    "kind": {
                      "const": "recovery-budget-extended",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "previousBlockingIssueOutcomes": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "lastBlockingIssueOutcomes": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxAttempts": {
                      "minimum": 2,
                      "type": "integer"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "verdict"
                  ],
                  "properties": {
                    "kind": {
                      "const": "recovery-verdict",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "verdict": {
                      "anyOf": [
                        {
                          "const": "retry",
                          "type": "string"
                        },
                        {
                          "const": "continue-repair",
                          "type": "string"
                        },
                        {
                          "const": "abandon",
                          "type": "string"
                        },
                        {
                          "const": "manual",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "strategy",
                    "files"
                  ],
                  "properties": {
                    "kind": {
                      "const": "merge-conflict-resolution",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "strategy": {
                      "type": "string"
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "decision"
          ],
          "properties": {
            "type": {
              "const": "planning:decision",
              "type": "string"
            },
            "planId": {
              "type": "string"
            },
            "decision": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "defaultBuild"
                  ],
                  "properties": {
                    "kind": {
                      "const": "build-pipeline-chosen",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "defaultBuild": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "strategy",
                    "perspectives",
                    "maxRounds",
                    "evaluatorStrictness"
                  ],
                  "properties": {
                    "kind": {
                      "const": "review-profile-chosen",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "strategy": {
                      "anyOf": [
                        {
                          "const": "auto",
                          "type": "string"
                        },
                        {
                          "const": "single",
                          "type": "string"
                        },
                        {
                          "const": "parallel",
                          "type": "string"
                        }
                      ]
                    },
                    "perspectives": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                        "type": "string"
                      }
                    },
                    "maxRounds": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "evaluatorStrictness": {
                      "anyOf": [
                        {
                          "const": "strict",
                          "type": "string"
                        },
                        {
                          "const": "standard",
                          "type": "string"
                        },
                        {
                          "const": "lenient",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "planCount",
                    "planIds"
                  ],
                  "properties": {
                    "kind": {
                      "const": "plan-set-shape",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "planCount": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "planIds": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "rationale",
                    "verdict",
                    "source",
                    "concreteSubsystemCount"
                  ],
                  "properties": {
                    "kind": {
                      "const": "root-decomposition",
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "verdict": {
                      "anyOf": [
                        {
                          "const": "cohesive",
                          "type": "string"
                        },
                        {
                          "const": "split",
                          "type": "string"
                        }
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "const": "agent",
                          "type": "string"
                        },
                        {
                          "const": "deterministic-fallback",
                          "type": "string"
                        }
                      ]
                    },
                    "concreteSubsystemCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "groupCount": {
                      "minimum": 2,
                      "type": "integer"
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "provider",
            "branch",
            "status"
          ],
          "properties": {
            "type": {
              "const": "stack:layer:recorded",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "parentPrdId": {
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "artifact": {
              "type": "object",
              "required": [
                "branch"
              ],
              "properties": {
                "branch": {
                  "type": "string"
                },
                "commitSha": {
                  "type": "string"
                },
                "prUrl": {
                  "type": "string"
                }
              }
            },
            "landingAction": {
              "anyOf": [
                {
                  "const": "pr",
                  "type": "string"
                },
                {
                  "const": "merge",
                  "type": "string"
                },
                {
                  "const": "leave",
                  "type": "string"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "const": "pending",
                  "type": "string"
                },
                {
                  "const": "building",
                  "type": "string"
                },
                {
                  "const": "built",
                  "type": "string"
                },
                {
                  "const": "merged",
                  "type": "string"
                },
                {
                  "const": "landed",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "provider",
            "command",
            "exitCode"
          ],
          "properties": {
            "type": {
              "const": "stack:provider:command",
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "args": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "exitCode": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "branch": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "action",
            "branch",
            "status"
          ],
          "properties": {
            "type": {
              "const": "stack:landing:update",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "action": {
              "anyOf": [
                {
                  "const": "pr",
                  "type": "string"
                },
                {
                  "const": "merge",
                  "type": "string"
                },
                {
                  "const": "leave",
                  "type": "string"
                }
              ]
            },
            "branch": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "const": "started",
                  "type": "string"
                },
                {
                  "const": "complete",
                  "type": "string"
                },
                {
                  "const": "skipped",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                }
              ]
            },
            "prUrl": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "originalBaseBranch": {
              "type": "string"
            },
            "effectiveBaseBranch": {
              "type": "string"
            },
            "baseRepairReason": {
              "const": "parent-artifact-already-integrated",
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "provider",
            "branch",
            "operation",
            "conflictKind",
            "conflictedFiles"
          ],
          "properties": {
            "type": {
              "const": "stack:landing:conflict:detected",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "operation": {
              "anyOf": [
                {
                  "const": "branch-restack",
                  "type": "string"
                },
                {
                  "const": "stack-restack",
                  "type": "string"
                },
                {
                  "const": "repo-sync",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "conflictKind": {
              "anyOf": [
                {
                  "const": "git-rebase",
                  "type": "string"
                },
                {
                  "const": "git-merge",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "conflictedFiles": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "provider",
            "branch",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "stack:landing:conflict:recovery:start",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "provider",
            "branch",
            "attempts"
          ],
          "properties": {
            "type": {
              "const": "stack:landing:conflict:recovery:complete",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "attempts": {
              "minimum": 1,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "stackId",
            "provider",
            "branch",
            "attempts",
            "reason",
            "abortAttempted",
            "abortSucceeded"
          ],
          "properties": {
            "type": {
              "const": "stack:landing:conflict:recovery:failed",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "stackId": {
              "type": "string"
            },
            "provider": {
              "const": "git-spice",
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "attempts": {
              "minimum": 0,
              "type": "integer"
            },
            "reason": {
              "type": "string"
            },
            "abortAttempted": {
              "type": "boolean"
            },
            "abortSucceeded": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "syncId",
            "dryRun"
          ],
          "properties": {
            "type": {
              "const": "stack:sync:start",
              "type": "string"
            },
            "syncId": {
              "type": "string"
            },
            "trigger": {
              "anyOf": [
                {
                  "const": "manual",
                  "type": "string"
                },
                {
                  "const": "after-build",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "retry-deferred",
                  "type": "string"
                }
              ]
            },
            "dryRun": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "syncId",
            "dryRun",
            "restackCandidates",
            "excludedCandidates"
          ],
          "properties": {
            "type": {
              "const": "stack:sync:complete",
              "type": "string"
            },
            "syncId": {
              "type": "string"
            },
            "trigger": {
              "anyOf": [
                {
                  "const": "manual",
                  "type": "string"
                },
                {
                  "const": "after-build",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "retry-deferred",
                  "type": "string"
                }
              ]
            },
            "dryRun": {
              "type": "boolean"
            },
            "restackCandidates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "excludedCandidates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "localTrunkSha": {
              "type": "string"
            },
            "originTrunkSha": {
              "type": "string"
            },
            "fastForward": {
              "type": "boolean"
            },
            "reason": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "syncId",
            "dryRun",
            "outcome",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "stack:sync:failed",
              "type": "string"
            },
            "syncId": {
              "type": "string"
            },
            "trigger": {
              "anyOf": [
                {
                  "const": "manual",
                  "type": "string"
                },
                {
                  "const": "after-build",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "retry-deferred",
                  "type": "string"
                }
              ]
            },
            "dryRun": {
              "type": "boolean"
            },
            "outcome": {
              "anyOf": [
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "conflict",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "type": "string"
            },
            "error": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "syncId",
            "reason",
            "excludedCandidates"
          ],
          "properties": {
            "type": {
              "const": "stack:sync:deferred",
              "type": "string"
            },
            "syncId": {
              "type": "string"
            },
            "trigger": {
              "anyOf": [
                {
                  "const": "manual",
                  "type": "string"
                },
                {
                  "const": "after-build",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "retry-deferred",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "type": "string"
            },
            "excludedCandidates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "syncId",
            "dryRun",
            "reason",
            "restackCandidates",
            "excludedCandidates"
          ],
          "properties": {
            "type": {
              "const": "stack:sync:skipped",
              "type": "string"
            },
            "syncId": {
              "type": "string"
            },
            "trigger": {
              "anyOf": [
                {
                  "const": "manual",
                  "type": "string"
                },
                {
                  "const": "after-build",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "retry-deferred",
                  "type": "string"
                }
              ]
            },
            "dryRun": {
              "type": "boolean"
            },
            "reason": {
              "type": "string"
            },
            "restackCandidates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "excludedCandidates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "base-sync:start",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "attempt",
            "maxAttempts",
            "conflictedFiles"
          ],
          "properties": {
            "type": {
              "const": "base-sync:conflict:attempt",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            },
            "conflictedFiles": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "base-sync:resolver:start",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "attempt",
            "maxAttempts",
            "resolved",
            "remainingConflicts"
          ],
          "properties": {
            "type": {
              "const": "base-sync:resolver:complete",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            },
            "resolved": {
              "type": "boolean"
            },
            "remainingConflicts": {
              "minimum": 0,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "attempt",
            "maxAttempts"
          ],
          "properties": {
            "type": {
              "const": "base-sync:rebase:continue",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "baseSha",
            "featureSha",
            "rebased"
          ],
          "properties": {
            "type": {
              "const": "base-sync:success",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "baseSha": {
              "type": "string"
            },
            "featureSha": {
              "type": "string"
            },
            "rebased": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "remote",
            "baseBranch",
            "featureBranch",
            "attempts",
            "maxAttempts",
            "conflictedFiles"
          ],
          "properties": {
            "type": {
              "const": "base-sync:budget:exhausted",
              "type": "string"
            },
            "remote": {
              "type": "string"
            },
            "baseBranch": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "attempts": {
              "minimum": 0,
              "type": "integer"
            },
            "maxAttempts": {
              "minimum": 1,
              "type": "integer"
            },
            "conflictedFiles": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "runId",
            "failure"
          ],
          "properties": {
            "type": {
              "const": "build:terminal-failure",
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "failure": {
              "type": "object",
              "required": [
                "scope",
                "message",
                "authoritative"
              ],
              "properties": {
                "scope": {
                  "anyOf": [
                    {
                      "const": "plan",
                      "type": "string"
                    },
                    {
                      "const": "post-merge-validation",
                      "type": "string"
                    },
                    {
                      "const": "prd-validation",
                      "type": "string"
                    },
                    {
                      "const": "acceptance-validation",
                      "type": "string"
                    },
                    {
                      "const": "artifact-recording",
                      "type": "string"
                    },
                    {
                      "const": "landing",
                      "type": "string"
                    },
                    {
                      "const": "daemon",
                      "type": "string"
                    },
                    {
                      "const": "compile",
                      "type": "string"
                    },
                    {
                      "const": "unknown",
                      "type": "string"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                },
                "authoritative": {
                  "type": "boolean"
                },
                "planId": {
                  "type": "string"
                },
                "terminalSubtype": {
                  "anyOf": [
                    {
                      "const": "error_max_turns",
                      "type": "string"
                    },
                    {
                      "const": "error_max_budget_usd",
                      "type": "string"
                    },
                    {
                      "const": "error_max_structured_output_retries",
                      "type": "string"
                    },
                    {
                      "const": "error_during_execution",
                      "type": "string"
                    },
                    {
                      "const": "error_pi_tool_infrastructure",
                      "type": "string"
                    },
                    {
                      "const": "error_context_window",
                      "type": "string"
                    },
                    {
                      "const": "error_transient_transport",
                      "type": "string"
                    }
                  ]
                },
                "stage": {
                  "type": "string"
                },
                "phaseSummary": {
                  "type": "string"
                },
                "phaseStatus": {
                  "type": "string"
                },
                "eventType": {
                  "type": "string"
                },
                "sourceEventType": {
                  "type": "string"
                },
                "sourceEventId": {
                  "type": "integer"
                },
                "sourceEventTimestamp": {
                  "type": "string"
                },
                "landing": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                },
                "validationPassed": {
                  "type": "boolean"
                },
                "prdValidationPassed": {
                  "type": "boolean"
                },
                "acceptanceValidationPassed": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName",
            "featureBranch"
          ],
          "properties": {
            "type": {
              "const": "build:resume:start",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "seededMerged",
            "seededPending",
            "featureBranch",
            "landedCommitCount",
            "diffStat"
          ],
          "properties": {
            "type": {
              "const": "build:resume:state",
              "type": "string"
            },
            "seededMerged": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "seededPending": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "featureBranch": {
              "type": "string"
            },
            "landedCommitCount": {
              "type": "number"
            },
            "diffStat": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "reason"
          ],
          "properties": {
            "type": {
              "const": "build:resume:ineligible",
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "checkedPath": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName",
            "featureBranch",
            "artifactSource",
            "source",
            "orchestration",
            "plans"
          ],
          "properties": {
            "type": {
              "const": "build:resume:artifacts",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            },
            "featureBranch": {
              "type": "string"
            },
            "artifactSource": {
              "anyOf": [
                {
                  "const": "merge-worktree",
                  "type": "string"
                },
                {
                  "const": "branch-history",
                  "type": "string"
                }
              ]
            },
            "artifactCommit": {
              "type": "string"
            },
            "source": {
              "type": "object",
              "required": [
                "label"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                }
              }
            },
            "orchestration": {
              "type": "object",
              "required": [
                "name",
                "description",
                "created",
                "baseBranch",
                "pipeline",
                "plans"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "created": {
                  "type": "string"
                },
                "baseBranch": {
                  "type": "string"
                },
                "diffBaseRef": {
                  "type": "string"
                },
                "stackedValidationPinRequired": {
                  "type": "boolean"
                },
                "pipeline": {
                  "type": "object",
                  "required": [
                    "compile",
                    "defaultBuild",
                    "defaultReview",
                    "rationale"
                  ],
                  "properties": {
                    "compile": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "defaultBuild": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    },
                    "defaultReview": {
                      "type": "object",
                      "required": [
                        "strategy",
                        "perspectives",
                        "maxRounds",
                        "evaluatorStrictness"
                      ],
                      "properties": {
                        "strategy": {
                          "anyOf": [
                            {
                              "const": "auto",
                              "type": "string"
                            },
                            {
                              "const": "single",
                              "type": "string"
                            },
                            {
                              "const": "parallel",
                              "type": "string"
                            }
                          ]
                        },
                        "perspectives": {
                          "type": "array",
                          "items": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          }
                        },
                        "maxRounds": {
                          "type": "number"
                        },
                        "evaluatorStrictness": {
                          "anyOf": [
                            {
                              "const": "strict",
                              "type": "string"
                            },
                            {
                              "const": "standard",
                              "type": "string"
                            },
                            {
                              "const": "lenient",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    "rationale": {
                      "type": "string"
                    }
                  }
                },
                "plans": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "dependsOn",
                      "branch",
                      "build",
                      "review"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "dependsOn": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "branch": {
                        "type": "string"
                      },
                      "build": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "review": {
                        "type": "object",
                        "required": [
                          "strategy",
                          "perspectives",
                          "maxRounds",
                          "evaluatorStrictness"
                        ],
                        "properties": {
                          "strategy": {
                            "anyOf": [
                              {
                                "const": "auto",
                                "type": "string"
                              },
                              {
                                "const": "single",
                                "type": "string"
                              },
                              {
                                "const": "parallel",
                                "type": "string"
                              }
                            ]
                          },
                          "perspectives": {
                            "type": "array",
                            "items": {
                              "pattern": "^[a-z][a-z0-9-]{0,63}$",
                              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                              "type": "string"
                            }
                          },
                          "maxRounds": {
                            "type": "number"
                          },
                          "evaluatorStrictness": {
                            "anyOf": [
                              {
                                "const": "strict",
                                "type": "string"
                              },
                              {
                                "const": "standard",
                                "type": "string"
                              },
                              {
                                "const": "lenient",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      "testOwnership": {
                        "description": "Exclusive owner of new acceptance-test authoring for a plan",
                        "anyOf": [
                          {
                            "const": "builder",
                            "type": "string"
                          },
                          {
                            "const": "test-writer",
                            "type": "string"
                          },
                          {
                            "const": "existing-only",
                            "type": "string"
                          }
                        ]
                      },
                      "maxContinuations": {
                        "type": "number"
                      },
                      "allowNoOpMerge": {
                        "type": "boolean"
                      },
                      "agents": {
                        "type": "object",
                        "patternProperties": {
                          "^(.*)$": {
                            "type": "object",
                            "properties": {
                              "effort": {
                                "type": "string"
                              },
                              "thinking": {
                                "anyOf": [
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "object",
                                    "patternProperties": {
                                      "^(.*)$": {}
                                    }
                                  }
                                ]
                              },
                              "rationale": {
                                "type": "string"
                              },
                              "tier": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "validate": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            },
            "plans": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "body",
                  "dependsOn"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "dependsOn": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "branch": {
                    "type": "string"
                  },
                  "build": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "review": {
                    "type": "object",
                    "required": [
                      "strategy",
                      "perspectives",
                      "maxRounds",
                      "evaluatorStrictness"
                    ],
                    "properties": {
                      "strategy": {
                        "anyOf": [
                          {
                            "const": "auto",
                            "type": "string"
                          },
                          {
                            "const": "single",
                            "type": "string"
                          },
                          {
                            "const": "parallel",
                            "type": "string"
                          }
                        ]
                      },
                      "perspectives": {
                        "type": "array",
                        "items": {
                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                          "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                          "type": "string"
                        }
                      },
                      "maxRounds": {
                        "type": "number"
                      },
                      "evaluatorStrictness": {
                        "anyOf": [
                          {
                            "const": "strict",
                            "type": "string"
                          },
                          {
                            "const": "standard",
                            "type": "string"
                          },
                          {
                            "const": "lenient",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  },
                  "testOwnership": {
                    "description": "Exclusive owner of new acceptance-test authoring for a plan",
                    "anyOf": [
                      {
                        "const": "builder",
                        "type": "string"
                      },
                      {
                        "const": "test-writer",
                        "type": "string"
                      },
                      {
                        "const": "existing-only",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "prdId",
            "setName"
          ],
          "properties": {
            "type": {
              "const": "build:resume:complete",
              "type": "string"
            },
            "prdId": {
              "type": "string"
            },
            "setName": {
              "type": "string"
            }
          }
        }
      ]
    }
  ],
  "$defs": {
    "DaemonStreamSnapshot": {
      "type": "object",
      "required": [
        "cursor",
        "liveness",
        "recentActivity",
        "runs",
        "queue",
        "sessionMetadata",
        "autoBuild",
        "stackLayers",
        "failedEnqueues"
      ],
      "properties": {
        "cursor": {
          "type": "number"
        },
        "liveness": {
          "type": "object",
          "required": [
            "type",
            "timestamp",
            "uptime",
            "queueDepth",
            "runningBuilds",
            "autoBuild",
            "subscribers"
          ],
          "properties": {
            "type": {
              "const": "daemon:heartbeat",
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            },
            "uptime": {
              "type": "number"
            },
            "queueDepth": {
              "type": "number"
            },
            "runningBuilds": {
              "type": "number"
            },
            "autoBuild": {
              "type": "object",
              "required": [
                "enabled",
                "paused"
              ],
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "paused": {
                  "type": "boolean"
                },
                "desired": {
                  "anyOf": [
                    {
                      "const": "enabled",
                      "type": "string"
                    },
                    {
                      "const": "disabled",
                      "type": "string"
                    }
                  ]
                },
                "mode": {
                  "anyOf": [
                    {
                      "const": "disabled",
                      "type": "string"
                    },
                    {
                      "const": "starting",
                      "type": "string"
                    },
                    {
                      "const": "running",
                      "type": "string"
                    },
                    {
                      "const": "paused",
                      "type": "string"
                    },
                    {
                      "const": "stopping",
                      "type": "string"
                    },
                    {
                      "const": "restarting",
                      "type": "string"
                    },
                    {
                      "const": "faulted",
                      "type": "string"
                    }
                  ]
                },
                "scheduler": {
                  "type": "object",
                  "required": [
                    "alive",
                    "paused"
                  ],
                  "properties": {
                    "alive": {
                      "type": "boolean"
                    },
                    "paused": {
                      "type": "boolean"
                    },
                    "lastMutationReason": {
                      "type": "string"
                    },
                    "runningCount": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    }
                  }
                },
                "lastTransition": {
                  "type": "object",
                  "required": [
                    "at",
                    "previousMode",
                    "nextMode",
                    "desired",
                    "source"
                  ],
                  "properties": {
                    "at": {
                      "type": "string"
                    },
                    "previousMode": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "starting",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "paused",
                          "type": "string"
                        },
                        {
                          "const": "stopping",
                          "type": "string"
                        },
                        {
                          "const": "restarting",
                          "type": "string"
                        },
                        {
                          "const": "faulted",
                          "type": "string"
                        }
                      ]
                    },
                    "nextMode": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "starting",
                          "type": "string"
                        },
                        {
                          "const": "running",
                          "type": "string"
                        },
                        {
                          "const": "paused",
                          "type": "string"
                        },
                        {
                          "const": "stopping",
                          "type": "string"
                        },
                        {
                          "const": "restarting",
                          "type": "string"
                        },
                        {
                          "const": "faulted",
                          "type": "string"
                        }
                      ]
                    },
                    "desired": {
                      "anyOf": [
                        {
                          "const": "enabled",
                          "type": "string"
                        },
                        {
                          "const": "disabled",
                          "type": "string"
                        }
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                },
                "reason": {
                  "type": "string"
                },
                "recoveryAutoResume": {
                  "type": "object",
                  "required": [
                    "enabled",
                    "maxAttempts",
                    "attempts"
                  ],
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "maxAttempts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attempts": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "lastDecision": {
                      "anyOf": [
                        {
                          "const": "evaluate",
                          "type": "string"
                        },
                        {
                          "const": "queued",
                          "type": "string"
                        },
                        {
                          "const": "stopped",
                          "type": "string"
                        }
                      ]
                    },
                    "prdId": {
                      "type": "string"
                    },
                    "setName": {
                      "type": "string"
                    },
                    "stopReason": {
                      "anyOf": [
                        {
                          "const": "disabled",
                          "type": "string"
                        },
                        {
                          "const": "attempt-budget-exhausted",
                          "type": "string"
                        },
                        {
                          "const": "not-continue-repair",
                          "type": "string"
                        },
                        {
                          "const": "not-high-confidence",
                          "type": "string"
                        },
                        {
                          "const": "not-eligible",
                          "type": "string"
                        },
                        {
                          "const": "manual-confirmation-required",
                          "type": "string"
                        },
                        {
                          "const": "partial-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "malformed-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "missing-sidecar",
                          "type": "string"
                        },
                        {
                          "const": "ineligible-artifacts",
                          "type": "string"
                        },
                        {
                          "const": "dirty-worktree",
                          "type": "string"
                        },
                        {
                          "const": "conflicting-worktree",
                          "type": "string"
                        },
                        {
                          "const": "queue-preflight-blocked",
                          "type": "string"
                        },
                        {
                          "const": "conflicting-applied-marker",
                          "type": "string"
                        },
                        {
                          "const": "active-gate-or-hold",
                          "type": "string"
                        },
                        {
                          "const": "repeated-failure-signature",
                          "type": "string"
                        },
                        {
                          "const": "error",
                          "type": "string"
                        }
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "subscribers": {
              "type": "number"
            }
          }
        },
        "recentActivity": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "event"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "event": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "sessionId": {
                        "type": "string"
                      },
                      "runId": {
                        "type": "string"
                      },
                      "timestamp": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "sessionId"
                        ],
                        "properties": {
                          "type": {
                            "const": "session:start",
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "sessionId",
                          "result"
                        ],
                        "properties": {
                          "type": {
                            "const": "session:end",
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "result": {
                            "type": "object",
                            "required": [
                              "status",
                              "summary"
                            ],
                            "properties": {
                              "status": {
                                "anyOf": [
                                  {
                                    "const": "completed",
                                    "type": "string"
                                  },
                                  {
                                    "const": "failed",
                                    "type": "string"
                                  },
                                  {
                                    "const": "skipped",
                                    "type": "string"
                                  }
                                ]
                              },
                              "summary": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "profileName",
                          "source",
                          "scope",
                          "config"
                        ],
                        "properties": {
                          "type": {
                            "const": "session:profile",
                            "type": "string"
                          },
                          "profileName": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "source": {
                            "anyOf": [
                              {
                                "const": "local",
                                "type": "string"
                              },
                              {
                                "const": "project",
                                "type": "string"
                              },
                              {
                                "const": "user-local",
                                "type": "string"
                              },
                              {
                                "const": "missing",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "override",
                                "type": "string"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "const": "local",
                                "type": "string"
                              },
                              {
                                "const": "project",
                                "type": "string"
                              },
                              {
                                "const": "user",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "config": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "planSet",
                          "command"
                        ],
                        "properties": {
                          "type": {
                            "const": "phase:start",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          },
                          "command": {
                            "anyOf": [
                              {
                                "const": "compile",
                                "type": "string"
                              },
                              {
                                "const": "build",
                                "type": "string"
                              },
                              {
                                "const": "continue-repair",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "result"
                        ],
                        "properties": {
                          "type": {
                            "const": "phase:end",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "result": {
                            "type": "object",
                            "required": [
                              "status",
                              "summary"
                            ],
                            "properties": {
                              "status": {
                                "anyOf": [
                                  {
                                    "const": "completed",
                                    "type": "string"
                                  },
                                  {
                                    "const": "failed",
                                    "type": "string"
                                  },
                                  {
                                    "const": "skipped",
                                    "type": "string"
                                  }
                                ]
                              },
                              "summary": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "message",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "config:warning",
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "details": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "message",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:warning",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "details": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "moduleId",
                          "reason",
                          "errors"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:module:build-config:invalid",
                            "type": "string"
                          },
                          "moduleId": {
                            "type": "string"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "invalid-json",
                                "type": "string"
                              },
                              {
                                "const": "invalid-schema",
                                "type": "string"
                              }
                            ]
                          },
                          "errors": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "pattern",
                          "triggeringEventType",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:event-handler:failed",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "triggeringEventType": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "pattern",
                          "triggeringEventType",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:event-handler:timeout",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "triggeringEventType": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "invocationId",
                          "actionId",
                          "extensionName",
                          "extensionPath",
                          "requestedBy"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:action:start",
                            "type": "string"
                          },
                          "invocationId": {
                            "type": "string"
                          },
                          "actionId": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "requestedBy": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "host"
                            ],
                            "properties": {
                              "host": {
                                "anyOf": [
                                  {
                                    "const": "console",
                                    "type": "string"
                                  },
                                  {
                                    "const": "pi",
                                    "type": "string"
                                  },
                                  {
                                    "const": "claude",
                                    "type": "string"
                                  },
                                  {
                                    "const": "mcp",
                                    "type": "string"
                                  },
                                  {
                                    "const": "cli",
                                    "type": "string"
                                  }
                                ]
                              },
                              "surface": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "commandId": {
                                "type": "string"
                              },
                              "deepLinkId": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "invocationId",
                          "actionId",
                          "extensionName",
                          "extensionPath",
                          "requestedBy",
                          "durationMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:action:complete",
                            "type": "string"
                          },
                          "invocationId": {
                            "type": "string"
                          },
                          "actionId": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "requestedBy": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "host"
                            ],
                            "properties": {
                              "host": {
                                "anyOf": [
                                  {
                                    "const": "console",
                                    "type": "string"
                                  },
                                  {
                                    "const": "pi",
                                    "type": "string"
                                  },
                                  {
                                    "const": "claude",
                                    "type": "string"
                                  },
                                  {
                                    "const": "mcp",
                                    "type": "string"
                                  },
                                  {
                                    "const": "cli",
                                    "type": "string"
                                  }
                                ]
                              },
                              "surface": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "commandId": {
                                "type": "string"
                              },
                              "deepLinkId": {
                                "type": "string"
                              }
                            }
                          },
                          "durationMs": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "invocationId",
                          "actionId",
                          "extensionName",
                          "extensionPath",
                          "requestedBy",
                          "durationMs",
                          "errorCode",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:action:failed",
                            "type": "string"
                          },
                          "invocationId": {
                            "type": "string"
                          },
                          "actionId": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "requestedBy": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "host"
                            ],
                            "properties": {
                              "host": {
                                "anyOf": [
                                  {
                                    "const": "console",
                                    "type": "string"
                                  },
                                  {
                                    "const": "pi",
                                    "type": "string"
                                  },
                                  {
                                    "const": "claude",
                                    "type": "string"
                                  },
                                  {
                                    "const": "mcp",
                                    "type": "string"
                                  },
                                  {
                                    "const": "cli",
                                    "type": "string"
                                  }
                                ]
                              },
                              "surface": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "commandId": {
                                "type": "string"
                              },
                              "deepLinkId": {
                                "type": "string"
                              }
                            }
                          },
                          "durationMs": {
                            "type": "number"
                          },
                          "errorCode": {
                            "anyOf": [
                              {
                                "const": "invalid-input",
                                "type": "string"
                              },
                              {
                                "const": "daemon-unavailable",
                                "type": "string"
                              },
                              {
                                "const": "handler-error",
                                "type": "string"
                              },
                              {
                                "const": "invalid-output",
                                "type": "string"
                              },
                              {
                                "const": "output-schema-failed",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "validationErrors": {
                            "type": "array",
                            "items": {
                              "additionalProperties": {
                                "$id": "TypeBoxRecursive0",
                                "anyOf": [
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "$ref": "TypeBoxRecursive0"
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "patternProperties": {
                                      "^(.*)$": {
                                        "$ref": "TypeBoxRecursive0"
                                      }
                                    }
                                  }
                                ]
                              },
                              "type": "object",
                              "required": [
                                "path",
                                "message"
                              ],
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "invocationId",
                          "actionId",
                          "extensionName",
                          "extensionPath",
                          "requestedBy",
                          "durationMs",
                          "timeoutMs",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:action:timeout",
                            "type": "string"
                          },
                          "invocationId": {
                            "type": "string"
                          },
                          "actionId": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "requestedBy": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "host"
                            ],
                            "properties": {
                              "host": {
                                "anyOf": [
                                  {
                                    "const": "console",
                                    "type": "string"
                                  },
                                  {
                                    "const": "pi",
                                    "type": "string"
                                  },
                                  {
                                    "const": "claude",
                                    "type": "string"
                                  },
                                  {
                                    "const": "mcp",
                                    "type": "string"
                                  },
                                  {
                                    "const": "cli",
                                    "type": "string"
                                  }
                                ]
                              },
                              "surface": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "commandId": {
                                "type": "string"
                              },
                              "deepLinkId": {
                                "type": "string"
                              }
                            }
                          },
                          "durationMs": {
                            "type": "number"
                          },
                          "timeoutMs": {
                            "type": "number"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "taskId",
                          "taskKind",
                          "extensionName",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-task:start",
                            "type": "string"
                          },
                          "taskId": {
                            "type": "string"
                          },
                          "taskKind": {
                            "const": "eforge-plan.planning-draft",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "status": {
                            "const": "running",
                            "type": "string"
                          },
                          "metadata": {
                            "additionalProperties": false,
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "progressMessage": {
                                "type": "string"
                              },
                              "outputSectionCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "warningCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sectionProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "currentSection": {
                                    "maxLength": 500,
                                    "type": "string"
                                  },
                                  "coveredSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  },
                                  "remainingSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "backlogCurationProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "total",
                                  "cacheHits",
                                  "misses",
                                  "running",
                                  "completed",
                                  "remaining",
                                  "items"
                                ],
                                "properties": {
                                  "total": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "cacheHits": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "misses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "running": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "completed": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "remaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "items": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "itemId",
                                        "status"
                                      ],
                                      "properties": {
                                        "itemId": {
                                          "minLength": 1,
                                          "maxLength": 240,
                                          "type": "string"
                                        },
                                        "title": {
                                          "maxLength": 300,
                                          "type": "string"
                                        },
                                        "status": {
                                          "anyOf": [
                                            {
                                              "const": "pending",
                                              "type": "string"
                                            },
                                            {
                                              "const": "running",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cache-hit",
                                              "type": "string"
                                            },
                                            {
                                              "const": "completed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "failed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cancelled",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "outcome": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "summary": {
                                          "maxLength": 500,
                                          "type": "string"
                                        },
                                        "startedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        },
                                        "completedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "activityLog": {
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "timestamp",
                                    "message"
                                  ],
                                  "properties": {
                                    "timestamp": {
                                      "minLength": 1,
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                                      "type": "string"
                                    },
                                    "message": {
                                      "minLength": 1,
                                      "maxLength": 500,
                                      "pattern": "\\S",
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "taskId",
                          "taskKind",
                          "extensionName",
                          "status",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-task:progress",
                            "type": "string"
                          },
                          "taskId": {
                            "type": "string"
                          },
                          "taskKind": {
                            "const": "eforge-plan.planning-draft",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "status": {
                            "const": "running",
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "metadata": {
                            "additionalProperties": false,
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "progressMessage": {
                                "type": "string"
                              },
                              "outputSectionCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "warningCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sectionProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "currentSection": {
                                    "maxLength": 500,
                                    "type": "string"
                                  },
                                  "coveredSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  },
                                  "remainingSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "backlogCurationProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "total",
                                  "cacheHits",
                                  "misses",
                                  "running",
                                  "completed",
                                  "remaining",
                                  "items"
                                ],
                                "properties": {
                                  "total": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "cacheHits": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "misses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "running": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "completed": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "remaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "items": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "itemId",
                                        "status"
                                      ],
                                      "properties": {
                                        "itemId": {
                                          "minLength": 1,
                                          "maxLength": 240,
                                          "type": "string"
                                        },
                                        "title": {
                                          "maxLength": 300,
                                          "type": "string"
                                        },
                                        "status": {
                                          "anyOf": [
                                            {
                                              "const": "pending",
                                              "type": "string"
                                            },
                                            {
                                              "const": "running",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cache-hit",
                                              "type": "string"
                                            },
                                            {
                                              "const": "completed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "failed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cancelled",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "outcome": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "summary": {
                                          "maxLength": 500,
                                          "type": "string"
                                        },
                                        "startedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        },
                                        "completedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "activityLog": {
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "timestamp",
                                    "message"
                                  ],
                                  "properties": {
                                    "timestamp": {
                                      "minLength": 1,
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                                      "type": "string"
                                    },
                                    "message": {
                                      "minLength": 1,
                                      "maxLength": 500,
                                      "pattern": "\\S",
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "taskId",
                          "taskKind",
                          "extensionName",
                          "status",
                          "durationMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-task:complete",
                            "type": "string"
                          },
                          "taskId": {
                            "type": "string"
                          },
                          "taskKind": {
                            "const": "eforge-plan.planning-draft",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "status": {
                            "const": "completed",
                            "type": "string"
                          },
                          "durationMs": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "metadata": {
                            "additionalProperties": false,
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "progressMessage": {
                                "type": "string"
                              },
                              "outputSectionCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "warningCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sectionProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "currentSection": {
                                    "maxLength": 500,
                                    "type": "string"
                                  },
                                  "coveredSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  },
                                  "remainingSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "backlogCurationProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "total",
                                  "cacheHits",
                                  "misses",
                                  "running",
                                  "completed",
                                  "remaining",
                                  "items"
                                ],
                                "properties": {
                                  "total": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "cacheHits": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "misses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "running": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "completed": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "remaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "items": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "itemId",
                                        "status"
                                      ],
                                      "properties": {
                                        "itemId": {
                                          "minLength": 1,
                                          "maxLength": 240,
                                          "type": "string"
                                        },
                                        "title": {
                                          "maxLength": 300,
                                          "type": "string"
                                        },
                                        "status": {
                                          "anyOf": [
                                            {
                                              "const": "pending",
                                              "type": "string"
                                            },
                                            {
                                              "const": "running",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cache-hit",
                                              "type": "string"
                                            },
                                            {
                                              "const": "completed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "failed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cancelled",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "outcome": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "summary": {
                                          "maxLength": 500,
                                          "type": "string"
                                        },
                                        "startedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        },
                                        "completedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "activityLog": {
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "timestamp",
                                    "message"
                                  ],
                                  "properties": {
                                    "timestamp": {
                                      "minLength": 1,
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                                      "type": "string"
                                    },
                                    "message": {
                                      "minLength": 1,
                                      "maxLength": 500,
                                      "pattern": "\\S",
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "taskId",
                          "taskKind",
                          "extensionName",
                          "status",
                          "errorCode",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-task:failed",
                            "type": "string"
                          },
                          "taskId": {
                            "type": "string"
                          },
                          "taskKind": {
                            "const": "eforge-plan.planning-draft",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "status": {
                            "const": "failed",
                            "type": "string"
                          },
                          "durationMs": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "errorCode": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "metadata": {
                            "additionalProperties": false,
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "progressMessage": {
                                "type": "string"
                              },
                              "outputSectionCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "warningCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sectionProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "currentSection": {
                                    "maxLength": 500,
                                    "type": "string"
                                  },
                                  "coveredSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  },
                                  "remainingSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "backlogCurationProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "total",
                                  "cacheHits",
                                  "misses",
                                  "running",
                                  "completed",
                                  "remaining",
                                  "items"
                                ],
                                "properties": {
                                  "total": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "cacheHits": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "misses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "running": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "completed": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "remaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "items": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "itemId",
                                        "status"
                                      ],
                                      "properties": {
                                        "itemId": {
                                          "minLength": 1,
                                          "maxLength": 240,
                                          "type": "string"
                                        },
                                        "title": {
                                          "maxLength": 300,
                                          "type": "string"
                                        },
                                        "status": {
                                          "anyOf": [
                                            {
                                              "const": "pending",
                                              "type": "string"
                                            },
                                            {
                                              "const": "running",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cache-hit",
                                              "type": "string"
                                            },
                                            {
                                              "const": "completed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "failed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cancelled",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "outcome": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "summary": {
                                          "maxLength": 500,
                                          "type": "string"
                                        },
                                        "startedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        },
                                        "completedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "activityLog": {
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "timestamp",
                                    "message"
                                  ],
                                  "properties": {
                                    "timestamp": {
                                      "minLength": 1,
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                                      "type": "string"
                                    },
                                    "message": {
                                      "minLength": 1,
                                      "maxLength": 500,
                                      "pattern": "\\S",
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "taskId",
                          "taskKind",
                          "extensionName",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-task:cancelled",
                            "type": "string"
                          },
                          "taskId": {
                            "type": "string"
                          },
                          "taskKind": {
                            "const": "eforge-plan.planning-draft",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "status": {
                            "const": "cancelled",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "metadata": {
                            "additionalProperties": false,
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "summary": {
                                "type": "string"
                              },
                              "progressMessage": {
                                "type": "string"
                              },
                              "outputSectionCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "warningCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sectionProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "currentSection": {
                                    "maxLength": 500,
                                    "type": "string"
                                  },
                                  "coveredSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  },
                                  "remainingSections": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 500,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "backlogCurationProgress": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "total",
                                  "cacheHits",
                                  "misses",
                                  "running",
                                  "completed",
                                  "remaining",
                                  "items"
                                ],
                                "properties": {
                                  "total": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "cacheHits": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "misses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "running": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "completed": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "remaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "items": {
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "itemId",
                                        "status"
                                      ],
                                      "properties": {
                                        "itemId": {
                                          "minLength": 1,
                                          "maxLength": 240,
                                          "type": "string"
                                        },
                                        "title": {
                                          "maxLength": 300,
                                          "type": "string"
                                        },
                                        "status": {
                                          "anyOf": [
                                            {
                                              "const": "pending",
                                              "type": "string"
                                            },
                                            {
                                              "const": "running",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cache-hit",
                                              "type": "string"
                                            },
                                            {
                                              "const": "completed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "failed",
                                              "type": "string"
                                            },
                                            {
                                              "const": "cancelled",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "outcome": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "maxLength": 80,
                                          "type": "string"
                                        },
                                        "summary": {
                                          "maxLength": 500,
                                          "type": "string"
                                        },
                                        "startedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        },
                                        "completedAt": {
                                          "maxLength": 120,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "activityLog": {
                                "maxItems": 50,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "timestamp",
                                    "message"
                                  ],
                                  "properties": {
                                    "timestamp": {
                                      "minLength": 1,
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                                      "type": "string"
                                    },
                                    "message": {
                                      "minLength": 1,
                                      "maxLength": 500,
                                      "pattern": "\\S",
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "role",
                          "profile",
                          "promptCharCount",
                          "fragmentCount"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-context:applied",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "role": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tier": {
                            "type": "string"
                          },
                          "phase": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "promptCharCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "fragmentCount": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "role",
                          "profile",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-context:failed",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "role": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tier": {
                            "type": "string"
                          },
                          "phase": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "role",
                          "profile",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-context:timeout",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "role": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tier": {
                            "type": "string"
                          },
                          "phase": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "role",
                          "profile",
                          "fields"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-context:unsupported",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "role": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tier": {
                            "type": "string"
                          },
                          "phase": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "fields": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "const": "tools",
                                  "type": "string"
                                },
                                {
                                  "const": "allowedTools",
                                  "type": "string"
                                },
                                {
                                  "const": "disallowedTools",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionName",
                          "extensionPath",
                          "role",
                          "profile",
                          "toolNames",
                          "effectiveToolNames",
                          "registeredToolNames",
                          "inlineToolNames",
                          "allowedToolsAdded",
                          "disallowedToolsAdded",
                          "excludedToolNames",
                          "toolCount",
                          "allowedToolCount",
                          "disallowedToolCount",
                          "excludedToolCount"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:agent-tools:applied",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "role": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tier": {
                            "type": "string"
                          },
                          "phase": {
                            "type": "string"
                          },
                          "stage": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "projectMcpServerNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "toolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "effectiveToolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "registeredToolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "inlineToolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "allowedToolsAdded": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "disallowedToolsAdded": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "excludedToolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "toolCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "allowedToolCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "disallowedToolCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "excludedToolCount": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "profile",
                          "baseProfile",
                          "routerName",
                          "extensionName",
                          "extensionPath"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:profile:selected",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "string"
                          },
                          "baseProfile": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "routerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "confidence": {
                            "anyOf": [
                              {
                                "const": "low",
                                "type": "string"
                              },
                              {
                                "const": "medium",
                                "type": "string"
                              },
                              {
                                "const": "high",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "routerName",
                          "extensionName",
                          "extensionPath",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:profile:router-failed",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "routerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "routerName",
                          "extensionName",
                          "extensionPath",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:profile:router-timeout",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "routerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "routerName",
                          "extensionName",
                          "extensionPath",
                          "requestedProfile",
                          "reason",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:profile:invalid-selection",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "routerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "requestedProfile": {
                            "type": "string"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "not-found",
                                "type": "string"
                              },
                              {
                                "const": "load-error",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "prdId",
                          "decision"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "queue-dispatch",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeQueueDispatch",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "allow",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "prdId",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "queue-dispatch",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeQueueDispatch",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "block",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "prdId",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "queue-dispatch",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeQueueDispatch",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "require-approval",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "planId",
                          "decision"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "plan-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforePlanMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "planId": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "allow",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "planId",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "plan-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforePlanMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "planId": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "block",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "planId",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "plan-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforePlanMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "planId": {
                            "type": "string"
                          },
                          "decision": {
                            "const": "require-approval",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "featureBranch",
                          "baseBranch",
                          "decision"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "final-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeFinalMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "decision": {
                            "const": "allow",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "featureBranch",
                          "baseBranch",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "final-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeFinalMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "decision": {
                            "const": "block",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "featureBranch",
                          "baseBranch",
                          "decision",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:decision",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "final-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeFinalMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "decision": {
                            "const": "require-approval",
                            "type": "string"
                          },
                          "reason": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "prdId",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:failed",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "queue-dispatch",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeQueueDispatch",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "planId",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:failed",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "plan-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforePlanMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "planId": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "featureBranch",
                          "baseBranch",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:failed",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "final-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeFinalMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "prdId",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:timeout",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "queue-dispatch",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeQueueDispatch",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "prdTitle": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "planId",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:timeout",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "plan-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforePlanMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "planId": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "gateKind",
                          "method",
                          "extensionName",
                          "extensionPath",
                          "registrationIndex",
                          "failurePolicy",
                          "featureBranch",
                          "baseBranch",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:policy:timeout",
                            "type": "string"
                          },
                          "gateKind": {
                            "const": "final-merge",
                            "type": "string"
                          },
                          "method": {
                            "const": "beforeFinalMerge",
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "registrationIndex": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failurePolicy": {
                            "anyOf": [
                              {
                                "const": "fail-open",
                                "type": "string"
                              },
                              {
                                "const": "fail-closed",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionPath",
                          "extensionName",
                          "adapterName",
                          "sourceId",
                          "contentLength"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:input-source:fetched",
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "adapterName": {
                            "type": "string"
                          },
                          "sourceId": {
                            "type": "string"
                          },
                          "contentLength": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionPath",
                          "extensionName",
                          "adapterName",
                          "sourceId",
                          "reason",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:input-source:failed",
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "adapterName": {
                            "type": "string"
                          },
                          "sourceId": {
                            "type": "string"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "not-found",
                                "type": "string"
                              },
                              {
                                "const": "error",
                                "type": "string"
                              },
                              {
                                "const": "timeout",
                                "type": "string"
                              },
                              {
                                "const": "invalid-result",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionPath",
                          "extensionName",
                          "enricherName",
                          "sourceId",
                          "changed",
                          "inputLength",
                          "outputLength"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:prd-enricher:applied",
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "enricherName": {
                            "type": "string"
                          },
                          "sourceId": {
                            "type": "string"
                          },
                          "changed": {
                            "type": "boolean"
                          },
                          "inputLength": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "outputLength": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionPath",
                          "extensionName",
                          "enricherName",
                          "sourceId",
                          "reason",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:prd-enricher:failed",
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "enricherName": {
                            "type": "string"
                          },
                          "sourceId": {
                            "type": "string"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "error",
                                "type": "string"
                              },
                              {
                                "const": "timeout",
                                "type": "string"
                              },
                              {
                                "const": "invalid-result",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "extensionPath",
                          "extensionName",
                          "perspectiveKey",
                          "perspectiveLabel"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:reviewer-perspective:applied",
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "perspectiveKey": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          },
                          "perspectiveLabel": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "type",
                              "extensionPath",
                              "extensionName",
                              "perspectiveKey",
                              "reason"
                            ],
                            "properties": {
                              "type": {
                                "const": "extension:reviewer-perspective:skipped",
                                "type": "string"
                              },
                              "extensionPath": {
                                "type": "string"
                              },
                              "extensionName": {
                                "type": "string"
                              },
                              "perspectiveKey": {
                                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                "type": "string"
                              },
                              "reason": {
                                "anyOf": [
                                  {
                                    "const": "not-applicable",
                                    "type": "string"
                                  },
                                  {
                                    "const": "applicability-error",
                                    "type": "string"
                                  },
                                  {
                                    "const": "applicability-timeout",
                                    "type": "string"
                                  }
                                ]
                              },
                              "message": {
                                "type": "string"
                              },
                              "planId": {
                                "type": "string"
                              },
                              "timeoutMs": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            }
                          },
                          {
                            "type": "object",
                            "required": [
                              "type",
                              "perspectiveKey",
                              "reason"
                            ],
                            "properties": {
                              "type": {
                                "const": "extension:reviewer-perspective:skipped",
                                "type": "string"
                              },
                              "extensionPath": {
                                "type": "string"
                              },
                              "extensionName": {
                                "type": "string"
                              },
                              "perspectiveKey": {
                                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                "type": "string"
                              },
                              "reason": {
                                "const": "unknown-key",
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "planId": {
                                "type": "string"
                              }
                            }
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "providerName",
                          "extensionName",
                          "extensionPath",
                          "kind"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:validation-provider:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "providerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "kind": {
                            "anyOf": [
                              {
                                "const": "validate",
                                "type": "string"
                              },
                              {
                                "const": "commands",
                                "type": "string"
                              }
                            ]
                          },
                          "commandCount": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "providerName",
                          "extensionName",
                          "extensionPath",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:validation-provider:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "providerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "passed",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "providerName",
                          "extensionName",
                          "extensionPath",
                          "status",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:validation-provider:error",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "providerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "status": {
                            "const": "failed",
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "details": {
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          },
                          "exitCode": {
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "providerName",
                          "extensionName",
                          "extensionPath",
                          "timeoutMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "extension:validation-provider:timeout",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "providerName": {
                            "type": "string"
                          },
                          "extensionName": {
                            "type": "string"
                          },
                          "extensionPath": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "command": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:start",
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "summary"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:inspection-summary",
                            "type": "string"
                          },
                          "summary": {
                            "type": "object",
                            "required": [
                              "kind",
                              "version",
                              "source",
                              "relevantFiles",
                              "observedFacts",
                              "importantFindings",
                              "inferredImplementationAreas",
                              "unresolvedQuestions",
                              "sourceBuildContext",
                              "budgetDiagnostics",
                              "caveats",
                              "omittedCounts"
                            ],
                            "properties": {
                              "kind": {
                                "const": "planner-inspection-handoff",
                                "type": "string"
                              },
                              "version": {
                                "const": 1,
                                "type": "number"
                              },
                              "source": {
                                "type": "object",
                                "properties": {
                                  "sourceId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "sourceName": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "buildId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "planSetName": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "runId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              },
                              "relevantFiles": {
                                "maxItems": 40,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "observedFacts": {
                                "maxItems": 16,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "importantFindings": {
                                "maxItems": 12,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "inferredImplementationAreas": {
                                "maxItems": 16,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "unresolvedQuestions": {
                                "maxItems": 8,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "sourceBuildContext": {
                                "type": "object",
                                "properties": {
                                  "sourceSummary": {
                                    "maxLength": 3000,
                                    "type": "string"
                                  },
                                  "buildGoal": {
                                    "maxLength": 3000,
                                    "type": "string"
                                  },
                                  "promptSourceSnippet": {
                                    "maxLength": 3000,
                                    "type": "string"
                                  }
                                }
                              },
                              "budgetDiagnostics": {
                                "type": "object",
                                "required": [
                                  "maxObservedInputTokens",
                                  "softInputTokenThreshold",
                                  "plannerMaxTurns",
                                  "inspectionTurnBudget",
                                  "softInputTokenRatio",
                                  "softTurnRatio",
                                  "observed",
                                  "toolUseCount",
                                  "toolResultCount"
                                ],
                                "properties": {
                                  "maxObservedInputTokens": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "softInputTokenThreshold": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "plannerMaxTurns": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "inspectionTurnBudget": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "softInputTokenRatio": {
                                    "minimum": 0,
                                    "maximum": 1,
                                    "type": "number"
                                  },
                                  "softTurnRatio": {
                                    "minimum": 0,
                                    "maximum": 1,
                                    "type": "number"
                                  },
                                  "guardDiagnostics": {
                                    "type": "object",
                                    "required": [
                                      "metadataSource",
                                      "outputReserveTokens",
                                      "overheadReserveTokens",
                                      "safetyMargin",
                                      "limits"
                                    ],
                                    "properties": {
                                      "provider": {
                                        "type": "string"
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "metadataSource": {
                                        "anyOf": [
                                          {
                                            "const": "registry",
                                            "type": "string"
                                          },
                                          {
                                            "const": "builtin",
                                            "type": "string"
                                          },
                                          {
                                            "const": "synthetic",
                                            "type": "string"
                                          },
                                          {
                                            "const": "fallback",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "fallbackReason": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      },
                                      "contextWindow": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "outputReserveTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "overheadReserveTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "safetyMargin": {
                                        "exclusiveMinimum": 0,
                                        "maximum": 1,
                                        "type": "number"
                                      },
                                      "limits": {
                                        "type": "object",
                                        "required": [
                                          "maxPromptBytes",
                                          "maxObservedInputTokens",
                                          "maxExplanationBytes"
                                        ],
                                        "properties": {
                                          "maxPromptBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedInputTokens": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedTurns": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxExplanationBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "observed": {
                                    "type": "object",
                                    "required": [
                                      "inputTokens",
                                      "outputTokens",
                                      "turns",
                                      "promptBytes"
                                    ],
                                    "properties": {
                                      "inputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "outputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "turns": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "promptBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "toolUseCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "toolResultCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              },
                              "caveats": {
                                "maxItems": 8,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "omittedCounts": {
                                "additionalProperties": false,
                                "type": "object",
                                "properties": {
                                  "relevantFiles": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "observedFacts": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "importantFindings": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "inferredImplementationAreas": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "unresolvedQuestions": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "toolUses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "toolResults": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "toolUseSummaryBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "toolResultSnippetBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "importantFindingBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "messageBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "inferredImplementationAreaBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceIdBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceNameBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourcePathBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "buildIdBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "planSetNameBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "runIdBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceSummaryBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "buildGoalBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "promptSourceSnippetBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "relevantFileBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "caveatBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          },
                          "artifactPath": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:skip",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planCount",
                          "totalBodySize",
                          "hasMigrations"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:submission",
                            "type": "string"
                          },
                          "planCount": {
                            "type": "number"
                          },
                          "totalBodySize": {
                            "type": "number"
                          },
                          "hasMigrations": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:error",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "failure"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:scope-context:failure",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "failure": {
                            "allOf": [
                              {
                                "type": "object",
                                "required": [
                                  "source",
                                  "failureKind",
                                  "stage",
                                  "explanation",
                                  "recovery",
                                  "artifacts"
                                ],
                                "properties": {
                                  "source": {
                                    "anyOf": [
                                      {
                                        "const": "live-context-guard",
                                        "type": "string"
                                      },
                                      {
                                        "const": "provider",
                                        "type": "string"
                                      },
                                      {
                                        "const": "decomposition",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "failureKind": {
                                    "anyOf": [
                                      {
                                        "const": "context-budget",
                                        "type": "string"
                                      },
                                      {
                                        "const": "context-window",
                                        "type": "string"
                                      },
                                      {
                                        "const": "context-length",
                                        "type": "string"
                                      },
                                      {
                                        "const": "scope-too-broad",
                                        "type": "string"
                                      },
                                      {
                                        "const": "decomposition-exhausted",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "stage": {
                                    "anyOf": [
                                      {
                                        "const": "planner",
                                        "type": "string"
                                      },
                                      {
                                        "const": "compile",
                                        "type": "string"
                                      },
                                      {
                                        "const": "planning-decomposition",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "explanation": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "observed": {
                                    "type": "object",
                                    "properties": {
                                      "inputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "outputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "turns": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "promptBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "guardDiagnostics": {
                                    "type": "object",
                                    "required": [
                                      "metadataSource",
                                      "outputReserveTokens",
                                      "overheadReserveTokens",
                                      "safetyMargin",
                                      "limits"
                                    ],
                                    "properties": {
                                      "provider": {
                                        "type": "string"
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "metadataSource": {
                                        "anyOf": [
                                          {
                                            "const": "registry",
                                            "type": "string"
                                          },
                                          {
                                            "const": "builtin",
                                            "type": "string"
                                          },
                                          {
                                            "const": "synthetic",
                                            "type": "string"
                                          },
                                          {
                                            "const": "fallback",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "fallbackReason": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      },
                                      "contextWindow": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "outputReserveTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "overheadReserveTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "safetyMargin": {
                                        "exclusiveMinimum": 0,
                                        "maximum": 1,
                                        "type": "number"
                                      },
                                      "limits": {
                                        "type": "object",
                                        "required": [
                                          "maxPromptBytes",
                                          "maxObservedInputTokens",
                                          "maxExplanationBytes"
                                        ],
                                        "properties": {
                                          "maxPromptBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedInputTokens": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedTurns": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxExplanationBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "decompositionEvidence": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "unitId",
                                      "depth",
                                      "budgets",
                                      "observed",
                                      "assignedCriteriaIds",
                                      "unresolvedCriteria",
                                      "blockers",
                                      "splitAttempts"
                                    ],
                                    "properties": {
                                      "unitId": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      },
                                      "parentUnitId": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      },
                                      "depth": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "budgets": {
                                        "additionalProperties": false,
                                        "type": "object",
                                        "required": [
                                          "maxRecursiveDepth",
                                          "maxPromptSourceBytes",
                                          "maxPromptBytes",
                                          "maxObservedInputTokens",
                                          "maxCompactHandoffBytes",
                                          "maxLocalExplorationToolUses",
                                          "maxCriteriaPerUnit",
                                          "maxSubsystemsPerUnit",
                                          "maxSplitAttemptsPerUnit"
                                        ],
                                        "properties": {
                                          "maxRecursiveDepth": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "maxPromptSourceBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxPromptBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedInputTokens": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxObservedTurns": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxCompactHandoffBytes": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxLocalExplorationToolUses": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxCriteriaPerUnit": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxSubsystemsPerUnit": {
                                            "minimum": 1,
                                            "type": "integer"
                                          },
                                          "maxSplitAttemptsPerUnit": {
                                            "minimum": 1,
                                            "type": "integer"
                                          }
                                        }
                                      },
                                      "observed": {
                                        "additionalProperties": false,
                                        "type": "object",
                                        "required": [
                                          "triggeredLimitKeys"
                                        ],
                                        "properties": {
                                          "promptSourceBytes": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "promptBytes": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "observedInputTokens": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "observedTurns": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "compactHandoffBytes": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "localExplorationToolUses": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "criteriaCount": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "subsystemCount": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "splitAttempts": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "triggeredLimitKeys": {
                                            "maxItems": 32,
                                            "type": "array",
                                            "items": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "assignedCriteriaIds": {
                                        "maxItems": 64,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      },
                                      "unresolvedCriteria": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "reason"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "reason": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "evidence": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "blockers": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      },
                                      "splitAttempts": {
                                        "maxItems": 8,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "attempt",
                                            "reason",
                                            "resultingUnitIds"
                                          ],
                                          "properties": {
                                            "unitId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "attempt": {
                                              "minimum": 1,
                                              "type": "integer"
                                            },
                                            "reason": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "resultingUnitIds": {
                                              "maxItems": 128,
                                              "type": "array",
                                              "items": {
                                                "maxLength": 2000,
                                                "type": "string"
                                              }
                                            },
                                            "observed": {
                                              "additionalProperties": false,
                                              "type": "object",
                                              "required": [
                                                "triggeredLimitKeys"
                                              ],
                                              "properties": {
                                                "promptSourceBytes": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "promptBytes": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "observedInputTokens": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "observedTurns": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "compactHandoffBytes": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "localExplorationToolUses": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "criteriaCount": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "subsystemCount": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "splitAttempts": {
                                                  "minimum": 0,
                                                  "type": "integer"
                                                },
                                                "triggeredLimitKeys": {
                                                  "maxItems": 32,
                                                  "type": "array",
                                                  "items": {
                                                    "maxLength": 2000,
                                                    "type": "string"
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "recovery": {
                                    "type": "object",
                                    "required": [
                                      "action",
                                      "eligible",
                                      "attempted",
                                      "attempt",
                                      "maxAttempts",
                                      "reason"
                                    ],
                                    "properties": {
                                      "action": {
                                        "anyOf": [
                                          {
                                            "const": "none",
                                            "type": "string"
                                          },
                                          {
                                            "const": "bounded-decomposition",
                                            "type": "string"
                                          },
                                          {
                                            "const": "manual-reduce-scope",
                                            "type": "string"
                                          },
                                          {
                                            "const": "repair-existing-artifacts",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "eligible": {
                                        "type": "boolean"
                                      },
                                      "attempted": {
                                        "type": "boolean"
                                      },
                                      "attempt": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "maxAttempts": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "reason": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "artifacts": {
                                    "type": "object",
                                    "required": [
                                      "orchestrationExists",
                                      "validPlanCount",
                                      "invalidPlanCount",
                                      "missingPlanFileCount",
                                      "missingPlanFiles",
                                      "invalidPlanFiles"
                                    ],
                                    "properties": {
                                      "orchestrationExists": {
                                        "type": "boolean"
                                      },
                                      "validPlanCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "invalidPlanCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "missingPlanFileCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "missingPlanFiles": {
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      },
                                      "invalidPlanFiles": {
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "required": [
                                      "source",
                                      "failureKind",
                                      "stage",
                                      "decompositionEvidence"
                                    ],
                                    "properties": {
                                      "source": {
                                        "const": "decomposition",
                                        "type": "string"
                                      },
                                      "failureKind": {
                                        "const": "decomposition-exhausted",
                                        "type": "string"
                                      },
                                      "stage": {
                                        "const": "planning-decomposition",
                                        "type": "string"
                                      },
                                      "decompositionEvidence": {
                                        "additionalProperties": false,
                                        "type": "object",
                                        "required": [
                                          "unitId",
                                          "depth",
                                          "budgets",
                                          "observed",
                                          "assignedCriteriaIds",
                                          "unresolvedCriteria",
                                          "blockers",
                                          "splitAttempts"
                                        ],
                                        "properties": {
                                          "unitId": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          },
                                          "parentUnitId": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          },
                                          "depth": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "budgets": {
                                            "additionalProperties": false,
                                            "type": "object",
                                            "required": [
                                              "maxRecursiveDepth",
                                              "maxPromptSourceBytes",
                                              "maxPromptBytes",
                                              "maxObservedInputTokens",
                                              "maxCompactHandoffBytes",
                                              "maxLocalExplorationToolUses",
                                              "maxCriteriaPerUnit",
                                              "maxSubsystemsPerUnit",
                                              "maxSplitAttemptsPerUnit"
                                            ],
                                            "properties": {
                                              "maxRecursiveDepth": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "maxPromptSourceBytes": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxPromptBytes": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxObservedInputTokens": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxObservedTurns": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxCompactHandoffBytes": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxLocalExplorationToolUses": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxCriteriaPerUnit": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxSubsystemsPerUnit": {
                                                "minimum": 1,
                                                "type": "integer"
                                              },
                                              "maxSplitAttemptsPerUnit": {
                                                "minimum": 1,
                                                "type": "integer"
                                              }
                                            }
                                          },
                                          "observed": {
                                            "additionalProperties": false,
                                            "type": "object",
                                            "required": [
                                              "triggeredLimitKeys"
                                            ],
                                            "properties": {
                                              "promptSourceBytes": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "promptBytes": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "observedInputTokens": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "observedTurns": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "compactHandoffBytes": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "localExplorationToolUses": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "criteriaCount": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "subsystemCount": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "splitAttempts": {
                                                "minimum": 0,
                                                "type": "integer"
                                              },
                                              "triggeredLimitKeys": {
                                                "maxItems": 32,
                                                "type": "array",
                                                "items": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                }
                                              }
                                            }
                                          },
                                          "assignedCriteriaIds": {
                                            "maxItems": 64,
                                            "type": "array",
                                            "items": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          },
                                          "unresolvedCriteria": {
                                            "maxItems": 32,
                                            "type": "array",
                                            "items": {
                                              "additionalProperties": false,
                                              "type": "object",
                                              "required": [
                                                "criterionId",
                                                "reason"
                                              ],
                                              "properties": {
                                                "criterionId": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                },
                                                "reason": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                },
                                                "evidence": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                }
                                              }
                                            }
                                          },
                                          "blockers": {
                                            "maxItems": 32,
                                            "type": "array",
                                            "items": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          },
                                          "splitAttempts": {
                                            "maxItems": 8,
                                            "type": "array",
                                            "items": {
                                              "additionalProperties": false,
                                              "type": "object",
                                              "required": [
                                                "attempt",
                                                "reason",
                                                "resultingUnitIds"
                                              ],
                                              "properties": {
                                                "unitId": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                },
                                                "attempt": {
                                                  "minimum": 1,
                                                  "type": "integer"
                                                },
                                                "reason": {
                                                  "maxLength": 2000,
                                                  "type": "string"
                                                },
                                                "resultingUnitIds": {
                                                  "maxItems": 128,
                                                  "type": "array",
                                                  "items": {
                                                    "maxLength": 2000,
                                                    "type": "string"
                                                  }
                                                },
                                                "observed": {
                                                  "additionalProperties": false,
                                                  "type": "object",
                                                  "required": [
                                                    "triggeredLimitKeys"
                                                  ],
                                                  "properties": {
                                                    "promptSourceBytes": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "promptBytes": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "observedInputTokens": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "observedTurns": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "compactHandoffBytes": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "localExplorationToolUses": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "criteriaCount": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "subsystemCount": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "splitAttempts": {
                                                      "minimum": 0,
                                                      "type": "integer"
                                                    },
                                                    "triggeredLimitKeys": {
                                                      "maxItems": 32,
                                                      "type": "array",
                                                      "items": {
                                                        "maxLength": 2000,
                                                        "type": "string"
                                                      }
                                                    }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "source",
                                      "failureKind"
                                    ],
                                    "properties": {
                                      "source": {
                                        "anyOf": [
                                          {
                                            "const": "live-context-guard",
                                            "type": "string"
                                          },
                                          {
                                            "const": "provider",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "failureKind": {
                                        "anyOf": [
                                          {
                                            "const": "context-budget",
                                            "type": "string"
                                          },
                                          {
                                            "const": "context-window",
                                            "type": "string"
                                          },
                                          {
                                            "const": "context-length",
                                            "type": "string"
                                          },
                                          {
                                            "const": "scope-too-broad",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "decompositionEvidence": {
                                        "not": {}
                                      }
                                    }
                                  }
                                ]
                              }
                            ],
                            "properties": {
                              "source": {
                                "anyOf": [
                                  {
                                    "const": "live-context-guard",
                                    "type": "string"
                                  },
                                  {
                                    "const": "provider",
                                    "type": "string"
                                  },
                                  {
                                    "const": "decomposition",
                                    "type": "string"
                                  }
                                ]
                              },
                              "failureKind": {
                                "anyOf": [
                                  {
                                    "const": "context-budget",
                                    "type": "string"
                                  },
                                  {
                                    "const": "context-window",
                                    "type": "string"
                                  },
                                  {
                                    "const": "context-length",
                                    "type": "string"
                                  },
                                  {
                                    "const": "scope-too-broad",
                                    "type": "string"
                                  },
                                  {
                                    "const": "decomposition-exhausted",
                                    "type": "string"
                                  }
                                ]
                              },
                              "stage": {
                                "anyOf": [
                                  {
                                    "const": "planner",
                                    "type": "string"
                                  },
                                  {
                                    "const": "compile",
                                    "type": "string"
                                  },
                                  {
                                    "const": "planning-decomposition",
                                    "type": "string"
                                  }
                                ]
                              },
                              "explanation": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "observed": {
                                "type": "object",
                                "properties": {
                                  "inputTokens": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "outputTokens": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "turns": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "promptBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              },
                              "guardDiagnostics": {
                                "type": "object",
                                "required": [
                                  "metadataSource",
                                  "outputReserveTokens",
                                  "overheadReserveTokens",
                                  "safetyMargin",
                                  "limits"
                                ],
                                "properties": {
                                  "provider": {
                                    "type": "string"
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "metadataSource": {
                                    "anyOf": [
                                      {
                                        "const": "registry",
                                        "type": "string"
                                      },
                                      {
                                        "const": "builtin",
                                        "type": "string"
                                      },
                                      {
                                        "const": "synthetic",
                                        "type": "string"
                                      },
                                      {
                                        "const": "fallback",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "fallbackReason": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "contextWindow": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "outputReserveTokens": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "overheadReserveTokens": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "safetyMargin": {
                                    "exclusiveMinimum": 0,
                                    "maximum": 1,
                                    "type": "number"
                                  },
                                  "limits": {
                                    "type": "object",
                                    "required": [
                                      "maxPromptBytes",
                                      "maxObservedInputTokens",
                                      "maxExplanationBytes"
                                    ],
                                    "properties": {
                                      "maxPromptBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedInputTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedTurns": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxExplanationBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    }
                                  }
                                }
                              },
                              "decompositionEvidence": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "unitId",
                                  "depth",
                                  "budgets",
                                  "observed",
                                  "assignedCriteriaIds",
                                  "unresolvedCriteria",
                                  "blockers",
                                  "splitAttempts"
                                ],
                                "properties": {
                                  "unitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "parentUnitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "depth": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "budgets": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "maxRecursiveDepth",
                                      "maxPromptSourceBytes",
                                      "maxPromptBytes",
                                      "maxObservedInputTokens",
                                      "maxCompactHandoffBytes",
                                      "maxLocalExplorationToolUses",
                                      "maxCriteriaPerUnit",
                                      "maxSubsystemsPerUnit",
                                      "maxSplitAttemptsPerUnit"
                                    ],
                                    "properties": {
                                      "maxRecursiveDepth": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "maxPromptSourceBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxPromptBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedInputTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedTurns": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCompactHandoffBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxLocalExplorationToolUses": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCriteriaPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSubsystemsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSplitAttemptsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "observed": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "triggeredLimitKeys"
                                    ],
                                    "properties": {
                                      "promptSourceBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "promptBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "observedInputTokens": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "observedTurns": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "compactHandoffBytes": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "localExplorationToolUses": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "criteriaCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "subsystemCount": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "splitAttempts": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "triggeredLimitKeys": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "assignedCriteriaIds": {
                                    "maxItems": 64,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "unresolvedCriteria": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "criterionId",
                                        "reason"
                                      ],
                                      "properties": {
                                        "criterionId": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "reason": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "evidence": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "blockers": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "splitAttempts": {
                                    "maxItems": 8,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "attempt",
                                        "reason",
                                        "resultingUnitIds"
                                      ],
                                      "properties": {
                                        "unitId": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "attempt": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "reason": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "resultingUnitIds": {
                                          "maxItems": 128,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "observed": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "triggeredLimitKeys"
                                          ],
                                          "properties": {
                                            "promptSourceBytes": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "promptBytes": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "observedInputTokens": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "observedTurns": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "compactHandoffBytes": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "localExplorationToolUses": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "criteriaCount": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "subsystemCount": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "splitAttempts": {
                                              "minimum": 0,
                                              "type": "integer"
                                            },
                                            "triggeredLimitKeys": {
                                              "maxItems": 32,
                                              "type": "array",
                                              "items": {
                                                "maxLength": 2000,
                                                "type": "string"
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "recovery": {
                                "type": "object",
                                "required": [
                                  "action",
                                  "eligible",
                                  "attempted",
                                  "attempt",
                                  "maxAttempts",
                                  "reason"
                                ],
                                "properties": {
                                  "action": {
                                    "anyOf": [
                                      {
                                        "const": "none",
                                        "type": "string"
                                      },
                                      {
                                        "const": "bounded-decomposition",
                                        "type": "string"
                                      },
                                      {
                                        "const": "manual-reduce-scope",
                                        "type": "string"
                                      },
                                      {
                                        "const": "repair-existing-artifacts",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "eligible": {
                                    "type": "boolean"
                                  },
                                  "attempted": {
                                    "type": "boolean"
                                  },
                                  "attempt": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "maxAttempts": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "reason": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              },
                              "artifacts": {
                                "type": "object",
                                "required": [
                                  "orchestrationExists",
                                  "validPlanCount",
                                  "invalidPlanCount",
                                  "missingPlanFileCount",
                                  "missingPlanFiles",
                                  "invalidPlanFiles"
                                ],
                                "properties": {
                                  "orchestrationExists": {
                                    "type": "boolean"
                                  },
                                  "validPlanCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "invalidPlanCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "missingPlanFileCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "missingPlanFiles": {
                                    "maxItems": 12,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "invalidPlanFiles": {
                                    "maxItems": 12,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "graphId",
                          "rootUnitId",
                          "unitCount",
                          "edgeCount",
                          "limits"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:start",
                            "type": "string"
                          },
                          "graphId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "rootUnitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "unitCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "edgeCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "limits": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "parallelism",
                              "maxDepth",
                              "maxPromptSourceBytes",
                              "maxPromptBytes",
                              "maxObservedInputTokens",
                              "maxCompactHandoffBytes",
                              "maxLocalExplorationToolUses",
                              "maxCriteriaPerUnit",
                              "maxSubsystemsPerUnit",
                              "maxSplitAttemptsPerUnit"
                            ],
                            "properties": {
                              "parallelism": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxDepth": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxPromptSourceBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxPromptBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxObservedInputTokens": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxObservedTurns": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxCompactHandoffBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxLocalExplorationToolUses": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxCriteriaPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxSubsystemsPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxSplitAttemptsPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unit"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:queued",
                            "type": "string"
                          },
                          "unit": {
                            "type": "object",
                            "allOf": [
                              {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "unitId",
                                  "depth",
                                  "sourceSlices",
                                  "coverage",
                                  "subsystemHints",
                                  "dependencies",
                                  "interfaceConstraints",
                                  "sharedFileConstraints",
                                  "budgets",
                                  "status"
                                ],
                                "properties": {
                                  "unitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "parentUnitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "depth": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceSlices": {
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "kind",
                                        "sourceHash",
                                        "criteriaIds",
                                        "byteLength"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "anyOf": [
                                            {
                                              "const": "prd",
                                              "type": "string"
                                            },
                                            {
                                              "const": "artifact",
                                              "type": "string"
                                            },
                                            {
                                              "const": "file",
                                              "type": "string"
                                            },
                                            {
                                              "const": "criteria",
                                              "type": "string"
                                            },
                                            {
                                              "const": "other",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "sourceHash": {
                                          "pattern": "^[a-f0-9]{64}$",
                                          "type": "string"
                                        },
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "headingPath": {
                                          "maxItems": 32,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "startLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "endLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "byteStart": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "byteEnd": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "criteriaIds": {
                                          "maxItems": 64,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "byteLength": {
                                          "minimum": 0,
                                          "type": "integer"
                                        }
                                      }
                                    }
                                  },
                                  "coverage": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "coveredCriteria",
                                      "unresolvedCriteria"
                                    ],
                                    "properties": {
                                      "totalCriteria": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "omittedCriteriaCount": {
                                        "minimum": 0,
                                        "maximum": 10000,
                                        "type": "integer"
                                      },
                                      "coveredCriteria": {
                                        "maxItems": 64,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "coveredByUnitIds"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "sourceHash": {
                                              "pattern": "^[a-f0-9]{64}$",
                                              "type": "string"
                                            },
                                            "coveredByUnitIds": {
                                              "maxItems": 128,
                                              "type": "array",
                                              "items": {
                                                "maxLength": 2000,
                                                "type": "string"
                                              }
                                            }
                                          }
                                        }
                                      },
                                      "unresolvedCriteria": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "reason"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "reason": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "evidence": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "subsystemHints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "dependencies": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "interfaceConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "sharedFileConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "budgets": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "maxRecursiveDepth",
                                      "maxPromptSourceBytes",
                                      "maxPromptBytes",
                                      "maxObservedInputTokens",
                                      "maxCompactHandoffBytes",
                                      "maxLocalExplorationToolUses",
                                      "maxCriteriaPerUnit",
                                      "maxSubsystemsPerUnit",
                                      "maxSplitAttemptsPerUnit"
                                    ],
                                    "properties": {
                                      "maxRecursiveDepth": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "maxPromptSourceBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxPromptBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedInputTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedTurns": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCompactHandoffBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxLocalExplorationToolUses": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCriteriaPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSubsystemsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSplitAttemptsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "status": {
                                    "anyOf": [
                                      {
                                        "const": "queued",
                                        "type": "string"
                                      },
                                      {
                                        "const": "running",
                                        "type": "string"
                                      },
                                      {
                                        "const": "completed",
                                        "type": "string"
                                      },
                                      {
                                        "const": "skipped",
                                        "type": "string"
                                      },
                                      {
                                        "const": "failed",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "queued",
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitId"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:running",
                            "type": "string"
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitId",
                          "message"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:progress",
                            "type": "string"
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "message": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "observed": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "triggeredLimitKeys"
                            ],
                            "properties": {
                              "promptSourceBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "promptBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedInputTokens": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedTurns": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "compactHandoffBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "localExplorationToolUses": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "criteriaCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "subsystemCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "splitAttempts": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "triggeredLimitKeys": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unit"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:completed",
                            "type": "string"
                          },
                          "unit": {
                            "type": "object",
                            "allOf": [
                              {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "unitId",
                                  "depth",
                                  "sourceSlices",
                                  "coverage",
                                  "subsystemHints",
                                  "dependencies",
                                  "interfaceConstraints",
                                  "sharedFileConstraints",
                                  "budgets",
                                  "status"
                                ],
                                "properties": {
                                  "unitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "parentUnitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "depth": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceSlices": {
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "kind",
                                        "sourceHash",
                                        "criteriaIds",
                                        "byteLength"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "anyOf": [
                                            {
                                              "const": "prd",
                                              "type": "string"
                                            },
                                            {
                                              "const": "artifact",
                                              "type": "string"
                                            },
                                            {
                                              "const": "file",
                                              "type": "string"
                                            },
                                            {
                                              "const": "criteria",
                                              "type": "string"
                                            },
                                            {
                                              "const": "other",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "sourceHash": {
                                          "pattern": "^[a-f0-9]{64}$",
                                          "type": "string"
                                        },
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "headingPath": {
                                          "maxItems": 32,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "startLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "endLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "byteStart": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "byteEnd": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "criteriaIds": {
                                          "maxItems": 64,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "byteLength": {
                                          "minimum": 0,
                                          "type": "integer"
                                        }
                                      }
                                    }
                                  },
                                  "coverage": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "coveredCriteria",
                                      "unresolvedCriteria"
                                    ],
                                    "properties": {
                                      "totalCriteria": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "omittedCriteriaCount": {
                                        "minimum": 0,
                                        "maximum": 10000,
                                        "type": "integer"
                                      },
                                      "coveredCriteria": {
                                        "maxItems": 64,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "coveredByUnitIds"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "sourceHash": {
                                              "pattern": "^[a-f0-9]{64}$",
                                              "type": "string"
                                            },
                                            "coveredByUnitIds": {
                                              "maxItems": 128,
                                              "type": "array",
                                              "items": {
                                                "maxLength": 2000,
                                                "type": "string"
                                              }
                                            }
                                          }
                                        }
                                      },
                                      "unresolvedCriteria": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "reason"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "reason": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "evidence": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "subsystemHints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "dependencies": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "interfaceConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "sharedFileConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "budgets": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "maxRecursiveDepth",
                                      "maxPromptSourceBytes",
                                      "maxPromptBytes",
                                      "maxObservedInputTokens",
                                      "maxCompactHandoffBytes",
                                      "maxLocalExplorationToolUses",
                                      "maxCriteriaPerUnit",
                                      "maxSubsystemsPerUnit",
                                      "maxSplitAttemptsPerUnit"
                                    ],
                                    "properties": {
                                      "maxRecursiveDepth": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "maxPromptSourceBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxPromptBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedInputTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedTurns": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCompactHandoffBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxLocalExplorationToolUses": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCriteriaPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSubsystemsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSplitAttemptsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "status": {
                                    "anyOf": [
                                      {
                                        "const": "queued",
                                        "type": "string"
                                      },
                                      {
                                        "const": "running",
                                        "type": "string"
                                      },
                                      {
                                        "const": "completed",
                                        "type": "string"
                                      },
                                      {
                                        "const": "skipped",
                                        "type": "string"
                                      },
                                      {
                                        "const": "failed",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "completed",
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitId",
                          "reason"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:skipped",
                            "type": "string"
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "unit": {
                            "type": "object",
                            "allOf": [
                              {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "unitId",
                                  "depth",
                                  "sourceSlices",
                                  "coverage",
                                  "subsystemHints",
                                  "dependencies",
                                  "interfaceConstraints",
                                  "sharedFileConstraints",
                                  "budgets",
                                  "status"
                                ],
                                "properties": {
                                  "unitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "parentUnitId": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  },
                                  "depth": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "sourceSlices": {
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "kind",
                                        "sourceHash",
                                        "criteriaIds",
                                        "byteLength"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "anyOf": [
                                            {
                                              "const": "prd",
                                              "type": "string"
                                            },
                                            {
                                              "const": "artifact",
                                              "type": "string"
                                            },
                                            {
                                              "const": "file",
                                              "type": "string"
                                            },
                                            {
                                              "const": "criteria",
                                              "type": "string"
                                            },
                                            {
                                              "const": "other",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "sourceHash": {
                                          "pattern": "^[a-f0-9]{64}$",
                                          "type": "string"
                                        },
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "headingPath": {
                                          "maxItems": 32,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "startLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "endLine": {
                                          "minimum": 1,
                                          "type": "integer"
                                        },
                                        "byteStart": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "byteEnd": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "criteriaIds": {
                                          "maxItems": 64,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        },
                                        "byteLength": {
                                          "minimum": 0,
                                          "type": "integer"
                                        }
                                      }
                                    }
                                  },
                                  "coverage": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "coveredCriteria",
                                      "unresolvedCriteria"
                                    ],
                                    "properties": {
                                      "totalCriteria": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "omittedCriteriaCount": {
                                        "minimum": 0,
                                        "maximum": 10000,
                                        "type": "integer"
                                      },
                                      "coveredCriteria": {
                                        "maxItems": 64,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "coveredByUnitIds"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "sourceHash": {
                                              "pattern": "^[a-f0-9]{64}$",
                                              "type": "string"
                                            },
                                            "coveredByUnitIds": {
                                              "maxItems": 128,
                                              "type": "array",
                                              "items": {
                                                "maxLength": 2000,
                                                "type": "string"
                                              }
                                            }
                                          }
                                        }
                                      },
                                      "unresolvedCriteria": {
                                        "maxItems": 32,
                                        "type": "array",
                                        "items": {
                                          "additionalProperties": false,
                                          "type": "object",
                                          "required": [
                                            "criterionId",
                                            "reason"
                                          ],
                                          "properties": {
                                            "criterionId": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "reason": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            },
                                            "evidence": {
                                              "maxLength": 2000,
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "subsystemHints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "dependencies": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  },
                                  "interfaceConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "sharedFileConstraints": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "description"
                                      ],
                                      "properties": {
                                        "path": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        },
                                        "description": {
                                          "maxLength": 2000,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "budgets": {
                                    "additionalProperties": false,
                                    "type": "object",
                                    "required": [
                                      "maxRecursiveDepth",
                                      "maxPromptSourceBytes",
                                      "maxPromptBytes",
                                      "maxObservedInputTokens",
                                      "maxCompactHandoffBytes",
                                      "maxLocalExplorationToolUses",
                                      "maxCriteriaPerUnit",
                                      "maxSubsystemsPerUnit",
                                      "maxSplitAttemptsPerUnit"
                                    ],
                                    "properties": {
                                      "maxRecursiveDepth": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "maxPromptSourceBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxPromptBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedInputTokens": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxObservedTurns": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCompactHandoffBytes": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxLocalExplorationToolUses": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxCriteriaPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSubsystemsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      },
                                      "maxSplitAttemptsPerUnit": {
                                        "minimum": 1,
                                        "type": "integer"
                                      }
                                    }
                                  },
                                  "status": {
                                    "anyOf": [
                                      {
                                        "const": "queued",
                                        "type": "string"
                                      },
                                      {
                                        "const": "running",
                                        "type": "string"
                                      },
                                      {
                                        "const": "completed",
                                        "type": "string"
                                      },
                                      {
                                        "const": "skipped",
                                        "type": "string"
                                      },
                                      {
                                        "const": "failed",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "skipped",
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitId",
                          "reason",
                          "evidence"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:unit:failed",
                            "type": "string"
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "evidence": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "unitId",
                              "depth",
                              "budgets",
                              "observed",
                              "assignedCriteriaIds",
                              "unresolvedCriteria",
                              "blockers",
                              "splitAttempts"
                            ],
                            "properties": {
                              "unitId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "parentUnitId": {
                                "maxLength": 2000,
                                "type": "string"
                              },
                              "depth": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "budgets": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "maxRecursiveDepth",
                                  "maxPromptSourceBytes",
                                  "maxPromptBytes",
                                  "maxObservedInputTokens",
                                  "maxCompactHandoffBytes",
                                  "maxLocalExplorationToolUses",
                                  "maxCriteriaPerUnit",
                                  "maxSubsystemsPerUnit",
                                  "maxSplitAttemptsPerUnit"
                                ],
                                "properties": {
                                  "maxRecursiveDepth": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "maxPromptSourceBytes": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxPromptBytes": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxObservedInputTokens": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxObservedTurns": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxCompactHandoffBytes": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxLocalExplorationToolUses": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxCriteriaPerUnit": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxSubsystemsPerUnit": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxSplitAttemptsPerUnit": {
                                    "minimum": 1,
                                    "type": "integer"
                                  }
                                }
                              },
                              "observed": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "triggeredLimitKeys"
                                ],
                                "properties": {
                                  "promptSourceBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "promptBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "observedInputTokens": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "observedTurns": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "compactHandoffBytes": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "localExplorationToolUses": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "criteriaCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "subsystemCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "splitAttempts": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "triggeredLimitKeys": {
                                    "maxItems": 32,
                                    "type": "array",
                                    "items": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "assignedCriteriaIds": {
                                "maxItems": 64,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "unresolvedCriteria": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "criterionId",
                                    "reason"
                                  ],
                                  "properties": {
                                    "criterionId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "reason": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "evidence": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "blockers": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "splitAttempts": {
                                "maxItems": 8,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "attempt",
                                    "reason",
                                    "resultingUnitIds"
                                  ],
                                  "properties": {
                                    "unitId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "attempt": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "reason": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "resultingUnitIds": {
                                      "maxItems": 128,
                                      "type": "array",
                                      "items": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      }
                                    },
                                    "observed": {
                                      "additionalProperties": false,
                                      "type": "object",
                                      "required": [
                                        "triggeredLimitKeys"
                                      ],
                                      "properties": {
                                        "promptSourceBytes": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "promptBytes": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "observedInputTokens": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "observedTurns": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "compactHandoffBytes": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "localExplorationToolUses": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "criteriaCount": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "subsystemCount": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "splitAttempts": {
                                          "minimum": 0,
                                          "type": "integer"
                                        },
                                        "triggeredLimitKeys": {
                                          "maxItems": 32,
                                          "type": "array",
                                          "items": {
                                            "maxLength": 2000,
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "decision"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:schedule",
                            "type": "string"
                          },
                          "decision": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "readyUnitIds",
                              "runningUnitIds",
                              "waitingUnitIds",
                              "waitingReasons",
                              "selectedBatchUnitIds",
                              "parallelism",
                              "blockedPairs"
                            ],
                            "properties": {
                              "readyUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "runningUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "waitingUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "waitingReasons": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "unitId",
                                    "reasons"
                                  ],
                                  "properties": {
                                    "unitId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "reasons": {
                                      "maxItems": 32,
                                      "type": "array",
                                      "items": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "selectedBatchUnitIds": {
                                "maxItems": 128,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              },
                              "parallelism": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "blockedPairs": {
                                "maxItems": 64,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "unitId",
                                    "blockedByUnitId"
                                  ],
                                  "properties": {
                                    "unitId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "blockedByUnitId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "reason": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "limits",
                          "unitId",
                          "unitBudgets"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:budget",
                            "type": "string"
                          },
                          "limits": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "parallelism",
                              "maxDepth",
                              "maxPromptSourceBytes",
                              "maxPromptBytes",
                              "maxObservedInputTokens",
                              "maxCompactHandoffBytes",
                              "maxLocalExplorationToolUses",
                              "maxCriteriaPerUnit",
                              "maxSubsystemsPerUnit",
                              "maxSplitAttemptsPerUnit"
                            ],
                            "properties": {
                              "parallelism": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxDepth": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxPromptSourceBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxPromptBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxObservedInputTokens": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxObservedTurns": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxCompactHandoffBytes": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxLocalExplorationToolUses": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxCriteriaPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxSubsystemsPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              },
                              "maxSplitAttemptsPerUnit": {
                                "minimum": 1,
                                "type": "integer"
                              }
                            }
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "unitBudgets": {
                            "maxItems": 128,
                            "type": "array",
                            "items": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "unitId",
                                "budget"
                              ],
                              "properties": {
                                "unitId": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "budget": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "maxRecursiveDepth",
                                    "maxPromptSourceBytes",
                                    "maxPromptBytes",
                                    "maxObservedInputTokens",
                                    "maxCompactHandoffBytes",
                                    "maxLocalExplorationToolUses",
                                    "maxCriteriaPerUnit",
                                    "maxSubsystemsPerUnit",
                                    "maxSplitAttemptsPerUnit"
                                  ],
                                  "properties": {
                                    "maxRecursiveDepth": {
                                      "minimum": 0,
                                      "type": "integer"
                                    },
                                    "maxPromptSourceBytes": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxPromptBytes": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxObservedInputTokens": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxObservedTurns": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxCompactHandoffBytes": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxLocalExplorationToolUses": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxCriteriaPerUnit": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxSubsystemsPerUnit": {
                                      "minimum": 1,
                                      "type": "integer"
                                    },
                                    "maxSplitAttemptsPerUnit": {
                                      "minimum": 1,
                                      "type": "integer"
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "observed": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "triggeredLimitKeys"
                            ],
                            "properties": {
                              "promptSourceBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "promptBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedInputTokens": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "observedTurns": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "compactHandoffBytes": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "localExplorationToolUses": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "criteriaCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "subsystemCount": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "splitAttempts": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "triggeredLimitKeys": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitId",
                          "artifactPath",
                          "byteLength",
                          "contentHash",
                          "omittedUnitIds"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:compact-handoff",
                            "type": "string"
                          },
                          "unitId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "artifactPath": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "byteLength": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "contentHash": {
                            "pattern": "^[a-f0-9]{64}$",
                            "type": "string"
                          },
                          "omittedUnitIds": {
                            "maxItems": 128,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "timestamp",
                          "type",
                          "unitCount",
                          "completedUnitCount",
                          "failedUnitCount",
                          "skippedUnitCount",
                          "coverage",
                          "artifactPaths"
                        ],
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "type": {
                            "const": "planning:decomposition:synthesis:complete",
                            "type": "string"
                          },
                          "unitCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "completedUnitCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "failedUnitCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "skippedUnitCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "coverage": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "coveredCriteria",
                              "unresolvedCriteria"
                            ],
                            "properties": {
                              "totalCriteria": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "omittedCriteriaCount": {
                                "minimum": 0,
                                "maximum": 10000,
                                "type": "integer"
                              },
                              "coveredCriteria": {
                                "maxItems": 64,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "criterionId",
                                    "coveredByUnitIds"
                                  ],
                                  "properties": {
                                    "criterionId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "sourceHash": {
                                      "pattern": "^[a-f0-9]{64}$",
                                      "type": "string"
                                    },
                                    "coveredByUnitIds": {
                                      "maxItems": 128,
                                      "type": "array",
                                      "items": {
                                        "maxLength": 2000,
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "unresolvedCriteria": {
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "additionalProperties": false,
                                  "type": "object",
                                  "required": [
                                    "criterionId",
                                    "reason"
                                  ],
                                  "properties": {
                                    "criterionId": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "reason": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    },
                                    "evidence": {
                                      "maxLength": 2000,
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "artifactPaths": {
                            "maxItems": 32,
                            "type": "array",
                            "items": {
                              "maxLength": 2000,
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "questions"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:clarification",
                            "type": "string"
                          },
                          "questions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "question"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "question": {
                                  "type": "string"
                                },
                                "context": {
                                  "type": "string"
                                },
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "default": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "answers"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:clarification:answer",
                            "type": "string"
                          },
                          "answers": {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:progress",
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "attempt",
                          "maxContinuations"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:continuation",
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxContinuations": {
                            "type": "number"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "max_turns",
                                "type": "string"
                              },
                              {
                                "const": "dropped_submission",
                                "type": "string"
                              },
                              {
                                "const": "compact_inspection",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "compile",
                          "defaultBuild",
                          "defaultReview",
                          "rationale"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:pipeline",
                            "type": "string"
                          },
                          "compile": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "defaultBuild": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              ]
                            }
                          },
                          "defaultReview": {
                            "type": "object",
                            "required": [
                              "strategy",
                              "perspectives",
                              "maxRounds",
                              "evaluatorStrictness"
                            ],
                            "properties": {
                              "strategy": {
                                "anyOf": [
                                  {
                                    "const": "auto",
                                    "type": "string"
                                  },
                                  {
                                    "const": "single",
                                    "type": "string"
                                  },
                                  {
                                    "const": "parallel",
                                    "type": "string"
                                  }
                                ]
                              },
                              "perspectives": {
                                "type": "array",
                                "items": {
                                  "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                  "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                  "type": "string"
                                }
                              },
                              "maxRounds": {
                                "type": "number"
                              },
                              "evaluatorStrictness": {
                                "anyOf": [
                                  {
                                    "const": "strict",
                                    "type": "string"
                                  },
                                  {
                                    "const": "standard",
                                    "type": "string"
                                  },
                                  {
                                    "const": "lenient",
                                    "type": "string"
                                  }
                                ]
                              }
                            }
                          },
                          "rationale": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "plans"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:complete",
                            "type": "string"
                          },
                          "plans": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "name",
                                "dependsOn",
                                "branch",
                                "body",
                                "filePath"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "dependsOn": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "branch": {
                                  "type": "string"
                                },
                                "migrations": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "timestamp",
                                      "description"
                                    ],
                                    "properties": {
                                      "timestamp": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "agents": {
                                  "type": "object",
                                  "patternProperties": {
                                    "^(.*)$": {
                                      "type": "object",
                                      "properties": {
                                        "effort": {
                                          "type": "string"
                                        },
                                        "thinking": {
                                          "anyOf": [
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "object",
                                              "patternProperties": {
                                                "^(.*)$": {}
                                              }
                                            }
                                          ]
                                        },
                                        "rationale": {
                                          "type": "string"
                                        },
                                        "tier": {
                                          "type": "string"
                                        },
                                        "shards": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "id"
                                            ],
                                            "properties": {
                                              "id": {
                                                "type": "string"
                                              },
                                              "roots": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "files": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                },
                                "body": {
                                  "type": "string"
                                },
                                "filePath": {
                                  "type": "string"
                                },
                                "warnings": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "planConfigs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "build": {
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "review": {
                                  "type": "object",
                                  "required": [
                                    "strategy",
                                    "perspectives",
                                    "maxRounds",
                                    "evaluatorStrictness"
                                  ],
                                  "properties": {
                                    "strategy": {
                                      "anyOf": [
                                        {
                                          "const": "auto",
                                          "type": "string"
                                        },
                                        {
                                          "const": "single",
                                          "type": "string"
                                        },
                                        {
                                          "const": "parallel",
                                          "type": "string"
                                        }
                                      ]
                                    },
                                    "perspectives": {
                                      "type": "array",
                                      "items": {
                                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                        "type": "string"
                                      }
                                    },
                                    "maxRounds": {
                                      "type": "number"
                                    },
                                    "evaluatorStrictness": {
                                      "anyOf": [
                                        {
                                          "const": "strict",
                                          "type": "string"
                                        },
                                        {
                                          "const": "standard",
                                          "type": "string"
                                        },
                                        {
                                          "const": "lenient",
                                          "type": "string"
                                        }
                                      ]
                                    }
                                  }
                                },
                                "testOwnership": {
                                  "description": "Exclusive owner of new acceptance-test authoring for a plan",
                                  "anyOf": [
                                    {
                                      "const": "builder",
                                      "type": "string"
                                    },
                                    {
                                      "const": "test-writer",
                                      "type": "string"
                                    },
                                    {
                                      "const": "existing-only",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:review:start",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "issues"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:review:complete",
                            "type": "string"
                          },
                          "issues": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "severity",
                                "category",
                                "file",
                                "description"
                              ],
                              "properties": {
                                "issueId": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "pattern": "\\S",
                                  "type": "string"
                                },
                                "severity": {
                                  "anyOf": [
                                    {
                                      "const": "critical",
                                      "type": "string"
                                    },
                                    {
                                      "const": "warning",
                                      "type": "string"
                                    },
                                    {
                                      "const": "suggestion",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "category": {
                                  "type": "string"
                                },
                                "file": {
                                  "type": "string"
                                },
                                "line": {
                                  "type": "number"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "fix": {
                                  "type": "string"
                                },
                                "retryGuidance": {
                                  "type": "string"
                                },
                                "failureKind": {
                                  "type": "string"
                                },
                                "repairClass": {
                                  "anyOf": [
                                    {
                                      "const": "narrow",
                                      "type": "string"
                                    },
                                    {
                                      "const": "structural",
                                      "type": "string"
                                    },
                                    {
                                      "const": "manual",
                                      "type": "string"
                                    },
                                    {
                                      "const": "followup",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "metadata": {
                                  "type": "object",
                                  "patternProperties": {
                                    "^(.*)$": {
                                      "$id": "TypeBoxRecursive1",
                                      "anyOf": [
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "maxLength": 4096,
                                          "type": "string"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "$ref": "TypeBoxRecursive1"
                                          }
                                        },
                                        {
                                          "type": "object",
                                          "patternProperties": {
                                            "^(.*)$": {
                                              "$ref": "TypeBoxRecursive1"
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                },
                                "validationProviderName": {
                                  "type": "string"
                                },
                                "runtimeFailureKind": {
                                  "anyOf": [
                                    {
                                      "const": "result",
                                      "type": "string"
                                    },
                                    {
                                      "const": "command",
                                      "type": "string"
                                    },
                                    {
                                      "const": "timeout",
                                      "type": "string"
                                    },
                                    {
                                      "const": "exception",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unexpected-return",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:evaluate:start",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "attempt",
                          "maxContinuations"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:evaluate:continuation",
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxContinuations": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "accepted",
                          "rejected"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:evaluate:complete",
                            "type": "string"
                          },
                          "accepted": {
                            "type": "number"
                          },
                          "rejected": {
                            "type": "number"
                          },
                          "verdicts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "file",
                                "action",
                                "reason"
                              ],
                              "properties": {
                                "file": {
                                  "type": "string"
                                },
                                "action": {
                                  "anyOf": [
                                    {
                                      "const": "accept",
                                      "type": "string"
                                    },
                                    {
                                      "const": "reject",
                                      "type": "string"
                                    },
                                    {
                                      "const": "review",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "reason": {
                                  "type": "string"
                                },
                                "hunk": {
                                  "minimum": 1,
                                  "type": "integer"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "graphId",
                          "atomCount",
                          "edgeCount",
                          "atoms",
                          "edges"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:map-reduce:atoms",
                            "type": "string"
                          },
                          "graphId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "atomCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "edgeCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "atoms": {
                            "maxItems": 1024,
                            "type": "array",
                            "items": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "atomId",
                                "title",
                                "reason",
                                "criterionIds",
                                "dependencyAtomIds"
                              ],
                              "properties": {
                                "atomId": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "title": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "reason": {
                                  "anyOf": [
                                    {
                                      "const": "foundation-contract",
                                      "type": "string"
                                    },
                                    {
                                      "const": "subsystem",
                                      "type": "string"
                                    },
                                    {
                                      "const": "oversized-criterion",
                                      "type": "string"
                                    },
                                    {
                                      "const": "general",
                                      "type": "string"
                                    },
                                    {
                                      "const": "rescope-split",
                                      "type": "string"
                                    },
                                    {
                                      "const": "risk-split",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "criterionIds": {
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                },
                                "dependencyAtomIds": {
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "edges": {
                            "maxItems": 2048,
                            "type": "array",
                            "items": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "fromAtomId",
                                "toAtomId",
                                "reason"
                              ],
                              "properties": {
                                "fromAtomId": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "toAtomId": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "reason": {
                                  "maxLength": 2000,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "atomId",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:map-reduce:atom:status",
                            "type": "string"
                          },
                          "atomId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "queued",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "graphId",
                          "maxDepth",
                          "nodeCount",
                          "nodes"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:map-reduce:reduce-tree",
                            "type": "string"
                          },
                          "graphId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "rootNodeId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "maxDepth": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "nodeCount": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "nodes": {
                            "maxItems": 1024,
                            "type": "array",
                            "items": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "nodeId",
                                "depth",
                                "inputAtomIds",
                                "inputNodeIds"
                              ],
                              "properties": {
                                "nodeId": {
                                  "maxLength": 2000,
                                  "type": "string"
                                },
                                "depth": {
                                  "minimum": 0,
                                  "type": "integer"
                                },
                                "inputAtomIds": {
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                },
                                "inputNodeIds": {
                                  "maxItems": 128,
                                  "type": "array",
                                  "items": {
                                    "maxLength": 2000,
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "nodeId",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:map-reduce:reduce:status",
                            "type": "string"
                          },
                          "nodeId": {
                            "maxLength": 2000,
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "queued",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "incomplete",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:implement:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:implement:progress",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "attempt",
                          "maxContinuations"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:implement:continuation",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxContinuations": {
                            "type": "number"
                          },
                          "shardId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:implement:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "files"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:files_changed",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "files": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "diffs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "path",
                                "diff"
                              ],
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "diff": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "baseBranch": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "issues"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "issues": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "severity",
                                "category",
                                "file",
                                "description"
                              ],
                              "properties": {
                                "issueId": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "pattern": "\\S",
                                  "type": "string"
                                },
                                "severity": {
                                  "anyOf": [
                                    {
                                      "const": "critical",
                                      "type": "string"
                                    },
                                    {
                                      "const": "warning",
                                      "type": "string"
                                    },
                                    {
                                      "const": "suggestion",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "category": {
                                  "type": "string"
                                },
                                "file": {
                                  "type": "string"
                                },
                                "line": {
                                  "type": "number"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "fix": {
                                  "type": "string"
                                },
                                "retryGuidance": {
                                  "type": "string"
                                },
                                "failureKind": {
                                  "type": "string"
                                },
                                "repairClass": {
                                  "anyOf": [
                                    {
                                      "const": "narrow",
                                      "type": "string"
                                    },
                                    {
                                      "const": "structural",
                                      "type": "string"
                                    },
                                    {
                                      "const": "manual",
                                      "type": "string"
                                    },
                                    {
                                      "const": "followup",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "metadata": {
                                  "type": "object",
                                  "patternProperties": {
                                    "^(.*)$": {
                                      "$id": "TypeBoxRecursive1",
                                      "anyOf": [
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "maxLength": 4096,
                                          "type": "string"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "$ref": "TypeBoxRecursive1"
                                          }
                                        },
                                        {
                                          "type": "object",
                                          "patternProperties": {
                                            "^(.*)$": {
                                              "$ref": "TypeBoxRecursive1"
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                },
                                "validationProviderName": {
                                  "type": "string"
                                },
                                "runtimeFailureKind": {
                                  "anyOf": [
                                    {
                                      "const": "result",
                                      "type": "string"
                                    },
                                    {
                                      "const": "command",
                                      "type": "string"
                                    },
                                    {
                                      "const": "timeout",
                                      "type": "string"
                                    },
                                    {
                                      "const": "exception",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unexpected-return",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "perspectives"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:parallel:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "perspectives": {
                            "type": "array",
                            "items": {
                              "pattern": "^[a-z][a-z0-9-]{0,63}$",
                              "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                              "type": "string"
                            }
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "perspective"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:parallel:perspective:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "perspective": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "perspective",
                          "issues"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:parallel:perspective:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "perspective": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          },
                          "issues": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "severity",
                                "category",
                                "file",
                                "description"
                              ],
                              "properties": {
                                "issueId": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "pattern": "\\S",
                                  "type": "string"
                                },
                                "severity": {
                                  "anyOf": [
                                    {
                                      "const": "critical",
                                      "type": "string"
                                    },
                                    {
                                      "const": "warning",
                                      "type": "string"
                                    },
                                    {
                                      "const": "suggestion",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "category": {
                                  "type": "string"
                                },
                                "file": {
                                  "type": "string"
                                },
                                "line": {
                                  "type": "number"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "fix": {
                                  "type": "string"
                                },
                                "retryGuidance": {
                                  "type": "string"
                                },
                                "failureKind": {
                                  "type": "string"
                                },
                                "repairClass": {
                                  "anyOf": [
                                    {
                                      "const": "narrow",
                                      "type": "string"
                                    },
                                    {
                                      "const": "structural",
                                      "type": "string"
                                    },
                                    {
                                      "const": "manual",
                                      "type": "string"
                                    },
                                    {
                                      "const": "followup",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "metadata": {
                                  "type": "object",
                                  "patternProperties": {
                                    "^(.*)$": {
                                      "$id": "TypeBoxRecursive1",
                                      "anyOf": [
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "maxLength": 4096,
                                          "type": "string"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "$ref": "TypeBoxRecursive1"
                                          }
                                        },
                                        {
                                          "type": "object",
                                          "patternProperties": {
                                            "^(.*)$": {
                                              "$ref": "TypeBoxRecursive1"
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                },
                                "validationProviderName": {
                                  "type": "string"
                                },
                                "runtimeFailureKind": {
                                  "anyOf": [
                                    {
                                      "const": "result",
                                      "type": "string"
                                    },
                                    {
                                      "const": "command",
                                      "type": "string"
                                    },
                                    {
                                      "const": "timeout",
                                      "type": "string"
                                    },
                                    {
                                      "const": "exception",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unexpected-return",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "perspective",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:parallel:perspective:error",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "perspective": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "issueCount"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:fix:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "issueCount": {
                            "type": "number"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:fix:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "issueReferences": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "issueId",
                                "status"
                              ],
                              "properties": {
                                "issueId": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "pattern": "\\S",
                                  "type": "string"
                                },
                                "status": {
                                  "anyOf": [
                                    {
                                      "const": "addressed",
                                      "type": "string"
                                    },
                                    {
                                      "const": "deferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "obsolete",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "note": {
                                  "minLength": 1,
                                  "maxLength": 4096,
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "attempt",
                          "maxContinuations"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:review:fix:continuation",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxContinuations": {
                            "type": "number"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:evaluate:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "attempt",
                          "maxContinuations"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:evaluate:continuation",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxContinuations": {
                            "type": "number"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "accepted",
                          "rejected"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:evaluate:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "accepted": {
                            "type": "number"
                          },
                          "rejected": {
                            "type": "number"
                          },
                          "round": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "resolvedIssueOutcomes": {
                            "type": "number"
                          },
                          "falsePositiveIssueOutcomes": {
                            "type": "number"
                          },
                          "unresolvedIssueOutcomes": {
                            "type": "number"
                          },
                          "unresolvedNonBlockingIssueOutcomes": {
                            "type": "number"
                          },
                          "needsHumanReviewIssueOutcomes": {
                            "type": "number"
                          },
                          "acceptedRiskIssueOutcomes": {
                            "type": "number"
                          },
                          "splitToFollowupIssueOutcomes": {
                            "type": "number"
                          },
                          "blockingIssueOutcomes": {
                            "type": "number"
                          },
                          "verdicts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "file",
                                "action",
                                "reason"
                              ],
                              "properties": {
                                "file": {
                                  "type": "string"
                                },
                                "action": {
                                  "anyOf": [
                                    {
                                      "const": "accept",
                                      "type": "string"
                                    },
                                    {
                                      "const": "reject",
                                      "type": "string"
                                    },
                                    {
                                      "const": "review",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "reason": {
                                  "type": "string"
                                },
                                "hunk": {
                                  "minimum": 1,
                                  "type": "integer"
                                },
                                "issueOutcome": {
                                  "description": "Evaluator issue disposition separate from patch action. Missing values are interpreted conservatively by the engine.",
                                  "anyOf": [
                                    {
                                      "const": "resolved",
                                      "type": "string"
                                    },
                                    {
                                      "const": "false_positive",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unresolved",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unresolved_blocking",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unresolved_nonblocking",
                                      "type": "string"
                                    },
                                    {
                                      "const": "needs_human_review",
                                      "type": "string"
                                    },
                                    {
                                      "const": "accepted_risk",
                                      "type": "string"
                                    },
                                    {
                                      "const": "split_to_followup",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "retryGuidance": {
                                  "type": "string"
                                },
                                "issueIds": {
                                  "type": "array",
                                  "items": {
                                    "minLength": 1,
                                    "maxLength": 4096,
                                    "pattern": "\\S",
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:doc-author:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "docsAuthored"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:doc-author:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "docsAuthored": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:doc-sync:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "docsSynced"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:doc-sync:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "docsSynced": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "stage",
                          "declaredOwner",
                          "changedPaths",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:test:ownership:violation",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "stage": {
                            "anyOf": [
                              {
                                "const": "implement",
                                "type": "string"
                              },
                              {
                                "const": "test-write",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "declaredOwner": {
                            "anyOf": [
                              {
                                "description": "Exclusive owner of new acceptance-test authoring for a plan",
                                "anyOf": [
                                  {
                                    "const": "builder",
                                    "type": "string"
                                  },
                                  {
                                    "const": "test-writer",
                                    "type": "string"
                                  },
                                  {
                                    "const": "existing-only",
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "const": "unspecified",
                                "type": "string"
                              }
                            ]
                          },
                          "changedPaths": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:test:write:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "testsWritten"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:test:write:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "testsWritten": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:test:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "passed",
                          "failed",
                          "testBugsFixed",
                          "productionIssues"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:test:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "passed": {
                            "type": "number"
                          },
                          "failed": {
                            "type": "number"
                          },
                          "testBugsFixed": {
                            "type": "number"
                          },
                          "productionIssues": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "severity",
                                "category",
                                "file",
                                "testFile",
                                "description"
                              ],
                              "properties": {
                                "severity": {
                                  "anyOf": [
                                    {
                                      "const": "critical",
                                      "type": "string"
                                    },
                                    {
                                      "const": "warning",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "category": {
                                  "anyOf": [
                                    {
                                      "const": "production-bug",
                                      "type": "string"
                                    },
                                    {
                                      "const": "missing-behavior",
                                      "type": "string"
                                    },
                                    {
                                      "const": "regression",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "file": {
                                  "type": "string"
                                },
                                "testFile": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "testOutput": {
                                  "type": "string"
                                },
                                "fix": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "blockerKind",
                          "issueCount",
                          "maxAttempts",
                          "attemptsRemaining"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:recovery:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "blockerKind": {
                            "anyOf": [
                              {
                                "const": "review",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "issueCount": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          },
                          "attemptsRemaining": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "blockerKind",
                          "attempt",
                          "maxAttempts",
                          "attemptsRemaining"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:recovery:attempt:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "blockerKind": {
                            "anyOf": [
                              {
                                "const": "review",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          },
                          "attemptsRemaining": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "blockerKind",
                          "attempt",
                          "maxAttempts",
                          "blockersCleared",
                          "attemptsRemaining"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:recovery:attempt:result",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "blockerKind": {
                            "anyOf": [
                              {
                                "const": "review",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          },
                          "blockersCleared": {
                            "type": "boolean"
                          },
                          "attemptsRemaining": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "blockerKind",
                          "reason",
                          "details",
                          "attemptsRemaining"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:recovery:skip",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "blockerKind": {
                            "anyOf": [
                              {
                                "const": "review",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "not-active-plan",
                                "type": "string"
                              },
                              {
                                "const": "manual-gate",
                                "type": "string"
                              },
                              {
                                "const": "human-review-gate",
                                "type": "string"
                              },
                              {
                                "const": "cross-plan-blocker",
                                "type": "string"
                              },
                              {
                                "const": "upstream-or-base-owned",
                                "type": "string"
                              },
                              {
                                "const": "low-confidence",
                                "type": "string"
                              },
                              {
                                "const": "incomplete-classification",
                                "type": "string"
                              },
                              {
                                "const": "unsupported-blocker",
                                "type": "string"
                              },
                              {
                                "const": "unsafe-worktree",
                                "type": "string"
                              },
                              {
                                "const": "budget-exhausted",
                                "type": "string"
                              },
                              {
                                "const": "stale-pass-data",
                                "type": "string"
                              }
                            ]
                          },
                          "details": {
                            "type": "string"
                          },
                          "attemptsRemaining": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "blockerKind",
                          "attemptsUsed",
                          "maxAttempts",
                          "details"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:recovery:exhausted",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "blockerKind": {
                            "anyOf": [
                              {
                                "const": "review",
                                "type": "string"
                              },
                              {
                                "const": "test",
                                "type": "string"
                              }
                            ]
                          },
                          "attemptsUsed": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          },
                          "details": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:failed",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          },
                          "terminalSubtype": {
                            "anyOf": [
                              {
                                "const": "error_max_turns",
                                "type": "string"
                              },
                              {
                                "const": "error_max_budget_usd",
                                "type": "string"
                              },
                              {
                                "const": "error_max_structured_output_retries",
                                "type": "string"
                              },
                              {
                                "const": "error_during_execution",
                                "type": "string"
                              },
                              {
                                "const": "error_pi_tool_infrastructure",
                                "type": "string"
                              },
                              {
                                "const": "error_context_window",
                                "type": "string"
                              },
                              {
                                "const": "error_transient_transport",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:progress",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:status:change",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "blocked",
                                "type": "string"
                              },
                              {
                                "const": "merged",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:error:set",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:error:clear",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planIds"
                        ],
                        "properties": {
                          "type": {
                            "const": "schedule:start",
                            "type": "string"
                          },
                          "planIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:schedule:ready",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:merge:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:merge:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "commitSha": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:merge:resolve:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "resolved"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:merge:resolve:complete",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "resolved": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "baseBranch"
                        ],
                        "properties": {
                          "type": {
                            "const": "merge:finalize:start",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "baseBranch"
                        ],
                        "properties": {
                          "type": {
                            "const": "merge:finalize:complete",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "commitSha": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "baseBranch",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "merge:finalize:skipped",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "action",
                          "featureBranch",
                          "baseBranch"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:start",
                            "type": "string"
                          },
                          "action": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "trunkBranch": {
                            "type": "string"
                          },
                          "workflow": {
                            "anyOf": [
                              {
                                "const": "trunk-pr",
                                "type": "string"
                              },
                              {
                                "const": "trunk-local-merge",
                                "type": "string"
                              },
                              {
                                "const": "feature-pr",
                                "type": "string"
                              },
                              {
                                "const": "feature-local-merge",
                                "type": "string"
                              },
                              {
                                "const": "leave-branch",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "action",
                          "featureBranch",
                          "baseBranch"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:complete",
                            "type": "string"
                          },
                          "action": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "commitSha": {
                            "type": "string"
                          },
                          "prUrl": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "action",
                          "featureBranch",
                          "baseBranch",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:skipped",
                            "type": "string"
                          },
                          "action": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "prUrl"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:auto-merge:start",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "prUrl": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "prUrl"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:auto-merge:complete",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "prUrl": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "featureBranch",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "landing:auto-merge:skipped",
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "prUrl": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "path"
                        ],
                        "properties": {
                          "type": {
                            "const": "merge:worktree:set",
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "merge:worktree:clear",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "model",
                          "harness",
                          "harnessSource",
                          "tier",
                          "tierSource",
                          "runtimeChoice",
                          "runtimeChoiceQualified",
                          "runtimeChoiceSource"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:start",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "model": {
                            "type": "string"
                          },
                          "harness": {
                            "anyOf": [
                              {
                                "const": "claude-sdk",
                                "type": "string"
                              },
                              {
                                "const": "pi",
                                "type": "string"
                              }
                            ]
                          },
                          "harnessSource": {
                            "const": "tier",
                            "type": "string"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "tierSource": {
                            "anyOf": [
                              {
                                "const": "tier",
                                "type": "string"
                              },
                              {
                                "const": "role",
                                "type": "string"
                              },
                              {
                                "const": "plan",
                                "type": "string"
                              }
                            ]
                          },
                          "runtimeChoice": {
                            "type": "string"
                          },
                          "runtimeChoiceQualified": {
                            "type": "string"
                          },
                          "runtimeChoiceSource": {
                            "anyOf": [
                              {
                                "const": "default",
                                "type": "string"
                              },
                              {
                                "const": "rule",
                                "type": "string"
                              },
                              {
                                "const": "extension-router",
                                "type": "string"
                              },
                              {
                                "const": "fallback",
                                "type": "string"
                              }
                            ]
                          },
                          "runtimeChoiceRule": {
                            "type": "string"
                          },
                          "runtimeChoiceRouter": {
                            "type": "string"
                          },
                          "runtimeChoiceFallbackReason": {
                            "anyOf": [
                              {
                                "const": "no-match",
                                "type": "string"
                              },
                              {
                                "const": "router-declined",
                                "type": "string"
                              },
                              {
                                "const": "router-timeout",
                                "type": "string"
                              },
                              {
                                "const": "router-error",
                                "type": "string"
                              },
                              {
                                "const": "router-invalid-choice",
                                "type": "string"
                              }
                            ]
                          },
                          "effort": {
                            "type": "string"
                          },
                          "effortSource": {
                            "anyOf": [
                              {
                                "const": "tier",
                                "type": "string"
                              },
                              {
                                "const": "role",
                                "type": "string"
                              },
                              {
                                "const": "plan",
                                "type": "string"
                              }
                            ]
                          },
                          "thinking": {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {}
                            }
                          },
                          "thinkingSource": {
                            "anyOf": [
                              {
                                "const": "tier",
                                "type": "string"
                              },
                              {
                                "const": "role",
                                "type": "string"
                              },
                              {
                                "const": "plan",
                                "type": "string"
                              }
                            ]
                          },
                          "effortClamped": {
                            "type": "boolean"
                          },
                          "effortOriginal": {
                            "type": "string"
                          },
                          "thinkingCoerced": {
                            "type": "boolean"
                          },
                          "thinkingOriginal": {
                            "type": "object",
                            "patternProperties": {
                              "^(.*)$": {}
                            }
                          },
                          "perspective": {
                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                            "type": "string"
                          },
                          "toolbelt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "toolbeltSource": {
                            "anyOf": [
                              {
                                "const": "tier",
                                "type": "string"
                              },
                              {
                                "const": "role",
                                "type": "string"
                              },
                              {
                                "const": "plan",
                                "type": "string"
                              },
                              {
                                "const": "default",
                                "type": "string"
                              }
                            ]
                          },
                          "projectMcpSelection": {
                            "anyOf": [
                              {
                                "const": "all",
                                "type": "string"
                              },
                              {
                                "const": "none",
                                "type": "string"
                              },
                              {
                                "const": "toolbelt",
                                "type": "string"
                              }
                            ]
                          },
                          "projectMcpServerNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "code",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:warning",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:stop",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "usage",
                          "costUsd",
                          "numTurns"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:usage",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "usage": {
                            "type": "object",
                            "required": [
                              "input",
                              "output",
                              "total",
                              "cacheRead",
                              "cacheCreation"
                            ],
                            "properties": {
                              "input": {
                                "type": "number"
                              },
                              "output": {
                                "type": "number"
                              },
                              "total": {
                                "type": "number"
                              },
                              "cacheRead": {
                                "type": "number"
                              },
                              "cacheCreation": {
                                "type": "number"
                              }
                            }
                          },
                          "costUsd": {
                            "type": "number"
                          },
                          "numTurns": {
                            "type": "number"
                          },
                          "final": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "content"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:message",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "content": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "tool",
                          "toolUseId",
                          "input"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:tool_use",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tool": {
                            "type": "string"
                          },
                          "toolUseId": {
                            "type": "string"
                          },
                          "input": {}
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "tool",
                          "toolUseId",
                          "output"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:tool_result",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "tool": {
                            "type": "string"
                          },
                          "toolUseId": {
                            "type": "string"
                          },
                          "output": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agent",
                          "result"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:result",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "result": {
                            "type": "object",
                            "required": [
                              "durationMs",
                              "durationApiMs",
                              "numTurns",
                              "totalCostUsd",
                              "usage",
                              "modelUsage"
                            ],
                            "properties": {
                              "durationMs": {
                                "type": "number"
                              },
                              "durationApiMs": {
                                "type": "number"
                              },
                              "numTurns": {
                                "type": "number"
                              },
                              "totalCostUsd": {
                                "type": "number"
                              },
                              "usage": {
                                "type": "object",
                                "required": [
                                  "input",
                                  "output",
                                  "total",
                                  "cacheRead",
                                  "cacheCreation"
                                ],
                                "properties": {
                                  "input": {
                                    "type": "number"
                                  },
                                  "output": {
                                    "type": "number"
                                  },
                                  "total": {
                                    "type": "number"
                                  },
                                  "cacheRead": {
                                    "type": "number"
                                  },
                                  "cacheCreation": {
                                    "type": "number"
                                  }
                                }
                              },
                              "modelUsage": {
                                "type": "object",
                                "patternProperties": {
                                  "^(.*)$": {
                                    "type": "object",
                                    "required": [
                                      "inputTokens",
                                      "outputTokens",
                                      "cacheReadInputTokens",
                                      "cacheCreationInputTokens",
                                      "costUSD"
                                    ],
                                    "properties": {
                                      "inputTokens": {
                                        "type": "number"
                                      },
                                      "outputTokens": {
                                        "type": "number"
                                      },
                                      "cacheReadInputTokens": {
                                        "type": "number"
                                      },
                                      "cacheCreationInputTokens": {
                                        "type": "number"
                                      },
                                      "costUSD": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                }
                              },
                              "harness": {
                                "anyOf": [
                                  {
                                    "const": "claude-sdk",
                                    "type": "string"
                                  },
                                  {
                                    "const": "pi",
                                    "type": "string"
                                  }
                                ]
                              },
                              "provider": {
                                "type": "string"
                              },
                              "resultText": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agentId",
                          "agent",
                          "attribution"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:activity",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "agentId": {
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "files": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "path"
                              ],
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string"
                                },
                                "additions": {
                                  "type": "number"
                                },
                                "deletions": {
                                  "type": "number"
                                },
                                "binary": {
                                  "type": "boolean"
                                }
                              }
                            }
                          },
                          "totals": {
                            "type": "object",
                            "required": [
                              "filesChanged",
                              "additions",
                              "deletions"
                            ],
                            "properties": {
                              "filesChanged": {
                                "type": "number"
                              },
                              "additions": {
                                "type": "number"
                              },
                              "deletions": {
                                "type": "number"
                              }
                            }
                          },
                          "attribution": {
                            "anyOf": [
                              {
                                "const": "exact",
                                "type": "string"
                              },
                              {
                                "const": "best_effort",
                                "type": "string"
                              },
                              {
                                "const": "unavailable",
                                "type": "string"
                              }
                            ]
                          },
                          "notes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "agent",
                          "attempt",
                          "maxAttempts",
                          "subtype",
                          "label"
                        ],
                        "properties": {
                          "type": {
                            "const": "agent:retry",
                            "type": "string"
                          },
                          "agent": {
                            "anyOf": [
                              {
                                "const": "planner",
                                "type": "string"
                              },
                              {
                                "const": "builder",
                                "type": "string"
                              },
                              {
                                "const": "reviewer",
                                "type": "string"
                              },
                              {
                                "const": "review-fixer",
                                "type": "string"
                              },
                              {
                                "const": "evaluator",
                                "type": "string"
                              },
                              {
                                "const": "plan-reviewer",
                                "type": "string"
                              },
                              {
                                "const": "plan-evaluator",
                                "type": "string"
                              },
                              {
                                "const": "validation-fixer",
                                "type": "string"
                              },
                              {
                                "const": "merge-conflict-resolver",
                                "type": "string"
                              },
                              {
                                "const": "staleness-assessor",
                                "type": "string"
                              },
                              {
                                "const": "formatter",
                                "type": "string"
                              },
                              {
                                "const": "doc-author",
                                "type": "string"
                              },
                              {
                                "const": "doc-syncer",
                                "type": "string"
                              },
                              {
                                "const": "test-writer",
                                "type": "string"
                              },
                              {
                                "const": "tester",
                                "type": "string"
                              },
                              {
                                "const": "prd-validator",
                                "type": "string"
                              },
                              {
                                "const": "dependency-detector",
                                "type": "string"
                              },
                              {
                                "const": "gap-closer",
                                "type": "string"
                              },
                              {
                                "const": "recovery-analyst",
                                "type": "string"
                              }
                            ]
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          },
                          "subtype": {
                            "anyOf": [
                              {
                                "const": "error_max_turns",
                                "type": "string"
                              },
                              {
                                "const": "error_max_budget_usd",
                                "type": "string"
                              },
                              {
                                "const": "error_max_structured_output_retries",
                                "type": "string"
                              },
                              {
                                "const": "error_during_execution",
                                "type": "string"
                              },
                              {
                                "const": "error_pi_tool_infrastructure",
                                "type": "string"
                              },
                              {
                                "const": "error_context_window",
                                "type": "string"
                              },
                              {
                                "const": "error_transient_transport",
                                "type": "string"
                              }
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "shardId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "commands"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:start",
                            "type": "string"
                          },
                          "commands": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "command"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:command:start",
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "command",
                          "exitCode",
                          "output"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:command:complete",
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          },
                          "exitCode": {
                            "type": "number"
                          },
                          "output": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "command",
                          "timeoutMs",
                          "pid"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:command:timeout",
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          },
                          "timeoutMs": {
                            "type": "number"
                          },
                          "pid": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "passed"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:complete",
                            "type": "string"
                          },
                          "passed": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:fix:start",
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          },
                          "maxAttempts": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "attempt"
                        ],
                        "properties": {
                          "type": {
                            "const": "validation:fix:complete",
                            "type": "string"
                          },
                          "attempt": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "prd_validation:start",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "passed",
                          "gaps"
                        ],
                        "properties": {
                          "type": {
                            "const": "prd_validation:complete",
                            "type": "string"
                          },
                          "passed": {
                            "type": "boolean"
                          },
                          "gaps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "requirement",
                                "explanation"
                              ],
                              "properties": {
                                "requirement": {
                                  "type": "string"
                                },
                                "explanation": {
                                  "type": "string"
                                },
                                "complexity": {
                                  "anyOf": [
                                    {
                                      "const": "trivial",
                                      "type": "string"
                                    },
                                    {
                                      "const": "moderate",
                                      "type": "string"
                                    },
                                    {
                                      "const": "significant",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          },
                          "completionPercent": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "gap_close:start",
                            "type": "string"
                          },
                          "gapCount": {
                            "type": "number"
                          },
                          "completionPercent": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planBody",
                          "gaps"
                        ],
                        "properties": {
                          "type": {
                            "const": "gap_close:plan_ready",
                            "type": "string"
                          },
                          "planBody": {
                            "type": "string"
                          },
                          "gaps": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "requirement",
                                "explanation"
                              ],
                              "properties": {
                                "requirement": {
                                  "type": "string"
                                },
                                "explanation": {
                                  "type": "string"
                                },
                                "complexity": {
                                  "anyOf": [
                                    {
                                      "const": "trivial",
                                      "type": "string"
                                    },
                                    {
                                      "const": "moderate",
                                      "type": "string"
                                    },
                                    {
                                      "const": "significant",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "passed"
                        ],
                        "properties": {
                          "type": {
                            "const": "gap_close:complete",
                            "type": "string"
                          },
                          "passed": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "passed",
                          "verdicts",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "acceptance_validation:complete",
                            "type": "string"
                          },
                          "passed": {
                            "type": "boolean"
                          },
                          "verdicts": {
                            "minItems": 1,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "criterion",
                                "verdict",
                                "evidence"
                              ],
                              "properties": {
                                "criterion": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "verdict": {
                                  "anyOf": [
                                    {
                                      "const": "pass",
                                      "type": "string"
                                    },
                                    {
                                      "const": "fail",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "minLength": 1,
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "waivers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "acceptanceConflicts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "criterion",
                                "evidence",
                                "conflictsWith",
                                "scope",
                                "recommendedAction"
                              ],
                              "properties": {
                                "criterion": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "evidence": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "conflictsWith": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "scope": {
                                  "anyOf": [
                                    {
                                      "const": "narrow",
                                      "type": "string"
                                    },
                                    {
                                      "const": "broad",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "recommendedAction": {
                                  "anyOf": [
                                    {
                                      "const": "revise_acceptance_criteria",
                                      "type": "string"
                                    },
                                    {
                                      "const": "manual_review",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          },
                          "source": {
                            "minLength": 1,
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "reconciliation:start",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "report"
                        ],
                        "properties": {
                          "type": {
                            "const": "reconciliation:complete",
                            "type": "string"
                          },
                          "report": {
                            "type": "object",
                            "required": [
                              "valid",
                              "missing",
                              "corrupt",
                              "cleared"
                            ],
                            "properties": {
                              "valid": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "missing": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "corrupt": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "cleared": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planSet"
                        ],
                        "properties": {
                          "type": {
                            "const": "cleanup:start",
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planSet"
                        ],
                        "properties": {
                          "type": {
                            "const": "cleanup:complete",
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "action",
                          "details"
                        ],
                        "properties": {
                          "type": {
                            "const": "approval:needed",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string"
                          },
                          "details": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "approved"
                        ],
                        "properties": {
                          "type": {
                            "const": "approval:response",
                            "type": "string"
                          },
                          "approved": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "enqueue:start",
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id",
                          "filePath",
                          "title",
                          "planSet"
                        ],
                        "properties": {
                          "type": {
                            "const": "enqueue:complete",
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "filePath": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "enqueue:failed",
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "enqueue:commit-failed",
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:start",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "summary"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:summary",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "object",
                            "required": [
                              "prdId",
                              "setName",
                              "featureBranch",
                              "baseBranch",
                              "plans",
                              "failingPlan",
                              "landedCommits",
                              "diffStat",
                              "modelsUsed",
                              "failedAt"
                            ],
                            "properties": {
                              "prdId": {
                                "type": "string"
                              },
                              "setName": {
                                "type": "string"
                              },
                              "featureBranch": {
                                "type": "string"
                              },
                              "baseBranch": {
                                "type": "string"
                              },
                              "plans": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "planId",
                                    "status"
                                  ],
                                  "properties": {
                                    "planId": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "string"
                                    },
                                    "mergedAt": {
                                      "type": "string"
                                    },
                                    "error": {
                                      "type": "string"
                                    },
                                    "terminalSubtype": {
                                      "type": "string"
                                    },
                                    "commitSha": {
                                      "type": "string"
                                    },
                                    "testPassed": {
                                      "minimum": 0,
                                      "type": "integer"
                                    },
                                    "testFailed": {
                                      "minimum": 0,
                                      "type": "integer"
                                    },
                                    "completedAt": {
                                      "type": "string"
                                    },
                                    "toolUseCount": {
                                      "minimum": 0,
                                      "type": "integer"
                                    }
                                  }
                                }
                              },
                              "failingPlan": {
                                "type": "object",
                                "required": [
                                  "planId"
                                ],
                                "properties": {
                                  "planId": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "agentRole": {
                                    "type": "string"
                                  },
                                  "errorMessage": {
                                    "type": "string"
                                  },
                                  "terminalSubtype": {
                                    "type": "string"
                                  },
                                  "toolUseCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              },
                              "landedCommits": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "sha",
                                    "subject",
                                    "author",
                                    "date"
                                  ],
                                  "properties": {
                                    "sha": {
                                      "type": "string"
                                    },
                                    "subject": {
                                      "type": "string"
                                    },
                                    "author": {
                                      "type": "string"
                                    },
                                    "date": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "diffStat": {
                                "type": "string"
                              },
                              "modelsUsed": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "failedAt": {
                                "type": "string"
                              },
                              "partial": {
                                "type": "boolean"
                              },
                              "prdContent": {
                                "type": "string"
                              },
                              "terminalFailure": {
                                "type": "object",
                                "properties": {
                                  "scope": {
                                    "anyOf": [
                                      {
                                        "const": "plan",
                                        "type": "string"
                                      },
                                      {
                                        "const": "post-merge-validation",
                                        "type": "string"
                                      },
                                      {
                                        "const": "prd-validation",
                                        "type": "string"
                                      },
                                      {
                                        "const": "acceptance-validation",
                                        "type": "string"
                                      },
                                      {
                                        "const": "artifact-recording",
                                        "type": "string"
                                      },
                                      {
                                        "const": "landing",
                                        "type": "string"
                                      },
                                      {
                                        "const": "daemon",
                                        "type": "string"
                                      },
                                      {
                                        "const": "compile",
                                        "type": "string"
                                      },
                                      {
                                        "const": "unknown",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "authoritative": {
                                    "type": "boolean"
                                  },
                                  "planId": {
                                    "type": "string"
                                  },
                                  "terminalSubtype": {
                                    "anyOf": [
                                      {
                                        "const": "error_max_turns",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_max_budget_usd",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_max_structured_output_retries",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_during_execution",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_pi_tool_infrastructure",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_context_window",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error_transient_transport",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "stage": {
                                    "type": "string"
                                  },
                                  "phaseSummary": {
                                    "type": "string"
                                  },
                                  "phaseStatus": {
                                    "type": "string"
                                  },
                                  "eventType": {
                                    "type": "string"
                                  },
                                  "sourceEventType": {
                                    "type": "string"
                                  },
                                  "sourceEventId": {
                                    "type": "integer"
                                  },
                                  "sourceEventTimestamp": {
                                    "type": "string"
                                  },
                                  "landing": {
                                    "type": "object",
                                    "required": [
                                      "status"
                                    ],
                                    "properties": {
                                      "status": {
                                        "type": "string"
                                      },
                                      "action": {
                                        "type": "string"
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "validationPassed": {
                                    "type": "boolean"
                                  },
                                  "prdValidationPassed": {
                                    "type": "boolean"
                                  },
                                  "acceptanceValidationPassed": {
                                    "type": "boolean"
                                  }
                                }
                              },
                              "acceptanceValidation": {
                                "type": "object",
                                "required": [
                                  "passed",
                                  "total",
                                  "pass",
                                  "fail",
                                  "unknown",
                                  "verdicts"
                                ],
                                "properties": {
                                  "passed": {
                                    "type": "boolean"
                                  },
                                  "total": {
                                    "type": "number"
                                  },
                                  "pass": {
                                    "type": "number"
                                  },
                                  "fail": {
                                    "type": "number"
                                  },
                                  "unknown": {
                                    "type": "number"
                                  },
                                  "verdicts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "criterion",
                                        "verdict",
                                        "evidence"
                                      ],
                                      "properties": {
                                        "criterion": {
                                          "minLength": 1,
                                          "type": "string"
                                        },
                                        "verdict": {
                                          "anyOf": [
                                            {
                                              "const": "pass",
                                              "type": "string"
                                            },
                                            {
                                              "const": "fail",
                                              "type": "string"
                                            },
                                            {
                                              "const": "unknown",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "evidence": {
                                          "minLength": 1,
                                          "type": "string"
                                        }
                                      }
                                    }
                                  },
                                  "waivers": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "conflicts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "criterion",
                                        "evidence",
                                        "conflictsWith",
                                        "scope",
                                        "recommendedAction"
                                      ],
                                      "properties": {
                                        "criterion": {
                                          "minLength": 1,
                                          "type": "string"
                                        },
                                        "evidence": {
                                          "minLength": 1,
                                          "type": "string"
                                        },
                                        "conflictsWith": {
                                          "minLength": 1,
                                          "type": "string"
                                        },
                                        "scope": {
                                          "anyOf": [
                                            {
                                              "const": "narrow",
                                              "type": "string"
                                            },
                                            {
                                              "const": "broad",
                                              "type": "string"
                                            },
                                            {
                                              "const": "unknown",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "recommendedAction": {
                                          "anyOf": [
                                            {
                                              "const": "revise_acceptance_criteria",
                                              "type": "string"
                                            },
                                            {
                                              "const": "manual_review",
                                              "type": "string"
                                            }
                                          ]
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "validationCommands": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "command",
                                    "exitCode"
                                  ],
                                  "properties": {
                                    "command": {
                                      "type": "string"
                                    },
                                    "exitCode": {
                                      "type": "number"
                                    },
                                    "output": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "landing": {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "action": {
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                }
                              },
                              "failingPlans": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "planId"
                                  ],
                                  "properties": {
                                    "planId": {
                                      "type": "string"
                                    },
                                    "agentId": {
                                      "type": "string"
                                    },
                                    "agentRole": {
                                      "type": "string"
                                    },
                                    "errorMessage": {
                                      "type": "string"
                                    },
                                    "terminalSubtype": {
                                      "type": "string"
                                    },
                                    "toolUseCount": {
                                      "minimum": 0,
                                      "type": "integer"
                                    }
                                  }
                                }
                              },
                              "reviewFailure": {
                                "type": "object",
                                "required": [
                                  "planId",
                                  "issues"
                                ],
                                "properties": {
                                  "planId": {
                                    "type": "string"
                                  },
                                  "issues": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "severity",
                                        "category",
                                        "file",
                                        "description"
                                      ],
                                      "properties": {
                                        "issueId": {
                                          "minLength": 1,
                                          "maxLength": 4096,
                                          "pattern": "\\S",
                                          "type": "string"
                                        },
                                        "severity": {
                                          "anyOf": [
                                            {
                                              "const": "critical",
                                              "type": "string"
                                            },
                                            {
                                              "const": "warning",
                                              "type": "string"
                                            },
                                            {
                                              "const": "suggestion",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "category": {
                                          "type": "string"
                                        },
                                        "file": {
                                          "type": "string"
                                        },
                                        "line": {
                                          "type": "number"
                                        },
                                        "description": {
                                          "type": "string"
                                        },
                                        "fix": {
                                          "type": "string"
                                        },
                                        "retryGuidance": {
                                          "type": "string"
                                        },
                                        "failureKind": {
                                          "type": "string"
                                        },
                                        "repairClass": {
                                          "anyOf": [
                                            {
                                              "const": "narrow",
                                              "type": "string"
                                            },
                                            {
                                              "const": "structural",
                                              "type": "string"
                                            },
                                            {
                                              "const": "manual",
                                              "type": "string"
                                            },
                                            {
                                              "const": "followup",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "metadata": {
                                          "type": "object",
                                          "patternProperties": {
                                            "^(.*)$": {
                                              "$id": "TypeBoxRecursive1",
                                              "anyOf": [
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "maxLength": 4096,
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "$ref": "TypeBoxRecursive1"
                                                  }
                                                },
                                                {
                                                  "type": "object",
                                                  "patternProperties": {
                                                    "^(.*)$": {
                                                      "$ref": "TypeBoxRecursive1"
                                                    }
                                                  }
                                                }
                                              ]
                                            }
                                          }
                                        },
                                        "validationProviderName": {
                                          "type": "string"
                                        },
                                        "runtimeFailureKind": {
                                          "anyOf": [
                                            {
                                              "const": "result",
                                              "type": "string"
                                            },
                                            {
                                              "const": "command",
                                              "type": "string"
                                            },
                                            {
                                              "const": "timeout",
                                              "type": "string"
                                            },
                                            {
                                              "const": "exception",
                                              "type": "string"
                                            },
                                            {
                                              "const": "unexpected-return",
                                              "type": "string"
                                            }
                                          ]
                                        }
                                      }
                                    }
                                  },
                                  "evaluation": {
                                    "type": "object",
                                    "required": [
                                      "accepted",
                                      "rejected",
                                      "review",
                                      "verdicts"
                                    ],
                                    "properties": {
                                      "accepted": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "rejected": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "review": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "verdicts": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "file",
                                            "action",
                                            "reason"
                                          ],
                                          "properties": {
                                            "file": {
                                              "type": "string"
                                            },
                                            "action": {
                                              "anyOf": [
                                                {
                                                  "const": "accept",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "reject",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "review",
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            "reason": {
                                              "type": "string"
                                            },
                                            "hunk": {
                                              "minimum": 1,
                                              "type": "integer"
                                            },
                                            "issueOutcome": {
                                              "description": "Evaluator issue disposition separate from patch action. Missing values are interpreted conservatively by the engine.",
                                              "anyOf": [
                                                {
                                                  "const": "resolved",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "false_positive",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "unresolved",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "unresolved_blocking",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "unresolved_nonblocking",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "needs_human_review",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "accepted_risk",
                                                  "type": "string"
                                                },
                                                {
                                                  "const": "split_to_followup",
                                                  "type": "string"
                                                }
                                              ]
                                            },
                                            "retryGuidance": {
                                              "type": "string"
                                            },
                                            "issueIds": {
                                              "type": "array",
                                              "items": {
                                                "minLength": 1,
                                                "maxLength": 4096,
                                                "pattern": "\\S",
                                                "type": "string"
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "verdict"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:complete",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "verdict": {
                            "type": "object",
                            "required": [
                              "verdict",
                              "confidence",
                              "rationale",
                              "completedWork",
                              "remainingWork",
                              "risks"
                            ],
                            "properties": {
                              "verdict": {
                                "anyOf": [
                                  {
                                    "const": "retry",
                                    "type": "string"
                                  },
                                  {
                                    "const": "continue-repair",
                                    "type": "string"
                                  },
                                  {
                                    "const": "abandon",
                                    "type": "string"
                                  },
                                  {
                                    "const": "manual",
                                    "type": "string"
                                  }
                                ]
                              },
                              "confidence": {
                                "anyOf": [
                                  {
                                    "const": "low",
                                    "type": "string"
                                  },
                                  {
                                    "const": "medium",
                                    "type": "string"
                                  },
                                  {
                                    "const": "high",
                                    "type": "string"
                                  }
                                ]
                              },
                              "rationale": {
                                "type": "string"
                              },
                              "completedWork": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "remainingWork": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "risks": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "partial": {
                                "type": "boolean"
                              },
                              "recoveryError": {
                                "type": "string"
                              },
                              "recommendationSource": {
                                "anyOf": [
                                  {
                                    "const": "deterministic",
                                    "type": "string"
                                  },
                                  {
                                    "const": "analyst",
                                    "type": "string"
                                  },
                                  {
                                    "const": "manual-fallback",
                                    "type": "string"
                                  }
                                ]
                              },
                              "recommendationRationale": {
                                "type": "string"
                              },
                              "verdictInvalidationReason": {
                                "type": "string"
                              }
                            }
                          },
                          "sidecarMdPath": {
                            "type": "string"
                          },
                          "sidecarJsonPath": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:error",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          },
                          "rawOutput": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName",
                          "enabled",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:auto-resume:evaluate",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "attempt": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 0,
                            "maximum": 3,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName",
                          "action",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:auto-resume:queued",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          },
                          "action": {
                            "const": "continue-repair",
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "maximum": 3,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName",
                          "reason",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:auto-resume:stopped",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          },
                          "reason": {
                            "anyOf": [
                              {
                                "const": "disabled",
                                "type": "string"
                              },
                              {
                                "const": "attempt-budget-exhausted",
                                "type": "string"
                              },
                              {
                                "const": "not-continue-repair",
                                "type": "string"
                              },
                              {
                                "const": "not-high-confidence",
                                "type": "string"
                              },
                              {
                                "const": "not-eligible",
                                "type": "string"
                              },
                              {
                                "const": "manual-confirmation-required",
                                "type": "string"
                              },
                              {
                                "const": "partial-sidecar",
                                "type": "string"
                              },
                              {
                                "const": "malformed-sidecar",
                                "type": "string"
                              },
                              {
                                "const": "missing-sidecar",
                                "type": "string"
                              },
                              {
                                "const": "ineligible-artifacts",
                                "type": "string"
                              },
                              {
                                "const": "dirty-worktree",
                                "type": "string"
                              },
                              {
                                "const": "conflicting-worktree",
                                "type": "string"
                              },
                              {
                                "const": "queue-preflight-blocked",
                                "type": "string"
                              },
                              {
                                "const": "conflicting-applied-marker",
                                "type": "string"
                              },
                              {
                                "const": "active-gate-or-hold",
                                "type": "string"
                              },
                              {
                                "const": "repeated-failure-signature",
                                "type": "string"
                              },
                              {
                                "const": "error",
                                "type": "string"
                              }
                            ]
                          },
                          "attempt": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 0,
                            "maximum": 3,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:apply:start",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "verdict",
                          "noAction"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:apply:complete",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "verdict": {
                            "anyOf": [
                              {
                                "const": "retry",
                                "type": "string"
                              },
                              {
                                "const": "continue-repair",
                                "type": "string"
                              },
                              {
                                "const": "abandon",
                                "type": "string"
                              },
                              {
                                "const": "manual",
                                "type": "string"
                              }
                            ]
                          },
                          "noAction": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "recovery:apply:error",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "run"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:run:upsert",
                            "type": "string"
                          },
                          "run": {
                            "type": "object",
                            "required": [
                              "id",
                              "planSet",
                              "command",
                              "status",
                              "startedAt",
                              "cwd"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "planSet": {
                                "type": "string"
                              },
                              "command": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "startedAt": {
                                "type": "string"
                              },
                              "completedAt": {
                                "type": "string"
                              },
                              "cwd": {
                                "type": "string"
                              },
                              "pid": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:paused",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pid",
                          "port",
                          "version",
                          "mode"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:lifecycle:starting",
                            "type": "string"
                          },
                          "pid": {
                            "type": "number"
                          },
                          "port": {
                            "type": "number"
                          },
                          "version": {
                            "type": "string"
                          },
                          "mode": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pid",
                          "port",
                          "version",
                          "mode",
                          "recoveryDurationMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:lifecycle:ready",
                            "type": "string"
                          },
                          "pid": {
                            "type": "number"
                          },
                          "port": {
                            "type": "number"
                          },
                          "version": {
                            "type": "string"
                          },
                          "mode": {
                            "type": "string"
                          },
                          "recoveryDurationMs": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "signal",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:lifecycle:shutdown:start",
                            "type": "string"
                          },
                          "signal": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "durationMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:lifecycle:shutdown:complete",
                            "type": "string"
                          },
                          "durationMs": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "uptime",
                          "queueDepth",
                          "runningBuilds",
                          "autoBuild",
                          "subscribers"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:heartbeat",
                            "type": "string"
                          },
                          "uptime": {
                            "type": "number"
                          },
                          "queueDepth": {
                            "type": "number"
                          },
                          "runningBuilds": {
                            "type": "number"
                          },
                          "autoBuild": {
                            "type": "object",
                            "required": [
                              "enabled",
                              "paused"
                            ],
                            "properties": {
                              "enabled": {
                                "type": "boolean"
                              },
                              "paused": {
                                "type": "boolean"
                              },
                              "desired": {
                                "anyOf": [
                                  {
                                    "const": "enabled",
                                    "type": "string"
                                  },
                                  {
                                    "const": "disabled",
                                    "type": "string"
                                  }
                                ]
                              },
                              "mode": {
                                "anyOf": [
                                  {
                                    "const": "disabled",
                                    "type": "string"
                                  },
                                  {
                                    "const": "starting",
                                    "type": "string"
                                  },
                                  {
                                    "const": "running",
                                    "type": "string"
                                  },
                                  {
                                    "const": "paused",
                                    "type": "string"
                                  },
                                  {
                                    "const": "stopping",
                                    "type": "string"
                                  },
                                  {
                                    "const": "restarting",
                                    "type": "string"
                                  },
                                  {
                                    "const": "faulted",
                                    "type": "string"
                                  }
                                ]
                              },
                              "scheduler": {
                                "type": "object",
                                "required": [
                                  "alive",
                                  "paused"
                                ],
                                "properties": {
                                  "alive": {
                                    "type": "boolean"
                                  },
                                  "paused": {
                                    "type": "boolean"
                                  },
                                  "lastMutationReason": {
                                    "type": "string"
                                  },
                                  "runningCount": {
                                    "type": "number"
                                  },
                                  "limit": {
                                    "type": "number"
                                  }
                                }
                              },
                              "lastTransition": {
                                "type": "object",
                                "required": [
                                  "at",
                                  "previousMode",
                                  "nextMode",
                                  "desired",
                                  "source"
                                ],
                                "properties": {
                                  "at": {
                                    "type": "string"
                                  },
                                  "previousMode": {
                                    "anyOf": [
                                      {
                                        "const": "disabled",
                                        "type": "string"
                                      },
                                      {
                                        "const": "starting",
                                        "type": "string"
                                      },
                                      {
                                        "const": "running",
                                        "type": "string"
                                      },
                                      {
                                        "const": "paused",
                                        "type": "string"
                                      },
                                      {
                                        "const": "stopping",
                                        "type": "string"
                                      },
                                      {
                                        "const": "restarting",
                                        "type": "string"
                                      },
                                      {
                                        "const": "faulted",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "nextMode": {
                                    "anyOf": [
                                      {
                                        "const": "disabled",
                                        "type": "string"
                                      },
                                      {
                                        "const": "starting",
                                        "type": "string"
                                      },
                                      {
                                        "const": "running",
                                        "type": "string"
                                      },
                                      {
                                        "const": "paused",
                                        "type": "string"
                                      },
                                      {
                                        "const": "stopping",
                                        "type": "string"
                                      },
                                      {
                                        "const": "restarting",
                                        "type": "string"
                                      },
                                      {
                                        "const": "faulted",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "desired": {
                                    "anyOf": [
                                      {
                                        "const": "enabled",
                                        "type": "string"
                                      },
                                      {
                                        "const": "disabled",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "reason": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string"
                                  }
                                }
                              },
                              "reason": {
                                "type": "string"
                              },
                              "recoveryAutoResume": {
                                "type": "object",
                                "required": [
                                  "enabled",
                                  "maxAttempts",
                                  "attempts"
                                ],
                                "properties": {
                                  "enabled": {
                                    "type": "boolean"
                                  },
                                  "maxAttempts": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "attempts": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "lastDecision": {
                                    "anyOf": [
                                      {
                                        "const": "evaluate",
                                        "type": "string"
                                      },
                                      {
                                        "const": "queued",
                                        "type": "string"
                                      },
                                      {
                                        "const": "stopped",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "prdId": {
                                    "type": "string"
                                  },
                                  "setName": {
                                    "type": "string"
                                  },
                                  "stopReason": {
                                    "anyOf": [
                                      {
                                        "const": "disabled",
                                        "type": "string"
                                      },
                                      {
                                        "const": "attempt-budget-exhausted",
                                        "type": "string"
                                      },
                                      {
                                        "const": "not-continue-repair",
                                        "type": "string"
                                      },
                                      {
                                        "const": "not-high-confidence",
                                        "type": "string"
                                      },
                                      {
                                        "const": "not-eligible",
                                        "type": "string"
                                      },
                                      {
                                        "const": "manual-confirmation-required",
                                        "type": "string"
                                      },
                                      {
                                        "const": "partial-sidecar",
                                        "type": "string"
                                      },
                                      {
                                        "const": "malformed-sidecar",
                                        "type": "string"
                                      },
                                      {
                                        "const": "missing-sidecar",
                                        "type": "string"
                                      },
                                      {
                                        "const": "ineligible-artifacts",
                                        "type": "string"
                                      },
                                      {
                                        "const": "dirty-worktree",
                                        "type": "string"
                                      },
                                      {
                                        "const": "conflicting-worktree",
                                        "type": "string"
                                      },
                                      {
                                        "const": "queue-preflight-blocked",
                                        "type": "string"
                                      },
                                      {
                                        "const": "conflicting-applied-marker",
                                        "type": "string"
                                      },
                                      {
                                        "const": "active-gate-or-hold",
                                        "type": "string"
                                      },
                                      {
                                        "const": "repeated-failure-signature",
                                        "type": "string"
                                      },
                                      {
                                        "const": "error",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "subscribers": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "queueDepth",
                          "capacityRemaining"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:scheduler:dequeued",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "queueDepth": {
                            "type": "number"
                          },
                          "capacityRemaining": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "queueDepth",
                          "runningCount",
                          "limit"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:scheduler:capacity-blocked",
                            "type": "string"
                          },
                          "queueDepth": {
                            "type": "number"
                          },
                          "runningCount": {
                            "type": "number"
                          },
                          "limit": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "blockedBy"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:scheduler:dependency-blocked",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "blockedBy": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:scheduler:paused",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:scheduler:resumed",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:enabled",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:disabled",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:resumed",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "trigger",
                          "prdsEnqueued"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:triggered",
                            "type": "string"
                          },
                          "trigger": {
                            "type": "string"
                          },
                          "prdsEnqueued": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "previousMode",
                          "nextMode",
                          "desired",
                          "source"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:auto-build:transition",
                            "type": "string"
                          },
                          "previousMode": {
                            "anyOf": [
                              {
                                "const": "disabled",
                                "type": "string"
                              },
                              {
                                "const": "starting",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "paused",
                                "type": "string"
                              },
                              {
                                "const": "stopping",
                                "type": "string"
                              },
                              {
                                "const": "restarting",
                                "type": "string"
                              },
                              {
                                "const": "faulted",
                                "type": "string"
                              }
                            ]
                          },
                          "nextMode": {
                            "anyOf": [
                              {
                                "const": "disabled",
                                "type": "string"
                              },
                              {
                                "const": "starting",
                                "type": "string"
                              },
                              {
                                "const": "running",
                                "type": "string"
                              },
                              {
                                "const": "paused",
                                "type": "string"
                              },
                              {
                                "const": "stopping",
                                "type": "string"
                              },
                              {
                                "const": "restarting",
                                "type": "string"
                              },
                              {
                                "const": "faulted",
                                "type": "string"
                              }
                            ]
                          },
                          "desired": {
                            "anyOf": [
                              {
                                "const": "enabled",
                                "type": "string"
                              },
                              {
                                "const": "disabled",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:recovery:start",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "planSet",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:recovery:run-marked-failed",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "path",
                          "pid"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:recovery:lock-removed",
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "pid": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "path",
                          "pid",
                          "prdId"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:recovery:lock-adopted",
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "pid": {
                            "type": "number"
                          },
                          "prdId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runsFailed",
                          "locksRemoved",
                          "durationMs"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:recovery:complete",
                            "type": "string"
                          },
                          "runsFailed": {
                            "type": "number"
                          },
                          "locksRemoved": {
                            "type": "number"
                          },
                          "durationMs": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "sessionId",
                          "planSet",
                          "pid"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:orphan:reaped",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "planSet": {
                            "type": "string"
                          },
                          "pid": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "failedEnqueue"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:failed-enqueue:upsert",
                            "type": "string"
                          },
                          "failedEnqueue": {
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "runId",
                              "sourceLabel",
                              "failureReason",
                              "failedAt",
                              "canReenqueue",
                              "nextCommand"
                            ],
                            "properties": {
                              "runId": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "sourceLabel": {
                                "type": "string"
                              },
                              "provenance": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "label"
                                ],
                                "properties": {
                                  "label": {
                                    "type": "string"
                                  }
                                }
                              },
                              "failureReason": {
                                "type": "string"
                              },
                              "failedAt": {
                                "type": "string"
                              },
                              "canReenqueue": {
                                "type": "boolean"
                              },
                              "disabledReason": {
                                "type": "string"
                              },
                              "nextCommand": {
                                "additionalProperties": false,
                                "type": "object",
                                "required": [
                                  "executable",
                                  "args"
                                ],
                                "properties": {
                                  "executable": {
                                    "type": "string"
                                  },
                                  "args": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "resolvedAt": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "resolvedAt"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:failed-enqueue:resolved",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "resolvedAt": {
                            "type": "string"
                          },
                          "spawnedSessionId": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "source",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:warning",
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "details": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "source",
                          "message"
                        ],
                        "properties": {
                          "type": {
                            "const": "daemon:error",
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "stack": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdCount",
                          "dir"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:start",
                            "type": "string"
                          },
                          "prdCount": {
                            "type": "number"
                          },
                          "dir": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:start",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:discovered",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "dependsOn": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title",
                          "removedDependency",
                          "previousDependsOn",
                          "currentDependsOn"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:dependency-overridden",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "removedDependency": {
                            "type": "string"
                          },
                          "previousDependsOn": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "currentDependsOn": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "previousStatus"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:removed",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "previousStatus": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "waiting",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              }
                            ]
                          },
                          "removedSidecars": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title",
                          "verdict",
                          "justification"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:stale",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "verdict": {
                            "anyOf": [
                              {
                                "const": "proceed",
                                "type": "string"
                              },
                              {
                                "const": "revise",
                                "type": "string"
                              },
                              {
                                "const": "obsolete",
                                "type": "string"
                              }
                            ]
                          },
                          "justification": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:skip",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title",
                          "reason",
                          "stage"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:dispatch-failed",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "stage": {
                            "anyOf": [
                              {
                                "const": "stacking-validation",
                                "type": "string"
                              },
                              {
                                "const": "policy-gate",
                                "type": "string"
                              },
                              {
                                "const": "profile-routing",
                                "type": "string"
                              },
                              {
                                "const": "dispatch",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "title",
                          "error"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:commit-failed",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:prd:complete",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "completed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "processed",
                          "skipped"
                        ],
                        "properties": {
                          "type": {
                            "const": "queue:complete",
                            "type": "string"
                          },
                          "processed": {
                            "type": "number"
                          },
                          "skipped": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "planId",
                          "decision"
                        ],
                        "properties": {
                          "type": {
                            "const": "plan:build:decision",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "strategy",
                                  "source"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "review-strategy",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "strategy": {
                                    "anyOf": [
                                      {
                                        "const": "single",
                                        "type": "string"
                                      },
                                      {
                                        "const": "parallel",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "const": "config",
                                        "type": "string"
                                      },
                                      {
                                        "const": "auto-threshold",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "auto": {
                                    "type": "object",
                                    "required": [
                                      "files",
                                      "lines",
                                      "threshold"
                                    ],
                                    "properties": {
                                      "files": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "lines": {
                                        "minimum": 0,
                                        "type": "integer"
                                      },
                                      "threshold": {
                                        "type": "object",
                                        "required": [
                                          "files",
                                          "lines"
                                        ],
                                        "properties": {
                                          "files": {
                                            "minimum": 0,
                                            "type": "integer"
                                          },
                                          "lines": {
                                            "minimum": 0,
                                            "type": "integer"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "perspectives",
                                  "categories",
                                  "rules"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "perspectives-inferred",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "perspectives": {
                                    "type": "array",
                                    "items": {
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                      "type": "string"
                                    }
                                  },
                                  "categories": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "rules": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "round",
                                  "reason",
                                  "issuesRemaining"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "cycle-terminated",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "round": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "reason": {
                                    "anyOf": [
                                      {
                                        "const": "no-issues",
                                        "type": "string"
                                      },
                                      {
                                        "const": "max-rounds",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "issuesRemaining": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "lastReviewIssueCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationAccepted": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationRejected": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationRan": {
                                    "type": "boolean"
                                  },
                                  "finalEvaluationResolved": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationFalsePositive": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationUnresolved": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationNeedsHumanReview": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "finalEvaluationBlocking": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "round",
                                  "perspectives",
                                  "dropped"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "perspectives-respawned",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "round": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "perspectives": {
                                    "type": "array",
                                    "items": {
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                      "type": "string"
                                    }
                                  },
                                  "dropped": {
                                    "type": "array",
                                    "items": {
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "strictness",
                                  "source"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "evaluator-strictness",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "strictness": {
                                    "anyOf": [
                                      {
                                        "const": "strict",
                                        "type": "string"
                                      },
                                      {
                                        "const": "standard",
                                        "type": "string"
                                      },
                                      {
                                        "const": "lenient",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "const": "config",
                                        "type": "string"
                                      },
                                      {
                                        "const": "default",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "perspective",
                                  "round"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "review-perspective-degraded",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "perspective": {
                                    "type": "string"
                                  },
                                  "round": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "previousBlockingIssueOutcomes",
                                  "lastBlockingIssueOutcomes",
                                  "maxAttempts"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "recovery-budget-extended",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "previousBlockingIssueOutcomes": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "lastBlockingIssueOutcomes": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "maxAttempts": {
                                    "minimum": 2,
                                    "type": "integer"
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "verdict"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "recovery-verdict",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "verdict": {
                                    "anyOf": [
                                      {
                                        "const": "retry",
                                        "type": "string"
                                      },
                                      {
                                        "const": "continue-repair",
                                        "type": "string"
                                      },
                                      {
                                        "const": "abandon",
                                        "type": "string"
                                      },
                                      {
                                        "const": "manual",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "strategy",
                                  "files"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "merge-conflict-resolution",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "strategy": {
                                    "type": "string"
                                  },
                                  "files": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "decision"
                        ],
                        "properties": {
                          "type": {
                            "const": "planning:decision",
                            "type": "string"
                          },
                          "planId": {
                            "type": "string"
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "defaultBuild"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "build-pipeline-chosen",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "defaultBuild": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "strategy",
                                  "perspectives",
                                  "maxRounds",
                                  "evaluatorStrictness"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "review-profile-chosen",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "strategy": {
                                    "anyOf": [
                                      {
                                        "const": "auto",
                                        "type": "string"
                                      },
                                      {
                                        "const": "single",
                                        "type": "string"
                                      },
                                      {
                                        "const": "parallel",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "perspectives": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                      "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                      "type": "string"
                                    }
                                  },
                                  "maxRounds": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "evaluatorStrictness": {
                                    "anyOf": [
                                      {
                                        "const": "strict",
                                        "type": "string"
                                      },
                                      {
                                        "const": "standard",
                                        "type": "string"
                                      },
                                      {
                                        "const": "lenient",
                                        "type": "string"
                                      }
                                    ]
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "planCount",
                                  "planIds"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "plan-set-shape",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "planCount": {
                                    "minimum": 1,
                                    "type": "integer"
                                  },
                                  "planIds": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "rationale",
                                  "verdict",
                                  "source",
                                  "concreteSubsystemCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "const": "root-decomposition",
                                    "type": "string"
                                  },
                                  "rationale": {
                                    "type": "string"
                                  },
                                  "verdict": {
                                    "anyOf": [
                                      {
                                        "const": "cohesive",
                                        "type": "string"
                                      },
                                      {
                                        "const": "split",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "const": "agent",
                                        "type": "string"
                                      },
                                      {
                                        "const": "deterministic-fallback",
                                        "type": "string"
                                      }
                                    ]
                                  },
                                  "concreteSubsystemCount": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "groupCount": {
                                    "minimum": 2,
                                    "type": "integer"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "provider",
                          "branch",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:layer:recorded",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "parentPrdId": {
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "artifact": {
                            "type": "object",
                            "required": [
                              "branch"
                            ],
                            "properties": {
                              "branch": {
                                "type": "string"
                              },
                              "commitSha": {
                                "type": "string"
                              },
                              "prUrl": {
                                "type": "string"
                              }
                            }
                          },
                          "landingAction": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "pending",
                                "type": "string"
                              },
                              {
                                "const": "building",
                                "type": "string"
                              },
                              {
                                "const": "built",
                                "type": "string"
                              },
                              {
                                "const": "merged",
                                "type": "string"
                              },
                              {
                                "const": "landed",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "provider",
                          "command",
                          "exitCode"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:provider:command",
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          },
                          "args": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "exitCode": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "branch": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "action",
                          "branch",
                          "status"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:landing:update",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "action": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "branch": {
                            "type": "string"
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "started",
                                "type": "string"
                              },
                              {
                                "const": "complete",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              }
                            ]
                          },
                          "prUrl": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "originalBaseBranch": {
                            "type": "string"
                          },
                          "effectiveBaseBranch": {
                            "type": "string"
                          },
                          "baseRepairReason": {
                            "const": "parent-artifact-already-integrated",
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "provider",
                          "branch",
                          "operation",
                          "conflictKind",
                          "conflictedFiles"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:landing:conflict:detected",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "operation": {
                            "anyOf": [
                              {
                                "const": "branch-restack",
                                "type": "string"
                              },
                              {
                                "const": "stack-restack",
                                "type": "string"
                              },
                              {
                                "const": "repo-sync",
                                "type": "string"
                              },
                              {
                                "const": "unknown",
                                "type": "string"
                              }
                            ]
                          },
                          "conflictKind": {
                            "anyOf": [
                              {
                                "const": "git-rebase",
                                "type": "string"
                              },
                              {
                                "const": "git-merge",
                                "type": "string"
                              },
                              {
                                "const": "unknown",
                                "type": "string"
                              }
                            ]
                          },
                          "conflictedFiles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "provider",
                          "branch",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:landing:conflict:recovery:start",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "provider",
                          "branch",
                          "attempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:landing:conflict:recovery:complete",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "attempts": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "stackId",
                          "provider",
                          "branch",
                          "attempts",
                          "reason",
                          "abortAttempted",
                          "abortSucceeded"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:landing:conflict:recovery:failed",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "stackId": {
                            "type": "string"
                          },
                          "provider": {
                            "const": "git-spice",
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "attempts": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "abortAttempted": {
                            "type": "boolean"
                          },
                          "abortSucceeded": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "syncId",
                          "dryRun"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:sync:start",
                            "type": "string"
                          },
                          "syncId": {
                            "type": "string"
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "after-build",
                                "type": "string"
                              },
                              {
                                "const": "scheduled",
                                "type": "string"
                              },
                              {
                                "const": "retry-deferred",
                                "type": "string"
                              }
                            ]
                          },
                          "dryRun": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "syncId",
                          "dryRun",
                          "restackCandidates",
                          "excludedCandidates"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:sync:complete",
                            "type": "string"
                          },
                          "syncId": {
                            "type": "string"
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "after-build",
                                "type": "string"
                              },
                              {
                                "const": "scheduled",
                                "type": "string"
                              },
                              {
                                "const": "retry-deferred",
                                "type": "string"
                              }
                            ]
                          },
                          "dryRun": {
                            "type": "boolean"
                          },
                          "restackCandidates": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "excludedCandidates": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "localTrunkSha": {
                            "type": "string"
                          },
                          "originTrunkSha": {
                            "type": "string"
                          },
                          "fastForward": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "syncId",
                          "dryRun",
                          "outcome",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:sync:failed",
                            "type": "string"
                          },
                          "syncId": {
                            "type": "string"
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "after-build",
                                "type": "string"
                              },
                              {
                                "const": "scheduled",
                                "type": "string"
                              },
                              {
                                "const": "retry-deferred",
                                "type": "string"
                              }
                            ]
                          },
                          "dryRun": {
                            "type": "boolean"
                          },
                          "outcome": {
                            "anyOf": [
                              {
                                "const": "failed",
                                "type": "string"
                              },
                              {
                                "const": "conflict",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "syncId",
                          "reason",
                          "excludedCandidates"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:sync:deferred",
                            "type": "string"
                          },
                          "syncId": {
                            "type": "string"
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "after-build",
                                "type": "string"
                              },
                              {
                                "const": "scheduled",
                                "type": "string"
                              },
                              {
                                "const": "retry-deferred",
                                "type": "string"
                              }
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "excludedCandidates": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "syncId",
                          "dryRun",
                          "reason",
                          "restackCandidates",
                          "excludedCandidates"
                        ],
                        "properties": {
                          "type": {
                            "const": "stack:sync:skipped",
                            "type": "string"
                          },
                          "syncId": {
                            "type": "string"
                          },
                          "trigger": {
                            "anyOf": [
                              {
                                "const": "manual",
                                "type": "string"
                              },
                              {
                                "const": "after-build",
                                "type": "string"
                              },
                              {
                                "const": "scheduled",
                                "type": "string"
                              },
                              {
                                "const": "retry-deferred",
                                "type": "string"
                              }
                            ]
                          },
                          "dryRun": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "restackCandidates": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "excludedCandidates": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:start",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "attempt",
                          "maxAttempts",
                          "conflictedFiles"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:conflict:attempt",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "conflictedFiles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:resolver:start",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "attempt",
                          "maxAttempts",
                          "resolved",
                          "remainingConflicts"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:resolver:complete",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "resolved": {
                            "type": "boolean"
                          },
                          "remainingConflicts": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "attempt",
                          "maxAttempts"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:rebase:continue",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "attempt": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "baseSha",
                          "featureSha",
                          "rebased"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:success",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "baseSha": {
                            "type": "string"
                          },
                          "featureSha": {
                            "type": "string"
                          },
                          "rebased": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "remote",
                          "baseBranch",
                          "featureBranch",
                          "attempts",
                          "maxAttempts",
                          "conflictedFiles"
                        ],
                        "properties": {
                          "type": {
                            "const": "base-sync:budget:exhausted",
                            "type": "string"
                          },
                          "remote": {
                            "type": "string"
                          },
                          "baseBranch": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "attempts": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "maxAttempts": {
                            "minimum": 1,
                            "type": "integer"
                          },
                          "conflictedFiles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "runId",
                          "failure"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:terminal-failure",
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "failure": {
                            "type": "object",
                            "required": [
                              "scope",
                              "message",
                              "authoritative"
                            ],
                            "properties": {
                              "scope": {
                                "anyOf": [
                                  {
                                    "const": "plan",
                                    "type": "string"
                                  },
                                  {
                                    "const": "post-merge-validation",
                                    "type": "string"
                                  },
                                  {
                                    "const": "prd-validation",
                                    "type": "string"
                                  },
                                  {
                                    "const": "acceptance-validation",
                                    "type": "string"
                                  },
                                  {
                                    "const": "artifact-recording",
                                    "type": "string"
                                  },
                                  {
                                    "const": "landing",
                                    "type": "string"
                                  },
                                  {
                                    "const": "daemon",
                                    "type": "string"
                                  },
                                  {
                                    "const": "compile",
                                    "type": "string"
                                  },
                                  {
                                    "const": "unknown",
                                    "type": "string"
                                  }
                                ]
                              },
                              "message": {
                                "type": "string"
                              },
                              "authoritative": {
                                "type": "boolean"
                              },
                              "planId": {
                                "type": "string"
                              },
                              "terminalSubtype": {
                                "anyOf": [
                                  {
                                    "const": "error_max_turns",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_max_budget_usd",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_max_structured_output_retries",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_during_execution",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_pi_tool_infrastructure",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_context_window",
                                    "type": "string"
                                  },
                                  {
                                    "const": "error_transient_transport",
                                    "type": "string"
                                  }
                                ]
                              },
                              "stage": {
                                "type": "string"
                              },
                              "phaseSummary": {
                                "type": "string"
                              },
                              "phaseStatus": {
                                "type": "string"
                              },
                              "eventType": {
                                "type": "string"
                              },
                              "sourceEventType": {
                                "type": "string"
                              },
                              "sourceEventId": {
                                "type": "integer"
                              },
                              "sourceEventTimestamp": {
                                "type": "string"
                              },
                              "landing": {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "action": {
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                }
                              },
                              "validationPassed": {
                                "type": "boolean"
                              },
                              "prdValidationPassed": {
                                "type": "boolean"
                              },
                              "acceptanceValidationPassed": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName",
                          "featureBranch"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:resume:start",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "seededMerged",
                          "seededPending",
                          "featureBranch",
                          "landedCommitCount",
                          "diffStat"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:resume:state",
                            "type": "string"
                          },
                          "seededMerged": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "seededPending": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "landedCommitCount": {
                            "type": "number"
                          },
                          "diffStat": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "reason"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:resume:ineligible",
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "checkedPath": {
                            "type": "string"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName",
                          "featureBranch",
                          "artifactSource",
                          "source",
                          "orchestration",
                          "plans"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:resume:artifacts",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          },
                          "featureBranch": {
                            "type": "string"
                          },
                          "artifactSource": {
                            "anyOf": [
                              {
                                "const": "merge-worktree",
                                "type": "string"
                              },
                              {
                                "const": "branch-history",
                                "type": "string"
                              }
                            ]
                          },
                          "artifactCommit": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "label"
                            ],
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string"
                              }
                            }
                          },
                          "orchestration": {
                            "type": "object",
                            "required": [
                              "name",
                              "description",
                              "created",
                              "baseBranch",
                              "pipeline",
                              "plans"
                            ],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "created": {
                                "type": "string"
                              },
                              "baseBranch": {
                                "type": "string"
                              },
                              "diffBaseRef": {
                                "type": "string"
                              },
                              "stackedValidationPinRequired": {
                                "type": "boolean"
                              },
                              "pipeline": {
                                "type": "object",
                                "required": [
                                  "compile",
                                  "defaultBuild",
                                  "defaultReview",
                                  "rationale"
                                ],
                                "properties": {
                                  "compile": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "defaultBuild": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "defaultReview": {
                                    "type": "object",
                                    "required": [
                                      "strategy",
                                      "perspectives",
                                      "maxRounds",
                                      "evaluatorStrictness"
                                    ],
                                    "properties": {
                                      "strategy": {
                                        "anyOf": [
                                          {
                                            "const": "auto",
                                            "type": "string"
                                          },
                                          {
                                            "const": "single",
                                            "type": "string"
                                          },
                                          {
                                            "const": "parallel",
                                            "type": "string"
                                          }
                                        ]
                                      },
                                      "perspectives": {
                                        "type": "array",
                                        "items": {
                                          "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                          "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                          "type": "string"
                                        }
                                      },
                                      "maxRounds": {
                                        "type": "number"
                                      },
                                      "evaluatorStrictness": {
                                        "anyOf": [
                                          {
                                            "const": "strict",
                                            "type": "string"
                                          },
                                          {
                                            "const": "standard",
                                            "type": "string"
                                          },
                                          {
                                            "const": "lenient",
                                            "type": "string"
                                          }
                                        ]
                                      }
                                    }
                                  },
                                  "rationale": {
                                    "type": "string"
                                  }
                                }
                              },
                              "plans": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "id",
                                    "name",
                                    "dependsOn",
                                    "branch",
                                    "build",
                                    "review"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "dependsOn": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "branch": {
                                      "type": "string"
                                    },
                                    "build": {
                                      "type": "array",
                                      "items": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    "review": {
                                      "type": "object",
                                      "required": [
                                        "strategy",
                                        "perspectives",
                                        "maxRounds",
                                        "evaluatorStrictness"
                                      ],
                                      "properties": {
                                        "strategy": {
                                          "anyOf": [
                                            {
                                              "const": "auto",
                                              "type": "string"
                                            },
                                            {
                                              "const": "single",
                                              "type": "string"
                                            },
                                            {
                                              "const": "parallel",
                                              "type": "string"
                                            }
                                          ]
                                        },
                                        "perspectives": {
                                          "type": "array",
                                          "items": {
                                            "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                            "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                            "type": "string"
                                          }
                                        },
                                        "maxRounds": {
                                          "type": "number"
                                        },
                                        "evaluatorStrictness": {
                                          "anyOf": [
                                            {
                                              "const": "strict",
                                              "type": "string"
                                            },
                                            {
                                              "const": "standard",
                                              "type": "string"
                                            },
                                            {
                                              "const": "lenient",
                                              "type": "string"
                                            }
                                          ]
                                        }
                                      }
                                    },
                                    "testOwnership": {
                                      "description": "Exclusive owner of new acceptance-test authoring for a plan",
                                      "anyOf": [
                                        {
                                          "const": "builder",
                                          "type": "string"
                                        },
                                        {
                                          "const": "test-writer",
                                          "type": "string"
                                        },
                                        {
                                          "const": "existing-only",
                                          "type": "string"
                                        }
                                      ]
                                    },
                                    "maxContinuations": {
                                      "type": "number"
                                    },
                                    "allowNoOpMerge": {
                                      "type": "boolean"
                                    },
                                    "agents": {
                                      "type": "object",
                                      "patternProperties": {
                                        "^(.*)$": {
                                          "type": "object",
                                          "properties": {
                                            "effort": {
                                              "type": "string"
                                            },
                                            "thinking": {
                                              "anyOf": [
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "object",
                                                  "patternProperties": {
                                                    "^(.*)$": {}
                                                  }
                                                }
                                              ]
                                            },
                                            "rationale": {
                                              "type": "string"
                                            },
                                            "tier": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "validate": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "warnings": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "plans": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "name",
                                "body",
                                "dependsOn"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "body": {
                                  "type": "string"
                                },
                                "dependsOn": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "branch": {
                                  "type": "string"
                                },
                                "build": {
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "review": {
                                  "type": "object",
                                  "required": [
                                    "strategy",
                                    "perspectives",
                                    "maxRounds",
                                    "evaluatorStrictness"
                                  ],
                                  "properties": {
                                    "strategy": {
                                      "anyOf": [
                                        {
                                          "const": "auto",
                                          "type": "string"
                                        },
                                        {
                                          "const": "single",
                                          "type": "string"
                                        },
                                        {
                                          "const": "parallel",
                                          "type": "string"
                                        }
                                      ]
                                    },
                                    "perspectives": {
                                      "type": "array",
                                      "items": {
                                        "pattern": "^[a-z][a-z0-9-]{0,63}$",
                                        "description": "A review perspective key: lowercase slug starting with a letter, 1–64 chars (e.g. \"code\", \"accessibility\")",
                                        "type": "string"
                                      }
                                    },
                                    "maxRounds": {
                                      "type": "number"
                                    },
                                    "evaluatorStrictness": {
                                      "anyOf": [
                                        {
                                          "const": "strict",
                                          "type": "string"
                                        },
                                        {
                                          "const": "standard",
                                          "type": "string"
                                        },
                                        {
                                          "const": "lenient",
                                          "type": "string"
                                        }
                                      ]
                                    }
                                  }
                                },
                                "testOwnership": {
                                  "description": "Exclusive owner of new acceptance-test authoring for a plan",
                                  "anyOf": [
                                    {
                                      "const": "builder",
                                      "type": "string"
                                    },
                                    {
                                      "const": "test-writer",
                                      "type": "string"
                                    },
                                    {
                                      "const": "existing-only",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "prdId",
                          "setName"
                        ],
                        "properties": {
                          "type": {
                            "const": "build:resume:complete",
                            "type": "string"
                          },
                          "prdId": {
                            "type": "string"
                          },
                          "setName": {
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "runs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "planSet",
              "command",
              "status",
              "startedAt",
              "cwd"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "sessionId": {
                "type": "string"
              },
              "planSet": {
                "type": "string"
              },
              "command": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "startedAt": {
                "type": "string"
              },
              "completedAt": {
                "type": "string"
              },
              "cwd": {
                "type": "string"
              },
              "pid": {
                "type": "number"
              }
            }
          }
        },
        "queue": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "title",
              "status",
              "capabilities"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "priority": {
                "type": "number"
              },
              "created": {
                "type": "string"
              },
              "dependsOn": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "dispatchFailure": {
                "type": "object",
                "required": [
                  "reason",
                  "stage",
                  "timestamp"
                ],
                "properties": {
                  "reason": {
                    "type": "string"
                  },
                  "stage": {
                    "anyOf": [
                      {
                        "const": "stacking-validation",
                        "type": "string"
                      },
                      {
                        "const": "policy-gate",
                        "type": "string"
                      },
                      {
                        "const": "profile-routing",
                        "type": "string"
                      },
                      {
                        "const": "dispatch",
                        "type": "string"
                      }
                    ]
                  },
                  "timestamp": {
                    "type": "string"
                  }
                }
              },
              "recoveryVerdict": {
                "type": "object",
                "required": [
                  "verdict",
                  "confidence"
                ],
                "properties": {
                  "verdict": {
                    "anyOf": [
                      {
                        "const": "retry",
                        "type": "string"
                      },
                      {
                        "const": "continue-repair",
                        "type": "string"
                      },
                      {
                        "const": "abandon",
                        "type": "string"
                      },
                      {
                        "const": "manual",
                        "type": "string"
                      }
                    ]
                  },
                  "confidence": {
                    "anyOf": [
                      {
                        "const": "low",
                        "type": "string"
                      },
                      {
                        "const": "medium",
                        "type": "string"
                      },
                      {
                        "const": "high",
                        "type": "string"
                      }
                    ]
                  }
                }
              },
              "hold": {
                "type": "object",
                "required": [
                  "held"
                ],
                "properties": {
                  "held": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "heldAt": {
                    "type": "string"
                  }
                }
              },
              "capabilities": {
                "type": "object",
                "required": [
                  "priority",
                  "remove",
                  "dependencyOverride",
                  "hold",
                  "unhold",
                  "cascadeRemove",
                  "cancel",
                  "cascadeCancel"
                ],
                "properties": {
                  "priority": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "remove": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "dependencyOverride": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "hold": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "unhold": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "cascadeRemove": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "cancel": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  },
                  "cascadeCancel": {
                    "type": "object",
                    "required": [
                      "allowed"
                    ],
                    "properties": {
                      "allowed": {
                        "type": "boolean"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "recoveryApplied": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "action",
                      "appliedAt"
                    ],
                    "properties": {
                      "action": {
                        "anyOf": [
                          {
                            "const": "retry",
                            "type": "string"
                          },
                          {
                            "const": "continue-repair",
                            "type": "string"
                          },
                          {
                            "const": "abandon",
                            "type": "string"
                          }
                        ]
                      },
                      "appliedAt": {
                        "type": "string"
                      },
                      "commitSha": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "action",
                      "acceptedAt",
                      "reasonCategory",
                      "reason",
                      "cleanup",
                      "landing",
                      "dependents"
                    ],
                    "properties": {
                      "action": {
                        "const": "accepted-success",
                        "type": "string"
                      },
                      "acceptedAt": {
                        "type": "string"
                      },
                      "reasonCategory": {
                        "anyOf": [
                          {
                            "const": "bad_acceptance_criterion",
                            "type": "string"
                          },
                          {
                            "const": "manual_verification_passed",
                            "type": "string"
                          },
                          {
                            "const": "external_or_inconclusive_criterion_waived",
                            "type": "string"
                          },
                          {
                            "const": "other",
                            "type": "string"
                          }
                        ]
                      },
                      "reason": {
                        "type": "string"
                      },
                      "cleanup": {
                        "type": "object",
                        "required": [
                          "status"
                        ],
                        "properties": {
                          "status": {
                            "anyOf": [
                              {
                                "const": "committed",
                                "type": "string"
                              },
                              {
                                "const": "noop",
                                "type": "string"
                              }
                            ]
                          },
                          "commitSha": {
                            "type": "string"
                          }
                        }
                      },
                      "landing": {
                        "type": "object",
                        "required": [
                          "action",
                          "status"
                        ],
                        "properties": {
                          "action": {
                            "anyOf": [
                              {
                                "const": "pr",
                                "type": "string"
                              },
                              {
                                "const": "merge",
                                "type": "string"
                              },
                              {
                                "const": "leave",
                                "type": "string"
                              }
                            ]
                          },
                          "status": {
                            "anyOf": [
                              {
                                "const": "complete",
                                "type": "string"
                              },
                              {
                                "const": "skipped",
                                "type": "string"
                              },
                              {
                                "const": "failed",
                                "type": "string"
                              }
                            ]
                          },
                          "prUrl": {
                            "type": "string"
                          },
                          "mergeCommitSha": {
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "autoMerge": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "status"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "complete",
                                    "type": "string"
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "status",
                                  "reason"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "skipped",
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                }
                              },
                              {
                                "type": "object",
                                "required": [
                                  "status",
                                  "reason"
                                ],
                                "properties": {
                                  "status": {
                                    "const": "failed",
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      },
                      "dependents": {
                        "type": "object",
                        "required": [
                          "unblocked",
                          "remainedBlocked",
                          "notFound"
                        ],
                        "properties": {
                          "unblocked": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "remainedBlocked": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "notFound": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "sessionMetadata": {
          "type": "object",
          "patternProperties": {
            "^(.*)$": {
              "type": "object",
              "required": [
                "planCount",
                "baseProfile"
              ],
              "properties": {
                "planCount": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "baseProfile": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        },
        "autoBuild": {
          "type": "object",
          "required": [
            "enabled",
            "watcher"
          ],
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "watcher": {
              "type": "object",
              "required": [
                "running",
                "pid",
                "sessionId"
              ],
              "properties": {
                "running": {
                  "type": "boolean"
                },
                "pid": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sessionId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "desired": {
              "anyOf": [
                {
                  "const": "enabled",
                  "type": "string"
                },
                {
                  "const": "disabled",
                  "type": "string"
                }
              ]
            },
            "mode": {
              "anyOf": [
                {
                  "const": "disabled",
                  "type": "string"
                },
                {
                  "const": "starting",
                  "type": "string"
                },
                {
                  "const": "running",
                  "type": "string"
                },
                {
                  "const": "paused",
                  "type": "string"
                },
                {
                  "const": "stopping",
                  "type": "string"
                },
                {
                  "const": "restarting",
                  "type": "string"
                },
                {
                  "const": "faulted",
                  "type": "string"
                }
              ]
            },
            "scheduler": {
              "type": "object",
              "required": [
                "alive",
                "paused"
              ],
              "properties": {
                "alive": {
                  "type": "boolean"
                },
                "paused": {
                  "type": "boolean"
                },
                "lastMutationReason": {
                  "type": "string"
                },
                "runningCount": {
                  "type": "number"
                },
                "limit": {
                  "type": "number"
                }
              }
            },
            "lastTransition": {
              "type": "object",
              "required": [
                "at",
                "previousMode",
                "nextMode",
                "desired",
                "source"
              ],
              "properties": {
                "at": {
                  "type": "string"
                },
                "previousMode": {
                  "anyOf": [
                    {
                      "const": "disabled",
                      "type": "string"
                    },
                    {
                      "const": "starting",
                      "type": "string"
                    },
                    {
                      "const": "running",
                      "type": "string"
                    },
                    {
                      "const": "paused",
                      "type": "string"
                    },
                    {
                      "const": "stopping",
                      "type": "string"
                    },
                    {
                      "const": "restarting",
                      "type": "string"
                    },
                    {
                      "const": "faulted",
                      "type": "string"
                    }
                  ]
                },
                "nextMode": {
                  "anyOf": [
                    {
                      "const": "disabled",
                      "type": "string"
                    },
                    {
                      "const": "starting",
                      "type": "string"
                    },
                    {
                      "const": "running",
                      "type": "string"
                    },
                    {
                      "const": "paused",
                      "type": "string"
                    },
                    {
                      "const": "stopping",
                      "type": "string"
                    },
                    {
                      "const": "restarting",
                      "type": "string"
                    },
                    {
                      "const": "faulted",
                      "type": "string"
                    }
                  ]
                },
                "desired": {
                  "anyOf": [
                    {
                      "const": "enabled",
                      "type": "string"
                    },
                    {
                      "const": "disabled",
                      "type": "string"
                    }
                  ]
                },
                "reason": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              }
            },
            "reason": {
              "type": "string"
            },
            "recoveryAutoResume": {
              "type": "object",
              "required": [
                "enabled",
                "maxAttempts",
                "attempts"
              ],
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "maxAttempts": {
                  "minimum": 0,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 0,
                  "type": "integer"
                },
                "lastDecision": {
                  "anyOf": [
                    {
                      "const": "evaluate",
                      "type": "string"
                    },
                    {
                      "const": "queued",
                      "type": "string"
                    },
                    {
                      "const": "stopped",
                      "type": "string"
                    }
                  ]
                },
                "prdId": {
                  "type": "string"
                },
                "setName": {
                  "type": "string"
                },
                "stopReason": {
                  "anyOf": [
                    {
                      "const": "disabled",
                      "type": "string"
                    },
                    {
                      "const": "attempt-budget-exhausted",
                      "type": "string"
                    },
                    {
                      "const": "not-continue-repair",
                      "type": "string"
                    },
                    {
                      "const": "not-high-confidence",
                      "type": "string"
                    },
                    {
                      "const": "not-eligible",
                      "type": "string"
                    },
                    {
                      "const": "manual-confirmation-required",
                      "type": "string"
                    },
                    {
                      "const": "partial-sidecar",
                      "type": "string"
                    },
                    {
                      "const": "malformed-sidecar",
                      "type": "string"
                    },
                    {
                      "const": "missing-sidecar",
                      "type": "string"
                    },
                    {
                      "const": "ineligible-artifacts",
                      "type": "string"
                    },
                    {
                      "const": "dirty-worktree",
                      "type": "string"
                    },
                    {
                      "const": "conflicting-worktree",
                      "type": "string"
                    },
                    {
                      "const": "queue-preflight-blocked",
                      "type": "string"
                    },
                    {
                      "const": "conflicting-applied-marker",
                      "type": "string"
                    },
                    {
                      "const": "active-gate-or-hold",
                      "type": "string"
                    },
                    {
                      "const": "repeated-failure-signature",
                      "type": "string"
                    },
                    {
                      "const": "error",
                      "type": "string"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        },
        "stackLayers": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "prdId",
              "stackId",
              "provider",
              "branch",
              "status",
              "recordedAt",
              "updatedAt"
            ],
            "properties": {
              "prdId": {
                "type": "string"
              },
              "stackId": {
                "type": "string"
              },
              "parentPrdId": {
                "type": "string"
              },
              "provider": {
                "const": "git-spice",
                "type": "string"
              },
              "branch": {
                "type": "string"
              },
              "baseBranch": {
                "type": "string"
              },
              "artifact": {
                "type": "object",
                "required": [
                  "branch"
                ],
                "properties": {
                  "branch": {
                    "type": "string"
                  },
                  "commitSha": {
                    "type": "string"
                  },
                  "prUrl": {
                    "type": "string"
                  }
                }
              },
              "landingAction": {
                "anyOf": [
                  {
                    "const": "pr",
                    "type": "string"
                  },
                  {
                    "const": "merge",
                    "type": "string"
                  },
                  {
                    "const": "leave",
                    "type": "string"
                  }
                ]
              },
              "landing": {
                "type": "object",
                "required": [
                  "action",
                  "status",
                  "startedAt"
                ],
                "properties": {
                  "action": {
                    "anyOf": [
                      {
                        "const": "pr",
                        "type": "string"
                      },
                      {
                        "const": "merge",
                        "type": "string"
                      },
                      {
                        "const": "leave",
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "const": "started",
                        "type": "string"
                      },
                      {
                        "const": "complete",
                        "type": "string"
                      },
                      {
                        "const": "skipped",
                        "type": "string"
                      },
                      {
                        "const": "failed",
                        "type": "string"
                      }
                    ]
                  },
                  "prUrl": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "originalBaseBranch": {
                    "type": "string"
                  },
                  "effectiveBaseBranch": {
                    "type": "string"
                  },
                  "baseRepairReason": {
                    "const": "parent-artifact-already-integrated",
                    "type": "string"
                  },
                  "startedAt": {
                    "type": "string"
                  },
                  "completedAt": {
                    "type": "string"
                  }
                }
              },
              "status": {
                "anyOf": [
                  {
                    "const": "pending",
                    "type": "string"
                  },
                  {
                    "const": "building",
                    "type": "string"
                  },
                  {
                    "const": "built",
                    "type": "string"
                  },
                  {
                    "const": "merged",
                    "type": "string"
                  },
                  {
                    "const": "landed",
                    "type": "string"
                  },
                  {
                    "const": "failed",
                    "type": "string"
                  }
                ]
              },
              "recordedAt": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string"
              }
            }
          }
        },
        "failedEnqueues": {
          "type": "array",
          "items": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "runId",
              "sourceLabel",
              "failureReason",
              "failedAt",
              "canReenqueue",
              "nextCommand"
            ],
            "properties": {
              "runId": {
                "type": "string"
              },
              "sessionId": {
                "type": "string"
              },
              "sourceLabel": {
                "type": "string"
              },
              "provenance": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "label"
                ],
                "properties": {
                  "label": {
                    "type": "string"
                  }
                }
              },
              "failureReason": {
                "type": "string"
              },
              "failedAt": {
                "type": "string"
              },
              "canReenqueue": {
                "type": "boolean"
              },
              "disabledReason": {
                "type": "string"
              },
              "nextCommand": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "executable",
                  "args"
                ],
                "properties": {
                  "executable": {
                    "type": "string"
                  },
                  "args": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "resolvedAt": {
                "type": "string"
              }
            }
          }
        },
        "stackSyncStatus": {
          "type": "object",
          "properties": {
            "last": {
              "type": "object",
              "required": [
                "id",
                "startedAt",
                "outcome",
                "dryRun",
                "restackCandidates"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "const": "manual",
                      "type": "string"
                    },
                    {
                      "const": "after-build",
                      "type": "string"
                    },
                    {
                      "const": "scheduled",
                      "type": "string"
                    },
                    {
                      "const": "retry-deferred",
                      "type": "string"
                    }
                  ]
                },
                "activeBuildPolicy": {
                  "anyOf": [
                    {
                      "const": "skip",
                      "type": "string"
                    },
                    {
                      "const": "defer",
                      "type": "string"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string"
                },
                "completedAt": {
                  "type": "string"
                },
                "outcome": {
                  "anyOf": [
                    {
                      "const": "skipped",
                      "type": "string"
                    },
                    {
                      "const": "complete",
                      "type": "string"
                    },
                    {
                      "const": "failed",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    },
                    {
                      "const": "deferred",
                      "type": "string"
                    }
                  ]
                },
                "reason": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "dryRun": {
                  "type": "boolean"
                },
                "localTrunkSha": {
                  "type": "string"
                },
                "originTrunkSha": {
                  "type": "string"
                },
                "fastForward": {
                  "type": "boolean"
                },
                "restackCandidates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "activeBuildSkips": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "branch",
                      "reason"
                    ],
                    "properties": {
                      "branch": {
                        "type": "string"
                      },
                      "worktree": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  }
                },
                "providerCommands": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "command",
                      "args",
                      "dryRun",
                      "ran"
                    ],
                    "properties": {
                      "command": {
                        "type": "string"
                      },
                      "args": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "dryRun": {
                        "type": "boolean"
                      },
                      "ran": {
                        "type": "boolean"
                      },
                      "stdout": {
                        "type": "string"
                      },
                      "stderr": {
                        "type": "string"
                      },
                      "exitCode": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "current": {
              "type": "object",
              "required": [
                "id",
                "startedAt",
                "dryRun",
                "restackCandidates"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "const": "manual",
                      "type": "string"
                    },
                    {
                      "const": "after-build",
                      "type": "string"
                    },
                    {
                      "const": "scheduled",
                      "type": "string"
                    },
                    {
                      "const": "retry-deferred",
                      "type": "string"
                    }
                  ]
                },
                "activeBuildPolicy": {
                  "anyOf": [
                    {
                      "const": "skip",
                      "type": "string"
                    },
                    {
                      "const": "defer",
                      "type": "string"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string"
                },
                "completedAt": {
                  "type": "string"
                },
                "outcome": {
                  "anyOf": [
                    {
                      "const": "skipped",
                      "type": "string"
                    },
                    {
                      "const": "complete",
                      "type": "string"
                    },
                    {
                      "const": "failed",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    },
                    {
                      "const": "deferred",
                      "type": "string"
                    }
                  ]
                },
                "reason": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "dryRun": {
                  "type": "boolean"
                },
                "localTrunkSha": {
                  "type": "string"
                },
                "originTrunkSha": {
                  "type": "string"
                },
                "fastForward": {
                  "type": "boolean"
                },
                "restackCandidates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "activeBuildSkips": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "branch",
                      "reason"
                    ],
                    "properties": {
                      "branch": {
                        "type": "string"
                      },
                      "worktree": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  }
                },
                "providerCommands": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "command",
                      "args",
                      "dryRun",
                      "ran"
                    ],
                    "properties": {
                      "command": {
                        "type": "string"
                      },
                      "args": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "dryRun": {
                        "type": "boolean"
                      },
                      "ran": {
                        "type": "boolean"
                      },
                      "stdout": {
                        "type": "string"
                      },
                      "stderr": {
                        "type": "string"
                      },
                      "exitCode": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
