Repository navigation
feat(effects): rule and rule action changes - #612
Open
ccf-lisa[bot] wants to merge 1 commit into
Open
ccf-lisa[bot] wants to merge 1 commit into
ccf-lisa[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
ccf-lisa
Bot
force-pushed
the
effectors/16b-rule-lifecycle
branch
from
December 1, 2026 18:49
3e902ca to
836f331
Compare
ccf-lisa
Bot
force-pushed
the
effectors/16b-rule-lifecycle
branch
from
December 2, 2026 12:07
836f331 to
41640e5
Compare
This was referenced Dec 2, 2026
rules.Lifecycle is how a rule or rule action change reaches its effects, inside the transaction that saves it; effects.Engine implements it: - rule created, enabled or its trigger changed: backfill the rule; - rule disabled or deleted: every delivered effect is cleared as disabled or removed, pending ones go inactive silently, and the rule's matches and watches are dropped; - action created or changed: backfill that action; a params change also redelivers its active and finished effects (transition redelivered) so plugins re-render them; - action repointed to another agent or effector action: its effects on the old one are removed, and it is backfilled from scratch; - action deleted: its effects are removed. The jobs a change decides are written to the outbox with it (backfills join ticks and deliveries) and enqueued after commit. Redeliver bumps an active or finished effect's generation with the same content. A raised max_repeats does not resume a finished effect (an open question). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccf-lisa
Bot
force-pushed
the
effectors/16b-rule-lifecycle
branch
from
December 2, 2026 14:45
41640e5 to
be4826c
Compare
This was referenced Dec 2, 2026
gusfcarvalho
approved these changes
Dec 2, 2026
gusfcarvalho
left a comment
Contributor
There was a problem hiding this comment.
ccf-review: APPROVE
no findings.
Stack (gh stack 604): #592 → #593 → #594 → #595 → #596 → #597 → #598 → #599 → #600 → #601 → #602 → #603 → #605 → #606 → #607 → #608 → #609 → #610 → #611 → #612 → #613 → #614 → #615 → #616 → #617 → #618 → #619 → #620 → #621 → #622 → #623 → #624 → #625 → #626 → #627 → #628 → #629 → #630
This was referenced Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
rules.Lifecycleis how a rule or rule action change reaches its effects, inside the transaction that saves it (user interface, rule actions are resources; API LLD, effect state machine).effects.Engine.Applyimplements it:disabled/removed; pending ones go inactive silently; matches and watches droppedredelivered) so plugins re-renderremoved; backfilled from scratchremovedThe jobs a change decides are written to the outbox with it (backfills join ticks and deliveries) and enqueued after commit (
AfterCommit).Machine.Redeliverbumps an active or finished effect's generation with the same content.Raising
max_repeatsdoes not resume a finished effect: that is an open question in the plan, deliberately not implemented.Nothing calls
Applyuntil the rule routes (stack 3).Why
Plan: stack 2, split out of the plan's PR 15/16 to keep each under 1000 lines.
Test evidence
lifecycle_integration_test.go(Postgres): disable (pending effects aren't delivered), enable (backfill, generations keep increasing), delete (removed, the document still builds); repoint (removed on the old agent, fresh on the new one, an old tick is a no-op) and delete an action; params changes redeliver active and finished effects only, with the new params in the document; an evaluation and a backfill wait for a disable and then write nothing; a rule change's backfill is written to the outbox;Redeliver(not redeliverable, not found, ok).jobs_integration_test.gocovers backfill payloads.Gate on this branch:
go build ./...pass;go vet -tags integration ./...pass;make lint(golangci-lint v2.15.0, CI config) 0 new issues;make testpass;make swagno diff;go mod tidyno diff;go test -tags integration -p 1on./internal/service/effects/ ./internal/service/rules/pass.Size
Counted: 558 lines.
🤖 Generated with Claude Code