CLI harness, conflict gates, swarm branches, and V4 wiring#108
Conversation
Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
- scripts/full-cli-harness.sh exercises all dispatch commands with git init for mock build, team-pack init smoke, and optional live plan when CURSOR_API_KEY is set (resume loop through agent-pass checkpoints). - scripts/cli-harness.sh waits for doctor completion before asserting output. - Wire both harnesses into CI after demo scripts. - Update docs/agents/README.md verification commands and counts. Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR wires a new --swarm-branches flag into the CLI and plan execution (parallel swarm research), blocks approvals when open conflicts exist (BLOCKED), emits conflict events and conflict-aware approval actions in orchestration, adds deterministic tmux and full end-to-end CLI harnesses, integrates harnesses into CI, and updates docs/tests/verification records. ChangesSwarm research and approval conflict gating
CLI testing harness infrastructure
Verification state and agent documentation
Sequence DiagramsequenceDiagram
participant Reviewer
participant CLI as CLI (plan.ts)
participant Parser as parsePlanArgs
participant Orchestration as Plan Orchestration
participant Swarm as Swarm Research
participant Conflicts as Conflict Query
participant Approval as Approval Gate
Reviewer->>CLI: foundry plan --swarm-branches 3 "idea"
CLI->>Parser: parsePlanArgs(argv)
Parser->>Parser: Parse --swarm-branches 3
Parser-->>CLI: Return {swarmBranches: 3, swarmResearch: true, idea: "idea"}
CLI->>Orchestration: executePlan({swarmBranches: 3, swarmResearch: true, ...})
Orchestration->>Swarm: runResearchSwarm(parallel: true)
Swarm-->>Orchestration: Returns differing research outcomes
Orchestration->>Orchestration: Emit conflict_raised event
Orchestration->>Conflicts: listOpenConflicts(runDir)
Conflicts-->>Approval: Returns [swarm-disagreement conflict ID]
Approval->>Approval: Compute blocked_actions=[approve], next_actions=[resolve]
Approval-->>Orchestration: Return gated actions
Orchestration-->>Reviewer: Status awaiting_approval with conflict info
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Doctor harness steps allow exit 1 when CURSOR_API_KEY is unset (GitHub CI). Export FOUNDRY_BUILD_MOCK=1 for the entire mock build section. Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
Integrate conflict approval gate, plan orchestrate blocked_actions, and deterministic cli-harness waits. Resolve harness merge (doctor wait without requiring exit 0 for CI). Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
- Merge conflict approval gate from PR #107 (already integrated). - Expand help.ts for all dispatch commands and flags. - Add plan --swarm-branches (2-5) with parallel swarm research. - Emit conflict_raised events when swarm disagreement writes artifacts. - Cloud AGENTS.md pi stub note; VERIFIED_STATE #37 done, #32 progress. - tests: plan-args, cli help coverage (234 tests pass). Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
Summary
Consolidates verification harness work, conflict approval blocking (formerly PR #107), and incremental V4 fixes.
Harness & CI
scripts/full-cli-harness.sh— all dispatch commands; optional live plan with checkpoint resumescripts/cli-harness.sh— deterministic tmux pattern waits (CI-safe without requiring doctor exit 0)#37 Conflict pipeline (DONE)
foundry approvewhen open conflicts existblocked_actionswhen conflicts remainconflict_raisedon swarm disagreement#32 Swarm (progress)
foundry plan --swarm-branches N(2–5), parallel research fanoutUX
foundry --helpfor tui/daemon/notify/update and key flagsVerification
npm test: 234/234 passbash scripts/full-cli-harness.sh(live plan whenCURSOR_API_KEYset)bash scripts/cli-harness.shSupersedes draft PRs #106 and #107.
Summary by cubic
Adds an exhaustive CLI harness with optional live Composer verification, and enforces a conflict-aware approval gate that blocks
approveuntil conflicts are resolved. Also addsplan --swarm-branchesfor parallel research and expands CLI help.New Features
scripts/full-cli-harness.sh: runs all dispatch commands end-to-end; optional liveplanwith resume; secrets leak check; CI runs this andscripts/cli-harness.sh; docs updated with verification steps.approvewhen open conflicts exist;status/banner show next vs blocked actions;approveexits with a helpful error.foundry plan --swarm-branches N(2–5): enables parallel swarm research; emitsconflict_raisedevents on disagreement;helpnow lists all commands and flags (tui, daemon, notify, update).Bug Fixes
scripts/cli-harness.shusing pattern-based checks to avoid thedoctortiming race; CI harness tolerates missingCURSOR_API_KEYand setsFOUNDRY_BUILD_MOCK=1for the mock build.Written for commit 050150e. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Features
Documentation
Tests