{
  "$schema": "https://t2k.ai/schemas/t2k-ontology-pack.v1.schema.json",
  "manifestType": "t2k.ontology-pack",
  "manifestVersion": "1.0",
  "ontologyVersion": "1.0.0",
  "ontologyId": "example.workflows",
  "label": "Workflows: employee onboarding",
  "description": "Separate a process definition, an execution, task dependencies, approval, and completion.",
  "packKind": "workflow",
  "status": "draft",
  "scope": {
    "domain": "employee_onboarding",
    "description": "Fictional, read-only teaching example. Declared rules document intended semantics; they are not executable policy enforcement."
  },
  "objectTypes": [
    {
      "id": "workflow_definition",
      "label": "Workflow definition",
      "family": "Workflow execution",
      "nodeKind": "workflow",
      "purpose": "A reusable versioned process design, distinct from a particular execution.",
      "identity": [
        "definition_id"
      ],
      "properties": [
        {
          "id": "definition_id",
          "valueType": "string",
          "required": true,
          "description": "Stable identifier in this example source system.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "name",
          "valueType": "string",
          "required": true,
          "description": "Human-readable process name.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "version",
          "valueType": "string",
          "required": true,
          "description": "Version identifier of the authored process design.",
          "authorityDomain": "example_source",
          "temporal": false
        }
      ]
    },
    {
      "id": "step_definition",
      "label": "Step definition",
      "family": "Workflow execution",
      "nodeKind": "reference",
      "purpose": "An authored step in a workflow design, not a task that has been performed.",
      "identity": [
        "step_id"
      ],
      "properties": [
        {
          "id": "step_id",
          "valueType": "string",
          "required": true,
          "description": "Stable identifier in this example source system.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "name",
          "valueType": "string",
          "required": true,
          "description": "Human-readable step name.",
          "authorityDomain": "example_source",
          "temporal": false
        }
      ]
    },
    {
      "id": "workflow_run",
      "label": "Workflow run",
      "family": "Workflow execution",
      "nodeKind": "case",
      "purpose": "One employee onboarding execution using a specified definition.",
      "identity": [
        "run_id"
      ],
      "properties": [
        {
          "id": "run_id",
          "valueType": "string",
          "required": true,
          "description": "Stable identifier in this example source system.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "status",
          "valueType": "string",
          "required": true,
          "description": "Recorded run status; not derived from task completeness by these queries.",
          "authorityDomain": "example_source",
          "temporal": true
        },
        {
          "id": "subject_name",
          "valueType": "string",
          "required": true,
          "description": "Fictional onboarding subject label.",
          "authorityDomain": "example_source",
          "temporal": false
        }
      ]
    },
    {
      "id": "task",
      "label": "Task instance",
      "family": "Workflow execution",
      "nodeKind": "action",
      "purpose": "One execution of a step, with explicit task dependencies and separate completion status.",
      "identity": [
        "task_id"
      ],
      "properties": [
        {
          "id": "task_id",
          "valueType": "string",
          "required": true,
          "description": "Stable identifier in this example source system.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "status",
          "valueType": "string",
          "required": true,
          "description": "Recorded status: pending, in_progress, or completed.",
          "authorityDomain": "example_source",
          "temporal": true
        },
        {
          "id": "assigned_role",
          "valueType": "string",
          "required": true,
          "description": "Recorded owner role; not evidence of approval authority.",
          "authorityDomain": "example_source",
          "temporal": true
        }
      ]
    },
    {
      "id": "approval",
      "label": "Approval record",
      "family": "Workflow execution",
      "nodeKind": "authority",
      "purpose": "A review state for a task, not evidence that the task was performed.",
      "identity": [
        "approval_id"
      ],
      "properties": [
        {
          "id": "approval_id",
          "valueType": "string",
          "required": true,
          "description": "Stable identifier in this example source system.",
          "authorityDomain": "example_source",
          "temporal": false
        },
        {
          "id": "status",
          "valueType": "string",
          "required": true,
          "description": "Recorded review state: pending, approved, or rejected.",
          "authorityDomain": "example_source",
          "temporal": true
        },
        {
          "id": "reviewer_role",
          "valueType": "string",
          "required": true,
          "description": "Role named by the review source; effective authority is outside this example.",
          "authorityDomain": "example_source",
          "temporal": true
        }
      ]
    }
  ],
  "structuralRelationships": [
    {
      "from": "workflow_definition",
      "property": "includes_step",
      "to": "step_definition",
      "cardinality": "one_to_many",
      "description": "Steps declared by this process version."
    },
    {
      "from": "workflow_run",
      "property": "instantiates",
      "to": "workflow_definition",
      "cardinality": "many_to_one",
      "description": "The process version selected by this execution."
    },
    {
      "from": "workflow_run",
      "property": "contains_task",
      "to": "task",
      "cardinality": "one_to_many",
      "description": "Task instances included in the run snapshot."
    },
    {
      "from": "task",
      "property": "implements_step",
      "to": "step_definition",
      "cardinality": "many_to_one",
      "description": "The reusable step instantiated by this task."
    },
    {
      "from": "task",
      "property": "depends_on",
      "to": "task",
      "cardinality": "many_to_many",
      "description": "An explicitly recorded immediate predecessor; not transitive closure or proof of a complete dependency list."
    },
    {
      "from": "task",
      "property": "has_approval",
      "to": "approval",
      "cardinality": "one_to_one",
      "description": "The review record linked to this task in the teaching snapshot."
    }
  ],
  "reasoningFunctions": [
    {
      "id": "incomplete_predecessors",
      "input": "A workflow run entity ID and its recorded tasks and dependency links.",
      "output": "Pending tasks whose explicitly linked immediate predecessors are not recorded completed.",
      "humanCheckpoint": "Review dependency coverage and process policy. The result is a blocker list, not a universal readiness or authorization decision."
    },
    {
      "id": "approved_unfinished_tasks",
      "input": "A workflow run entity ID and its recorded task and approval states.",
      "output": "Tasks with an approved review and a task status other than completed.",
      "humanCheckpoint": "Confirm effective approval scope and all prerequisites in the operational system before execution."
    }
  ],
  "normalizationRules": [
    "Keep process-version identity separate from execution and task identity.",
    "Preserve approval state and task completion as separate facts, even when a source UI groups them together.",
    "Do not infer completed from approved, and do not infer approval from a completed task.",
    "Keep explicit dependency links; an absent link is not evidence that no prerequisite exists."
  ],
  "validationRules": [
    {
      "id": "dependency_scope",
      "level": "semantic",
      "severity": "review",
      "target": "task.depends_on",
      "assertion": "Declared import requirement: dependencies are valid task references in the intended run and are acyclic.",
      "message": "The example programs do not perform cycle detection or establish dependency-list completeness."
    },
    {
      "id": "completion_evidence",
      "level": "governance",
      "severity": "review",
      "target": "task.status",
      "assertion": "A completed task should reference evidence of execution rather than only an approval event.",
      "message": "This fixture records status observations; a production importer must validate the source event semantics."
    },
    {
      "id": "approval_scope",
      "level": "governance",
      "severity": "review",
      "target": "approval",
      "assertion": "A recorded approval is scoped to its task and does not by itself authorize tools or satisfy all prerequisites.",
      "message": "The graph functions are read-only and do not create accounts, update HR systems, or send notifications."
    }
  ],
  "extensions": {
    "exampleOnly": true,
    "ruleExecution": "Normalization and validation rules are declarative documentation; only the scenario graph-function programs execute."
  }
}
