{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:component-trace-gap:v1",
  "title": "Component Trace Gap V1",
  "description": "Generation-bound evidence that observations are unavailable.",
  "x-dia-workflow": "project",
  "x-dia-status": "accepted",
  "x-dia-basis": ["doc/project/40-proposals/086-component-communication-observation-and-trace-sessions.md"],
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "schema/v", "observation/generation", "requested/cursor", "earliest/available-cursor", "latest/available-cursor", "reason", "boundary/filters"],
  "properties": {
    "schema": {"const": "component-trace-gap.v1"},
    "schema/v": {"const": 1},
    "observation/generation": {"$ref": "#/$defs/ref"},
    "requested/cursor": {"$ref": "#/$defs/cursor"},
    "earliest/available-cursor": {"$ref": "#/$defs/cursor"},
    "latest/available-cursor": {"$ref": "#/$defs/cursor"},
    "known/lost-count": {"$ref": "#/$defs/cursor"},
    "reason": {"enum": ["buffer-evicted", "subscriber-lagged", "process-restarted", "recorder-interrupted", "policy-transition-unavailable", "context-unavailable"]},
    "boundary/filters": {"type": "array", "maxItems": 512, "uniqueItems": true, "items": {"$ref": "#/$defs/ref"}}
  },
  "$defs": {
    "ref": {"type": "string", "minLength": 1, "maxLength": 512, "pattern": "^[ -~]+$"},
    "cursor": {"type": "integer", "minimum": 0, "maximum": 9007199254740991}
  }
}
