{
  "schema_version": 1,
  "module_id": "source",
  "name": "Development",
  "case_module": "source",
  "kind": "working",
  "root_profile": "source.root",
  "memory_root": "source",
  "profiles": [
    {
      "key": "source.root",
      "execution_kind": "llm",
      "owns": [
        "source"
      ]
    },
    {
      "key": "source.planner",
      "execution_kind": "llm",
      "owns": []
    },
    {
      "key": "source.implementer.serdica-backend",
      "execution_kind": "llm",
      "owns": [
        "source/serdica-backend"
      ]
    },
    {
      "key": "source.implementer.serdica-ui",
      "execution_kind": "llm",
      "owns": [
        "source/serdica-ui"
      ]
    },
    {
      "key": "source.implementer.db-plsql",
      "execution_kind": "llm",
      "owns": [
        "source/db-plsql"
      ]
    },
    {
      "key": "source.implementer.intentgpt",
      "execution_kind": "llm",
      "owns": [
        "source/intentgpt"
      ]
    },
    {
      "key": "source.camunda_developer",
      "execution_kind": "llm",
      "owns": []
    },
    {
      "key": "source.db_extractor",
      "execution_kind": "llm",
      "owns": []
    },
    {
      "key": "source.test_runner",
      "execution_kind": "deterministic",
      "owns": []
    },
    {
      "key": "source.reviewer",
      "execution_kind": "llm",
      "owns": []
    },
    {
      "key": "source.deployer",
      "execution_kind": "llm",
      "owns": []
    }
  ],
  "entry_stage": "S1",
  "stages": [
    {
      "id": "S1",
      "profile": "source.planner",
      "consumes": [
        "handover-packet",
        "normalised-arrival"
      ],
      "produces": [
        "branch-set",
        "brief"
      ],
      "gates": [
        {
          "kind": "H1",
          "when": "result_ready"
        }
      ],
      "done": "Reproduction, scope and actual branch set established."
    },
    {
      "id": "S2",
      "profile": "source.planner",
      "consumes": [
        "brief"
      ],
      "produces": [
        "brief"
      ],
      "gates": [
        {
          "kind": "H2",
          "when": "plan_ready"
        }
      ],
      "done": "Placement and test plan approved; H1/H2 can share one packet."
    },
    {
      "id": "S3",
      "profile": "source.implementer.serdica-backend",
      "consumes": [
        "brief",
        "branch-set"
      ],
      "produces": [
        "paper:build_state"
      ],
      "gates": [],
      "done": "Declared source selects implementer; isolated worktree change and evidence recorded.",
      "profile_variants": {
        "serdica-backend": "source.implementer.serdica-backend",
        "serdica-ui": "source.implementer.serdica-ui",
        "db-plsql": "source.implementer.db-plsql",
        "intentgpt": "source.implementer.intentgpt"
      }
    },
    {
      "id": "S4",
      "profile": "source.test_runner",
      "consumes": [
        "paper:build_state"
      ],
      "produces": [
        "paper:report"
      ],
      "gates": [],
      "done": "Build, targeted tests and applicable interface/eval checks pass."
    },
    {
      "id": "S5",
      "profile": "source.reviewer",
      "consumes": [
        "brief",
        "paper:report"
      ],
      "produces": [
        "paper:verdict"
      ],
      "gates": [
        {
          "kind": "H3",
          "when": "result_ready"
        }
      ],
      "done": "Reviewed MR head and pipeline recorded."
    },
    {
      "id": "S6",
      "profile": "source.deployer",
      "consumes": [
        "paper:verdict"
      ],
      "produces": [
        "paper:packet"
      ],
      "gates": [
        {
          "kind": "H4",
          "when": "plan_ready"
        }
      ],
      "done": "Release packet pins reviewed head, merge policy, artefacts, targets and revert."
    },
    {
      "id": "S7",
      "profile": "source.deployer",
      "consumes": [
        "paper:packet"
      ],
      "produces": [
        "paper:packet"
      ],
      "gates": [
        {
          "kind": "H5",
          "when": "before_execution"
        }
      ],
      "done": "Target execution decisions recorded."
    },
    {
      "id": "S8",
      "profile": "source.deployer",
      "consumes": [
        "paper:packet"
      ],
      "produces": [
        "paper:report"
      ],
      "gates": [],
      "done": "Pipeline/DDL results, serving revision, smoke and port outcome verified."
    },
    {
      "id": "S9",
      "profile": "source.deployer",
      "consumes": [
        "paper:report"
      ],
      "produces": [
        "paper:report"
      ],
      "gates": [
        {
          "kind": "H7",
          "when": "before_execution"
        }
      ],
      "done": "Compensation authorised and verified."
    }
  ],
  "edges": [
    {
      "from": "S1",
      "to": "S2",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S2",
      "to": "S3",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S3",
      "to": "S4",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S4",
      "to": "S5",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S5",
      "to": "S3",
      "on": "review correction",
      "kind": "rework"
    },
    {
      "from": "S5",
      "to": "S6",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S6",
      "to": "S7",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S7",
      "to": "S8",
      "on": "ready",
      "kind": "dependency"
    },
    {
      "from": "S8",
      "to": "S9",
      "on": "failed release",
      "kind": "rework"
    }
  ],
  "eval_sets": [
    "source.planning",
    "source.implementation",
    "source.review",
    "source.deployment"
  ]
}
