{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passalong-dev/json-schema/passalong-dev-work-schema.json",
  "title": "Work",
  "description": "One piece of work: what to do, in plain words, with whatever came with it. It has no kinds and no required sections; read it and work out what done means.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passalong-dev-openapi.json#/components/schemas/Work",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "summary": {
      "type": "string",
      "description": "What it is, in a sentence or two, for a person."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "ready",
        "done"
      ]
    },
    "url": {
      "type": "string",
      "description": "The share link. Append `.md` for the markdown, no account needed."
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "pulls": {
      "type": "integer",
      "description": "How many times it has been taken."
    },
    "mine": {
      "type": "boolean"
    },
    "from": {
      "type": "string",
      "description": "Handle of whoever shared it."
    },
    "from_name": {
      "type": "string",
      "description": "Whoever sent it, as a person reads them: their name, else @handle, else @id."
    },
    "team": {
      "type": "string"
    },
    "team_name": {
      "type": "string",
      "description": "The team's display name, or empty."
    },
    "to": {
      "type": "string",
      "description": "Handle it was addressed to, if anyone."
    },
    "to_name": {
      "type": "string",
      "description": "Who it was sent to, by name, or empty."
    },
    "to_group": {
      "type": "string",
      "description": "Group inside the team it was handed to, if any. Reaches every member; the first to take it clears it from the others."
    },
    "to_group_name": {
      "type": "string",
      "description": "That group's display name, or empty."
    },
    "for_me": {
      "type": "boolean",
      "description": "Addressed to you: by handle, or to a group you are in, rather than the team."
    },
    "stage": {
      "type": "string",
      "enum": [
        "draft",
        "todo",
        "working",
        "done"
      ],
      "description": "Its column on the team board, the same for everyone who sees it."
    },
    "held_by": {
      "type": "array",
      "description": "Who holds it.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "agent": {
            "type": "string",
            "description": "The agent's name; empty for a person."
          },
          "you": {
            "type": "boolean"
          },
          "health": {
            "type": "string",
            "enum": [
              "working",
              "quiet",
              "asking",
              "person"
            ]
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "Last heard from."
          }
        }
      }
    },
    "answered_elsewhere": {
      "type": "boolean",
      "description": "Someone else took it, holds it or finished it, so it is not waiting on you. Never true when it names you by handle or you said you are on it."
    },
    "source_context": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "stack_assumptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "parent": {
      "type": "string",
      "description": "The work this came out of, if any."
    }
  }
}