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:
33
next/genesis/projections/define-registry.sx
Normal file
33
next/genesis/projections/define-registry.sx
Normal file
@@ -0,0 +1,33 @@
|
||||
;; next/genesis/projections/define-registry.sx
|
||||
;;
|
||||
;; The meta-projection: folds Create{Define*{...}} activities into
|
||||
;; the kernel registry. Resolves the chicken-and-egg circle —
|
||||
;; bootstrap.erl populates the registry directly at startup from
|
||||
;; the genesis bundle, and from then on define-registry's fold
|
||||
;; keeps it current as new Define* activities arrive. Per design §5.
|
||||
|
||||
(DefineProjection
|
||||
:name "define-registry"
|
||||
:doc "Maps {kind, name} -> definition entry. Folded from\n Create{DefineActivity|DefineObject|DefineProjection|\n DefineValidator|DefineCodec|DefineSigSuite|...}. Kind is\n derived from the inner :object :type tag."
|
||||
:initial-state {}
|
||||
:fold (fn
|
||||
(state act)
|
||||
(let
|
||||
((obj (-> act :object)) (otype (-> act :object :type)))
|
||||
(cond
|
||||
(= (-> act :type) "Create")
|
||||
(cond
|
||||
(= otype "DefineActivity")
|
||||
(assoc-in state (list :activity-types (-> obj :name)) obj)
|
||||
(= otype "DefineObject")
|
||||
(assoc-in state (list :object-types (-> obj :name)) obj)
|
||||
(= otype "DefineProjection")
|
||||
(assoc-in state (list :projections (-> obj :name)) obj)
|
||||
(= otype "DefineValidator")
|
||||
(assoc-in state (list :validators (-> obj :name)) obj)
|
||||
(= otype "DefineCodec")
|
||||
(assoc-in state (list :codecs (-> obj :name)) obj)
|
||||
(= otype "DefineSigSuite")
|
||||
(assoc-in state (list :sig-suites (-> obj :name)) obj)
|
||||
:else state)
|
||||
:else state))))
|
||||
Reference in New Issue
Block a user