{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/common.json",
  "title": "Narrative Spec shared definitions",
  "$defs": {
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "Immutable within a work. The display name may change; this may not."
    },
    "id": {
      "type": "string",
      "pattern": "^(work|character|world|faction|ruleset|location|relationship|event|audience|chapter|scene):[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "type:slug, unique within a work. e.g. character:mara-tidecaller"
    },
    "ref": {
      "type": "string",
      "pattern": "^(work|character|world|faction|ruleset|location|relationship|event|audience|chapter|scene):[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "A typed reference to another object. Never an embedded copy."
    },
    "specVersion": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$",
      "description": "The spec version this object is written against, as semver with an optional prerelease suffix. A work pins one major."
    },
    "status": {
      "enum": [
        "stub",
        "draft",
        "canon"
      ],
      "default": "stub",
      "description": "canon is writer-asserted. Council may propose patches; it never flips this."
    },
    "extensions": {
      "type": "object",
      "description": "Medium overlays and vendor data. Known namespaces (novel, screen, game, graphic) validate against overlay schemas; any other namespace is opaque JSON the core validator ignores. Shadowing a reserved core field name here is an error."
    }
  }
}
