{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-actions-response-schema.json",
  "title": "ActionsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-actions-api-openapi.yml#/components/schemas/ActionsResponse",
  "properties": {
    "status": {
      "type": "string",
      "const": "available",
      "title": "Status"
    },
    "anchor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Anchor",
      "description": "Newest indexed commit time; windows count back from it."
    },
    "week_start": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Week Start"
    },
    "context": {
      "$ref": "#/$defs/ActionContext"
    },
    "horizons": {
      "additionalProperties": {
        "$ref": "#/$defs/ActionHorizon"
      },
      "propertyNames": {
        "enum": [
          "week",
          "quarter"
        ]
      },
      "type": "object",
      "title": "Horizons"
    },
    "summary": {
      "additionalProperties": {
        "type": "string"
      },
      "propertyNames": {
        "enum": [
          "week",
          "quarter"
        ]
      },
      "type": "object",
      "title": "Summary",
      "description": "Where things stand in each horizon, in one sentence."
    },
    "rules": {
      "items": {
        "$ref": "#/$defs/ActionRuleStatus"
      },
      "type": "array",
      "title": "Rules"
    },
    "unavailable": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Unavailable"
    }
  },
  "type": "object",
  "required": [
    "status",
    "anchor",
    "week_start",
    "context",
    "horizons",
    "summary",
    "rules",
    "unavailable"
  ],
  "$defs": {
    "ActionCommand": {
      "properties": {
        "purpose": {
          "type": "string",
          "title": "Purpose"
        },
        "mcp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mcp"
        },
        "cli": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cli"
        },
        "tool": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool"
        },
        "arguments": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Arguments"
        }
      },
      "type": "object",
      "required": [
        "purpose"
      ],
      "title": "ActionCommand"
    },
    "ActionContext": {
      "properties": {
        "production_files": {
          "type": "integer",
          "title": "Production Files"
        },
        "active_authors_90d": {
          "type": "integer",
          "title": "Active Authors 90D"
        },
        "fix_commits_90d": {
          "type": "integer",
          "title": "Fix Commits 90D"
        },
        "busy_threshold": {
          "type": "integer",
          "title": "Busy Threshold"
        },
        "coverage": {
          "type": "string",
          "enum": [
            "measured",
            "stale",
            "unknown"
          ],
          "title": "Coverage"
        },
        "history_too_short": {
          "type": "boolean",
          "title": "History Too Short",
          "description": "The index holds too few commits for history-driven rules to rank by.",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "production_files",
        "active_authors_90d",
        "fix_commits_90d",
        "busy_threshold",
        "coverage"
      ],
      "title": "ActionContext"
    },
    "ActionDetail": {
      "properties": {
        "path": {
          "type": "string",
          "title": "Path"
        },
        "line": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line"
        },
        "symbol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Symbol"
        },
        "marker": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Marker"
        },
        "severity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Severity"
        },
        "reason": {
          "type": "string",
          "title": "Reason",
          "default": ""
        },
        "ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ref"
        }
      },
      "type": "object",
      "required": [
        "path"
      ],
      "title": "ActionDetail"
    },
    "ActionHorizon": {
      "properties": {
        "actions": {
          "items": {
            "$ref": "#/$defs/NextAction"
          },
          "type": "array",
          "title": "Actions"
        },
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Every visible action in this horizon, not only those listed."
        },
        "hidden": {
          "type": "integer",
          "title": "Hidden",
          "description": "Actions the person dismissed, snoozed or marked done."
        },
        "by_tier": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "By Tier"
        }
      },
      "type": "object",
      "required": [
        "actions",
        "total",
        "hidden",
        "by_tier"
      ],
      "title": "ActionHorizon"
    },
    "ActionRuleStatus": {
      "properties": {
        "rule": {
          "type": "string",
          "title": "Rule"
        },
        "status": {
          "type": "string",
          "enum": [
            "evaluated",
            "not_applicable",
            "unavailable"
          ],
          "title": "Status"
        },
        "reason": {
          "type": "string",
          "title": "Reason"
        },
        "emitted": {
          "type": "integer",
          "title": "Emitted"
        }
      },
      "type": "object",
      "required": [
        "rule",
        "status",
        "reason",
        "emitted"
      ],
      "title": "ActionRuleStatus"
    },
    "ActionTarget": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "file",
            "symbol",
            "folder",
            "document",
            "decision",
            "repo"
          ],
          "title": "Kind"
        },
        "path": {
          "type": "string",
          "title": "Path"
        },
        "symbol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Symbol"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "path"
      ],
      "title": "ActionTarget"
    },
    "ActionWhy": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "value": {
          "type": "string",
          "title": "Value"
        },
        "basis": {
          "type": "string",
          "enum": [
            "measured",
            "inferred",
            "unknown"
          ],
          "title": "Basis"
        }
      },
      "type": "object",
      "required": [
        "label",
        "value",
        "basis"
      ],
      "title": "ActionWhy"
    },
    "NextAction": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "rule": {
          "type": "string",
          "title": "Rule"
        },
        "tier": {
          "type": "string",
          "enum": [
            "act_now",
            "plan",
            "improve_signal"
          ],
          "title": "Tier"
        },
        "horizons": {
          "items": {
            "type": "string",
            "enum": [
              "week",
              "quarter"
            ]
          },
          "type": "array",
          "title": "Horizons"
        },
        "severity": {
          "type": "string",
          "enum": [
            "critical",
            "high",
            "medium",
            "low"
          ],
          "title": "Severity"
        },
        "title": {
          "type": "string",
          "title": "Title",
          "description": "Verb first; paths and symbols wrapped in backticks."
        },
        "impact": {
          "type": "string",
          "title": "Impact"
        },
        "why": {
          "items": {
            "$ref": "#/$defs/ActionWhy"
          },
          "type": "array",
          "title": "Why"
        },
        "target": {
          "$ref": "#/$defs/ActionTarget"
        },
        "surface": {
          "type": "string",
          "title": "Surface"
        },
        "effort": {
          "type": "string",
          "enum": [
            "S",
            "M",
            "L"
          ],
          "title": "Effort"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium"
          ],
          "title": "Confidence"
        },
        "value": {
          "type": "integer",
          "title": "Value",
          "description": "0-4: the Fix first value band, or what the severity says.",
          "default": 0
        },
        "priority": {
          "type": "number",
          "title": "Priority",
          "description": "Value x confidence / effort: the order inside a tier.",
          "default": 0.0
        },
        "done_when": {
          "type": "string",
          "title": "Done When"
        },
        "command": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Command"
        },
        "marker": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Marker"
        },
        "evidence_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Evidence Ids"
        },
        "evidence_total": {
          "type": "integer",
          "title": "Evidence Total"
        },
        "includes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Includes"
        },
        "fingerprint": {
          "type": "string",
          "title": "Fingerprint"
        },
        "details": {
          "items": {
            "$ref": "#/$defs/ActionDetail"
          },
          "type": "array",
          "title": "Details"
        },
        "details_total": {
          "type": "integer",
          "title": "Details Total",
          "default": 0
        },
        "commands": {
          "items": {
            "$ref": "#/$defs/ActionCommand"
          },
          "type": "array",
          "title": "Commands"
        }
      },
      "type": "object",
      "required": [
        "id",
        "rule",
        "tier",
        "horizons",
        "severity",
        "title",
        "impact",
        "why",
        "target",
        "surface",
        "effort",
        "confidence",
        "done_when",
        "evidence_ids",
        "evidence_total",
        "includes",
        "fingerprint"
      ],
      "title": "NextAction"
    }
  }
}