{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://standards.rootblocks.com/schemas/slices/slice.v1.schema.json",
  "title": "RootBlocks Slice v1",
  "description": "Machine-readable contract for the SliceOps slice (P1: 1 slice = 1 chat = 1 PR). Carries the slice DAG via depends_on (P3: Stage is computed from this, never declared). Token band rangos are adopter configuration per P8 — only the band enum is normative here. Ported per DEC-007 (Standard v2) / ARC-002 §5 row 2. additionalProperties is true: adopters add operational fields (owner, createdAt, mergedAt, pr, notes) under their own scope.",
  "type": "object",
  "additionalProperties": true,
  "required": ["id", "slug", "section", "depends_on", "band", "status"],
  "properties": {
    "id": {
      "$ref": "#/$defs/sliceId"
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]*$",
      "maxLength": 80
    },
    "section": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "depends_on": {
      "description": "Slice DAG edges (P3). May be empty. Self-reference and cycles are rejected by process tooling (build-slice-dag), not this schema.",
      "type": "array",
      "items": { "$ref": "#/$defs/sliceId" }
    },
    "band": {
      "description": "Token band. The numeric ranges per band are adopter configuration (P8 / FND-003), not fixed by this schema.",
      "enum": ["XS", "S", "M", "L", "XL"]
    },
    "status": {
      "enum": ["pending", "in-progress", "review", "merged", "rolled-back", "cancelled"]
    },
    "auditStatus": {
      "description": "Audit plane state (P2), independent of delivery status. Adopters may restrict the allowed subset by audit policy.",
      "enum": ["pending", "ack", "warn", "block"]
    }
  },
  "$defs": {
    "sliceId": {
      "type": "string",
      "pattern": "^BL-[0-9]{2,}(\\.SEC-[0-9]{2,})?\\.SL-[0-9]{3}[a-z]?$"
    }
  }
}
