# Diffo v0.5.0 - Table of Contents

> TMF Service and Resource Manager with a difference

## Pages

- [Guide](readme.md)
- [License](mit.md)

- How-to
  - [Using Diffo.Type](use_diffo_type.md)
  - [Using the Diffo Provider Extension](use_diffo_provider_extension.md)
  - [Instance Versioning with the Diffo Provider](use_diffo_provider_versioning.md)

- Tutorials
  - [Tutorial](diffo.md)

- DSLs
  - [DSL: Diffo.Provider.Extension](dsl-diffo-provider-extension.md)

## Modules

- [Diffo](Diffo.md): Diffo - TMF Service and Resource Management with a difference
- [Diffo.Provider](Diffo.Provider.md): Provider API endpoint
- [Diffo.Provider.AssignableCharacteristic](Diffo.Provider.AssignableCharacteristic.md): Typed characteristic carrying pool bounds and assignment algorithm.
- [Diffo.Provider.AssignableCharacteristic.Value](Diffo.Provider.AssignableCharacteristic.Value.md): JSON value struct for AssignableCharacteristic.
- [Diffo.Provider.AssignableValue](Diffo.Provider.AssignableValue.md): Ash Typed Struct for Assignable Characteristic Value
- [Diffo.Provider.Assigner](Diffo.Provider.Assigner.md): Helper to perform Assignment using `Diffo.Provider.AssignmentRelationship`.
- [Diffo.Provider.Assignment](Diffo.Provider.Assignment.md): Ash Typed Struct for Assignment
- [Diffo.Provider.AssignmentRelationship](Diffo.Provider.AssignmentRelationship.md): Ash Resource for a pool assignment relationship.
- [Diffo.Provider.BaseCharacteristic](Diffo.Provider.BaseCharacteristic.md): Ash Resource Fragment which is the point of extension for typed TMF Characteristics.
- [Diffo.Provider.BaseGeographicAddress](Diffo.Provider.BaseGeographicAddress.md): Ash Resource Fragment for TMF674 GeographicAddress — postal-address-style Place.
- [Diffo.Provider.BaseGeographicLocation](Diffo.Provider.BaseGeographicLocation.md): Ash Resource Fragment for TMF675 GeographicLocation — geometry-bearing Place
(a point or polygon region in WGS-84).
- [Diffo.Provider.BaseGeographicSite](Diffo.Provider.BaseGeographicSite.md): Ash Resource Fragment for TMF675 GeographicSite — named-location-style Place
(exchange, office, branch, data centre, etc.).
- [Diffo.Provider.BaseIndividual](Diffo.Provider.BaseIndividual.md): Ash Resource Fragment for TMF632 Individual — a Party representing a single
human being.
- [Diffo.Provider.BaseInstance](Diffo.Provider.BaseInstance.md): Ash Resource Fragment which is the shared base for your TMF Service or Resource Instance.
- [Diffo.Provider.BaseOrganization](Diffo.Provider.BaseOrganization.md): Ash Resource Fragment for TMF632 Organization — a Party representing a group
of people identified by shared interests or purpose (business, department,
enterprise).
- [Diffo.Provider.BaseParty](Diffo.Provider.BaseParty.md): Ash Resource Fragment which is the foundation for TMF Party subtypes.
- [Diffo.Provider.BasePlace](Diffo.Provider.BasePlace.md): Ash Resource Fragment which is the foundation for TMF Place subtypes.
- [Diffo.Provider.BaseRelationship](Diffo.Provider.BaseRelationship.md): Ash Resource Fragment which is the shared foundation for TMF Relationship resources.
- [Diffo.Provider.Calculations.FieldFromAssignment](Diffo.Provider.Calculations.FieldFromAssignment.md): Reads a field directly from an `AssignmentRelationship` record.
- [Diffo.Provider.Calculations.FieldViaAssignedRelationship](Diffo.Provider.Calculations.FieldViaAssignedRelationship.md): Reads a field from the source instance of an `AssignmentRelationship`.
- [Diffo.Provider.Calculations.FieldViaRelationship](Diffo.Provider.Calculations.FieldViaRelationship.md): Reads a field from target instances reached via `DefinedSimpleRelationship`.
- [Diffo.Provider.Calculations.InheritedCharacteristic](Diffo.Provider.Calculations.InheritedCharacteristic.md): Backing calculation for `inherited_characteristic` DSL declarations.
- [Diffo.Provider.Calculations.InheritedParty](Diffo.Provider.Calculations.InheritedParty.md): Backing calculation for `inherited_party` DSL declarations.
- [Diffo.Provider.Calculations.InheritedPlace](Diffo.Provider.Calculations.InheritedPlace.md): Backing calculation for `inherited_place` DSL declarations.
- [Diffo.Provider.Calculations.PoolCharacteristics](Diffo.Provider.Calculations.PoolCharacteristics.md): Loads the `AssignableCharacteristic` pool records associated with an
instance, one per `pool :name, :thing` declaration on the resource module.
- [Diffo.Provider.Calculations.ProjectedRef](Diffo.Provider.Calculations.ProjectedRef.md): Reusable cross-world projection calculation.
- [Diffo.Provider.Calculations.ReverseInheritedCharacteristic](Diffo.Provider.Calculations.ReverseInheritedCharacteristic.md): Backing calculation for `reverse_inherited_characteristic` DSL declarations.
- [Diffo.Provider.Calculations.TypedCharacteristics](Diffo.Provider.Calculations.TypedCharacteristics.md): Loads all typed `BaseCharacteristic`-derived records associated with an
instance.
- [Diffo.Provider.Changes.Assign](Diffo.Provider.Changes.Assign.md): After-action change for the standard `:assign_*` pattern.
- [Diffo.Provider.Changes.Define](Diffo.Provider.Changes.Define.md): After-action change for the standard `:define` pattern.
- [Diffo.Provider.Changes.Relate](Diffo.Provider.Changes.Relate.md): After-action change for the standard `:relate` pattern.
- [Diffo.Provider.Characteristic](Diffo.Provider.Characteristic.md): Ash Resource for a TMF Characteristic
- [Diffo.Provider.Characteristic.Extension](Diffo.Provider.Characteristic.Extension.md): Marker extension identifying a module as a valid characteristic resource.
- [Diffo.Provider.Characteristic.Extension.Transformers.GenerateActions](Diffo.Provider.Characteristic.Extension.Transformers.GenerateActions.md): Synthesises default `:create` and `:update` actions on
`BaseCharacteristic`-derived resources from the resource's declared public
attributes.
- [Diffo.Provider.DefinedSimpleRelationship](Diffo.Provider.DefinedSimpleRelationship.md): Ash Resource for a relationship with an optional single embedded characteristic,
set at creation and never changed.
- [Diffo.Provider.DomainFragment](Diffo.Provider.DomainFragment.md): Domain fragment for Ash domains that extend the Diffo Provider.
- [Diffo.Provider.Entity](Diffo.Provider.Entity.md): Ash Resource for a TMF Entity
- [Diffo.Provider.EntityRef](Diffo.Provider.EntityRef.md): Ash Resource for a TMF Entity Reference
- [Diffo.Provider.Event](Diffo.Provider.Event.md): Ash Resource for a TMF Event
- [Diffo.Provider.Extension](Diffo.Provider.Extension.md): Unified DSL extension for all Diffo provider resource kinds.
- [Diffo.Provider.Extension.Info](Diffo.Provider.Extension.Info.md)
- [Diffo.Provider.Extension.InheritedCharacteristicDeclaration](Diffo.Provider.Extension.InheritedCharacteristicDeclaration.md): DSL entity for an `inherited_characteristic` declaration inside `characteristics do`
on an Instance resource.
- [Diffo.Provider.Extension.InheritedPartyDeclaration](Diffo.Provider.Extension.InheritedPartyDeclaration.md): DSL entity for an `inherited_party` declaration inside `parties do` on an Instance resource.
- [Diffo.Provider.Extension.InheritedPlaceDeclaration](Diffo.Provider.Extension.InheritedPlaceDeclaration.md): DSL entity for an `inherited_place` declaration inside `places do` on an Instance resource.
- [Diffo.Provider.Extension.InstanceRole](Diffo.Provider.Extension.InstanceRole.md): DSL entity declaring a role a Party or Place kind plays with respect to Instances
- [Diffo.Provider.Extension.PartyDeclaration](Diffo.Provider.Extension.PartyDeclaration.md): DSL entity declaring a party role on an Instance
- [Diffo.Provider.Extension.PartyRole](Diffo.Provider.Extension.PartyRole.md): DSL entity declaring a role a Party or Place kind plays with respect to Parties
- [Diffo.Provider.Extension.Persisters.PersistCharacteristics](Diffo.Provider.Extension.Persisters.PersistCharacteristics.md): Persists characteristic declarations and bakes `characteristics/0`.
- [Diffo.Provider.Extension.Persisters.PersistFeatures](Diffo.Provider.Extension.Persisters.PersistFeatures.md): Persists feature declarations and bakes features/0
- [Diffo.Provider.Extension.Persisters.PersistInstances](Diffo.Provider.Extension.Persisters.PersistInstances.md): Persists instance role declarations and bakes instances/0
- [Diffo.Provider.Extension.Persisters.PersistParties](Diffo.Provider.Extension.Persisters.PersistParties.md): Persists party declarations/roles and bakes parties/0
- [Diffo.Provider.Extension.Persisters.PersistPlaces](Diffo.Provider.Extension.Persisters.PersistPlaces.md): Persists place declarations/roles and bakes places/0
- [Diffo.Provider.Extension.Persisters.PersistPools](Diffo.Provider.Extension.Persisters.PersistPools.md): Persists pool declarations and bakes pools/0
- [Diffo.Provider.Extension.Persisters.PersistSpecification](Diffo.Provider.Extension.Persisters.PersistSpecification.md): Normalises specification DSL options, persists them, and bakes specification/0
- [Diffo.Provider.Extension.PlaceDeclaration](Diffo.Provider.Extension.PlaceDeclaration.md): DSL entity declaring a place role on an Instance
- [Diffo.Provider.Extension.PlaceRole](Diffo.Provider.Extension.PlaceRole.md): DSL entity declaring a role a Party or Place kind plays with respect to Places
- [Diffo.Provider.Extension.ReverseInheritedCharacteristicDeclaration](Diffo.Provider.Extension.ReverseInheritedCharacteristicDeclaration.md): DSL entity for a `reverse_inherited_characteristic` declaration inside
`characteristics do` on an Instance resource.
- [Diffo.Provider.Extension.Transformers.TransformBehaviour](Diffo.Provider.Extension.Transformers.TransformBehaviour.md): Generates build_before/1 and build_after/2, and injects build arguments into declared create actions
- [Diffo.Provider.Extension.Transformers.TransformInheritedJason](Diffo.Provider.Extension.Transformers.TransformInheritedJason.md): Surfaces inherited and reverse-inherited results into the TMF JSON view.
- [Diffo.Provider.Extension.Transformers.TransformInheritedRefs](Diffo.Provider.Extension.Transformers.TransformInheritedRefs.md): Injects Ash calculations for `inherited_place`, `inherited_party`,
`inherited_characteristic`, and `reverse_inherited_characteristic` declarations.
- [Diffo.Provider.Extension.Transformers.TransformRelationships](Diffo.Provider.Extension.Transformers.TransformRelationships.md): Resolves the relationships pipeline and bakes permitted_source_roles/0 and permitted_target_roles/0
- [Diffo.Provider.Extension.Verifiers.VerifyBehaviour](Diffo.Provider.Extension.Verifiers.VerifyBehaviour.md): Verifies that actions declared in behaviour do exist as Ash actions of the correct type
- [Diffo.Provider.Extension.Verifiers.VerifyCharacteristics](Diffo.Provider.Extension.Verifiers.VerifyCharacteristics.md): Verifies characteristic names are unique and value_type modules exist and extend BaseCharacteristic
- [Diffo.Provider.Extension.Verifiers.VerifyFeatures](Diffo.Provider.Extension.Verifiers.VerifyFeatures.md): Verifies feature names are unique and feature characteristic value_type modules exist and extend BaseCharacteristic
- [Diffo.Provider.Extension.Verifiers.VerifyInstances](Diffo.Provider.Extension.Verifiers.VerifyInstances.md): Verifies instance role declarations — no duplicates, instance_type modules must exist and extend BaseInstance
- [Diffo.Provider.Extension.Verifiers.VerifyParties](Diffo.Provider.Extension.Verifiers.VerifyParties.md): Verifies party declarations and roles — no duplicates, party_type modules must exist and extend BaseParty
- [Diffo.Provider.Extension.Verifiers.VerifyPlaces](Diffo.Provider.Extension.Verifiers.VerifyPlaces.md): Verifies place declarations and roles — no duplicates, place_type modules must exist and extend BasePlace
- [Diffo.Provider.Extension.Verifiers.VerifyPools](Diffo.Provider.Extension.Verifiers.VerifyPools.md): Verifies pool names are unique
- [Diffo.Provider.Extension.Verifiers.VerifyRelationships](Diffo.Provider.Extension.Verifiers.VerifyRelationships.md): Verifies that relationship role declarations are atoms, not modules or other invalid values
- [Diffo.Provider.Extension.Verifiers.VerifySpecification](Diffo.Provider.Extension.Verifiers.VerifySpecification.md): Verifies specification DSL values satisfy the Specification resource constraints
- [Diffo.Provider.Extension.Verifiers.VerifySpecificationKind](Diffo.Provider.Extension.Verifiers.VerifySpecificationKind.md): Verifies the declared `specification do type` matches the instance's kind
- [Diffo.Provider.ExternalIdentifier](Diffo.Provider.ExternalIdentifier.md): Ash Resource for a TMF ExternalIdentifier
- [Diffo.Provider.Feature](Diffo.Provider.Feature.md): Ash Resource for a TMF Feature
- [Diffo.Provider.GeographicAddress](Diffo.Provider.GeographicAddress.md): Ash Resource for a TMF674 GeographicAddress.
- [Diffo.Provider.GeographicLocation](Diffo.Provider.GeographicLocation.md): Ash Resource for a TMF675 GeographicLocation.
- [Diffo.Provider.GeographicSite](Diffo.Provider.GeographicSite.md): Ash Resource for a TMF675 GeographicSite.
- [Diffo.Provider.Individual](Diffo.Provider.Individual.md): Ash Resource for a TMF632 Individual.
- [Diffo.Provider.Instance](Diffo.Provider.Instance.md): The generic TMF Service Instance, and the abstract reader for the
Service/Resource cascade.
- [Diffo.Provider.Instance.Extension](Diffo.Provider.Instance.Extension.md): Marker extension — identifies BaseInstance-derived resources. DSL is in `Diffo.Provider.Extension`.
- [Diffo.Provider.Instance.Extension.Info](Diffo.Provider.Instance.Extension.Info.md)
- [Diffo.Provider.Instance.Extension.PartyDeclaration](Diffo.Provider.Instance.Extension.PartyDeclaration.md): PartyDeclaration - DSL entity declaring a party role on an Instance

