Motivation
TransformBehaviour is currently registered under persisters: in extension.ex but does transformer work (injects action arguments). This is misclassified. Spark runs transformers and persisters in separate pipelines — before?/after? ordering declarations on a persister targeting a transformer are silently ignored.
Background
Spark pipeline order:
- Transformers — run in dependency order via
before?/after?; can modify DSL state; may also persist
- Persisters — always run after ALL transformers;
before?/after? only works relative to other persisters
- Verifiers — read-only, run last
A transformer that needs to expose baked state should call Transformer.persist/3 inline — no separate persister needed.
Work
- Audit each
Persist* module — confirm it only reads DSL state and bakes module functions (true persister), or identify if it computes/modifies state (should be a transformer)
- Audit
TransformBehaviour — identify what persisted state it reads; determine if dependencies exist on Persist* modules running first
- Move
TransformBehaviour to transformers: — if it reads persisted state from a Persist* module, fold that persisting work into TransformBehaviour directly
- Any other misclassified modules: fold their persisting into the transformer that needs the result, or confirm they are true persisters and leave them
Caution
Moving a module from persisters: to transformers: changes when it runs relative to Ash's own transformers. If it currently relies on Ash transformer output being available, moving it may break things silently. Audit dependencies before moving.
Out of scope
Adding new DSL features — this is a structural correctness fix only.
Motivation
TransformBehaviouris currently registered underpersisters:inextension.exbut does transformer work (injects action arguments). This is misclassified. Spark runs transformers and persisters in separate pipelines —before?/after?ordering declarations on a persister targeting a transformer are silently ignored.Background
Spark pipeline order:
before?/after?; can modify DSL state; may also persistbefore?/after?only works relative to other persistersA transformer that needs to expose baked state should call
Transformer.persist/3inline — no separate persister needed.Work
Persist*module — confirm it only reads DSL state and bakes module functions (true persister), or identify if it computes/modifies state (should be a transformer)TransformBehaviour— identify what persisted state it reads; determine if dependencies exist onPersist*modules running firstTransformBehaviourtotransformers:— if it reads persisted state from aPersist*module, fold that persisting work intoTransformBehaviourdirectlyCaution
Moving a module from
persisters:totransformers:changes when it runs relative to Ash's own transformers. If it currently relies on Ash transformer output being available, moving it may break things silently. Audit dependencies before moving.Out of scope
Adding new DSL features — this is a structural correctness fix only.