{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.radiantnull.com/core-architectures-chimeric-prototype-current-pack-v0.1/strategy-canvas-system-v0.2/strategy-canvas.schema.json",
  "title": "Strategy Canvas collaboration state",
  "description": "Closed canonical state with an explicit namespace for compatible collaboration extensions.",
  "type": "object",
  "required": ["schemaVersion", "meta", "method", "scale", "dimensions", "view", "lifecycle", "extensions"],
  "properties": {
    "schemaVersion": { "const": "strategy-canvas/2.0" },
    "meta": { "$ref": "#/$defs/meta" },
    "method": { "$ref": "#/$defs/method" },
    "scale": { "$ref": "#/$defs/scale" },
    "dimensions": { "type": "array", "minItems": 1, "maxItems": 24, "items": { "$ref": "#/$defs/dimension" } },
    "view": { "$ref": "#/$defs/view" },
    "lifecycle": { "$ref": "#/$defs/lifecycle" },
    "extensions": { "$ref": "#/$defs/extensions" }
  },
  "additionalProperties": false,
  "$defs": {
    "id": { "type": "string", "minLength": 1, "maxLength": 96, "pattern": "^[a-z][a-z0-9-]*$" },
    "meta": {
      "type": "object",
      "required": ["id", "title", "subtitle", "decisionObject", "horizon", "revision"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "title": { "type": "string", "minLength": 1, "maxLength": 160 },
        "subtitle": { "type": "string", "maxLength": 360 },
        "decisionObject": { "type": "string", "maxLength": 240 },
        "horizon": { "type": "string", "maxLength": 160 },
        "revision": { "type": "integer", "minimum": 1 }
      },
      "additionalProperties": false
    },
    "method": {
      "type": "object",
      "required": ["posture", "scoreMeaning", "weightMeaning"],
      "properties": {
        "posture": { "enum": ["internal-collaboration", "market-strategy"] },
        "scoreMeaning": { "type": "string", "minLength": 1, "maxLength": 500 },
        "weightMeaning": { "type": "string", "minLength": 1, "maxLength": 500 }
      },
      "additionalProperties": false
    },
    "scale": {
      "type": "object",
      "required": ["min", "max", "step", "lowLabel", "middleLabel", "highLabel"],
      "properties": {
        "min": { "type": "number", "minimum": 0, "maximum": 100 },
        "max": { "type": "number", "exclusiveMinimum": 0, "maximum": 100 },
        "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 10 },
        "lowLabel": { "type": "string", "minLength": 1, "maxLength": 160 },
        "middleLabel": { "type": "string", "minLength": 1, "maxLength": 160 },
        "highLabel": { "type": "string", "minLength": 1, "maxLength": 160 }
      },
      "additionalProperties": false
    },
    "anchors": {
      "type": "object",
      "required": ["low", "middle", "high"],
      "properties": {
        "low": { "type": "string", "minLength": 1, "maxLength": 600 },
        "middle": { "type": "string", "minLength": 1, "maxLength": 600 },
        "high": { "type": "string", "minLength": 1, "maxLength": 600 }
      },
      "additionalProperties": false
    },
    "scores": {
      "type": "object",
      "required": ["current", "goodEnough", "desired"],
      "properties": {
        "current": { "type": "number" },
        "goodEnough": { "type": "number" },
        "desired": { "type": "number" }
      },
      "additionalProperties": false
    },
    "dimension": {
      "type": "object",
      "required": ["id", "label", "definition", "anchors", "scores", "consequenceWeight", "action", "evidenceBasis"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "label": { "type": "string", "minLength": 1, "maxLength": 120 },
        "definition": { "type": "string", "minLength": 1, "maxLength": 900 },
        "anchors": { "$ref": "#/$defs/anchors" },
        "scores": { "$ref": "#/$defs/scores" },
        "consequenceWeight": { "type": "integer", "minimum": 0, "maximum": 5 },
        "action": { "enum": ["eliminate", "reduce", "raise", "create", "hold", "open"] },
        "evidenceBasis": { "type": "string", "maxLength": 1200 }
      },
      "additionalProperties": false
    },
    "view": {
      "type": "object",
      "required": ["dimensionOrder", "selectedDimensionId", "mode"],
      "properties": {
        "dimensionOrder": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true },
        "selectedDimensionId": { "$ref": "#/$defs/id" },
        "mode": { "enum": ["working", "presentation"] }
      },
      "additionalProperties": false
    },
    "reviewedSnapshot": {
      "type": "object",
      "required": ["schemaVersion", "meta", "method", "scale", "dimensions", "view", "extensions"],
      "properties": {
        "schemaVersion": { "const": "strategy-canvas/2.0" },
        "meta": { "$ref": "#/$defs/meta" },
        "method": { "$ref": "#/$defs/method" },
        "scale": { "$ref": "#/$defs/scale" },
        "dimensions": { "type": "array", "minItems": 1, "maxItems": 24, "items": { "$ref": "#/$defs/dimension" } },
        "view": { "$ref": "#/$defs/view" },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "lifecycle": {
      "type": "object",
      "required": ["status", "reviewedSnapshot", "reviewedBy", "reviewNote", "reviewedAt"],
      "properties": {
        "status": { "enum": ["working", "reviewed"] },
        "reviewedSnapshot": { "oneOf": [{ "$ref": "#/$defs/reviewedSnapshot" }, { "type": "null" }] },
        "reviewedBy": { "type": "string", "maxLength": 160 },
        "reviewNote": { "type": "string", "maxLength": 1200 },
        "reviewedAt": { "type": "string", "maxLength": 64 }
      },
      "additionalProperties": false
    },
    "extensions": {
      "type": "object",
      "properties": {
        "contextCanvas": { "$ref": "#/$defs/contextCanvasExtension" },
        "narrativeProjection": { "type": "object" }
      },
      "patternProperties": { "^[a-z][a-zA-Z0-9]*$": { "type": "object" } },
      "additionalProperties": false
    },
    "contextCanvasExtension": {
      "type": "object",
      "required": ["collaboration", "aiCollaboration"],
      "properties": {
        "collaboration": { "$ref": "#/$defs/collaborationExtension" },
        "aiCollaboration": { "$ref": "#/$defs/aiCollaborationExtension" }
      },
      "additionalProperties": false
    },
    "collaborationExtension": {
      "type": "object",
      "required": ["session", "participants", "rounds", "ballots", "scenarios", "acceptedScenario", "notes", "reviewedSnapshots", "events"],
      "properties": {
        "session": { "$ref": "#/$defs/session" },
        "participants": { "type": "array", "items": { "$ref": "#/$defs/participant" } },
        "rounds": { "type": "array", "items": { "$ref": "#/$defs/round" } },
        "ballots": { "$ref": "#/$defs/ballotLedger" },
        "scenarios": { "type": "array", "items": { "$ref": "#/$defs/scenario" } },
        "acceptedScenario": { "oneOf": [{ "$ref": "#/$defs/acceptedScenario" }, { "type": "null" }] },
        "notes": { "type": "array", "items": { "$ref": "#/$defs/note" } },
        "reviewedSnapshots": { "type": "array", "items": { "$ref": "#/$defs/collaborationSnapshot" } },
        "events": { "type": "array", "items": { "$ref": "#/$defs/event" } }
      },
      "additionalProperties": false
    },
    "session": {
      "type": "object",
      "required": ["phase", "decisionReceipt", "includeReviewedStateInAI"],
      "properties": {
        "phase": { "enum": ["orient", "define", "vote", "reveal", "shape", "act", "review", "handoff"] },
        "decisionReceipt": { "type": "string", "maxLength": 4000 },
        "includeReviewedStateInAI": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "participant": {
      "type": "object",
      "required": ["id", "alias", "role"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "alias": { "type": "string", "minLength": 1, "maxLength": 96 },
        "role": { "type": "string", "maxLength": 120 }
      },
      "additionalProperties": false
    },
    "round": {
      "type": "object",
      "required": ["id", "label", "target", "status", "participantIds", "createdAt", "revealedAt"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "label": { "type": "string", "minLength": 1, "maxLength": 160 },
        "target": { "enum": ["current", "goodEnough", "desired"] },
        "status": { "enum": ["collecting", "revealed"] },
        "participantIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true },
        "createdAt": { "type": "string", "maxLength": 64 },
        "revealedAt": { "type": ["string", "null"], "maxLength": 64 },
        "sourceScenarioId": { "$ref": "#/$defs/id" },
        "proposalValues": { "$ref": "#/$defs/valueMap" }
      },
      "additionalProperties": false
    },
    "valueMap": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/id" },
      "additionalProperties": { "type": "number" }
    },
    "ballotEntry": {
      "type": "object",
      "required": ["participantId", "values", "status", "submittedAt", "channel"],
      "properties": {
        "participantId": { "$ref": "#/$defs/id" },
        "values": { "$ref": "#/$defs/valueMap" },
        "status": { "const": "submitted" },
        "submittedAt": { "type": "string", "maxLength": 64 },
        "channel": { "const": "human-ballot" }
      },
      "additionalProperties": false
    },
    "ballotLedger": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/id" },
      "additionalProperties": {
        "type": "object",
        "propertyNames": { "$ref": "#/$defs/id" },
        "additionalProperties": { "$ref": "#/$defs/ballotEntry" }
      }
    },
    "aggregateReading": {
      "type": "object",
      "required": ["count", "mean", "median", "min", "max", "range", "missing", "values"],
      "properties": {
        "count": { "type": "integer", "minimum": 0 },
        "mean": { "type": ["number", "null"] },
        "median": { "type": ["number", "null"] },
        "min": { "type": ["number", "null"] },
        "max": { "type": ["number", "null"] },
        "range": { "type": ["number", "null"] },
        "missing": { "type": "integer", "minimum": 0 },
        "values": { "type": "array", "items": { "type": "number" } }
      },
      "additionalProperties": false
    },
    "note": {
      "type": "object",
      "required": ["id", "dimensionId", "roundId", "type", "author", "body", "standing", "createdAt"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "dimensionId": { "type": ["string", "null"], "maxLength": 96 },
        "roundId": { "type": ["string", "null"], "maxLength": 96 },
        "type": { "enum": ["evidence", "observation", "assumption", "question", "dissent", "decision", "follow-up", "ai-proposal"] },
        "author": { "type": "string", "minLength": 1, "maxLength": 120 },
        "body": { "type": "string", "minLength": 1, "maxLength": 4000 },
        "standing": { "enum": ["human-authored note", "AI-attributed proposal"] },
        "createdAt": { "type": "string", "maxLength": 64 }
      },
      "additionalProperties": false
    },
    "scenario": {
      "type": "object",
      "required": ["id", "label", "target", "sourceRoundId", "values", "status", "createdAt"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "label": { "type": "string", "minLength": 1, "maxLength": 120 },
        "target": { "enum": ["current", "goodEnough", "desired"] },
        "sourceRoundId": { "$ref": "#/$defs/id" },
        "values": { "$ref": "#/$defs/valueMap" },
        "status": { "const": "working" },
        "createdAt": { "type": "string", "maxLength": 64 }
      },
      "additionalProperties": false
    },
    "acceptedScenario": {
      "type": "object",
      "required": ["id", "label", "target", "sourceRoundId", "values", "status", "createdAt", "acceptedAt", "standing"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "label": { "type": "string", "minLength": 1, "maxLength": 120 },
        "target": { "enum": ["current", "goodEnough", "desired"] },
        "sourceRoundId": { "$ref": "#/$defs/id" },
        "values": { "$ref": "#/$defs/valueMap" },
        "status": { "const": "carried-to-review" },
        "createdAt": { "type": "string", "maxLength": 64 },
        "acceptedAt": { "type": "string", "maxLength": 64 },
        "standing": { "const": "facilitated working scenario" }
      },
      "additionalProperties": false
    },
    "collaborationSnapshot": {
      "type": "object",
      "required": ["id", "reviewedAt", "reviewedBy", "receipt", "dimensionIds", "roundId", "aggregates", "scenario", "noteIds"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "reviewedAt": { "type": "string", "maxLength": 64 },
        "reviewedBy": { "type": "string", "maxLength": 160 },
        "receipt": { "type": "string", "maxLength": 4000 },
        "dimensionIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true },
        "roundId": { "type": ["string", "null"], "maxLength": 96 },
        "aggregates": { "type": "object", "propertyNames": { "$ref": "#/$defs/id" }, "additionalProperties": { "$ref": "#/$defs/aggregateReading" } },
        "scenario": { "oneOf": [{ "$ref": "#/$defs/acceptedScenario" }, { "type": "null" }] },
        "noteIds": { "type": "array", "items": { "$ref": "#/$defs/id" }, "uniqueItems": true }
      },
      "additionalProperties": false
    },
    "event": {
      "type": "object",
      "required": ["id", "type", "at"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "type": { "type": "string", "minLength": 1, "maxLength": 120 },
        "at": { "type": "string", "maxLength": 64 }
      },
      "additionalProperties": false
    },
    "aiCollaborationExtension": {
      "type": "object",
      "required": ["promptPreparedAt", "posture", "proposals", "proposalNote", "standing"],
      "properties": {
        "promptPreparedAt": { "type": ["string", "null"], "maxLength": 64 },
        "posture": { "enum": ["research", "facilitation", "loop", "cross-platform"] },
        "proposals": { "$ref": "#/$defs/valueMap" },
        "proposalNote": { "type": "string", "maxLength": 4000 },
        "standing": { "const": "AI-attributed proposal" },
        "networkPolicy": { "const": "local-only" },
        "consentScope": { "type": "array", "items": { "enum": ["dimensions", "reviewed-scores", "aggregates", "notes", "evidence-bases", "scenarios"] }, "uniqueItems": true },
        "reviewedRevision": { "type": ["integer", "null"], "minimum": 1 },
        "shadowRounds": { "type": "array", "items": { "$ref": "#/$defs/aiShadowRound" } }
      },
      "additionalProperties": false
    },
    "aiShadowRound": {
      "type": "object",
      "required": ["id", "sourceRoundId", "promptPacket", "standing", "includedInHumanAggregate", "createdAt"],
      "properties": {
        "id": { "$ref": "#/$defs/id" },
        "sourceRoundId": { "$ref": "#/$defs/id" },
        "promptPacket": { "type": "object" },
        "standing": { "const": "AI shadow round" },
        "includedInHumanAggregate": { "const": false },
        "createdAt": { "type": "string", "maxLength": 64 }
      },
      "additionalProperties": false
    }
  }
}