- [Diffo.Provider.Instance.Extension.Persisters.PersistCharacteristics](Diffo.Provider.Instance.Extension.Persisters.PersistCharacteristics.md): Persists characteristic declarations and bakes characteristics/0
- [Diffo.Provider.Instance.Extension.Persisters.PersistFeatures](Diffo.Provider.Instance.Extension.Persisters.PersistFeatures.md): Persists feature declarations and bakes features/0
- [Diffo.Provider.Instance.Extension.Persisters.PersistParties](Diffo.Provider.Instance.Extension.Persisters.PersistParties.md): Persists party declarations and bakes parties/0
- [Diffo.Provider.Instance.Extension.Persisters.PersistPlaces](Diffo.Provider.Instance.Extension.Persisters.PersistPlaces.md): Persists place declarations and bakes places/0
- [Diffo.Provider.Instance.Extension.Persisters.PersistSpecification](Diffo.Provider.Instance.Extension.Persisters.PersistSpecification.md): Normalises specification DSL options, persists them, and bakes specification/0
- [Diffo.Provider.Instance.Extension.PlaceDeclaration](Diffo.Provider.Instance.Extension.PlaceDeclaration.md): PlaceDeclaration - DSL entity declaring a place role on an Instance

- [Diffo.Provider.Instance.Extension.Verifiers.VerifyBehaviour](Diffo.Provider.Instance.Extension.Verifiers.VerifyBehaviour.md): Verifies that actions declared in behaviour do exist as Ash actions of the correct type
- [Diffo.Provider.Instance.Extension.Verifiers.VerifyCharacteristics](Diffo.Provider.Instance.Extension.Verifiers.VerifyCharacteristics.md): Verifies that characteristic names are unique and value_type modules exist
- [Diffo.Provider.Instance.Extension.Verifiers.VerifyFeatures](Diffo.Provider.Instance.Extension.Verifiers.VerifyFeatures.md): Verifies that feature names are unique, feature characteristic names are unique, and value_type modules exist
- [Diffo.Provider.Instance.Extension.Verifiers.VerifyParties](Diffo.Provider.Instance.Extension.Verifiers.VerifyParties.md): Verifies party role declarations — no duplicates, party_type modules must exist
- [Diffo.Provider.Instance.Extension.Verifiers.VerifySpecification](Diffo.Provider.Instance.Extension.Verifiers.VerifySpecification.md): Verifies that the specification DSL values satisfy the Specification resource's attribute constraints
- [Diffo.Provider.Instance.Info](Diffo.Provider.Instance.Info.md): Public introspection API for resources extending Diffo.Provider.BaseInstance
- [Diffo.Provider.Note](Diffo.Provider.Note.md): Ash Resource for a TMF Note
- [Diffo.Provider.Organization](Diffo.Provider.Organization.md): Ash Resource for a TMF632 Organization.
- [Diffo.Provider.Party](Diffo.Provider.Party.md): Abstract Party reader — plumbing, not a TMF subtype recommendation.
- [Diffo.Provider.Party.Extension](Diffo.Provider.Party.Extension.md): Marker extension — identifies BaseParty-derived resources. DSL is in `Diffo.Provider.Extension`.
- [Diffo.Provider.Party.Extension.Info](Diffo.Provider.Party.Extension.Info.md)
- [Diffo.Provider.Party.Extension.InstanceRole](Diffo.Provider.Party.Extension.InstanceRole.md): InstanceRole - DSL entity declaring a role this Party kind plays with respect to Instances

