{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-refactoring-plan-detail-response-schema.json",
  "title": "RefactoringPlanDetailResponse",
  "description": "One plan read alone: what other layers say about its target. Lists stay\non :class:`RefactoringPlanResponse` and never carry these; both are absent\non a plan that was never checked.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-openapi.json#/components/schemas/RefactoringPlanDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "refactoring_type": {
      "type": "string",
      "title": "Refactoring Type"
    },
    "file_path": {
      "type": "string",
      "title": "File Path"
    },
    "target_symbol": {
      "type": "string",
      "title": "Target Symbol"
    },
    "line_start": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Line Start"
    },
    "line_end": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Line End"
    },
    "plan": {
      "additionalProperties": true,
      "type": "object",
      "title": "Plan"
    },
    "evidence": {
      "additionalProperties": true,
      "type": "object",
      "title": "Evidence"
    },
    "impact_delta": {
      "type": "number",
      "title": "Impact Delta",
      "default": 0.0
    },
    "effort_bucket": {
      "type": "string",
      "title": "Effort Bucket",
      "default": ""
    },
    "blast_radius": {
      "additionalProperties": true,
      "type": "object",
      "title": "Blast Radius"
    },
    "confidence": {
      "type": "string",
      "title": "Confidence",
      "default": "medium"
    },
    "source_biomarker": {
      "type": "string",
      "title": "Source Biomarker",
      "default": ""
    },
    "benefit": {
      "type": "number",
      "title": "Benefit",
      "default": 0.0
    },
    "leverage": {
      "type": "number",
      "title": "Leverage",
      "default": 0.0
    },
    "cost": {
      "type": "number",
      "title": "Cost",
      "default": 0.0
    },
    "risk": {
      "type": "number",
      "title": "Risk",
      "default": 0.0
    },
    "rank_score": {
      "type": "number",
      "title": "Rank Score",
      "default": 0.0
    },
    "dependents": {
      "type": "integer",
      "title": "Dependents",
      "default": 0
    },
    "file_nloc": {
      "type": "integer",
      "title": "File Nloc",
      "default": 0
    },
    "file_weighted_deficit": {
      "type": "integer",
      "title": "File Weighted Deficit",
      "default": 0
    },
    "validation": {
      "additionalProperties": true,
      "type": "object",
      "title": "Validation"
    },
    "preview": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Preview"
    },
    "governed_by": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Governed By"
    },
    "risks": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/PlanRiskResponse"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Risks"
    },
    "recipe": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recipe"
    },
    "payoff": {
      "anyOf": [
        {
          "$ref": "#/$defs/PlanPayoffResponse"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "id",
    "refactoring_type",
    "file_path",
    "target_symbol"
  ],
  "$defs": {
    "PlanMeasuresResponse": {
      "properties": {
        "ccn": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ccn"
        },
        "nloc": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nloc"
        },
        "params": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Params"
        }
      },
      "type": "object",
      "title": "PlanMeasuresResponse",
      "description": "A function's stored size measures; an absent one was not measured."
    },
    "PlanPayoffResponse": {
      "properties": {
        "outcome": {
          "type": "string",
          "title": "Outcome"
        },
        "resolved_commit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolved Commit"
        },
        "resolved_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolved At"
        },
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/PlanMeasuresResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/PlanMeasuresResponse"
            },
            {
              "type": "null"
            }
          ]
        },
        "realised": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "integer"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Realised"
        },
        "new_symbol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "New Symbol"
        }
      },
      "type": "object",
      "required": [
        "outcome"
      ],
      "title": "PlanPayoffResponse",
      "description": "What happened to a plan the index resolved as no longer detected.\n\n``applied`` means the measures are consistent with the plan being applied:\nthe target shed at least half the predicted decision points and a function\nfitting the extracted slice appeared beside it."
    },
    "PlanRiskResponse": {
      "properties": {
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ref"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "text"
      ],
      "title": "PlanRiskResponse"
    }
  }
}