feat(run): workflow rewrite — smart skip, org cycle, wave execution [v0.3.0 — 2/7]#732
feat(run): workflow rewrite — smart skip, org cycle, wave execution [v0.3.0 — 2/7]#732kokevidaurre merged 8 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a significant architectural shift in the squad workflow, moving from a turn-based conversation model to a parallel execution model (Plan → Execute → Review → Verify). It also adds support for wave-based parallel execution in org cycles, resume capabilities after quota hits, and improved context injection for agents. While the changes improve scalability and efficiency, several issues were identified in the new workflow implementation: a critical bug where providing a CLI task causes the lead agent to lose its planning context, a logic error that forces a 'converged' status even when tasks are incomplete, and a resource leak due to an uncleared timeout in the agent execution logic. Additionally, the task assignment fallback only utilizes a single worker, and the execution query limit may be too low for large organizations.
…focus/resume Run engine and workflow rewrite from v0.3.0 development cycle. Fixes applied from Gemini Code Assist review: - HIGH: task directive now includes planPrompt context (was bypassed) - HIGH: converged reflects actual status (was forced true) - MEDIUM: setTimeout cleared on close/error (resource leak) - MEDIUM: skip logic query limit bumped to 500 - MEDIUM: fallback assigns ALL workers, not just first - Added CLI_RUN_COMPLETE telemetry event - Removed unused imports (dirname, homedir, bold) Co-Authored-By: Claude <noreply@anthropic.com>
a467d1a to
c49bce9
Compare
Co-Authored-By: Claude <noreply@anthropic.com>
… async) findProjectRoot() returns string|null, not a Promise. Co-Authored-By: Claude <noreply@anthropic.com>
workflow.ts now uses spawn instead of execSync. Updated test mocks: - Added createMockChild helper for spawn-based child processes - Added appendFileSync to fs mock - Added observability mock (snapshotGoals, diffGoals, logObservability) - All 16 tests pass Co-Authored-By: Claude <noreply@anthropic.com>
Wave definitions had our internal squad names (research, intelligence, cli, marketing, etc.) hardcoded. A user's squads would never match. Now: all planned squads run in a single parallel wave. Custom wave ordering can be added later via SQUAD.md `wave:` field. Co-Authored-By: Claude <noreply@anthropic.com>
Auto-committing hq memory between waves was our internal pattern, not a product feature. Users won't have .agents/memory/ in their project root. Removed. Co-Authored-By: Claude <noreply@anthropic.com>
"No prompts in code" — behavioral instructions live in markdown.
Extracted the inline planPrompt template string to a markdown file
with {{VARIABLE}} placeholders. TypeScript loads and substitutes.
Also: squadContext is now included in the template (was passed as
empty string, losing goals/priorities context).
Co-Authored-By: Claude <noreply@anthropic.com>
No longer needed after removing hardcoded git commit between waves. Co-Authored-By: Claude <noreply@anthropic.com>
Summary — PR 2 of 7 for v0.3.0 release
Run engine and workflow rewrite. The core execution pipeline.
Changes (2 files, major)
--force,--focus,--resumeflags. Org cycle coordination. Wave-based parallel execution. Quota detection. Worker timeout. Goal/directive injection.Merge order
Depends on PR #731 (core-refactor). Merge second:
Test plan
npm run buildpassesReorganized from 219-commit develop branch for proper review.