Skip to content

feat(api): rule sources, preview and effector actions - #623

Open
ccf-lisa[bot] wants to merge 2 commits into
effectors/22c-rule-changesfrom
effectors/23-rule-editor
Open

ccf-lisa[bot] wants to merge 2 commits into
effectors/22c-rule-changesfrom
effectors/23-rule-editor

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

What

The routes the rule editor reads (rule:read):

  • GET /api/rules/sources: the trigger catalogue (rules.Sources()).
  • POST /api/rules/preview: validated like a create (422, 403 without the source read), then rules.Preview (feat(rules): preview #607): subjects evaluated and matching now, the first 100 matching subjects with their documents, per action the targets with their subjects, rejected identities with the reason, the effect document each allowed target would get on activation (at most 20 subjects), costs, each agent's webhook status, evaluation errors and warnings. Nothing is written.
  • GET /api/effector-actions: one entry per (agent, action) as the most recently seen instance registered it, with fresh and instances, accepted-schemes (declared schemes some include pattern uses) and params (schema, defaults, locked, effective-defaults); filters agent, kind, effect, target-scheme. A stored lock list that doesn't decode is shown as ["*"], as the save check treats it (review thread on feat(effectors): models and migrations #602).

Why

Plan: stack 3, PR 22 (preview route) and PR 23 (/api/effector-actions).

Test evidence

rule_editor_integration_test.go: sources (and 401), preview (5 subjects, 4 matching, one target for two streams with its effect document, a lowercase ID rejected with the reason, a failing target expression counted and reported, a fixed target collecting every subject, 422, nothing saved), preview 403 without the source read, effector actions (sorting, filters, accepted schemes, params and effective defaults, an action without a schema, unknown agent), undecodable locks shown as *.

Gate on this branch: go build ./... pass; go vet -tags integration ./... pass; golangci-lint v2.15.0 (shared CI config, incl. unconvert) 0 new issues; make test pass; make swag no diff (regenerated docs/ committed here); go mod tidy no diff; go test -tags integration -p 1 on ./internal/api/handler/... pass.

Size

Counted: 701 lines (added + removed, tests included; docs/docs.go and docs/swagger.* excluded).

🤖 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: 047c6bba-27af-480a-9fb4-9664c3af9140

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

ccf-lisa Bot and others added 2 commits December 2, 2026 11:04
GET /api/rules/sources, POST /api/rules/preview (rules.Preview plus the
effect document each target would get, costs and effector status) and
GET /api/effector-actions (accepted target schemes, params with the
effective defaults; a lock list that doesn't decode is shown as "*").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r status can't be read

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