Skip to content

feat(worker): run the effector rule engine - #618

Open
ccf-lisa[bot] wants to merge 1 commit into
effectors/20a-effector-workersfrom
effectors/20b-effector-runtime
Open

ccf-lisa[bot] wants to merge 1 commit into
effectors/20a-effector-workersfrom
effectors/20b-effector-runtime

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What

When effectors are on (CCF_EFFECTOR_SIGNING_KEY) and the worker service runs:

  • the worker service builds the engine (CCF_EFFECTOR_CEL_COST_LIMIT, the agent instance stale-after), loads the signer (an unreadable key fails startup), registers the workers of 20a, adds their queues (rules 5, effects 10, rules-sweep 1) and periodic jobs (outbox dispatch every 2s, retention hourly, now sweep every minute), and gives the scheduler its River client;
  • ingested evidence (cmd/run.go, so batch ingest too) and workflow evidence record a subject-changed domain event in their transaction (cfg.EffectorDomainEvents()): the outbox wiring feat(effectors): config and domain event outbox #603 left for this stack.

With effectors off nothing changes: no producer writes the outbox and no effector job is registered. The agent instance prune also deletes the effector registrations of instances gone for the instance retention. .env.example says where deliveries go and what the UI links use.

Rules, rule actions and registrations are only created through the routes of stack 3, so until then the dispatcher marks evidence rows processed without evaluating anything.

Why

Plan: stack 2, PR 20. Last PR of stack 2.

Test evidence

  • effectors_pipeline_integration_test.go (Postgres, River running the registered workers, a fake agent that verifies Standard Webhooks signatures with the published keys): verification makes the agent ready; failing evidence ingested through EvidenceService → outbox → dispatch → evaluation → activated → signed delivery received; passing evidence → cleared → delivered as effect.clear; one EffectDelivery per generation with the stable webhook-id; every outbox row processed.
  • agent_instance_prune_integration_test.go: stale effector registrations pruned, heartbeating and recent ones kept.

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 test pass; make swag no diff; go mod tidy no diff; go test -tags integration -p 1 on ./internal/service/worker/ ./internal/service/effector/ ./cmd/ pass.

Size

Counted: 464 lines.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 92bebd66-54e3-4596-aff3-61f6cbf987b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

When effectors are on (CCF_EFFECTOR_SIGNING_KEY) and the worker service
runs:

- the worker service registers the rule engine's workers, adds its
  queues (rules, effects, and a single-worker rules-sweep) and periodic
  jobs (outbox dispatch every 2s, retention hourly, now sweep every
  minute), and enqueues the engine's jobs with its River client; an
  unreadable signing key fails startup;
- ingested evidence (cmd/run.go) and workflow evidence record a
  subject-changed domain event in their transaction.

With effectors off nothing changes: no producer writes the outbox and no
effector job is registered. The agent instance prune also deletes the
effector registrations of instances gone for the instance retention.

Rules, rule actions and agent registrations are only created through the
routes of the next stack, so until then the dispatcher marks evidence
rows processed without evaluating anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 branch has not been deployed

No deployments
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.

1 participant