Skip to content

feat(effects): effect document and signing - #608

Open
ccf-lisa[bot] wants to merge 1 commit into
effectors/13b-rules-previewfrom
effectors/14-effect-document
Open

ccf-lisa[bot] wants to merge 1 commit into
effectors/13b-rules-previewfrom
effectors/14-effect-document

Conversation

@ccf-lisa

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

Copy link
Copy Markdown
Contributor

What

Effect document (wire interface, the effect document), new package internal/service/effects:

  • Document(in): id, generation, transition, state (pending shown as inactive), repeat count, rule, action (effector-action, registered effect, max-repeats, params as {} when the rule set none), target split into scheme and value, entered subjects with the documents the rule saw and links to the UI's evidence pages, the current generation's entered/left, the agent's last report (applied: status, message, links, refs), and the UI link {CCF_WEB_BASE_URL}/admin/rules/{rule}/effects/{effect} (the plan's /admin/rules link).
  • Webhook(in): the envelope, effect.apply, or effect.clear for cleared, disabled and removed.
  • LoadWebhook / LoadDocumentInput: build it from the database now, also for a soft-deleted rule and action.

Signing, new package internal/service/effector (wire interface, headers and signing): Ed25519 keys from CCF_EFFECTOR_SIGNING_KEY and CCF_EFFECTOR_SIGNING_KEY_NEXT (PKCS#8 PEM), kid (first 16 hex chars of SHA-256 of the public key), Standard Webhooks v1a signatures over {id}.{timestamp}.{body}, the signed headers (with the protocol version), and the published delivery keys (current, and next during a rotation).

Why

Plan: stack 2, PR 14.

Test evidence

  • document_test.go: every document field, params, the /admin/rules link, applied block, the clear envelope, event types per transition.
  • load_integration_test.go (Postgres): the document from rule, action (params, max repeats), registration, entered subjects (pending ones left out) in entry order with their documents and titles, the current generation's changes; a deleted rule and action still build as effect.clear; not found.
  • signer_test.go: signatures verify with the agent's algorithm (and fail when the id, timestamp or body change, or with only the next key), kid and key encoding, loading keys from files (missing, invalid, wrong key type, bad next key), no signer → no keys.

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 test pass; make swag no diff; go mod tidy no diff; go test -tags integration -p 1 on ./internal/service/effects/ ./internal/service/effector/ pass.

Size

Counted: 782 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: aaed45d7-1df6-4a05-868c-def67923aca4

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

internal/service/effects: the effect document (wire-interface.md) built
from an effect, its rule and rule action (max_repeats, params as {}
when unset), its entered subjects with the documents the rule saw, the
current generation's entered and left subjects, the agent's last status
report, subject links to the UI's evidence pages and the effect's UI
link at /admin/rules/{rule}/effects/{effect}; its webhook envelope
(effect.apply, or effect.clear for cleared, disabled and removed);
LoadWebhook builds it from the database, also for a soft-deleted rule.

internal/service/effector: the delivery signer: Ed25519 keys from
CCF_EFFECTOR_SIGNING_KEY(_NEXT) (PKCS#8 PEM), kid, Standard Webhooks v1a
signatures over {id}.{timestamp}.{body}, the signed headers, and the
published delivery keys.

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