- [Diffo.Provider.Party.Extension.PartyRole](Diffo.Provider.Party.Extension.PartyRole.md): PartyRole - DSL entity declaring a role this Party kind plays with respect to other Parties

- [Diffo.Provider.Party.Extension.Persisters.PersistInstances](Diffo.Provider.Party.Extension.Persisters.PersistInstances.md): Persists instance role declarations and bakes instances/0
- [Diffo.Provider.Party.Extension.Persisters.PersistParties](Diffo.Provider.Party.Extension.Persisters.PersistParties.md): Persists party role declarations and bakes parties/0
- [Diffo.Provider.Party.Extension.Persisters.PersistPlaces](Diffo.Provider.Party.Extension.Persisters.PersistPlaces.md): Persists place role declarations and bakes places/0
- [Diffo.Provider.Party.Extension.PlaceRole](Diffo.Provider.Party.Extension.PlaceRole.md): PlaceRole - DSL entity declaring a role this Party kind plays with respect to Places

- [Diffo.Provider.Party.Extension.Verifiers.VerifyRoles](Diffo.Provider.Party.Extension.Verifiers.VerifyRoles.md): Verifies role declarations across instances, parties, and places sections
- [Diffo.Provider.PartyRef](Diffo.Provider.PartyRef.md): Ash Resource for a TMF PartyRef
- [Diffo.Provider.Place](Diffo.Provider.Place.md): Abstract Place reader — plumbing, not a TMF subtype recommendation.
- [Diffo.Provider.Place.Extension](Diffo.Provider.Place.Extension.md): Marker extension — identifies BasePlace-derived resources. DSL is in `Diffo.Provider.Extension`.
- [Diffo.Provider.Place.Extension.Info](Diffo.Provider.Place.Extension.Info.md)
- [Diffo.Provider.Place.Extension.InstanceRole](Diffo.Provider.Place.Extension.InstanceRole.md): InstanceRole - DSL entity declaring a role this Place kind plays with respect to Instances

