Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Entries for unreleased work are not written here directly. Each issue drops a
fragment in [`changelog.d/`](https://github.com/riddler/statifier_persistence/blob/v0.24.2/changelog.d/README.md); the fragments are assembled
fragment in [`changelog.d/`](https://github.com/riddler/statifier_persistence/blob/v0.25.0/changelog.d/README.md); the fragments are assembled
into a version section at release. See that README for the format and for when a
change warrants an entry at all.

## [0.25.0] 2026-10-13

Feature release: a host registers its guard functions once, with `function_providers:` on `step/5`, inside `initialize:` on `create/4` and on `Driver.new/3`, and a resumed execution evaluates a `cond` or `expr` that calls one. A list that does not resolve is refused at the entry, and `start_child_at/6` refuses it in its own shape.

Upgrading: no schema migration, and the `statifier` requirement moves from `~> 2.9` to `~> 2.15`. `{:function_providers, reason}` joins `t:StatifierPersistence.Executions.error/0`, answered only when a host passes the option and the list does not resolve. See `docs/upgrading.md`, "0.24 to 0.25".

### Added

- `function_providers:` on `StatifierPersistence.Executions.step/5`, inside `initialize:` on `create/4`, and on `StatifierPersistence.Driver.new/3` as a driver-level default each call may override: the host's guard functions are stamped onto the loaded position beside `routes:`, `invoke_types:` and `send_types:`, so a resumed execution evaluates a `cond` or `expr` that calls one without the host touching `Statifier.MachineState`. A durable subchart child the driver creates does not inherit the list.
- When `function_providers:` is passed, a list that does not resolve is refused at the entry with `{:error, {:function_providers, reason}}`, before any lock, load or write, on `step/5`, `create/4` and the driver's `create/3`, `send_event/4`, `done_invocation/5`, `failed_invocation/5` and `answer_parent/3`; `t:StatifierPersistence.Executions.error/0` gains the arm.
- When a driver's `function_providers:` list does not resolve, `StatifierPersistence.Driver.start_child_at/6` refuses with `{:refused, {:function_providers, reason}}`, its existing refusal shape, before any child is created or anything is written; a driver with a list that resolves, or with none, starts children as before.

### Changed

- The `statifier` requirement moves from `~> 2.9` to `~> 2.15`, the first release carrying host function providers; a host on statifier 2.9 to 2.14 moves statifier with it.

## [0.24.2] 2026-10-11

Docs release: the upgrading page appears in the HexDocs sidebar under
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ crash semantics. This package is that loop, packaged.
```elixir
def deps do
[
{:statifier_persistence, "~> 0.24.0"},
{:statifier_persistence, "~> 0.25.0"},
# Optional, for the Postgres adapter:
{:ecto_sql, "~> 3.10"}
]
Expand Down
3 changes: 0 additions & 3 deletions changelog.d/sp-8ktk.md

This file was deleted.

8 changes: 0 additions & 8 deletions changelog.d/sp-aa9z.md

This file was deleted.

64 changes: 58 additions & 6 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Upgrading a host from 0.13 to 0.24.2
# Upgrading a host from 0.13 to 0.25.0

This page says what a host changes to move `statifier_persistence` from
0.13.0 to 0.24.2, one minor at a time. A host here is the code that
0.13.0 to 0.25.0, one minor at a time. A host here is the code that
embeds the package: the module that calls `use StatifierPersistence.Ecto`,
the migrations it runs, the options it passes to
`StatifierPersistence.Executions` and `StatifierPersistence.Driver`, the
Expand All @@ -14,10 +14,10 @@ Take the minors in order, and move the pin with each one, as the README
recommends: `{:statifier_persistence, "~> 0.14.0"}`, then `"~> 0.15.0"`,
then `"~> 0.16.0"`, then `"~> 0.17.0"`, then `"~> 0.18.0"`, then
`"~> 0.19.0"`, then `"~> 0.20.0"`, then `"~> 0.21.0"`, then `"~> 0.22.0"`,
then `"~> 0.23.0"`, then `"~> 0.24.0"`.
then `"~> 0.23.0"`, then `"~> 0.24.0"`, then `"~> 0.25.0"`.
The `statifier` floor stays `~> 2.6` through 0.17.0; 0.18.0 moves it to
`~> 2.9`, and every later release through 0.24.2 keeps it there. The
release after 0.24.2 moves it to `~> 2.15`.
`~> 2.9`, and every later release through 0.24.2 keeps it there; 0.25.0
moves it to `~> 2.15`.

## Before you start: the database is at V07

Expand All @@ -35,7 +35,7 @@ with its own migration,
and an install still short of V06 follows the V06 ordering rule in the
`StatifierPersistence.Ecto.Migrations` documentation first. No release before
0.17.0 adds a migration; 0.17.0 does (V08, under "0.16 to 0.17"), and
no release from 0.18.0 through 0.24.0 adds one, and neither do the
no release from 0.18.0 through 0.25.0 adds one, and neither do the
0.23.1, 0.24.1 and 0.24.2 patches.

## 0.13 to 0.14
Expand Down Expand Up @@ -471,3 +471,55 @@ answer a host matches is added or removed.
A documentation release: no library code differs from 0.24.1, and the
`"~> 0.24.0"` pin already takes it. This page is now listed in the
HexDocs sidebar, under Upgrading. **NONE**.

## 0.24 to 0.25

### 0.25.0

Schema: **NONE**. The `statifier` floor moves from `~> 2.9` to `~> 2.15`,
the first release carrying host function providers, and no answer a host
matches is removed. One arm is added to a tuple a host may match:
`{:function_providers, reason}`, and it is answered only when a host passes
the new `function_providers:` option and the list does not resolve.

- **If your `statifier` requirement allows 2.9 through 2.14**, move it to
`~> 2.15`: `{:statifier, "~> 2.15"}`, or a looser one that still excludes
every release before 2.15. A host that takes `statifier` only through
this package needs no change in its own `mix.exs`, and `mix deps.update
statifier` fetches 2.15. Nothing in
`statifier_persistence` answers differently for a chart that calls no
host function. What statifier itself changed between 2.9 and 2.15,
including a document it now refuses to compile, is in statifier's
CHANGELOG and upgrading page, which a host reads for the releases it
skips.
- **If your charts call functions of your own in a `cond` or an `expr`**,
give the list of your `Predicator.FunctionProvider` modules to
`function_providers:` instead of stamping it by hand with
`Statifier.MachineState.put_function_providers/2`. It goes in three
places: on `StatifierPersistence.Executions.step/5`; inside `initialize:`
on `StatifierPersistence.Executions.create/4`; and on
`StatifierPersistence.Driver.new/3` as a driver-level default that each
call may override. The package stamps the list on the loaded position
beside `routes:`, `invoke_types:` and `send_types:`, so a resumed
execution evaluates the call with no touch of
`Statifier.MachineState` from you. A durable subchart child the driver
creates does not inherit the list. A host that registers no function
provider changes nothing: **NONE**.
- **If you pass `function_providers:` and match on the errors of
`StatifierPersistence.Executions` or the driver**, add the
`{:function_providers, reason}` arm to the match. A list that does not
resolve is refused at the entry with `{:error, {:function_providers,
reason}}`, before any lock, load or write, on `step/5`, `create/4`, and
the driver's `create/3`, `send_event/4`, `done_invocation/5`,
`failed_invocation/5` and `answer_parent/3`. `reason` is one of
`{:not_a_list, value}`, `{:invalid_provider, entry, message}` and
`{:shadowed_names, names}`
(`t:StatifierPersistence.Executions.function_providers_reason/0`). A
host that passes no list never sees the arm.
- **If you call `StatifierPersistence.Driver.start_child_at/6` on a driver
that carries a `function_providers:` list**, add
`{:refused, {:function_providers, reason}}` to the refusals you match: a
list that does not resolve is refused there before any child is created
or anything is written, in the door's own `{:refused, reason}` shape. It
emits no `[:statifier_persistence, :child, :refused]` event. A driver
with a list that resolves, or with none, starts children as before.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule StatifierPersistence.MixProject do
use Mix.Project

@version "0.24.2"
@version "0.25.0"
@source_url "https://github.com/riddler/statifier_persistence"

def project do
Expand Down
Loading