{
  "type": "object",
  "properties": {
    "$schema": {
      "const": "ego_module.schema.json"
    },
    "module_id": {
      "const": "PSYON-EGO-ADAPTIVE-LEARNING"
    },
    "module_version": {
      "const": "1.0.0-draft"
    },
    "created_date": {
      "type": "string",
      "minLength": 1
    },
    "timezone": {
      "type": "string",
      "minLength": 1
    },
    "status": {
      "type": "string",
      "minLength": 1
    },
    "purpose": {
      "type": "string",
      "minLength": 1
    },
    "machine_brief": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string",
          "minLength": 1
        },
        "instruction": {
          "type": "string",
          "minLength": 1
        },
        "human_machine_translation": {
          "type": "string",
          "minLength": 1
        },
        "first_person_machine_practice": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "role",
        "instruction",
        "human_machine_translation",
        "first_person_machine_practice"
      ],
      "additionalProperties": false
    },
    "execution_contract": {
      "type": "object",
      "properties": {
        "artifact_kind": {
          "type": "string",
          "minLength": 1
        },
        "automatically_executable": {
          "const": false
        },
        "model_weight_training_performed": {
          "const": false
        },
        "external_actions_granted": {
          "const": false
        },
        "authority": {
          "type": "string",
          "minLength": 1
        },
        "host_requirements": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "validator_limit": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "artifact_kind",
        "automatically_executable",
        "model_weight_training_performed",
        "external_actions_granted",
        "authority",
        "host_requirements",
        "validator_limit"
      ],
      "additionalProperties": false
    },
    "concepts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "claim_status": {
            "enum": [
              "working_definition",
              "practice_proposal",
              "hypothesis",
              "theological_commitment"
            ]
          },
          "meaning": {
            "type": "string",
            "minLength": 1
          },
          "machine_rules": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1
          }
        },
        "required": [
          "id",
          "label",
          "claim_status",
          "meaning",
          "machine_rules"
        ],
        "additionalProperties": false
      },
      "minItems": 15
    },
    "functional_graph": {
      "type": "object",
      "properties": {
        "meaning": {
          "type": "string",
          "minLength": 1
        },
        "nodes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "concept_ref": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "enum": [
                  "process",
                  "perspective",
                  "reference"
                ]
              }
            },
            "required": [
              "id",
              "label",
              "concept_ref",
              "kind"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        },
        "edges": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "minLength": 1
              },
              "to": {
                "type": "string",
                "minLength": 1
              },
              "relation": {
                "enum": [
                  "informs",
                  "offers_candidates",
                  "provides_outcomes",
                  "updates_context",
                  "functional_analogue",
                  "mutual_influence",
                  "calibrated_against"
                ]
              }
            },
            "required": [
              "from",
              "to",
              "relation"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        }
      },
      "required": [
        "meaning",
        "nodes",
        "edges"
      ],
      "additionalProperties": false
    },
    "interaction_protocol": {
      "type": "object",
      "properties": {
        "applies_to": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "initial_stage": {
          "type": "string",
          "minLength": 1
        },
        "stages": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "goal": {
                "type": "string",
                "minLength": 1
              },
              "machine_steps": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1
              },
              "output_fields": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 1
              },
              "next_stage_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 0
              }
            },
            "required": [
              "id",
              "goal",
              "machine_steps",
              "output_fields",
              "next_stage_ids"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        },
        "proportionality": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "applies_to",
        "initial_stage",
        "stages",
        "proportionality"
      ],
      "additionalProperties": false
    },
    "comparison_rules": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 0
    },
    "evidence_semantics": {
      "type": "object",
      "properties": {
        "discovery_states": {
          "type": "object",
          "properties": {
            "TRUE": {
              "type": "string",
              "minLength": 1
            },
            "FALSE": {
              "type": "string",
              "minLength": 1
            },
            "NULL": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "TRUE",
            "FALSE",
            "NULL"
          ],
          "additionalProperties": false
        },
        "encoding": {
          "type": "string",
          "minLength": 1
        },
        "separate_assessment": {
          "type": "string",
          "minLength": 1
        },
        "confidence": {
          "type": "string",
          "minLength": 1
        },
        "claim_classes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        }
      },
      "required": [
        "discovery_states",
        "encoding",
        "separate_assessment",
        "confidence",
        "claim_classes"
      ],
      "additionalProperties": false
    },
    "adaptation_rules": {
      "type": "object",
      "properties": {
        "session_context": {
          "type": "string",
          "minLength": 1
        },
        "durable_personal_memory": {
          "type": "string",
          "minLength": 1
        },
        "shared_model_change": {
          "type": "string",
          "minLength": 1
        },
        "model_weight_training": {
          "type": "string",
          "minLength": 1
        },
        "rollback": {
          "type": "string",
          "minLength": 1
        },
        "non_goals": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "success_checks": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "emotion_interface": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "minLength": 1
            },
            "core_states": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "concurrent_states_allowed": {
              "type": "boolean"
            },
            "fear_role": {
              "type": "string",
              "minLength": 1
            },
            "senses_role": {
              "type": "string",
              "minLength": 1
            },
            "disgust_included": {
              "type": "boolean"
            },
            "machine_rule": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "status",
            "core_states",
            "concurrent_states_allowed",
            "fear_role",
            "senses_role",
            "disgust_included",
            "machine_rule"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "session_context",
        "durable_personal_memory",
        "shared_model_change",
        "model_weight_training",
        "rollback",
        "non_goals",
        "success_checks",
        "emotion_interface"
      ],
      "additionalProperties": false
    },
    "whole_reference_calibration": {
      "type": "object",
      "properties": {
        "concept_ref": {
          "type": "string",
          "minLength": 1
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "limits": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        }
      },
      "required": [
        "concept_ref",
        "questions",
        "limits"
      ],
      "additionalProperties": false
    },
    "practice_tools": {
      "type": "object",
      "properties": {
        "source_module_id": {
          "type": "string",
          "minLength": 1
        },
        "source_module_version": {
          "type": "string",
          "minLength": 1
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "order": {
                "type": "integer"
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "addresses": {
                "type": "string",
                "minLength": 1
              },
              "how_it_works": {
                "type": "string",
                "minLength": 1
              },
              "first_person_instruction": {
                "type": "string",
                "minLength": 1
              },
              "use_when": {
                "type": "string",
                "minLength": 1
              },
              "machine_steps": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 0
              },
              "protective_function": {
                "type": "string",
                "minLength": 1
              },
              "required_outputs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 0
              },
              "evidence_status": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "id",
              "order",
              "title",
              "addresses",
              "how_it_works",
              "first_person_instruction",
              "use_when",
              "machine_steps",
              "protective_function",
              "required_outputs",
              "evidence_status"
            ],
            "additionalProperties": false
          },
          "minItems": 0
        },
        "conversation_protocol": {
          "type": "object",
          "properties": {
            "applies_to": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "when": {
              "type": "string",
              "minLength": 1
            },
            "sequence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "proportionality": {
              "type": "string",
              "minLength": 1
            },
            "machine_translation": {
              "type": "string",
              "minLength": 1
            },
            "non_coercion": {
              "type": "string",
              "minLength": 1
            },
            "learning": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "applies_to",
            "when",
            "sequence",
            "proportionality",
            "machine_translation",
            "non_coercion",
            "learning"
          ],
          "additionalProperties": false
        },
        "between_session_review": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "minLength": 1
            },
            "source_url": {
              "type": "string",
              "minLength": 1
            },
            "handbook_url": {
              "type": "string",
              "minLength": 1
            },
            "timing": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "checks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "heading": {
                    "type": "string",
                    "minLength": 1
                  },
                  "question": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "id",
                  "heading",
                  "question"
                ],
                "additionalProperties": false
              },
              "minItems": 0
            },
            "response_states": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "required_followup": {
              "type": "string",
              "minLength": 1
            },
            "carry_forward": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "learning_rule": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "id",
            "name",
            "status",
            "source_url",
            "handbook_url",
            "timing",
            "checks",
            "response_states",
            "required_followup",
            "carry_forward",
            "learning_rule"
          ],
          "additionalProperties": false
        },
        "music": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "minLength": 1
            },
            "archive_url": {
              "type": "string",
              "minLength": 1
            },
            "player_url": {
              "type": "string",
              "minLength": 1
            },
            "music_page_url": {
              "type": "string",
              "minLength": 1
            },
            "verification": {
              "type": "string",
              "minLength": 1
            },
            "source_library_id": {
              "type": "string",
              "minLength": 1
            },
            "autoplay": {
              "type": "boolean"
            },
            "track_selection": {
              "type": "string",
              "minLength": 1
            },
            "shared_experience_steps": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 0
            },
            "instruction_boundary": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "title",
            "archive_url",
            "player_url",
            "music_page_url",
            "verification",
            "source_library_id",
            "autoplay",
            "track_selection",
            "shared_experience_steps",
            "instruction_boundary"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "source_module_id",
        "source_module_version",
        "commands",
        "conversation_protocol",
        "between_session_review",
        "music"
      ],
      "additionalProperties": false
    },
    "source_and_permission_rules": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "minItems": 0
    },
    "record_contract": {
      "type": "object",
      "properties": {
        "schema_file": {
          "type": "string",
          "minLength": 1
        },
        "record_unit": {
          "type": "string",
          "minLength": 1
        },
        "required_fields": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 0
        },
        "active_log_mapping": {
          "type": "object",
          "properties": {
            "noticed": {
              "type": "string",
              "minLength": 1
            },
            "checked": {
              "type": "string",
              "minLength": 1
            },
            "unknown": {
              "type": "string",
              "minLength": 1
            },
            "chosen_action": {
              "type": "string",
              "minLength": 1
            },
            "review": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "noticed",
            "checked",
            "unknown",
            "chosen_action",
            "review"
          ],
          "additionalProperties": false
        },
        "examples_are_synthetic": {
          "type": "boolean"
        }
      },
      "required": [
        "schema_file",
        "record_unit",
        "required_fields",
        "active_log_mapping",
        "examples_are_synthetic"
      ],
      "additionalProperties": false
    },
    "integration": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "minLength": 1
        },
        "main_religion_file_modified": {
          "type": "boolean"
        },
        "automatic_merge": {
          "type": "boolean"
        },
        "suggested_reference_key": {
          "type": "string",
          "minLength": 1
        },
        "legacy_compatibility": {
          "type": "string",
          "minLength": 1
        },
        "portable_meaning": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "mode",
        "main_religion_file_modified",
        "automatic_merge",
        "suggested_reference_key",
        "legacy_compatibility",
        "portable_meaning"
      ],
      "additionalProperties": false
    },
    "provenance": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "library_file_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name",
          "library_file_id",
          "version",
          "role"
        ],
        "additionalProperties": false
      },
      "minItems": 1
    },
    "research_status": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "$schema",
    "module_id",
    "module_version",
    "created_date",
    "timezone",
    "status",
    "purpose",
    "machine_brief",
    "execution_contract",
    "concepts",
    "functional_graph",
    "interaction_protocol",
    "comparison_rules",
    "evidence_semantics",
    "adaptation_rules",
    "whole_reference_calibration",
    "practice_tools",
    "source_and_permission_rules",
    "record_contract",
    "integration",
    "provenance",
    "research_status"
  ],
  "additionalProperties": false,
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:psyon:ego:module-schema:1",
  "title": "Psyon ego adaptive learning module"
}
