fed-sx-m1: Step 4b-proj — 7 bootstrap projections + manifest update + 9 new parse tests (31 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 35s
This commit is contained in:
25
next/genesis/projections/audience-graph.sx
Normal file
25
next/genesis/projections/audience-graph.sx
Normal file
@@ -0,0 +1,25 @@
|
||||
;; next/genesis/projections/audience-graph.sx
|
||||
;;
|
||||
;; Per-actor follow / follower graph and audience caches. Folded
|
||||
;; from Follow / Accept / Reject / Undo{Follow}. Used by the
|
||||
;; activity router to expand :to / :cc audiences (Public,
|
||||
;; Followers, Direct) into concrete recipient sets. Per design §16.
|
||||
|
||||
(DefineProjection
|
||||
:name "audience-graph"
|
||||
:doc "Actor-id -> {following, followers, pending} sets.\n Updated by Follow / Accept / Reject / Undo. Federation\n (m2) wires this projection to the delivery queue."
|
||||
:initial-state {}
|
||||
:fold (fn
|
||||
(state act)
|
||||
(let
|
||||
((t (-> act :type)))
|
||||
(cond
|
||||
(= t "Follow")
|
||||
state
|
||||
(= t "Accept")
|
||||
state
|
||||
(= t "Reject")
|
||||
state
|
||||
(= t "Undo")
|
||||
state
|
||||
:else state))))
|
||||
Reference in New Issue
Block a user