Skip to content

86 transformers persisters verifiers#92

Merged
matt-beanland merged 6 commits into
devfrom
86-transformers-persisters-verifiers
Apr 28, 2026
Merged

86 transformers persisters verifiers#92
matt-beanland merged 6 commits into
devfrom
86-transformers-persisters-verifiers

Conversation

@matt-beanland
Copy link
Copy Markdown
Collaborator

No description provided.

relate_instance functions now pass %Instance{id: result.id} to Provider
calls rather than converting the domain-specific struct via Map.from_struct.
This respects Ash's static relationship contracts (Feature.instance_id
belongs to Diffo.Provider.Instance, not Shelf or Card).

build_after/2 ends with Ash.load/2 to load relationships back onto the
correct domain struct, replacing the per-domain reload that was masking
the struct type loss. build_after/4 removed entirely.

Also replaces Map.put with struct update syntax and drops dead-looking
aliases in favour of fully qualified module names in DSL options.
Five Spark.Dsl.Transformer modules bake structural DSL data into zero-cost
module functions (__diffo_specification__/0, __diffo_characteristics__/0,
__diffo_features__/0, __diffo_party_declarations__/0) and a behavioural
transformer (TransformBuildActions) composes them into __diffo_build_before__/1
and __diffo_build_after__/2.

2-arity variants added to Specification, Feature, Characteristic, and Party
helpers accept pre-baked declaration lists instead of doing runtime Info
introspection, so the generated build hooks pay no Info lookup cost at runtime.

Transformer ordering is enforced via after?/1 so TransformBuildActions always
runs after all four structural transformers.
…s, verifiers, and Info lookups

Restructures the extension into structure do (specification, characteristics, features, parties) and behaviour do (actions), bakes all DSL data at compile time via persisters, generates build_before/1/build_after/2 and single-item lookup functions (characteristic/1, feature/1, feature_characteristic/2, party/1) via TransformBehaviour, adds uniqueness and cross-reference verifiers for all DSL sections, exposes matching lookups on Diffo.Provider.Instance.Info, and removes superseded 1-arity helpers and old transformer files.
…livebook update

Strengthens party verifier to check party_type extends BaseParty via PartyInfo.party?/1, adds instance?/1 to Extension.Info mirroring the same idiom, and rewrites the provider extension livebook to use the structure do / behaviour do DSL with automatic build wiring.
@matt-beanland matt-beanland linked an issue Apr 28, 2026 that may be closed by this pull request
@matt-beanland matt-beanland merged commit 5c4226e into dev Apr 28, 2026
2 checks passed
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.

transformers, persisters, verifiers

1 participant