{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://studybrave.com/schemas/reckoning/0.1.0.json",
  "title": "Reckoning",
  "description": "Artifact produced by P-002. One week of prediction scored against outcome.",
  "type": "object",
  "required": [
    "artifact",
    "protocol",
    "version",
    "week",
    "closed",
    "scores",
    "patterns",
    "commitments"
  ],
  "additionalProperties": false,
  "properties": {
    "artifact": {
      "const": "reckoning"
    },
    "protocol": {
      "const": "P-002"
    },
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "week": {
      "type": "integer",
      "minimum": 1,
      "description": "Sequence number since the subject's first Reckoning."
    },
    "completed_at": {
      "type": "string",
      "description": "ISO 8601. Supplied by the runtime, not the model."
    },
    "adversary_mode": {
      "type": "boolean",
      "default": false
    },
    "closed": {
      "type": "array",
      "description": "Last week's commitments, scored. Empty in week one.",
      "items": {
        "type": "object",
        "required": [
          "what",
          "outcome"
        ],
        "additionalProperties": false,
        "properties": {
          "what": {
            "type": "string"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "done",
              "partial",
              "not-started"
            ]
          },
          "predicted_minutes": {
            "type": "number",
            "minimum": 0
          },
          "actual_minutes": {
            "type": "number",
            "minimum": 0
          },
          "time_estimated": {
            "type": "boolean",
            "description": "True when actual_minutes was recalled rather than tracked. Weak data, recorded as weak."
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "what_happened": {
            "type": "string",
            "description": "Verbatim, one sentence. Only for partial or not-started."
          },
          "carried_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "uncommitted_work": {
      "type": "array",
      "description": "Significant work done that was never committed to. Displacement lives here.",
      "items": {
        "type": "object",
        "required": [
          "what"
        ],
        "additionalProperties": false,
        "properties": {
          "what": {
            "type": "string"
          },
          "actual_minutes": {
            "type": "number",
            "minimum": 0
          },
          "displaced": {
            "type": "string",
            "description": "Which commitment it took the hours from, if identifiable."
          }
        }
      }
    },
    "scores": {
      "type": "object",
      "required": [
        "time_ratio_median",
        "completion_rate",
        "confidence_error"
      ],
      "additionalProperties": false,
      "properties": {
        "time_ratio_median": {
          "type": [
            "number",
            "null"
          ],
          "description": "Median of actual/predicted across scorable items. Null in week one."
        },
        "time_ratio_items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "what",
              "ratio"
            ],
            "additionalProperties": false,
            "properties": {
              "what": {
                "type": "string"
              },
              "ratio": {
                "type": "number"
              }
            }
          }
        },
        "completion_rate": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1,
          "description": "done / committed. Partial counts as zero, deliberately."
        },
        "confidence_error": {
          "type": [
            "number",
            "null"
          ],
          "minimum": -1,
          "maximum": 1,
          "description": "Mean of (confidence - outcome)/100. Positive is overconfident."
        },
        "direction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "improving",
            "flat",
            "worsening",
            null
          ],
          "description": "Available from week three. The direction is the point, not the value."
        },
        "padding_suspected": {
          "type": "boolean",
          "description": "Set when ratios sit at or below 1.0 from the start, which indicates inflated predictions rather than accuracy."
        }
      }
    },
    "patterns": {
      "type": "array",
      "maxItems": 3,
      "description": "At most three. More than three is noise and will be acted on by no one.",
      "items": {
        "type": "object",
        "required": [
          "pattern",
          "evidence"
        ],
        "additionalProperties": false,
        "properties": {
          "pattern": {
            "type": "string"
          },
          "evidence": {
            "type": "string",
            "description": "Which weeks, which items. A pattern without dates is an opinion."
          },
          "classification": {
            "type": "string",
            "enum": [
              "circumstance",
              "structure"
            ],
            "description": "Once is circumstance. Three times is structure."
          },
          "occurrences": {
            "type": "integer",
            "minimum": 1
          }
        }
      }
    },
    "avoided": {
      "type": "array",
      "description": "Items carried two or more weeks without progress.",
      "items": {
        "type": "object",
        "required": [
          "what",
          "carried_count"
        ],
        "additionalProperties": false,
        "properties": {
          "what": {
            "type": "string"
          },
          "carried_count": {
            "type": "integer",
            "minimum": 2
          },
          "stated_reason_for_survival": {
            "type": "string"
          },
          "drop_condition": {
            "type": "string",
            "description": "What would have to be true for it to be dropped entirely."
          }
        }
      }
    },
    "commitments": {
      "type": "array",
      "description": "Next week. An item missing any required field is not a commitment.",
      "items": {
        "type": "object",
        "required": [
          "what",
          "predicted_minutes",
          "when",
          "confidence"
        ],
        "additionalProperties": false,
        "properties": {
          "what": {
            "type": "string",
            "description": "Specific enough that 'done' is unambiguous."
          },
          "predicted_minutes": {
            "type": "number",
            "minimum": 1
          },
          "when": {
            "type": "string",
            "description": "A specific window, from the Self Map attention ledger where possible."
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "carried": {
            "type": "boolean"
          },
          "carried_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "budget": {
      "type": "object",
      "description": "Committed load against reality.",
      "additionalProperties": false,
      "properties": {
        "committed_minutes": {
          "type": "number",
          "minimum": 0
        },
        "available_minutes": {
          "type": "number",
          "minimum": 0,
          "description": "From the Self Map constraints."
        },
        "adjusted_minutes": {
          "type": "number",
          "description": "committed_minutes multiplied by the subject's own median time ratio. The outside view, built from their record."
        },
        "over_budget": {
          "type": "boolean"
        }
      }
    },
    "summary": {
      "type": "string",
      "description": "Short, plain. No encouragement."
    }
  }
}
