Skip to content

feat(act): add settle() for debounced correlate→drain#424

Merged
Rotorsoft merged 1 commit intomasterfrom
feat/settle
Feb 22, 2026
Merged

feat(act): add settle() for debounced correlate→drain#424
Rotorsoft merged 1 commit intomasterfrom
feat/settle

Conversation

@Rotorsoft
Copy link
Owner

Summary

  • Adds app.settle() — a debounced, non-blocking correlate→drain loop that emits a "settled" lifecycle event when the system reaches consistency
  • Consolidates the scheduleDrain()/eventBus pattern (previously reimplemented in every scaffolded app's helpers.ts) into the framework
  • drain() remains unchanged as the synchronous single-cycle method for tests/scripts
  • Adds SettleOptions type, stop_settling() cleanup method, and normalizes timer field naming

Test plan

  • All 249 existing tests pass
  • New tests cover: debounce coalescing, "settled" event emission, concurrent settle guard, custom options
  • pnpm typecheck clean
  • pnpm lint clean
  • Verify scaffold skill generates correct app.settle() + app.on("settled") pattern in new apps

🤖 Generated with Claude Code

…lifecycle event

Consolidates the scheduleDrain()/eventBus pattern (previously reimplemented
in every scaffolded app) into a framework-level settle() method. drain()
remains unchanged as the synchronous single-cycle method for tests/scripts.

- Add SettleOptions type extending DrainOptions
- Add settle() method with debounce, guard, and correlate→drain loop
- Add "settled" lifecycle event emitted when system reaches consistency
- Add stop_settling() for cleanup symmetry with stop_correlations()
- Normalize timer field naming (_correlation_timer, _settle_timer)
- Update skill templates to use app.settle() + app.on("settled")
- Update docs (CLAUDE.md, AGENT.md, README.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Rotorsoft Rotorsoft merged commit 6893784 into master Feb 22, 2026
5 checks passed
@github-actions
Copy link

🎉 This PR is included in version @rotorsoft/act-v0.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant