mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-15 23:31:04 +00:00
1.2 KiB
1.2 KiB
INT-003 — Two-Stage Reasoning Loop
Intent
Implement a two-stage state machine that enforces intent selection before code generation and validates AI output against intent constraints.
Scope (owned_scope)
src/core/hooks/HookEngine.tssrc/core/prompts/sections/tool-use-guidelines.tssrc/core/tools/SelectActiveIntentTool.tssrc/core/task/Task.ts
Constraints
- Stage 1 (Reasoning Intercept): Agent MUST call
select_active_intent(intent_id)before any destructive tool. - Stage 2 (Contextualized Action): Agent receives intent context and must include it when making code changes.
- System prompt must enforce this protocol in tool-use guidelines.
- Intent context must be injected into the agent's context before code generation.
Acceptance Criteria
- System prompt includes instructions requiring
select_active_intentbefore code changes. SelectActiveIntentToolreturns XML<intent_context>block with scope, constraints, and acceptance criteria.- Pre-hook blocks destructive tools if no active intent is selected.
- Agent receives intent context in subsequent tool calls.
- Intent context is logged in
agent_trace.jsonlentries.