Repository navigation
feat(effectors): models and migrations - #602
Open
ccf-lisa[bot] wants to merge 2 commits into
Open
ccf-lisa[bot] wants to merge 2 commits into
ccf-lisa[bot] wants to merge 2 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
ccf-lisa
Bot
force-pushed
the
effectors/10-models
branch
2 times, most recently
from
December 1, 2026 16:45
900e946 to
169df45
Compare
This was referenced Dec 1, 2026
gusfcarvalho
requested changes
Dec 1, 2026
ccf-lisa
Bot
force-pushed
the
effectors/10-models
branch
from
December 1, 2026 18:49
169df45 to
3cad378
Compare
internal/service/relational/effectors: the GORM models of the effector design (docs/effectors/lld/api.md, Data model): the domain event outbox, rules and rule actions (with params), per-subject matches and watches, effects with their subjects, history and deliveries, rule errors, and agent effector registrations and actions, with the indexes GORM tags can't express. Added to both AutoMigrate lists and to MigrateDown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EffectorAction.Locked dropped the decode error and returned no locks, so a corrupt stored list would let rule params through that the operator locked. It now returns ([]string, error), like DecodeParams, and callers fail closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccf-lisa
Bot
force-pushed
the
effectors/10-models
branch
from
December 2, 2026 12:07
3cad378 to
35495d4
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
New package
internal/service/relational/effectors: the GORM models of the API LLD's data model, allccf_-prefixed.DomainEventccf_domain_eventsRule,RuleActionccf_rules,ccf_rule_actionsparams)RuleSubjectMatch,RuleSubjectWatchccf_rule_subject_matches,…_watchesfortiming andnow-dependent subjectsEffect,EffectSubjectccf_effects,ccf_effect_subjectsEffectHistory,EffectDeliveryccf_effect_history,ccf_effect_deliveriesRuleErrorccf_rule_errorsAgentEffector,AgentEffectorInstance,EffectorActionccf_agent_effectors, …EnsureIndexesadds what GORM tags can't express (the outbox's partial indexes, the rule-error upsert key with a nil action as one key).Models()is added to both AutoMigrate lists (internal/service/migrator.go,internal/tests/migrate.go), andModelsReversed()to bothMigrateDowns. Small helpers encode and decode stored params.Ported from the PoC. The tables are created but nothing reads or writes them yet: the outbox writer comes in the next PR, the engine in stack 2.
Why
Plan: stack 1, PR 10.
Test evidence
models_integration_test.go(Postgres): a rule with an action and an effect, the effect key's uniqueness, the rule-error key treating a nil action as one key, the JSON columns of an effector action.models_test.go(new, unit):Models/ModelsReversedorder,DecodeParams/EncodeParams(null, empty, round trip, errors), the params accessors.Gate on this branch:
go build ./...pass;go vet -tags integration ./...pass;make lint0 new issues (6 pre-existing onmain, untouched files);make testpass;make swagno diff;go mod tidyno diff;go test -tags integration -p 1 ./internal/service/relational/effectors/ ./internal/service/pass (includes the migrator's integration tests).Notes for reviewers
Size
Counted: 600 lines.
🤖 Generated with Claude Code