Description
Priority: High
Dependencies: Issue #1
Description:
Implement the externalized state management system that tracks workflow execution and parses state updates from OpenCode output.
Requirements:
WorkflowState dataclass with fields: current_phase, iteration, is_complete, termination_reason, payload
JSON serialization/deserialization methods
StateParser class to extract state updates from LLM stdout
Support both XML-style (<state_update>...</state_update>) and markdown code block (```json) formats
Graceful handling of malformed output
Acceptance Criteria:
State can be serialized to JSON and deserialized back
Parser extracts valid JSON from XML tags
Parser extracts valid JSON from markdown code blocks
Parser returns None for malformed output (no crashes)
Activity
fix: resolve dead imports, end_state_condition eval, and stop mechanism