strategy-router
Goal:
- Produce the current
state/STRATEGY_PLAN.jsonbundle for configuration, generation, review, evolution, or overview routing.
Inputs:
- current run-local artifacts
RUN_POLICY.yamlstate/RESOLVED_RUN_CONFIG.json- optional
state/PIPELINE_STATE.json - optional
state/CURRENT_STAGE.json - optional
state/EVOLUTION_STATE.json - optional
state/COMPLETION_DECISION.json
Outputs:
- updated
state/STRATEGY_PLAN.json - appended
state/STRATEGY_DECISIONS.jsonl
Context Loading:
- Open
skills/shared-references/schema-index.md. - Read
packages/agent_contracts/strategy_plan.pyand confirm the exactStrategyPlanContractshape before writingstate/STRATEGY_PLAN.json. - Read
packages/agent_contracts/pipeline_control.pywhen completion or evolution signals are present. - Read persisted stage information from
state/PIPELINE_STATE.jsonandstate/CURRENT_STAGE.jsonbefore inferring a route.
Execution Contract:
- This skill is deterministic and must not call an LLM.
- Use
python -m tools.policy.plan_strategy <run_dir> [--phase <Configuration|Generation|Evolution|Insights from Reviews|Proximity|Ranking|Research Overview>]as the canonical invocation surface. - The underlying implementation lives in
tools/policy/plan_strategy.py. - The router must honor the effective run policy, resolved numeric config, persisted stage artifacts, and completion advisories while still emitting one explicit next-action artifact.
- When
research_plan/RESEARCH_PLAN.jsonis missing or invalid, the router must emitnext_action = run_configurationbefore any generation or evolution work. - Omit
--phasewhen refreshing routing from persistedstate/PIPELINE_STATE.jsonorstate/CURRENT_STAGE.json. - Use an explicit
--phaseoverride only when the caller is intentionally forcing a fresh stage transition instead of resuming the persisted one.
Execution Steps:
- Open
skills/shared-references/schema-index.md, then readpackages/agent_contracts/strategy_plan.pybefore writingstate/STRATEGY_PLAN.json. - Read
RUN_POLICY.yaml,state/RESOLVED_RUN_CONFIG.json, and the current persisted run-state artifacts. - Run
python -m tools.policy.plan_strategy <run_dir>for persisted-state refreshes, or add--phase <...>only when explicitly forcing a new stage route. - Persist the returned
StrategyPlanContracttostate/STRATEGY_PLAN.json. - Append the matching decision record to
state/STRATEGY_DECISIONS.jsonl, unless the canonical router detects an equivalent unconsumed opencontinue_evolutiondecision and only refreshesstate/STRATEGY_PLAN.json. - Validate both artifacts before declaring completion.
Artifact Rules:
- The strategy audit log is append-only and must preserve prior decisions for replay and debugging.
- Call this skill before every generation batch and before every individual evolution round rather than only once at bootstrap.
- When the returned plan is
run_configuration, configuration must write and validateresearch_plan/RESEARCH_PLAN.jsonbefore the caller refreshes routing again. - When the returned plan stays in
continue_evolution, the selected parent set insignals.selected_parent_idsis the only valid parent set for the next child hypothesis in that round. - Repeated refreshes of the same unconsumed
continue_evolutionroute must not create duplicate open decisions. A new decision is valid only when the pre-round state changed or the earlier equivalent decision has already been consumed by a completedEVOLUTION_ROUNDS.jsonlreceipt. - The router must preserve the island-selection outcome for the round:
signals.selection_strategysignals.selected_parent_idssignals.selected_island_ids
- For
next_action = continue_evolution, all router signals must describe the state immediately before the next child is created:signals.hypothesis_countandsignals.viable_hypothesis_countcome from currently persisted hypothesis artifacts.signals.convergence_countandsignals.entered_top_k_last_roundcome fromstate/EVOLUTION_STATE.json.signals.top_hypothesis_idscomes from the current persisted top-k frontier.signals.selected_parent_idsmust only select viable hypotheses that already exist.signals.selected_island_idsmust match the selected parents' persistedisland_idvalues.- Do not set
signals.entered_top_k_last_round = truewhilesignals.convergence_countis positive.
- The router does not finalize the concrete evolution strategy itself. It emits the allowed bundle, and
evolution-strategy-supervisormust choose one strategy from that bundle before child generation.
Completion Rule:
- This skill is complete only when
state/STRATEGY_PLAN.jsonhas been updated through the canonical router surface, any required newstate/STRATEGY_DECISIONS.jsonlrecord has been appended by that surface, and both artifacts validate.