{
  "$defs": {
    "ArtefactAudience": {
      "description": "Audience.",
      "oneOf": [
        {
          "const": "internal",
          "description": "Internal-only.",
          "type": "string"
        },
        {
          "const": "customer",
          "description": "External / customer-facing.",
          "type": "string"
        },
        {
          "const": "public",
          "description": "Public (open-source / website).",
          "type": "string"
        }
      ]
    },
    "ArtefactStatus": {
      "description": "Lifecycle.",
      "oneOf": [
        {
          "enum": [
            "draft",
            "published",
            "archived"
          ],
          "type": "string"
        },
        {
          "const": "stale",
          "description": "Stale — past review-cadence.",
          "type": "string"
        },
        {
          "const": "superseded",
          "description": "Superseded by a newer artefact.",
          "type": "string"
        }
      ]
    },
    "Confidentiality": {
      "description": "Cross-cutting confidentiality classification used across privacy,\nsecurity, knowledge, IR pillars. Default rendering rule: `corpospec-report`\nexcludes `Restricted | BoardOnly | InvestorOnly` records from public output\nunless an explicit audience parameter overrides. See BDR 0076 §1.",
      "oneOf": [
        {
          "const": "public",
          "description": "Safe to publish anywhere.",
          "type": "string"
        },
        {
          "const": "customer",
          "description": "Visible to customers under standard ToS.",
          "type": "string"
        },
        {
          "const": "internal",
          "description": "Employees and contractors only.",
          "type": "string"
        },
        {
          "const": "restricted",
          "description": "Need-to-know subset of internal.",
          "type": "string"
        },
        {
          "const": "board_only",
          "description": "Board members and direct staff.",
          "type": "string"
        },
        {
          "const": "investor_only",
          "description": "Existing investors + prospective with NDA.",
          "type": "string"
        }
      ]
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "KnowledgeKind": {
      "description": "Artefact kind.",
      "oneOf": [
        {
          "const": "faq",
          "description": "Frequently-asked questions list.",
          "type": "string"
        },
        {
          "const": "tutorial",
          "description": "Step-by-step tutorial.",
          "type": "string"
        },
        {
          "const": "reference",
          "description": "Reference / explanation.",
          "type": "string"
        },
        {
          "const": "architecture",
          "description": "Architecture / design doc.",
          "type": "string"
        },
        {
          "const": "decision_log",
          "description": "Decision log (lightweight — heavyweight goes to BDR).",
          "type": "string"
        },
        {
          "const": "glossary",
          "description": "Glossary / vocabulary entry.",
          "type": "string"
        },
        {
          "const": "onboarding",
          "description": "Onboarding doc.",
          "type": "string"
        },
        {
          "const": "concept",
          "description": "Concept / mental-model overview.",
          "type": "string"
        },
        {
          "const": "postmortem",
          "description": "Postmortem (lessons-learned write-up).",
          "type": "string"
        },
        {
          "const": "journal_entry",
          "description": "Internal blog / journal entry.",
          "type": "string"
        }
      ]
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/knowledge-artefact.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Knowledge-artefact record.",
  "properties": {
    "audience": {
      "$ref": "#/$defs/ArtefactAudience"
    },
    "body_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the body artefact (Markdown / Notion / wiki)."
    },
    "confidentiality": {
      "$ref": "#/$defs/Confidentiality"
    },
    "contributors": {
      "description": "Co-maintainers.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "created_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "entity": {
      "$ref": "#/$defs/PathRef"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "kind": {
      "$ref": "#/$defs/KnowledgeKind"
    },
    "last_reviewed": {
      "$ref": "#/$defs/IsoDate"
    },
    "next_review_due": {
      "$ref": "#/$defs/IsoDate"
    },
    "owner": {
      "$ref": "#/$defs/PathRef"
    },
    "references": {
      "description": "Cross-references to authoritative pillars.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "review_cadence": {
      "description": "Review-cadence ISO 8601 duration.",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/ArtefactStatus"
    },
    "summary": {
      "description": "Short summary / TL;DR.",
      "type": "string"
    },
    "supersedes": {
      "description": "PathRefs to predecessor artefacts, in chronological order.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "tags": {
      "description": "Free-form search tags.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "title": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "entity",
    "kind",
    "status",
    "audience",
    "title",
    "summary",
    "body_ref",
    "owner",
    "created_at",
    "last_reviewed",
    "review_cadence",
    "next_review_due",
    "confidentiality"
  ],
  "title": "KnowledgeArtefact",
  "type": "object",
  "x-corpospec-pillar": "knowledge"
}