=== META ===
{
  "id": "GTPX-WORKFLOW-MODEL",
  "title": "GTPX Workflow Model",
  "version": "0.1.0",
  "status": "draft",
  "updated": "2026-04-25",
  "authority": "11_workflow/GTPX-WORKFLOW-MODEL.gtpx",
  "type": "workflow_model",
  "project": "GTPX",
  "depends_on": [
    "00_meta/INDEX.gtpx",
    "00_meta/REGISTRY.gtpx",
    "09_runtime/GTPX-PATCH-MODEL.gtpx",
    "09_runtime/GTPX-AUDIT-MODEL.gtpx"
  ]
}

=== DATA ===
{
  "purpose": "Defines how the GTPX Standard is analyzed, reviewed, improved, versioned, published, and communicated to AI systems.",

  "workflow_scope": [
    "standard_analysis",
    "improvement_proposal",
    "patch_review",
    "patch_dry_run",
    "patch_acceptance",
    "version_release",
    "open_source_publication",
    "ai_contract_communication"
  ],

  "core_workflow": [
    "READ",
    "ANALYZE",
    "REPORT",
    "PROPOSE_PATCH",
    "REVIEW_PATCH",
    "DRY_RUN_PATCH",
    "ACCEPT_OR_REJECT",
    "COMMIT_VERSION",
    "PUBLISH",
    "AUDIT"
  ],

  "step_definitions": {
    "READ": "Load all registered GTPX documents according to INDEX and REGISTRY.",
    "ANALYZE": "Check structure, dependencies, consistency, terms, enums, conflicts, and missing definitions.",
    "REPORT": "Produce a structured analysis report with findings, risks, and recommended actions.",
    "PROPOSE_PATCH": "Create an explicit patch proposal with before, after, target, reason, and impact.",
    "REVIEW_PATCH": "Review whether the patch is valid, necessary, compatible, and non-conflicting.",
    "DRY_RUN_PATCH": "Simulate the effect of the patch without modifying the authoritative standard.",
    "ACCEPT_OR_REJECT": "Maintainer or authorized process approves or rejects the patch.",
    "COMMIT_VERSION": "Apply accepted patch and increment version according to versioning rules.",
    "PUBLISH": "Publish the updated standard in the public repository or canonical location.",
    "AUDIT": "Record the full change process, decision, version, and affected documents."
  },

  "analysis_requirements": {
    "must_check_registered_documents_exist": true,
    "must_check_unregistered_documents": true,
    "must_check_meta_blocks": true,
    "must_check_required_sections": true,
    "must_check_dependency_chain": true,
    "must_check_dictionary_terms": true,
    "must_check_enum_values": true,
    "must_check_conflicting_rules": true,
    "must_report_open_questions": true
  },

  "patch_requirements": {
    "patch_must_have_id": true,
    "patch_must_have_target": true,
    "patch_must_have_reason": true,
    "patch_must_have_before_state": true,
    "patch_must_have_after_state": true,
    "patch_must_have_impact_analysis": true,
    "patch_must_have_acceptance_criteria": true
  },

  "versioning_policy": {
    "major": "Breaking change to syntax, contract, validation, or execution behavior.",
    "minor": "Backward-compatible functional extension.",
    "patch": "Clarification, typo correction, documentation improvement, or non-breaking fix."
  },

  "open_source_policy": {
    "repository_structure": [
      "spec/",
      "examples/",
      "tools/",
      "modules/",
      "runtime/",
      "docs/"
    ],
    "change_request_model": "Each proposed change must be submitted as a patch or pull request.",
    "review_model": "Each change must pass analysis, review, dry-run, and maintainer acceptance before merge.",
    "release_model": "Each accepted release must have a version tag, changelog, and audit record."
  },

  "ai_contract_communication": {
    "manual_mode": {
      "description": "Human sends CONTRACT, REQUEST, EXPECTED_OUTPUT, and constraints directly to ChatGPT or another AI model.",
      "risk": "AI may not enforce GTPX unless instructed and checked by the human."
    },
    "runtime_mode": {
      "description": "Human sends request to Synarch or another GTPX runtime, which validates, enforces contract, calls AI, checks response, and returns structured output.",
      "preferred": true
    }
  },

  "minimum_ai_prompt_contract": {
    "required_blocks": [
      "CONTRACT",
      "TASK",
      "CONTEXT",
      "SOURCES",
      "RULES",
      "EXPECTED_OUTPUT",
      "FAIL_POLICY"
    ],
    "fail_policy": "If required information is missing, respond with BLOCKED and list missing information."
  }
}

=== RULES ===
{
  "standard_must_not_be_changed_without_patch": true,
  "patch_must_not_be_committed_without_review": true,
  "patch_must_not_be_committed_without_dry_run": true,
  "accepted_patch_requires_version_update": true,
  "published_release_requires_audit_record": true,
  "ai_contract_must_be_explicit": true,
  "runtime_mode_is_preferred_for_enforcement": true
}

=== STATUS ===
{
  "state": "draft",
  "open_questions": [
    "Define exact analyzer output format.",
    "Define exact patch document format.",
    "Define maintainer approval policy.",
    "Define public repository license.",
    "Define minimum ChatGPT-compatible prompt template."
  ],
  "next_step": "Create GTPX-ANALYSIS-REPORT-MODEL.gtpx and GTPX-PATCH-PROPOSAL-MODEL.gtpx."
}