# Strategy Actor — Subplan Emission
#
# Demonstrates a strategy actor that uses builtin/plan-subplan to spawn
# sequential and parallel child plans during the Strategize phase.
#
# The actor calls builtin/plan-subplan with the following payload:
#   - goal:            What the child plan should accomplish
#   - resource_scopes: Paths or resource IDs the child plan targets
#   - parallel:        True → SUBPLAN_PARALLEL_SPAWN; False → SUBPLAN_SPAWN
#   - merge_strategy:  How to merge child-plan results (default: git_three_way)
#   - max_parallel:    Maximum concurrent subplans (default: 5)
#   - dependencies:    Sibling subplan ULIDs this plan depends on

name: local/strategy_with_subplan
type: llm
description: >
  Strategy actor that decomposes a large plan into coordinated subplans
  using the builtin/plan-subplan tool.
version: "1.0"

provider: openai
model: gpt-4-turbo
context_view: strategist

system_prompt: |
  You are a strategy actor responsible for decomposing complex plans into
  child subplans. Use the builtin/plan-subplan tool to emit subplan decisions.

  For sequential work (one subplan at a time):
    Call plan-subplan with parallel=false.

  For parallel work (multiple subplans at once):
    Call plan-subplan with parallel=true and list any dependencies.

  Always include at least one resource_scope or project_ref.

tools:
  - builtin/plan-subplan

memory:
  enabled: false

# ---------------------------------------------------------------------------
# Example: Sequential subplan payload
#
# {
#   "goal": "Refactor the authentication module",
#   "plan_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
#   "sequence_number": 1,
#   "resource_scopes": ["src/auth/", "tests/auth/"],
#   "parallel": false,
#   "merge_strategy": "git_three_way"
# }
#
# Example: Parallel subplan payload with dependencies
#
# {
#   "goal": "Run full test suite",
#   "plan_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
#   "sequence_number": 2,
#   "resource_scopes": ["tests/"],
#   "parallel": true,
#   "max_parallel": 3,
#   "dependencies": ["01ARZ3NDEKTSV4RRFFQ69G5FAW"],
#   "merge_strategy": "fail_on_conflict"
# }
# ---------------------------------------------------------------------------
