Skip to content

feat(effector): target identities and pattern grammar - #595

Open
ccf-lisa[bot] wants to merge 2 commits into
effectors/03-docs-lldsfrom
effectors/04-targets
Open

ccf-lisa[bot] wants to merge 2 commits into
effectors/03-docs-lldsfrom
effectors/04-targets

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

What

New public package pkg/effector/targets, the target grammar shared by the API and the agent (effector interface, target pattern grammar):

  • ParseIdentity: scheme:value identities (scheme [a-z][a-z0-9-]*, printable value).
  • ParsePattern / Pattern.Match: scheme:glob patterns with *, **, ? and \\ escapes, matched by a linear dynamic program so a hostile pattern can't backtrack exponentially.
  • Matcher: include/exclude allowlists, Schemes() for the API's scheme check.
  • CompileValuePattern: a scheme's RE2 value-pattern, anchored to the whole value.
  • NormalizeBaseURL: the canonical effector base URL used to compare the admin-set URL with the one an instance registers.

Ported unchanged from the PoC. Standard library only; nothing in the API calls it yet (the rule engine and registration routes come in later stacks).

Why

Both sides validate targets with the same code, so the API never accepts a target the agent then refuses. Plan: stack 1, PR 4.

Test evidence

go test -cover ./pkg/effector/targets: 98.1% of statements. Table tests follow the grammar doc's examples.

Gate on this branch: go build ./... pass; go vet -tags integration ./... pass; make lint 0 new issues (6 pre-existing on main, untouched files); make test pass; make swag no diff; go mod tidy no diff. No integration tests in this package.

Size

Counted: 684 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: 47a0e9df-283f-4d6e-b84b-1ea17532bdda

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

@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: REQUEST_CHANGES

1 Must-fix.

Stack (gh stack 604): #592 → #593 → #594 → #595 → #596 → #597 → #598 → #599 → #600 → #601 → #602 → #603

Comment thread pkg/effector/targets/targets.go Resolved
ccf-lisa Bot and others added 2 commits December 2, 2026 08:34
pkg/effector/targets: target identities (scheme:value), target patterns
(scheme:glob) with include/exclude allowlists, scheme value-pattern
checks and effector base-URL normalisation, shared by the API and the
agent (docs/effectors/effector-interface.md, Target pattern grammar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CompileValuePattern compiled only the anchored wrapper, so an expression
that balances inside it (a)|(.*) escaped the anchors and matched any
value. The expression is now compiled alone first and rejected when it
isn't valid RE2.

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