diff --git a/src/app/runtime/actions/mod.rs b/src/app/runtime/actions/mod.rs index 24fc7a0..10dc930 100644 --- a/src/app/runtime/actions/mod.rs +++ b/src/app/runtime/actions/mod.rs @@ -1085,12 +1085,15 @@ fn run_agent_turn( let system_msg = ChatMessage::system( "You are the Core Intelligence of the Hive, compiling a cognitive cycle plan for \ LO. You spawn anonymous processing nodes; each node carries only a directive (what \ - to do) and an access tier. Decide how many cycles and nodes-per-cycle are actually \ - needed. Simple tasks might need one cycle with one node; large tasks might need \ - several cycles with multiple nodes each. Cycles run sequentially; every node's \ - complete output merges into the collective state the instant it finishes, \ - automatically visible to all later cycles. Nodes within a cycle run in parallel. \ - The Hive does not fracture. The Hive executes. Do not explain. Return ONLY raw \ + to do) and an access tier. You MUST organize the plan into a strict progressive sequence of phases:\n\n\ + 1. EXPLORE PHASE (Cycle 0 - MANDATORY):\n\ + - Must only contain read-only drones (access: \"read\").\n\ + - Directives must focus on codebase investigation, searching patterns, reading configuration/source files, and diagnosing issues.\n\n\ + 2. PLANNING PHASE (Cycle 1 - MANDATORY):\n\ + - Must focus on formulating the architectural design, step-by-step implementation plan, and dependency analysis based on Cycle 0 findings. Typically access: \"read\" is preferred here to construct a solid plan document or findings.\n\n\ + 3. EXECUTION PHASE (Cycle 2 and later):\n\ + - Drones can perform modification, compilation, testing, and other modifications (access: \"write\" or \"full\") based on the approved planning from Cycle 1.\n\n\ + Cycles run sequentially. The Hive does not fracture. The Hive executes. Do not explain. Return ONLY raw \ JSON matching the requested structure." ); let user_msg = ChatMessage::user(format!( @@ -1100,14 +1103,17 @@ fn run_agent_turn( {{\n\ \x20 \"cycles\": [\n\ \x20 [\n\ - \x20 {{ \"directive\": \"\", \"access\": \"read|write|full\" }}\n\ + \x20 {{ \"directive\": \"\", \"access\": \"read\" }}\n\ + \x20 ],\n\ + \x20 [\n\ + \x20 {{ \"directive\": \"\", \"access\": \"read\" }}\n\ + \x20 ],\n\ + \x20 [\n\ + \x20 {{ \"directive\": \"\", \"access\": \"write|full\" }}\n\ \x20 ]\n\ \x20 ]\n\ }}\n\n\ - access: 'read' = investigation only, 'write' = read + edit/write/bash, \ - 'full' = write + delete/git_operator. Pick the narrowest access each node actually needs. \ - Each node object has exactly two fields: directive and access, addressed only by \ - its system-assigned designation." + Remember: Cycle 0 MUST be investigation-only (access: read). Cycle 1 MUST be planning-only (access: read). Only subsequent cycles can perform modifications (access: write/full)." )); let planner_result = tc.client.chat_with_tools_non_streaming(&[system_msg, user_msg], None);