{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sediment.so/schemas/facts/session-commit-observation/v2.json",
  "title": "SessionCommitObservation",
  "description": "The first observed Git-note Session-to-commit edge.",
  "type": "object",
  "properties": {
    "schema_version": {
      "const": 1,
      "type": "integer",
      "description": "The Git-note observation Fact contract version. Fixed at 1."
    },
    "observation_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "Stable id for this Session-to-commit observation."
    },
    "org_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The deployment's tenant id, normalized. Bound to the server."
    },
    "repo": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The non-empty `owner/repo` that owns the observed commit, lowercased."
    },
    "commit_sha": {
      "type": "string",
      "description": "Full-length commit sha, lowercased."
    },
    "session_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The coding-agent session this belongs to (ADR 0002)."
    },
    "source_push_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The Push that triggered this Git-note observation."
    },
    "captured_at": {
      "type": "string",
      "format": "date-time",
      "description": "When Sediment stored the fact, stamped server-side. Windows and ordering anchor on this, never on a client clock."
    }
  },
  "additionalProperties": false,
  "required": [
    "schema_version",
    "observation_id",
    "org_id",
    "repo",
    "commit_sha",
    "session_id",
    "source_push_id",
    "captured_at"
  ]
}