- [Diffo.Provider.Place.Extension.PartyRole](Diffo.Provider.Place.Extension.PartyRole.md): PartyRole - DSL entity declaring a role this Place kind plays with respect to Parties

- [Diffo.Provider.Place.Extension.Persisters.PersistInstances](Diffo.Provider.Place.Extension.Persisters.PersistInstances.md): Persists instance role declarations and bakes instances/0
- [Diffo.Provider.Place.Extension.Persisters.PersistParties](Diffo.Provider.Place.Extension.Persisters.PersistParties.md): Persists party role declarations and bakes parties/0
- [Diffo.Provider.Place.Extension.Persisters.PersistPlaces](Diffo.Provider.Place.Extension.Persisters.PersistPlaces.md): Persists place role declarations and bakes places/0
- [Diffo.Provider.Place.Extension.PlaceRole](Diffo.Provider.Place.Extension.PlaceRole.md): PlaceRole - DSL entity declaring a role this Place kind plays with respect to other Places

- [Diffo.Provider.Place.Extension.Verifiers.VerifyRoles](Diffo.Provider.Place.Extension.Verifiers.VerifyRoles.md): Verifies role declarations across instances, parties, and places sections
- [Diffo.Provider.PlaceRef](Diffo.Provider.PlaceRef.md): Ash Resource for a TMF Place Reference
- [Diffo.Provider.ProcessStatus](Diffo.Provider.ProcessStatus.md): Ash Resource for a TMF ProcessStatus
- [Diffo.Provider.Relationship](Diffo.Provider.Relationship.md): 
Ash Resource for a TMF Service or Resource Relationship
- [Diffo.Provider.Resource](Diffo.Provider.Resource.md): Ash Resource Fragment for the Resource half of the Instance cascade (TMF639).
- [Diffo.Provider.Service](Diffo.Provider.Service.md): Ash Resource Fragment for the Service half of the Instance cascade (TMF638).
- [Diffo.Provider.Specification](Diffo.Provider.Specification.md): Ash Resource for a TMF Service or Resource Specification.
- [Diffo.Provider.Validations.ValidateSpecificationKind](Diffo.Provider.Validations.ValidateSpecificationKind.md): Validates that the specification an instance is being specified by matches the
instance kind: a **Service** must be specified by a `:serviceSpecification`, a
**Resource** by a `:resourceSpecification`.
- [Diffo.Type.CharacteristicValue](Diffo.Type.CharacteristicValue.md): Ash type for a typed characteristic value.
- [Diffo.Type.Dynamic](Diffo.Type.Dynamic.md): `Diffo.Type.Dynamic` is an `Ash.Type.NewType` for values whose exact type is not known until
runtime. The `:type` field holds the `Ash.Type.NewType` module and `:value` holds the cast value.
- [Diffo.Type.NameValueArrayPrimitive](Diffo.Type.NameValueArrayPrimitive.md): Ash TypedStruct for a named array of primitive values.
- [Diffo.Type.NameValuePrimitive](Diffo.Type.NameValuePrimitive.md): Ash TypedStruct for a named primitive value.
- [Diffo.Type.Primitive](Diffo.Type.Primitive.md): `Diffo.Type.Primitive` is a discriminated union of primitive types: string, integer, float,
boolean, date, time, datetime, and duration.
- [Diffo.Type.Value](Diffo.Type.Value.md): `Diffo.Type.Value` is an `Ash.Type.NewType` union that holds either a `Diffo.Type.Primitive`
or a `Diffo.Type.Dynamic` value.
- [Diffo.Unknown](Diffo.Unknown.md): Sentinel value for *"we tried and couldn't determine this in our current view
of the graph"* — the X state, complementary to Ash's `NotLoaded` (the U state).
- [Diffo.Unwrap](Diffo.Unwrap.md): `Diffo.Unwrap` is a protocol for extracting the underlying Elixir value from Diffo and Ash
wrapper types. It is defined with `@fallback_to_any true`, so any value without an explicit
implementation is returned unchanged.
- [Diffo.Util](Diffo.Util.md): Utility methods

- [Diffo.Uuid](Diffo.Uuid.md): Validate and/or create Uuid

## Mix Tasks

- [mix diffo.install](Mix.Tasks.Diffo.Install.md): Installs Diffo

