Skip to content

dev#110

Merged
matt-beanland merged 32 commits into
mainfrom
dev
May 6, 2026
Merged

dev#110
matt-beanland merged 32 commits into
mainfrom
dev

Conversation

@matt-beanland
Copy link
Copy Markdown
Collaborator

No description provided.

matt-beanland and others added 30 commits April 26, 2026 19:49
Adds `parties do` DSL to the Instance Extension, allowing resources to
declare which party roles they accept, with optional min/max multiplicity
constraints. Runtime enforcement is applied in `build_before` via
`Party.validate_parties/1`, checking roles against declarations and
rejecting builds that violate constraints.

Renames Party Extension DSL sections from singular (`instance`/`party`)
to plural (`instances`/`parties`) for consistency. Replaces `.license`
sidecar files with `REUSE.toml`. Fixes ExDoc sidebar by removing a
duplicate `docs:` key in mix.exs that shadowed the DSL extras config.
Adds `Assignment.compare/2` so `Enum.sort/2` works in the Assigner.
Updates all three livebooks to use the local path dep and cleans up
stale commented-out version pins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icity-reference-and-calculated-defaults

Instance DSL parties — multiplicity, validation, and enforcement
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.
…fiers

86 transformers persisters verifiers
…ns, persisters, verifiers, and tests

Extracts BasePlace as a Spark.Dsl.Fragment following the BaseParty pattern. Adds instances/parties/places DSL sections to Place.Extension and Party.Extension, with persisters baking role declarations onto resources at compile time and a VerifyRoles verifier checking for duplicates and correct base types across all sections. Adds places do to Instance.Extension structure do, with PersistPlaces and place/1 generated via TransformBehaviour.

Four test fixtures illustrate the simple and complex patterns for both Party and Place. Moduledocs across BaseInstance, BaseParty, and BasePlace now document the domain-specific attributes contract explicitly. Livebook updated with a Place Extension section and simplified cluster creation using the domain API.
…ion-doesnt-set-description

79 provider instance specification doesnt set description
Add minor_version, patch_version and tmf_version to the specification
do DSL section. Nil values are stripped before create_specification so
unset fields fall back to Specification resource defaults.
…ion-dsl-additional-fields

94 provider instance specification dsl additional fields
Add Specification moduledoc covering identity model, semantic versioning
table, and major version lifecycle phases. Add versioning_test.exs proving
the full NBN/RSP lifecycle end-to-end. Add use_diffo_provider_versioning.livemd
with a six-phase walkthrough: V1 → V1.1 minor (instant universal propagation) →
V2 publish (concurrent coexistence) → V1 freeze → RSP migration via
respecify_instance → V1 withdrawal with spec-node guard.

Closes #96
…k-warnings-on-compilation

removed duplicate tests
@matt-beanland matt-beanland merged commit 0cee37b into main May 6, 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.

1 participant