{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/triage-corpus.schema.json",
  "version": "1.0.0",
  "title": "Multi-Agent Pipeline  -  Triage corpus row",
  "description": "Shape of one row in the JSONL triage corpus at $HOME/.claude/memory/multi-agent/<repo-slug>/triage-corpus.jsonl. Append-only. Each row records a single accepted/deferred/rejected finding from a past triage run plus minimal task context. Used by Phase 1 (similar-task enrichment) and Phase 4 (prior-art lookup).",
  "type": "object",
  "additionalProperties": false,
  "required": ["v", "ts", "task_id", "classification", "severity", "file", "issue"],
  "properties": {
    "v": { "type": "string", "const": "1.0.0" },
    "ts": { "type": "string", "format": "date-time" },
    "task_id": { "type": "string", "minLength": 1 },
    "task_title": { "type": ["string", "null"] },
    "stack": { "type": ["string", "null"] },
    "classification": {
      "type": "string",
      "enum": ["accepted", "deferred", "rejected"]
    },
    "severity": {
      "type": "string",
      "enum": ["blocking", "important", "suggestion"]
    },
    "file": { "type": "string" },
    "line": { "type": ["integer", "null"] },
    "issue": { "type": "string", "minLength": 1 },
    "fix": { "type": ["string", "null"] },
    "reason": { "type": ["string", "null"] },
    "reviewer": { "type": ["string", "null"] },
    "file_sha": {
      "type": ["string", "null"],
      "description": "git blob SHA (git hash-object) of `file` at ingest time. On query, a differing current hash flags the hit stale (freshness gate). Null when not computable (file gone / not a git repo)."
    }
  }
}
