Skip to content

Commit cdbbea4

Browse files
committed
release 0.4.0
1 parent b9c4ffb commit cdbbea4

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,54 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
1111

1212
<!-- changelog -->
1313

14+
## [v0.4.0](https://github.com/diffo-dev/diffo/compare/v0.3.0...v0.4.0) (2026-05-20)
15+
16+
### Breaking Changes
17+
18+
* `Diffo.Provider.AssignedToRelationship` replaced by `Diffo.Provider.AssignmentRelationship` — stores pool assignments with top-level `pool`, `thing`, `value`, and `alias` scalar attributes, enabling graph-level filtering in AshNeo4j queries. Any existing graph data on `AssignedToRelationship` nodes must be migrated.
19+
* `create_assigned_to_relationship` code interface removed — use `create_assignment_relationship` instead.
20+
* `instance.assignments` now returns `AssignmentRelationship` records (struct name change only).
21+
22+
### Features
23+
24+
* **`DefinedSimpleRelationship`** — new resource for relationships carrying an optional single embedded `NameValuePrimitive` characteristic, frozen at creation. Used by the Assigner and available as a general-purpose committed-relationship primitive. Accessible via `instance.assignments`.
25+
* **`AssignmentRelationship` aliases** — the `alias` attribute on `AssignmentRelationship` (identity `[:target_id, :alias]`) gives a consuming instance a stable name for an assignment slot. Mirrors the `[:source_id, :alias]` identity on `DefinedSimpleRelationship`. Alias semantics are the foundation of the first-order expectation system (#74).
26+
* **`relationships do` DSL** — source and target validation pipeline for Instance resources. `ValidateRelationshipPermitted` is injected automatically into relate actions. Supports `:all`, `:none`, and explicit role-name lists.
27+
* **Resource lifecycle states**`resource_state` attribute on Instance resources with standard TMF states (`:installed`, `:operating`, `:retired`, etc.). The Assigner enforces `:operating` before allowing assignment.
28+
* **`inherited_place` / `inherited_party` DSL** — declare inside `places do` / `parties do` on an Instance resource to generate an Ash calculation that traverses the assignment graph by alias and inherits a place or party from the source instance. No `PlaceRef`/`PartyRef` edge is created — the calculation is the reference. Supports single-hop (default: role name as alias) and multi-hop (`via:` list).
29+
* **`FieldFromAssignment`** (`Diffo.Provider.Calculations.FieldFromAssignment`) — reads a field directly from an `AssignmentRelationship` record (`:value`, `:pool`, `:thing`, `:alias`). Filtered by optional `alias:`. Returns a list.
30+
* **`FieldViaAssignedRelationship`** (`Diffo.Provider.Calculations.FieldViaAssignedRelationship`) — traverses `AssignmentRelationship` in reverse (target → source) and reads a named field from each source instance. Supports multi-hop `via:` traversal. Returns a list.
31+
* **`FieldViaRelationship`** (`Diffo.Provider.Calculations.FieldViaRelationship`) — traverses `DefinedSimpleRelationship` forward (source → target) filtered by optional `alias:` and/or `type:`, and reads a named field from each target instance. Returns a list.
32+
33+
### Notable Changes
34+
35+
* Assigner rearchitected — `AssignmentRelationship` carries `pool`, `thing`, `value`, `alias` as top-level attributes for AshNeo4j-level filtering; `assigned_values` and `free_values` use query-level filtering rather than in-memory computation where possible.
36+
* `TransformBehaviour` moved from persister pipeline to transformer pipeline for correct Spark ordering relative to Ash's own transformers.
37+
* Characteristic type verifier improved — rejects `characteristic` DSL declarations whose type module is not derived from `BaseCharacteristic`.
38+
39+
### Documentation
40+
41+
* `usage-rules.md` — new sections covering alias semantics, `inherited_place`/`inherited_party` DSL, and all three field calculation modules including a decision table.
42+
* `AGENTS.md` — updated project structure, DSL inline examples for inherited refs, and new common mistakes section entries.
43+
* Provider Extension livebook — new section "Aliases, Inherited DSL, and Field Calculations" with Compute-domain examples.
44+
45+
### What's Changed
46+
47+
* defined_simple_relationship by @matt-beanland in https://github.com/diffo-dev/diffo/pull/142
48+
* refactored assigner using defined_simple_relationship by @matt-beanland in https://github.com/diffo-dev/diffo/pull/143
49+
* relationships DSL by @matt-beanland in https://github.com/diffo-dev/diffo/pull/146
50+
* relationships target side validation by @matt-beanlanda in https://github.com/diffo-dev/diffo/pull/148
51+
* clean code by @matt-beanland in https://github.com/diffo-dev/diffo/pull/150
52+
* improved assigner using aggregates by @matt-beanland in https://github.com/diffo-dev/diffo/pull/151
53+
* refactor transformers and persisters by @matt-beanland in https://github.com/diffo-dev/diffo/pull/152
54+
* resource lifecycle state by @matt-beanland in https://github.com/diffo-dev/diffo/pull/154
55+
* inherited party and place via instance DSL by @matt-beanland in https://github.com/diffo-dev/diffo/pull/155
56+
* agent guidance by @matt-beanland in https://github.com/diffo-dev/diffo/pull/161
57+
* FieldViaAssignedRelationship calculation by @matt-beanland in https://github.com/diffo-dev/diffo/pull/162
58+
* FieldViaRelationship calculation by @matt-beanland in https://github.com/diffo-dev/diffo/pull/165
59+
* FieldFromAssignment calculation by @matt-beanland in https://github.com/diffo-dev/diffo/pull/164
60+
* docs pass — inherited DSL, aliases, and field calculations by @matt-beanland in https://github.com/diffo-dev/diffo/pull/166
61+
1462
## [v0.3.0](https://github.com/diffo-dev/diffo/compare/v0.2.2...v0.3.0) (2026-05-17)
1563

1664
### Breaking Changes

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Diffo.MixProject do
66
@moduledoc false
77
use Mix.Project
88

9-
@version "0.3.0"
9+
@version "0.4.0"
1010
@name "Diffo"
1111
@description "TMF Service and Resource Manager with a difference"
1212
@github_url "https://github.com/diffo-dev/diffo"

0 commit comments

Comments
 (0)