Skip to content

feat(rules): agent references, rule kinds and durations - #620

Open
ccf-lisa[bot] wants to merge 1 commit into
effectors/21-agent-routesfrom
effectors/22a-rules-helpers
Open

ccf-lisa[bot] wants to merge 1 commit into
effectors/21-agent-routesfrom
effectors/22a-rules-helpers

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

What

internal/service/rules helpers for the rule routes:

  • ResolveAgent(ref): an agent ID, or a name exactly one active agent has (ErrAgentNotFound, ErrAgentAmbiguous).
  • SupportsKind(action, kind): whether an effector action registered a rule kind.
  • ClearErrors(tx, rule, action?): drops a rule's recorded errors for its when or one action after that expression changes.
  • ParseDuration / FormatDuration: rule durations (for, delay, repeat) as Go durations plus a day count (30m, 7d, 1d12h), whole seconds, at most 3650 days.

Why

Plan: stack 3; left for stack 3 by stack 2. They land ahead of the routes so the rule PRs stay under 1000 lines.

Test evidence

  • TestParseDuration, TestFormatDuration (round trip), TestSupportsKind.
  • TestResolveAgent, TestClearErrors (Postgres).

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/service/rules/... pass.

Size

Counted: 225 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: 8a74eeb4-4c07-454f-a147-2979641370fe

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

ResolveAgent (an agent ID, or a name exactly one active agent has),
SupportsKind, ClearErrors and the rule duration format (Go durations
plus days: 30m, 7d, 1d12h), for the rule routes.

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