Repository navigation
feat(rules): evaluation, targets and errors - #606
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/13-rules-evaluate
branch
from
December 1, 2026 18:49
d5d466f to
9a13683
Compare
ccf-lisa
Bot
force-pushed
the
effectors/13-rules-evaluate
branch
from
December 2, 2026 12:07
9a13683 to
2efc116
Compare
This was referenced Dec 2, 2026
internal/service/rules: evidence subject documents built from each stream's latest evidence in a fixed number of queries (labels, subjects with props and links, components with their identity labels), keyset paging over streams, EvaluateSubject (when, then each action's targets: fixed or CEL, deduplicated, sorted, and checked against the registered effector action's schemes, value patterns and target allowlist the way the agent checks them), RecordError (upserted per rule, action and subject; long messages cut on a UTF-8 boundary) and LookupEffectorAction (the freshest instance's registration, and whether it is fresh). Nothing calls them yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccf-lisa
Bot
force-pushed
the
effectors/13-rules-evaluate
branch
from
December 2, 2026 14:45
2efc116 to
21d3a56
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 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
internal/service/rules(API LLD, evidence source andrules.evaluate-subject):EvidenceSubjects/EvidenceSubjectFor: each stream's subject document from its latest evidence (greatestend), in a fixed number of queries: labels, subjects with props and links, components (system components with their defined component's identity labels, and subjects that are defined components).EvidenceStreamPagepages through streams by keyset.EvaluateSubject(when, plans, doc, now):when, then each action's targets (fixed identity or CEL), deduplicated and sorted; identities the registered effector action can't accept are left out with a reason. A failingwhenis no match, a failing target no target.CheckTarget: the checks the agent does: thescheme:valuegrammar, a declared scheme, its value pattern, the action's include/exclude patterns.RecordError: upserts an evaluation error per (rule, action, subject) with a count and first/last seen; messages are cut on a UTF-8 boundary.LookupEffectorAction: the freshest instance's registration of an action, and whether it is fresh.Not here, on purpose: the preview (next PR) and what only the rule routes use (
ResolveAgent,ClearErrors, durations, rule action params checks), which stack 3 ports with the routes.Why
Plan: stack 2, PR 13, split into this PR and the preview (13b) to stay under 1000 lines.
Test evidence
evaluate_test.go:CheckTarget(every rejection, no registered action, a broken value pattern),EvaluateSubject(fixed and CEL targets, duplicates, invalid identities with reasons, failing target and when, no match,now), UTF-8 truncation.rules_integration_test.go(Postgres): subject documents from the latest evidence, defined components as subjects, system components with and without a definition, a missing stream, paging;LookupEffectorAction(none, stale, freshest wins);RecordError(one row per key with a nil action as one key, count, truncation, first/last seen).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/rules/pass.Size
Counted: 742 lines.
🤖 Generated with Claude Code