{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://loadsheet.dev/schema/scan.v1.json",
  "title": "loadsheet Scan",
  "type": "object",
  "properties": {
    "schema": {
      "const": 1,
      "description": "The schema version, 1."
    },
    "tool": {
      "type": "string",
      "minLength": 1,
      "description": "The tool and version that wrote it, such as loadsheet@0.0.1."
    },
    "machine": {
      "type": "string",
      "minLength": 1,
      "description": "The machine's name."
    },
    "scannedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When it was scanned, as an ISO 8601 timestamp."
    },
    "window": {
      "type": "array",
      "items": [
        {
          "type": "string",
          "format": "date",
          "description": "A UTC calendar day, written YYYY-MM-DD."
        },
        {
          "type": "string",
          "format": "date",
          "description": "A UTC calendar day, written YYYY-MM-DD."
        }
      ],
      "minItems": 2,
      "additionalItems": false,
      "description": "The first and last day it covers, inclusive."
    },
    "coverage": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "machine": {
            "type": "string",
            "minLength": 1,
            "description": "The machine's name."
          },
          "harness": {
            "type": "string",
            "minLength": 1,
            "description": "The harness id."
          },
          "installed": {
            "type": "boolean",
            "description": "Whether the harness's home exists on that machine."
          },
          "sessions": {
            "type": "integer",
            "minimum": 0,
            "description": "Sessions found in the window."
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Harness versions seen in those sessions."
          },
          "firstDay": {
            "type": "string",
            "format": "date",
            "description": "The first day with a session."
          },
          "lastDay": {
            "type": "string",
            "format": "date",
            "description": "The last day with a session."
          },
          "signals": {
            "type": "object",
            "properties": {
              "listing": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "modelUse": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "userUse": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "instructions": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "mcp": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "tokens": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all."
              },
              "usage": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              },
              "cacheTtl": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              },
              "turns": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              },
              "hours": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              },
              "tools": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              },
              "limits": {
                "enum": ["exact", "inferred", "none"],
                "type": "string",
                "description": "How well a harness provides a signal: read directly, inferred from indirect evidence, or not at all.",
                "default": "none"
              }
            },
            "required": ["listing", "modelUse", "userUse", "instructions", "mcp", "tokens"],
            "description": "How well each signal is provided."
          },
          "contextWindow": {
            "type": "integer",
            "minimum": 1,
            "description": "The model's context window in tokens, as the harness reports it in its latest session or, failing that, its settings; absent when unknown."
          },
          "settings": {
            "type": "object",
            "properties": {
              "settingsPath": {
                "type": "string",
                "pattern": "^~\\/(?:(?!\\.{1,2}\\/)[^/\\\\\\x00-\\x1f\\x7f]+\\/)*settings\\.json$",
                "description": "The active settings.json, only when it can be named relative to home."
              },
              "cacheTtl": {
                "enum": ["5m", "1h"],
                "type": "string",
                "description": "How long the main conversation's prompt cache lives, as the settings set it."
              },
              "cacheTtlFrom": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z0-9_]+)*$",
                "description": "Which knob set cacheTtl, such as `settings.promptCacheTtl`, `env.FORCE_PROMPT_CACHING_5M` or `default`."
              },
              "subagentCacheTtl": {
                "enum": ["5m", "1h"],
                "type": "string",
                "description": "How long a subagent's prompt cache lives, as the settings set it."
              },
              "caching": {
                "enum": ["on", "off"],
                "type": "string",
                "description": "Whether prompt caching is on or turned off."
              },
              "cachingFrom": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9_]*(?:\\.[A-Za-z0-9_]+)*$",
                "description": "Which variable turned caching off, such as `settings.env.DISABLE_PROMPT_CACHING`; absent when it is on."
              },
              "retentionDays": {
                "type": "integer",
                "minimum": 0,
                "description": "Days the harness keeps a transcript before it deletes it."
              },
              "docMaxBytes": {
                "type": "integer",
                "minimum": 0,
                "description": "The most bytes of an instruction file the harness reads."
              },
              "autoCompact": {
                "type": "boolean",
                "description": "Whether the harness compacts a conversation on its own when its context fills."
              },
              "autoCompactWindow": {
                "type": "integer",
                "minimum": 0,
                "description": "The context size in tokens at which the harness compacts on its own."
              }
            },
            "required": [],
            "description": "What the harness's settings and environment set, as derived values, never their text; absent when the harness reads none."
          },
          "unread": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]*$"
            },
            "description": "The session stores of this harness that could not be read, by name, such as `opencode.db`; absent when every store was read."
          },
          "backfill": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "store": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9._-]*$",
                  "description": "The store, by name, such as `statev2.sqlite`."
                },
                "firstDay": {
                  "type": "string",
                  "format": "date",
                  "description": "The first day it added usage on."
                },
                "lastDay": {
                  "type": "string",
                  "format": "date",
                  "description": "The last day it added usage on."
                },
                "sessions": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Conversations it added, subagents' included."
                }
              },
              "required": ["store", "firstDay", "lastDay", "sessions"],
              "description": "What one session store added to a harness's usage, for sessions whose own files are gone."
            },
            "description": "The session stores that filled in this harness's sessions whose own files are gone, each with the days and sessions it added; absent when none did."
          }
        },
        "required": ["machine", "harness", "installed", "sessions", "versions", "signals"],
        "description": "What one harness on one machine could tell."
      },
      "description": "What each harness on this machine could tell."
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(skill|instructions|mcp|subagent|memory):(?!\\s*(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/])).+$",
            "description": "Its id, `${kind}:${name}`."
          },
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "enum": ["skill", "instructions", "mcp", "subagent", "memory"],
                "type": "string",
                "description": "What the piece of context is."
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))",
                "description": "Its name, unique within its kind."
              }
            },
            "required": ["kind", "name"],
            "description": "Its kind and name."
          },
          "harnesses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids of the harnesses that load it from this path."
          },
          "scope": {
            "enum": ["user", "project", "plugin"],
            "type": "string",
            "description": "Where it is installed."
          },
          "pack": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))",
            "description": "Where it came from: a plugin name, `owner/repo`, or a fleetrc source."
          },
          "managedBy": {
            "enum": ["fleetrc", "skills", "plugin", "hand"],
            "type": "string",
            "description": "What installed it."
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:(?:[\\\\/](?:\\.{1,2}(?=[\\\\/]))?)+(?:[uU][sS][eE][rR][sS]|[dD][oO][cC][uU][mM][eE][nN][tT][sS] [aA][nN][dD] [sS][eE][tT][tT][iI][nN][gG][sS])(?:[\\\\/](?:\\.{1,2}(?=[\\\\/]))?)+))",
            "description": "Its file or folder, relative to the home directory (`~/...`) or to the project."
          },
          "reaches": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:(?:[\\\\/](?:\\.{1,2}(?=[\\\\/]))?)+(?:[uU][sS][eE][rR][sS]|[dD][oO][cC][uU][mM][eE][nN][tT][sS] [aA][nN][dD] [sS][eE][tT][tT][iI][nN][gG][sS])(?:[\\\\/](?:\\.{1,2}(?=[\\\\/]))?)+))",
              "description": "Its file or folder, relative to the home directory (`~/...`) or to the project."
            },
            "description": "The paths of the other Items of this machine that removing this one would take or break, worked out on the machine's disk; absent when that is not known."
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "The sha256 of its file content (or metadata for an oversized memory index), as lowercase hex."
          },
          "chars": {
            "type": "object",
            "properties": {
              "listed": {
                "type": "integer",
                "minimum": 0,
                "description": "Characters it puts in the context of every session that lists or loads it: a skill's or subagent's name and description, an instruction file's whole text, an MCP server's instructions."
              },
              "body": {
                "type": "integer",
                "minimum": 0,
                "description": "Characters loaded only when it is invoked: the rest of a skill's or subagent's file; 0 for instruction files and MCP servers."
              }
            },
            "required": ["listed", "body"],
            "description": "Its size in characters: listed is paid by every session that lists or loads it, body only by a session that invokes it."
          },
          "modelInvocable": {
            "type": "boolean",
            "description": "Whether the model may invoke it on its own."
          },
          "description": {
            "type": "string",
            "description": "A skill's or subagent's description, the text the harness lists for it; absent for other kinds."
          },
          "memory": {
            "type": "object",
            "properties": {
              "folderDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "lines": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Lines in the index; null when it exceeds the inventory read cap."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bytes": {
                "type": "integer",
                "minimum": 0,
                "description": "The index's size in bytes."
              },
              "files": {
                "type": "integer",
                "minimum": 0,
                "description": "Files in the memory folder, the index among them and `archive/` left out."
              },
              "modified": {
                "type": "string",
                "format": "date",
                "description": "The UTC day the index or a file beside it last changed; absent when the files carry no times."
              },
              "stale": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those files, non-durable notes whose body names a pull request, a branch or a date, unchanged for over 30 days."
              }
            },
            "required": ["lines", "bytes", "files", "stale"],
            "description": "A memory index's size and its folder's, as counts; absent for other kinds."
          }
        },
        "required": [
          "id",
          "ref",
          "harnesses",
          "scope",
          "managedBy",
          "path",
          "digest",
          "chars",
          "modelInvocable"
        ],
        "description": "One installed piece of context found on disk (or in a pack). The same id at two paths is two Items."
      },
      "description": "Installed pieces of context."
    },
    "sessions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "The day the sessions started."
          },
          "harness": {
            "type": "string",
            "minLength": 1,
            "description": "The harness id."
          },
          "via": {
            "type": "string",
            "minLength": 1,
            "description": "The entrypoint or originator that started the sessions."
          },
          "sessions": {
            "type": "integer",
            "minimum": 0,
            "description": "Sessions started."
          },
          "fixedTokens": {
            "type": "integer",
            "minimum": 0,
            "description": "First-request input tokens, summed over the sessions that reported them."
          },
          "measured": {
            "type": "integer",
            "minimum": 0,
            "description": "Sessions that reported their first-request input tokens."
          }
        },
        "required": ["day", "harness", "via", "sessions", "fixedTokens", "measured"],
        "description": "Additive session totals for one harness, day and entrypoint: the denominator for every share."
      },
      "description": "Session totals."
    },
    "cells": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "The day the sessions started."
          },
          "harness": {
            "type": "string",
            "minLength": 1,
            "description": "The harness id."
          },
          "via": {
            "type": "string",
            "minLength": 1,
            "description": "The entrypoint or originator that started the sessions, such as cli or an app's name."
          },
          "item": {
            "type": "string",
            "pattern": "^(skill|instructions|mcp|subagent|memory):(?!\\s*(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/])).+$",
            "description": "The item's id."
          },
          "sessions": {
            "type": "integer",
            "minimum": 0,
            "description": "Sessions that listed it (skill, mcp, subagent) or loaded it (instructions)."
          },
          "bare": {
            "type": "integer",
            "minimum": 0,
            "description": "Of those sessions, how many listed it without its description."
          },
          "chars": {
            "type": "integer",
            "minimum": 0,
            "description": "Characters it occupied, summed over those sessions."
          },
          "byModel": {
            "type": "integer",
            "minimum": 0,
            "description": "Times the model invoked it."
          },
          "byUser": {
            "type": "integer",
            "minimum": 0,
            "description": "Times the user invoked it."
          }
        },
        "required": [
          "day",
          "harness",
          "via",
          "item",
          "sessions",
          "bare",
          "chars",
          "byModel",
          "byUser"
        ],
        "description": "Additive usage counters for one item, in one harness, on one day, through one entrypoint."
      },
      "description": "Usage counters."
    },
    "usage": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day the sessions started."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint or originator that started the sessions."
              },
              "project": {
                "type": "string",
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))(?:[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9._-]+|~(?:\\/[^\\0\\n\\r]*)?|\\/[^\\0\\n\\r]*|unknown)$",
                "description": "The project the sessions ran in: `owner/repo`, a folder under the home directory (`~/...`), an absolute path outside it, or `unknown`."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether these are main conversations or subagents' conversations."
              },
              "sessions": {
                "type": "integer",
                "minimum": 0,
                "description": "Sessions started; a subagent's conversation counts as one."
              },
              "compacted": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those sessions, how many compacted their context at least once."
              },
              "compactions": {
                "type": "integer",
                "minimum": 0,
                "description": "Compactions in those sessions, automatic and manual."
              },
              "manualCompactions": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those compactions, how many the user asked for."
              },
              "spoke": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those sessions, how many had at least one prompt the user wrote themselves, not one an agent wrote in their place, such as a brief to a delegated agent. Absent means 0."
              },
              "yelled": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those sessions, how many had at least one prompt where the user yelled, as `yelled` on turn cells counts it. Absent means 0."
              }
            },
            "required": [
              "day",
              "harness",
              "via",
              "project",
              "thread",
              "sessions",
              "compacted",
              "compactions",
              "manualCompactions"
            ],
            "description": "Additive session counters for one project, harness, day, entrypoint and thread."
          },
          "description": "Session counters."
        },
        "tokens": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day the requests were made."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint or originator that started the sessions."
              },
              "project": {
                "type": "string",
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))(?:[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9._-]+|~(?:\\/[^\\0\\n\\r]*)?|\\/[^\\0\\n\\r]*|unknown)$",
                "description": "The project the sessions ran in: `owner/repo`, a folder under the home directory (`~/...`), an absolute path outside it, or `unknown`."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether the requests came from main conversations or subagents' conversations."
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))",
                "description": "The model the requests went to, as the harness names it."
              },
              "requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Model requests counted."
              },
              "input": {
                "type": "integer",
                "minimum": 0,
                "description": "Input tokens sent without the prompt cache: neither read from it nor written to it."
              },
              "output": {
                "type": "integer",
                "minimum": 0,
                "description": "Output tokens, reasoning included."
              },
              "reasoning": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the output tokens, how many were reasoning."
              },
              "cacheRead": {
                "type": "integer",
                "minimum": 0,
                "description": "Input tokens read from the prompt cache."
              },
              "cacheWrite": {
                "type": "integer",
                "minimum": 0,
                "description": "Input tokens written to the prompt cache."
              },
              "cacheWrite5m": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the cache writes, the tokens written to a cache that lives 5 minutes."
              },
              "cacheWrite1h": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the cache writes, the tokens written to a cache that lives 1 hour; with cacheWrite5m at most cacheWrite, and the rest of unknown lifetime."
              },
              "cacheRewrite": {
                "type": "integer",
                "minimum": 0,
                "description": "Five-minute cache writes 5 to 60 minutes after a request to the same model in the conversation: possible reuse with a longer cache, not guaranteed hits."
              },
              "unsplit": {
                "type": "integer",
                "minimum": 0,
                "description": "Tokens whose split into input, output and cache is unknown, counted in no other counter. Absent means 0."
              },
              "activeSeconds": {
                "type": "integer",
                "minimum": 0,
                "description": "Seconds of work before these requests: each request adds the time since its conversation's previous request when that is at most 300 seconds. Absent means 0."
              }
            },
            "required": [
              "day",
              "harness",
              "via",
              "project",
              "thread",
              "model",
              "requests",
              "input",
              "output",
              "reasoning",
              "cacheRead",
              "cacheWrite",
              "cacheWrite5m",
              "cacheWrite1h",
              "cacheRewrite"
            ],
            "description": "Additive token counters for one project, harness, day, entrypoint, thread and model."
          },
          "description": "Token counters."
        },
        "turns": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day the turns started."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint or originator that started the sessions."
              },
              "project": {
                "type": "string",
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))(?:[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9._-]+|~(?:\\/[^\\0\\n\\r]*)?|\\/[^\\0\\n\\r]*|unknown)$",
                "description": "The project the sessions ran in: `owner/repo`, a folder under the home directory (`~/...`), an absolute path outside it, or `unknown`."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether the turns were in main conversations or subagents' conversations."
              },
              "turns": {
                "type": "integer",
                "minimum": 0,
                "description": "Turns started."
              },
              "interrupted": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many the user interrupted."
              },
              "timed": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many have a measured duration."
              },
              "durationMs": {
                "type": "integer",
                "minimum": 0,
                "description": "The summed duration of the timed turns, in milliseconds."
              },
              "toolCalls": {
                "type": "integer",
                "minimum": 0,
                "description": "Tool calls the model made in those turns."
              },
              "withSubagents": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many started at least one subagent."
              },
              "longer": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0
                },
                "minItems": 10,
                "maxItems": 10,
                "description": "Timed turns by length: entry i counts the turns that ran at least `TURN_LENGTH_SECONDS[i]` seconds (0, 30 s, 1, 2, 5, 10, 20, 30 and 60 minutes, 2 hours), so the first is every timed turn whose length was followed and the entries never rise. Absent when no turn's length was followed."
              },
              "spoke": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many began with a prompt the user wrote themselves, not one an agent wrote in their place. Only these prompts have a tone. Absent means 0."
              },
              "yelled": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many began with a prompt where the user yelled: in capitals, with a swear word or insult, or with a word that says they are fed up, such as \"wtf\" or \"bro\". Absent means 0."
              },
              "shouted": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the yelled prompts, how many were written mostly in capitals. Absent means 0."
              },
              "swore": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the yelled prompts, how many had a swear word or an insult. Absent means 0."
              },
              "thanked": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those turns, how many began with a prompt that said please or thanks. Absent means 0."
              }
            },
            "required": [
              "day",
              "harness",
              "via",
              "project",
              "thread",
              "turns",
              "interrupted",
              "timed",
              "durationMs",
              "toolCalls",
              "withSubagents"
            ],
            "description": "Additive turn counters for one project, harness, day, entrypoint and thread. A turn is one prompt and the work the agent did for it."
          },
          "description": "Turn counters; absent when no harness read reports turns."
        },
        "hours": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The UTC day."
              },
              "hour": {
                "type": "integer",
                "minimum": 0,
                "maximum": 23,
                "description": "The UTC hour of the day, 0 to 23."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether the activity was in main conversations or subagents' conversations."
              },
              "requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Model requests made in that hour."
              },
              "turns": {
                "type": "integer",
                "minimum": 0,
                "description": "Turns started in that hour."
              },
              "activeSeconds": {
                "type": "integer",
                "minimum": 0,
                "description": "Seconds of work in that hour, as token cells count `activeSeconds`; divided by 3,600, how many conversations ran at once on average. Absent means 0."
              }
            },
            "required": ["day", "hour", "harness", "thread", "requests", "turns"],
            "description": "Additive activity counters for one harness, day, hour and thread."
          },
          "description": "Activity by hour of the day; absent when no harness read reports it."
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day of the calls."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether the calls were made in main conversations or subagents' conversations."
              },
              "tool": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
                "description": "The tool: a built-in tool's name, `mcp:<server>` for any tool of an MCP server, or `other` for a name loadsheet does not keep."
              },
              "calls": {
                "type": "integer",
                "minimum": 0,
                "description": "Calls made."
              },
              "unattributedMcp": {
                "type": "integer",
                "minimum": 0,
                "description": "Calls to MCP tools whose server could not be verified."
              }
            },
            "required": ["day", "harness", "thread", "tool", "calls"],
            "description": "Additive tool-call counters for one harness, day, thread and tool."
          },
          "description": "Tool calls by tool; absent when no harness read reports them."
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day of the invocations."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint or originator that started the sessions."
              },
              "project": {
                "type": "string",
                "pattern": "^(?!(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/]))(?:[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9._-]+|~(?:\\/[^\\0\\n\\r]*)?|\\/[^\\0\\n\\r]*|unknown)$",
                "description": "The project the sessions ran in: `owner/repo`, a folder under the home directory (`~/...`), an absolute path outside it, or `unknown`."
              },
              "thread": {
                "enum": ["main", "subagent"],
                "type": "string",
                "description": "Whether the invocations were in main conversations or subagents' conversations."
              },
              "item": {
                "type": "string",
                "pattern": "^skill:(?!\\s*(?:(?:\\/(?:\\.{1,2}(?=\\/))?)+(?:home|Users|var(?:\\/(?:\\.{1,2}(?=\\/))?)+home)(?:\\/(?:\\.{1,2}(?=\\/))?)+|(?:\\/(?:\\.{1,2}(?=\\/))?)+root(?:\\/|$)|[A-Za-z]:[\\\\/])).+$",
                "description": "The skill invoked, `skill:<name>`."
              },
              "calls": {
                "type": "integer",
                "minimum": 0,
                "description": "Invocations, by the model or the user."
              }
            },
            "required": ["day", "harness", "via", "project", "thread", "item", "calls"],
            "description": "Additive skill-invocation counters for one harness, day, via, project, thread and skill."
          },
          "description": "Skill invocations by project; absent when no harness read reports them."
        },
        "limits": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day of the readings."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "windowMinutes": {
                "type": "integer",
                "minimum": 0,
                "description": "The window's length in minutes, such as 300 or 10080; 0 when the harness does not say."
              },
              "usedPercent": {
                "type": "number",
                "minimum": 0,
                "description": "The share of the window used at the latest reading, in percent; absent when there was none."
              },
              "at": {
                "type": "number",
                "minimum": 0,
                "description": "When the latest reading was taken, in seconds since the epoch with millisecond precision; absent with usedPercent."
              },
              "resetsAt": {
                "type": "integer",
                "minimum": 0,
                "description": "When the window resets, as of the latest reading, in seconds since the epoch; absent when unknown."
              },
              "peakUsedPercent": {
                "type": "number",
                "minimum": 0,
                "description": "The highest share used at any reading that day, in percent; absent with usedPercent."
              },
              "reached": {
                "type": "integer",
                "minimum": 0,
                "description": "How many times the limit was reached."
              }
            },
            "required": ["day", "harness", "windowMinutes", "reached"],
            "description": "One harness's rate-limit window on one day: the latest reading of how much of it is used, and how often the limit was hit. A gauge, not a sum: merging two keeps the later reading and the higher peak, and sums `reached`."
          },
          "description": "Rate-limit readings; absent when no harness read reports them."
        },
        "threads": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day of the requests."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint, as a session cell's."
              },
              "project": {
                "type": "string",
                "minLength": 1,
                "description": "The project, as a session cell's."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "A hash of the harness's id for the thread, never the id itself: the same for its subagents."
              },
              "requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Model requests made."
              },
              "tokens": {
                "type": "integer",
                "minimum": 0,
                "description": "Input, output, cache read and cache write tokens, and those whose split is unknown."
              }
            },
            "required": ["day", "harness", "via", "project", "id", "requests", "tokens"],
            "description": "One thread's tokens on one day: a conversation with its subagents, as the harness keeps it apart."
          },
          "description": "Tokens by thread; absent when no harness read keeps its threads apart."
        },
        "titles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "The thread, as a thread cell's `id`."
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "description": "The title, on one line."
              }
            },
            "required": ["harness", "id", "title"],
            "description": "A thread's title, as its harness or T3 Code names it. It stays on the machines that read it."
          },
          "description": "The titles of the threads in `threads` that have one; absent when none has."
        },
        "pulls": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The day the pull requests were opened: GitHub's creation day when it was asked, else the day an agent first linked each one."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness of the agent that first linked them."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The app the agent ran in, such as `t3-code`."
              },
              "project": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9._-]+$",
                "description": "The repository, `owner/repo`."
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "description": "The model of the agent that first linked them, as the harness names it."
              },
              "pulls": {
                "type": "integer",
                "minimum": 0,
                "description": "Pull requests counted."
              },
              "merged": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those, how many were merged."
              },
              "closed": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those, how many were closed without merging."
              },
              "open": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those, how many are still open."
              },
              "stale": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the open ones, how many were last seen open more than 7 days before the scan, with no answer from GitHub since: their state is likely out of date."
              },
              "mergeSeconds": {
                "type": "integer",
                "minimum": 0,
                "description": "The summed time from opening to merging of the merged ones, in seconds."
              },
              "mergedIn1h": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the merged ones, how many merged within an hour of opening."
              },
              "mergedIn1d": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the merged ones, how many merged within a day of opening; includes mergedIn1h."
              },
              "checked": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the pull requests, how many GitHub answered for: the commit counters cover these only."
              },
              "checkedMerged": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the merged ones, how many GitHub answered for: the share of them that is oneShot."
              },
              "commits": {
                "type": "integer",
                "minimum": 0,
                "description": "Commits in the checked pull requests."
              },
              "commitsAfterOpen": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those commits, how many were written after the pull request was opened, by their author date."
              },
              "oneShot": {
                "type": "integer",
                "minimum": 0,
                "description": "Of the checked pull requests that were merged, how many got no commit written after they were opened."
              }
            },
            "required": [
              "day",
              "harness",
              "via",
              "project",
              "model",
              "pulls",
              "merged",
              "closed",
              "open",
              "stale",
              "mergeSeconds",
              "mergedIn1h",
              "mergedIn1d",
              "checked",
              "checkedMerged",
              "commits",
              "commitsAfterOpen",
              "oneShot"
            ],
            "description": "Additive counters for the pull requests agents opened in one repository, harness, entrypoint, model and day, each counted once, under the agent that first linked it. States are as last known: GitHub's when it was asked, else the app's last copy."
          },
          "description": "Pull requests agents opened; absent when no app read reports them."
        },
        "activity": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "The thread, as a thread cell's `id`."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint, as a session cell's."
              },
              "agent": {
                "type": "string",
                "minLength": 1,
                "description": "A hash of the subagent's own id when a subagent made the requests; absent for the thread's main conversation."
              },
              "project": {
                "type": "string",
                "minLength": 1,
                "description": "The project, as a session cell's."
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "description": "The model, as the harness names it."
              },
              "runs": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000
                },
                "description": "Runs of requests at most 300 seconds apart, oldest first, flattened: the first request's time, the last request's time, both in seconds since the epoch, and the requests made."
              }
            },
            "required": ["harness", "id", "via", "project", "model", "runs"],
            "description": "One conversation's work in the last three days of a scan, as runs of model requests: what the Activity page draws."
          },
          "description": "Each conversation's runs of requests in the scan's last three days; absent when no harness read times its requests. A Scan keeps only those days, and a Report the runs of its Scans."
        },
        "agents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "The thread, as a thread cell's `id`."
              },
              "agent": {
                "type": "string",
                "minLength": 1,
                "description": "The subagent, as an activity cell's `agent`."
              },
              "type": {
                "type": "string",
                "minLength": 1,
                "description": "Its type, such as `Explore`."
              }
            },
            "required": ["harness", "id", "agent", "type"],
            "description": "A subagent whose type is known."
          },
          "description": "Known types of subagents in `activity` and of their openers."
        },
        "agentTree": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "The thread, as a thread cell's `id`."
              },
              "agent": {
                "type": "string",
                "minLength": 1,
                "description": "The subagent, as an activity cell's `agent`."
              },
              "parent": {
                "type": "string",
                "minLength": 1,
                "description": "The subagent that opened it, as that one's `agent`; absent when the thread itself opened it, or when the transcript does not say."
              }
            },
            "required": ["harness", "id", "agent"],
            "description": "A node in a thread's known subagent ancestry."
          },
          "description": "Known subagent ancestry. Each parent names another node of the same harness and thread."
        },
        "subagents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The UTC day."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint, as a session cell's."
              },
              "type": {
                "type": "string",
                "minLength": 1,
                "description": "The subagent's type, such as `Explore`, as the call that started it named it."
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "description": "The model, as the harness names it."
              },
              "requests": {
                "type": "integer",
                "minimum": 0,
                "description": "Requests made."
              },
              "context": {
                "type": "integer",
                "minimum": 0,
                "description": "Input and cache tokens, summed over the requests: the prompts' size."
              }
            },
            "required": ["day", "harness", "via", "type", "model", "requests", "context"],
            "description": "Subagent requests of one type and model, on the day of each run's first request, with their prompts' size: what the oversized-subagent rule judges."
          },
          "description": "Subagent requests by type and model in the scan's window; absent when no subagent's type is known. A Scan's alone, for the rules: a Report leaves it out."
        },
        "wakes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The UTC day the notification was written."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness id."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint, as a session cell's."
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "The thread, as a thread cell's `id`."
              },
              "kind": {
                "type": "string",
                "minLength": 1,
                "description": "What wrote it: pull, schedule, agent, relay, delegate, task or cancelled."
              },
              "wakes": {
                "type": "integer",
                "minimum": 0,
                "description": "Turns it started."
              }
            },
            "required": ["day", "harness", "via", "id", "kind", "wakes"],
            "description": "Turns a notification of one kind started in one thread on a day, rather than the user: what the pull-waiting rule judges."
          },
          "description": "Turns a notification started, by thread and kind, in the scan's window; absent when no harness read reports them. A Scan's alone, for the rules."
        },
        "pullSpend": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date",
                "description": "The UTC day the pull requests were opened."
              },
              "harness": {
                "type": "string",
                "minLength": 1,
                "description": "The harness of the thread that linked them."
              },
              "via": {
                "type": "string",
                "minLength": 1,
                "description": "The entrypoint, as a session cell's."
              },
              "pulls": {
                "type": "integer",
                "minimum": 0,
                "description": "Pull requests counted."
              },
              "joined": {
                "type": "integer",
                "minimum": 0,
                "description": "Of those, the ones whose thread was found with its runs and prompts."
              },
              "tokens": {
                "type": "integer",
                "minimum": 0,
                "description": "Tokens those threads spent after the link, before the user's next prompt."
              }
            },
            "required": ["day", "harness", "via", "pulls", "joined", "tokens"],
            "description": "The pull requests agents opened on a day and what their threads spent after linking them: the pull-waiting rule's evidence."
          },
          "description": "Pull requests by day with the spend after their link, in the scan's window; absent when no store reports them. A Scan's alone, for the rules."
        }
      },
      "required": ["sessions", "tokens"],
      "description": "Sessions and tokens per project, on every day the machine has a record of, not only the window's; absent when no harness read reports them."
    }
  },
  "required": [
    "schema",
    "tool",
    "machine",
    "scannedAt",
    "window",
    "coverage",
    "items",
    "sessions",
    "cells"
  ],
  "description": "One machine's counters for a window: what is installed and how it was used, with no text but thread titles. Scans of the same machine merge by summing their counters; Scans of different machines stay separate, and a Report is built from the list."
}
