feat(agent): Wave 3 strategic coupling (G5/G6) #6
Loading…
Reference in New Issue
No description provided.
Delete Branch "feat/agent-wave3-strategic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat(agent): Wave 3 strategic coupling (G5/G6)
Summary
Implements the PLAN_EXEC execution mode with a 4-phase state machine (PLANNING → BUILDING → VERIFICATION → DELIVERY) and per-phase tool whitelists with a bash command filter. Also adds SymbolExtractor + ReadFileTool with symbol slicing (G5).
This is Wave 3 of the advanced-agent gap optimization, building on top of Wave 2 (PR #5).
Implementation Units
U1 — G5: SymbolExtractor + ReadFileTool (
50885fb)SymbolExtractorprotocol withAstSymbolExtractor(tree-sitter-style AST) andRegexSymbolExtractor(fallback)ReadFileToolgainssymbolparameter for slicing specific functions/classesU2 — G6: PhaseState + PhasePolicy (
abf758f)PhaseStateenum: PLANNING → BUILDING → VERIFICATION → DELIVERYPhasePolicydataclass with per-phase tool whitelist + bash command filterdefault_policy()implements R24 whitelist (KTD5)policy_from_config()builds policy fromplan_execconfig sectionServerConfiggainsplan_execfieldU3 — G6: AdvancePhaseTool + ReActEngine phase enforcement (
c0a44b4)ReActEnginegainsphase_policyparam,current_phaseproperty,advance_phase()method_check_phase_permission()enforces whitelist + bash filter before tool dispatch_maybe_auto_advance()opt-in safety net (configurable step threshold)AdvancePhaseTool— LLM's manual escape hatch to signal phase completionU4 — G6: PLAN_EXEC wiring at WebSocket chat path (
7869cad)chat.pyWebSocket handler (KTD4: WebSocket only; REST raises 501)phase_changedevent emitted on phase transitionsPhasePolicyfromserver_config.plan_execwith error handlingCode Review Fixes (ce-code-review)
P1: bash/shell tool name mismatch
PhasePolicywhitelist used"bash"butShellToolregisters as"shell". Thebash_command_filterwas dead code — never matched the real tool name. Fixed inphase.pywhitelist,react.pyfilter check,agentkit.yamlconfig, and all tests.P1: AdvancePhaseTool missing import
AdvancePhaseToolwas in__all__but never imported intools/__init__.py.from agentkit.tools import AdvancePhaseToolraisedImportError. Added the import.P2: Error message truncation
chat.pyphase policy error echoed verbatim to WS client. Truncated to 200 chars to match nearby error paths and avoid leaking config internals.P2: policy_from_config refactor
Replaced 3× full-field PhasePolicy reconstruction with
dataclasses.replace()so new fields are not silently dropped in future reconstructions.Simplification (ce-simplify-code)
Removed over-engineered
_previous_valuestatic method inAdvancePhaseToolthat did index math on a hardcoded phase list. Instead, capture the previous phase before the transition — clearer intent, fewer lines, same behavior.Test Results
test_react_compression.py(confirmed unrelated to Wave 3)Plan
docs/plans/2026-06-29-004-feat-agent-wave3-strategic-plan.md
Depends on
92fc38de7etof50d3485ea