Skip to content

feat(flow): cadence-gate the auto-Act after a flow - #117

Merged
eduralph merged 1 commit into
mainfrom
feat/109-act-cadence-gate
Jun 22, 2026
Merged

feat(flow): cadence-gate the auto-Act after a flow#117
eduralph merged 1 commit into
mainfrom
feat/109-act-cadence-gate

Conversation

@eduralph

Copy link
Copy Markdown
Owner

Summary

Closes #109.

pdca flow auto-ran Act after every COMPLETE — including single-item flows — spending an interactive leaf on insufficient cross-cycle signal. Gate the auto-run on a configurable cadence that persists across flow invocations: run Act only when [driver].act_cadence (default 5) cycles have frozen since the last Act.

The "since last Act" count comes from a durable marker (the frozen-bundle count at the last review, in process/.act-reviewed) — so five separate one-bundle flows trip it on the fifth, and it works even when a command-mode Act writes no act-log entry (the review still happened). Below the threshold the flow skips with a hint; pdca act log runs Act on demand (and resets the cadence); --no-act still forces skip; cadence 1 restores run-after-every-flow.

  • config: [driver].act_cadence. act: mark_reviewed / cycles_since_review / act_due. leaves.run_act resets the marker (both modes); act log --append resets it too. flow: _maybe_run_act gates the single and batch auto-run.

Verification

ActCadence: Act held below cadence then fires on the 3rd flow (persistence across invocations); marker resets after a run. Full suite: 171 OK.

🤖 Generated with Claude Code

`pdca flow` auto-ran the Act leaf after every COMPLETE — including single- and
few-item flows. But Act is a cross-cycle cadence beat: it reviews FROZEN cycles across
the index for recurring signals and only yields a real delta once enough cycles have
accumulated. Auto-running it after one slice spends an interactive leaf on insufficient
signal and conflates the per-contribution loop with the cross-cycle cadence.

Gate the auto-run on a configurable cadence that PERSISTS across flow invocations: run
Act only when `[driver].act_cadence` (default 5) cycles have frozen SINCE the last Act.
The "since last Act" count is derived from a durable marker (the frozen-bundle count at
the last review, in process/.act-reviewed) — so five separate one-bundle flows trip it
on the fifth, and it works even when a command-mode Act writes no act-log entry (the
review still happened). Below the threshold the flow skips with a hint; `pdca act log`
runs Act on demand (and resets the cadence); `--no-act` still forces skip; cadence 1
restores run-after-every-flow.

- config: [driver].act_cadence (floor 1).
- act: mark_reviewed / cycles_since_review / act_due (frozen is monotonic, so
  current-minus-marker is the unreviewed count).
- leaves.run_act resets the marker whenever Act runs (both modes); cli `act log
  --append` resets it too.
- flow: _maybe_run_act gates both the single and batch auto-run.

Tests: ActCadence — Act held below cadence then fires on the 3rd flow (persistence
across invocations), and the marker resets after a run. Existing flow tests set
act_cadence=1 to keep asserting Act-after-flow. Full suite: 171 OK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Eduard Ralph <15236434+eduralph@users.noreply.github.com>
@eduralph
eduralph force-pushed the feat/109-act-cadence-gate branch from 9b902a9 to 9c2b13a Compare June 22, 2026 18:50
@eduralph
eduralph merged commit b2d8146 into main Jun 22, 2026
2 checks passed
@eduralph
eduralph deleted the feat/109-act-cadence-gate branch June 22, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flow: don't auto-run Act after small flows — Act is a cadence beat the human should trigger

1 participant