Repository navigation
Closed
Description
Currently implement-slice.flow.ts stops after git push. A human (or the loop I'm running) then opens the PR, waits for CI, addresses Bugbot findings, and merges. That's not really flows-driven.
Extend the flow to own the merge boundary
After push, the flow:
- Open PR — via relayfile writeback (github adapter, per docs(examples): nightly-implementer design artifact for flows-driven dogfooding #295 design — writes idempotency-keyed JSON to mount, adapter opens PR).
- Subscribe to PR state via effect steps: poll
gh pr checks+gh api ... /comments. Each poll is a journaled effect step so replay is deterministic. - Repair loop — if CI fails or Bugbot posts Medium+ severity:
- Read the failure/finding as a new input
f.agent(cli, {task: "Fix this specific finding: ..."})in the SAME worktree- Auto-commit (deterministic step)
- Force-push
- Loop back to step 2
- Terminate on:
- All CI green + no Medium+ bot findings → merge via
gh pr merge --squash --delete-branch(also a journaled effect) - N iterations exhausted (say, 3 review-fix cycles) → park in
needs_humanwith the accumulated blockers listed in the completion output
- All CI green + no Medium+ bot findings → merge via
Journal properties
- Every poll = one journaled effect step
- Every "fix" iteration = a nested agent step + auto-commit + force-push
- Replay is safe: effect-record shows "PR already at green state" and skips further work
Deferred to follow-up
- Cross-provider PR feedback (e.g., CodeRabbit specific parsing, CodeRabbit + Bugbot + cubic all handled uniformly) — v1 handles Bugbot + CI only
- Retry storm protection (backoff between fix cycles)
- Priority queueing when multiple slices' loops all park needing human
Scope
- Extend
implement-slice.flow.tswith the loop OR create a companionclose-pr.flow.tsthat takes an open PR + brief and drives it to merge - New primitive proposal:
f.pollUntil(command, predicate, {timeout})for the subscription step (or express via existingf.runin a loop withf.dispatchrecursion — needs design) - Depends on relayfile writeback for github adapter (part of A-follow-up landing story)
Acceptance
- (i) Dispatch a slice; flow opens PR, waits for CI, addresses one Bugbot finding, PR turns green, flow merges — all one journaled run
- (ii) Force a CI failure; flow reads the log, re-runs agent, force-pushes, re-verifies — CI green → merge
- (iii) 3 iterations without convergence → parks
needs_humanwith accumulated findings
Related
- Extends implement-slice.flow.ts (dogfood pattern)
- Complements the review-swarm gate from docs(examples): nightly-implementer design artifact for flows-driven dogfooding #295 (that runs PRE-push; this runs POST-push)
- Enables truly hands-off spec dispatch — human only intervenes when the loop parks
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(sdk): parseStepTimeout hardens fractional-coefficient float preci…
feat(surface,sdk,kernel): deterministic-step timeout option f.run wit…
feat(examples,sdk): PR-close-loop flow — subscribe to CI+Bugbot, fix …
fix(dogfood): cap pollIntervalSeconds under deterministic-step lease (#…
feat(examples,sdk): PR-close-loop flow — subscribe to CI+Bugbot, fix …