{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentstack-tech/json-schema/agentstack-tech-plan-claim-response-schema.json",
  "title": "PlanClaimResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentstack-tech-openapi.json#/components/schemas/PlanClaimResponse",
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "default": true
    },
    "claimed": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Claimed"
    },
    "task_list": {
      "anyOf": [
        {
          "$ref": "#/$defs/AgentTaskList"
        },
        {
          "type": "null"
        }
      ]
    },
    "graph_revision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Graph Revision"
    },
    "wip_full": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Wip Full"
    },
    "ok": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ok"
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Code"
    },
    "node_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Node Id"
    },
    "home": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Home"
    },
    "next_actions": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Actions"
    },
    "next_action": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Action"
    },
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "State"
    },
    "lease_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lease Seconds"
    },
    "heartbeat_after": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Heartbeat After"
    },
    "claim_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Claim Count"
    },
    "lazy_reclaim": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lazy Reclaim"
    },
    "recovery_hint": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recovery Hint"
    },
    "recovery": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recovery"
    },
    "required_role": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Required Role"
    },
    "role_mismatch": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Role Mismatch"
    },
    "eligibility": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Eligibility"
    },
    "owner_agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Owner Agent Id"
    }
  },
  "type": "object",
  "$defs": {
    "AgentTaskList": {
      "properties": {
        "version": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Version",
          "default": 3
        },
        "revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Revision",
          "default": 0
        },
        "root_prompt": {
          "type": "string",
          "maxLength": 4000,
          "title": "Root Prompt",
          "default": ""
        },
        "tasks": {
          "items": {
            "$ref": "#/$defs/PlanNode-Output"
          },
          "type": "array",
          "title": "Tasks"
        },
        "active_goal_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ],
          "title": "Active Goal Id"
        },
        "archived_completed_count": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Archived Completed Count",
          "default": 0
        },
        "archived_ids_tail": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Archived Ids Tail"
        },
        "content_hash": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 32
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Hash",
          "description": "Persisted plan_revision_hash fingerprint (write-path SoT; read fast-path)."
        }
      },
      "type": "object",
      "title": "AgentTaskList",
      "description": "Plan / Work Graph container. version 3 = Work Graph fields present."
    },
    "GraphRef": {
      "properties": {
        "project_id": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Project Id"
        },
        "user_id": {
          "type": "integer",
          "minimum": 0.0,
          "title": "User Id",
          "default": 0
        },
        "node_id": {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "title": "Node Id"
        }
      },
      "type": "object",
      "required": [
        "project_id",
        "node_id"
      ],
      "title": "GraphRef",
      "description": "Soft link to a node on another home. Not a dependency edge."
    },
    "PlanNode-Output": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "title": "Id"
        },
        "kind": {
          "type": "string",
          "enum": [
            "objective",
            "key_result",
            "initiative",
            "workstream",
            "issue",
            "feature",
            "task",
            "step",
            "verification",
            "goal",
            "note",
            "catalog"
          ],
          "title": "Kind",
          "default": "task"
        },
        "title": {
          "type": "string",
          "maxLength": 256,
          "title": "Title",
          "default": ""
        },
        "prompt": {
          "type": "string",
          "maxLength": 8000,
          "title": "Prompt",
          "default": ""
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "claimed",
            "in_progress",
            "verifying",
            "completed",
            "cancelled",
            "blocked",
            "waiting_input",
            "waiting_approval",
            "waiting_external"
          ],
          "title": "Status",
          "default": "pending"
        },
        "priority": {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0,
          "title": "Priority",
          "default": 0
        },
        "priority_class": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "P0",
                "P1",
                "P2",
                "P3",
                "P4",
                "P5"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Priority Class"
        },
        "priority_score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Priority Score"
        },
        "agent_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Id"
        },
        "playbook_step_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ],
          "title": "Playbook Step Id"
        },
        "intent_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ],
          "title": "Intent Id"
        },
        "skill_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Skill Ids"
        },
        "objective": {
          "type": "string",
          "maxLength": 2000,
          "title": "Objective",
          "default": ""
        },
        "required_role": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Required Role"
        },
        "parallelizable": {
          "type": "boolean",
          "title": "Parallelizable",
          "default": true
        },
        "dependencies": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Dependencies"
        },
        "quality_profiles": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Quality Profiles"
        },
        "completion_predicates": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Completion Predicates"
        },
        "evidence": {
          "additionalProperties": true,
          "type": "object",
          "title": "Evidence"
        },
        "scope": {
          "type": "string",
          "enum": [
            "project",
            "run"
          ],
          "title": "Scope",
          "default": "project"
        },
        "children": {
          "items": {
            "$ref": "#/$defs/PlanNode-Output"
          },
          "type": "array",
          "title": "Children"
        },
        "meta": {
          "additionalProperties": true,
          "type": "object",
          "title": "Meta"
        },
        "detail": {
          "type": "string",
          "maxLength": 4000,
          "title": "Detail",
          "default": ""
        },
        "goal_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 128
            },
            {
              "type": "null"
            }
          ],
          "title": "Goal Id"
        },
        "root_run_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Root Run Id"
        },
        "parent_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Id"
        },
        "layer": {
          "type": "string",
          "enum": [
            "business",
            "strategic",
            "tactical",
            "execution",
            "unknown"
          ],
          "title": "Layer",
          "default": "execution"
        },
        "complexity": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Complexity"
        },
        "effort": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Effort"
        },
        "impact": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Impact"
        },
        "urgency": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Urgency"
        },
        "severity": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Severity"
        },
        "risk": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 5.0,
              "minimum": 1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Risk"
        },
        "acceptance_criteria": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Acceptance Criteria"
        },
        "decomposition_status": {
          "type": "string",
          "enum": [
            "not_needed",
            "needed",
            "in_progress",
            "ready",
            "blocked",
            "unknown"
          ],
          "title": "Decomposition Status",
          "default": "not_needed"
        },
        "planning_state": {
          "type": "string",
          "enum": [
            "inbox",
            "triage",
            "planning",
            "verify_failed",
            "none"
          ],
          "title": "Planning State",
          "default": "none"
        },
        "source": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source"
        },
        "report_to": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Report To"
        },
        "allowed_actions": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Allowed Actions"
        },
        "forbidden_actions": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Forbidden Actions"
        },
        "refs": {
          "items": {
            "$ref": "#/$defs/GraphRef"
          },
          "type": "array",
          "title": "Refs"
        },
        "chunk_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Chunk Id"
        },
        "body_sha": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Body Sha"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "PlanNode"
    }
  }
}