{
  "isError" : false,
  "request" : { },
  "response" : {
    "meta" : {
      "serverMs" : "<timing>"
    },
    "status" : "ok",
    "workflowCount" : 4,
    "workflowNames" : [ "release", "feature_branch_start", "investigate_build_failure", "investigate_runtime_defect" ],
    "workflows" : [ {
      "name" : "release",
      "sequence" : [ {
        "reason" : "Bump the appropriate version part (typically patch after a fix).",
        "tool" : "ek9_increment_version"
      }, {
        "reason" : "Verify nothing regressed; produces the coverage report as a side effect.",
        "tool" : "ek9_run_tests"
      }, {
        "reason" : "Run full quality checks — coverage, complexity, readability, DI — to confirm nothing has degraded since the last release.",
        "tool" : "ek9_run_quality_checks"
      }, {
        "reason" : "Build the deployable artefact at the new version.",
        "tool" : "ek9_package"
      }, {
        "reason" : "Install into ~/.ek9/lib so sibling workspaces can pick it up.",
        "tool" : "ek9_install_package"
      }, {
        "reason" : "Verify the installed version matches what was bumped.",
        "tool" : "ek9_query_package_version"
      } ],
      "summary" : "Bump version + run tests with coverage + build artefact + install locally + verify."
    }, {
      "name" : "feature_branch_start",
      "sequence" : [ {
        "reason" : "Mark the package as on a feature branch (e.g. 2.1.0-PAYINTEG-0).",
        "tool" : "ek9_set_feature_version"
      }, {
        "reason" : "Declare each new package dependency the feature requires.",
        "tool" : "ek9_add_dependency"
      }, {
        "reason" : "Pull the new dependencies into ~/.ek9/lib.",
        "tool" : "ek9_resolve_dependencies"
      }, {
        "reason" : "Verify the package still compiles with the new deps.",
        "tool" : "ek9_compile"
      }, {
        "reason" : "Verify existing tests still pass before any feature work begins.",
        "tool" : "ek9_run_tests"
      } ],
      "summary" : "Set feature-branch version + add new dependencies + resolve + verify."
    }, {
      "name" : "investigate_build_failure",
      "sequence" : [ {
        "reason" : "Read the specific compiler/resolver error messages.",
        "tool" : "ek9_query_diagnostics"
      }, {
        "reason" : "See the resolved tree with version selections and any rejection reasons.",
        "tool" : "ek9_query_dependency_tree"
      }, {
        "reason" : "Rule out a transitive cycle in the published-package graph.",
        "tool" : "ek9_check_package_dependency_cycles"
      }, {
        "reason" : "Re-resolve after any fix to the package directive.",
        "tool" : "ek9_resolve_dependencies"
      }, {
        "reason" : "Confirm the build now succeeds.",
        "tool" : "ek9_compile"
      } ],
      "summary" : "Diagnose dependency-resolution or compilation failure: diagnostics → tree → cycles → fix → re-resolve."
    }, {
      "name" : "investigate_runtime_defect",
      "sequence" : [ {
        "reason" : "{action:'launch', run:'toEnd', args:<the failing input>}: reproduce the failure once - its message usually names the value that went wrong (a Panic on 'require total >= NOTHING' in Order.invoice -> watch Order.total).",
        "tool" : "ek9_debug_session"
      }, {
        "reason" : "{action:'sweep', inputs:[...], journal:{property:'Type.property', hypothesis}}: one run per input set, all with ONE seed. Include inputs you expect to PASS as well as the failing one - compare needs both; every change to the value, on every object, is recorded. Its answer already carries compare's top differences, and the investigation id.",
        "tool" : "ek9_debug_session"
      }, {
        "reason" : "{action:'compare', runs, hypothesis}: what only the failing runs did - a step they took, a step they LEFT OUT (onlyInPassing), or none (then the values differ). A tie or thin evidence means more inputs, not a verdict. Cite each difference by its run and ticks.",
        "tool" : "ek9_debug_inspect"
      }, {
        "reason" : "{action:'leadingTo', runId:<a failing run>, hypothesis}: the account - the changes that led to its failure, each with the line, the values and the calls that made it. Cite ticks for every claim.",
        "tool" : "ek9_debug_inspect"
      }, {
        "reason" : "{action:'firstWhere', runId, condition:'total < 0', hypothesis}: the step where the value first went wrong - usually the line to fix.",
        "tool" : "ek9_debug_inspect"
      }, {
        "reason" : "{action:'launch', run:'toEnd', seed:<the sweep's>, args:<one input changed>, journal}: confirm the suspect - the same run with only the suspect's input changed should pass. Without this, a difference is a suspect, not a cause.",
        "tool" : "ek9_debug_session"
      }, {
        "reason" : "{action:'report', runs, hypothesis, finding:'cause and fix, citing t5 and Orders.ek9:36'}: write the investigation up for the person (index.html, report.json); the finding is shown as yours.",
        "tool" : "ek9_debug_inspect"
      } ],
      "summary" : "A runtime failure whose cause is earlier: journal the value over failing AND passing runs -> compare -> leadingTo -> firstWhere -> confirm with one input changed -> report with a finding."
    } ]
  },
  "scenario" : "workflows_list_shape",
  "tool" : "list_workflows"
}
