{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/DY-2026/GameDesignOS/main/contracts/project-workspace.schema.json",
  "title": "GameDesignOS Project Workspace",
  "description": "Workspace manifest contract for game.designos.yaml. Workspace schema 0.8.0 remains supported; schema 1.0.0 is the Project-Ready layout.",
  "type": "object",
  "required": ["schema_version", "workspace_type", "project", "designos", "assets", "rules"],
  "additionalProperties": false,
  "properties": {
    "schema_version": {"type": "string", "enum": ["0.8.0", "1.0.0"]},
    "workspace_type": {"type": "string", "const": "gamedesignos-project"},
    "project": {
      "type": "object",
      "required": ["id", "title", "codename", "status", "visibility", "owner"],
      "additionalProperties": false,
      "properties": {
        "id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"},
        "title": {"type": "string", "minLength": 1},
        "codename": {"type": "string", "minLength": 1},
        "status": {"enum": ["concept", "prototype", "demo", "vertical-slice", "production", "paused", "archived"]},
        "visibility": {"enum": ["private", "public-synthetic", "public-cleared"]},
        "owner": {"type": "string", "minLength": 1},
        "target_platforms": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
        "tags": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
      }
    },
    "designos": {
      "type": "object",
      "required": ["version", "public_base_repo", "private_overlay"],
      "additionalProperties": false,
      "properties": {
        "version": {"type": "string", "enum": ["0.8.0", "0.9.0", "1.0.0", "1.1.0", "1.2.0", "1.3.0.dev0"]},
        "public_base_repo": {"type": "string", "const": "DY-2026/GameDesignOS"},
        "private_overlay": {"type": "boolean"}
      }
    },
    "assets": {
      "type": "object",
      "required": ["index", "inbox_dir"],
      "additionalProperties": false,
      "properties": {
        "index": {"type": "string", "minLength": 1},
        "inbox_dir": {"type": "string", "minLength": 1},
        "concept_dir": {"type": "string", "minLength": 1},
        "evidence_dir": {"type": "string", "minLength": 1},
        "analysis_dir": {"type": "string", "minLength": 1},
        "proposals_dir": {"type": "string", "minLength": 1},
        "experiments_dir": {"type": "string", "minLength": 1},
        "decisions_dir": {"type": "string", "minLength": 1},
        "retrospectives_dir": {"type": "string", "minLength": 1},
        "assumptions_dir": {"type": "string", "minLength": 1},
        "design_assets_dir": {"type": "string", "minLength": 1},
        "workflows_dir": {"type": "string", "minLength": 1},
        "learning_dir": {"type": "string", "minLength": 1},
        "exports_dir": {"type": "string", "minLength": 1}
      }
    },
    "rules": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "evidence_before_opinion": {"type": "boolean", "const": true},
        "feasibility_before_scope": {"type": "boolean", "const": true},
        "workflow_before_one_off_prompts": {"type": "boolean", "const": true},
        "voi_before_research": {"type": "boolean", "const": true},
        "eval_before_promotion": {"type": "boolean", "const": true},
        "rollback_before_confidence": {"type": "boolean", "const": true},
        "human_gate_for_commitments": {"type": "boolean", "const": true},
        "decision_before_information": {"type": "boolean", "const": true},
        "action_change_before_research": {"type": "boolean", "const": true},
        "sample_before_scale": {"type": "boolean", "const": true},
        "stop_when_marginal_voi_nonpositive": {"type": "boolean", "const": true},
        "preserve_local_negative_evidence": {"type": "boolean", "const": true},
        "decision_first": {"type": "boolean", "const": true},
        "evidence_bound": {"type": "boolean", "const": true},
        "experiment_before_commitment": {"type": "boolean", "const": true},
        "human_gate_owns_commitment": {"type": "boolean", "const": true},
        "learning_must_persist": {"type": "boolean", "const": true},
        "public_private_boundary": {"type": "boolean", "const": true}
      }
    }
  }
}
