From 56f1ec7b5ffa3318da936c0e456f73520f4f8179 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Mon, 12 Oct 2026 14:47:13 -0600 Subject: [PATCH 1/3] Carries the upgrading page to 2.15.0 The title and the intro's range move from 2.14.0 to 2.15.0, and the intro gains one sentence naming the hosts 2.15.0's changed answer reaches. A 2.15.0 section closes the page in the house shape, written from the fragment's host-facing sentences: - a host must change only where the new compile refusal reaches it: a chart that calls a function that is not In, a predicator builtin or a declared host function is refused with {:unknown_function, name, source}, where it compiled and raised error.execution at each call; - a host may start registering host functions with :function_providers (or declaring names with :function_names), with the purity contract, the resume and replay re-stamp, and the invoke non-inheritance; - the conformance corpus does not change. Documentation only: no changelog.d fragment, as changelog.d/README.md excludes documentation. Refs: st-3tmk --- docs/upgrading.md | 48 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index 7532ba06..ee66d9af 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -1,8 +1,8 @@ -# Upgrading from 2.5 to 2.14.0: what a host changes +# Upgrading from 2.5 to 2.15.0: what a host changes This page is for a host: the application that compiles charts, starts executions and supplies the services a chart reaches through `` and -``. For each release from 2.6.0 to 2.14.0 it says what a host must +``. For each release from 2.6.0 to 2.15.0 it says what a host must change to take the release, and then what a host may start doing with it. Where a host must change nothing, the page says NONE. The [Changelog](../CHANGELOG.md) says what the library changed; this page @@ -34,6 +34,10 @@ element, or that matches the validator's reasons exhaustively (the Breaking entry); a host that cancels a budget-halted session with events queued; and a host that waited for a further halted message after a delayed send fired into a budget-halted session. +2.15.0 changes one answer, and its "must change" names the hosts it +reaches: a host whose charts call a function from `cond` or `expr` that +is not `In`, a predicator builtin or a function the host declares, and a +host that matches the compiler's error reasons exhaustively. A dependency requirement of `{:statifier, "~> 2.5"}` already accepts every version on this page. Raise it only when your host calls a function a later release added: each section names the @@ -533,3 +537,43 @@ one element, so the new refusal moves no case. The case schema's descriptions now say that a step's `expect_position` members are compared as JSON values, and that the corpus writes `active_invocations` sorted while the schema does not check the order; no verdict changes. + +## 2.15.0 + +**A host must change:** only where this reaches it. A +`{:statifier, "~> 2.14"}` requirement already accepts 2.15.0. + +- `Statifier.compile/2` refuses a chart whose expressions call a function + that is not `In`, a predicator builtin or a function the host declares, + with a `Statifier.Compiler.Error` whose reason is + `{:unknown_function, name, source}`, located at the element that holds + the call. Before 2.15.0 such a chart compiled, and every evaluation of + the call raised `error.execution`. Register the function with + `:function_providers`, or declare its name with `:function_names`. If + your host matches `Statifier.Compiler.Error`'s reasons exhaustively, add + a clause for the new reason. + +**A host may start:** registering named functions a chart may call from +`cond` and `expr` (ADR-0078). Requires `{:statifier, "~> 2.15"}`. + +1. Write a `Predicator.FunctionProvider` module per family of functions. + A function reads only its arguments and the host term: it does no I/O, + reads no clock and no random source, and keeps no state, so a replay or + a resume evaluates it the same. +2. Pass the list as `:function_providers` to `Statifier.compile/2`, + `Statifier.MachineState.new/2` and `Statifier.Session.start_link/2`. + A provider may not replace `In` or a predicator builtin. A list that + does not resolve makes `Statifier.Session.start_link/2` refuse with + `{:error, {:function_providers, reason}}` before it starts anything. +3. A tool that checks a chart without loading the modules passes + `:function_names`, the names alone, to `Statifier.compile/2`. +4. A session started with `:resume` stamps the list it is given, and a + recording keeps it for `Statifier.Replay`. A host that resumes a + position itself re-stamps the list with + `Statifier.MachineState.put_function_providers/2`. +5. A child session started for an `` does not inherit the list. + +The guide is the section "Host functions for `cond` and `expr`" of +[How to extend Statifier: `` handlers, `` types and host functions](extending.md). + +The conformance corpus does not change in 2.15.0. From f7525a37c71e0125f59bf23991e0e79a8ba27fa7 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Mon, 12 Oct 2026 14:57:02 -0600 Subject: [PATCH 2/3] Releases 2.15.0 Assembles the host function providers fragment into a 2.15.0 section and deletes it, moves mix.exs @version to 2.15.0, and moves the README requirement to ~> 2.15. The lead paragraph names the new option and the compile refusal. Every bullet is carried byte for byte. ADR-0066's SemVer commitment makes this a minor release: the release adds the :function_providers and :function_names options, and the undeclared-function check stays at compile time as built (ruled by the operator, 2026-10-12). Statifier.Compiler.Error's closed reason union grows by {:unknown_function, name, source}, which the Changed section carries: a chart refused by it used to compile and raise error.execution at every evaluation of the call. No runtime dependency requirement moves and the conformance corpus does not change. Committed on the staged tree the full mix quality and mix quality --profile merge ran green on (write-tree e0431c63 before the commit). Prep only: the tag and the publish are not part of this commit. Refs: st-3tmk --- CHANGELOG.md | 18 ++++++++++++++++++ README.md | 2 +- changelog.d/st-g648.md | 7 ------- mix.exs | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) delete mode 100644 changelog.d/st-g648.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8aaeca..926575b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,24 @@ fragment in [`changelog.d/`](https://github.com/riddler/statifier-ex/blob/v2.9.0 into the section below at release. See that README for the format and for when a change warrants an entry at all. +## [2.15.0] 2026-10-12 + +A minor release. A host registers named functions a chart may call from +`cond` and `expr` with the new `:function_providers` option, and +`Statifier.compile/2` now refuses a chart whose expressions call a +function nothing declares, with the new `Statifier.Compiler.Error` reason +`{:unknown_function, name, source}`. Such a chart used to compile and +raise `error.execution` at every evaluation of the call; the Changed +bullet says what a host does about it. + +### Added + +- A host registers named functions a chart may call from `cond` and `expr` with the `:function_providers` option, a list of `Predicator.FunctionProvider` modules, on `Statifier.compile/2`, `Statifier.MachineState.new/2` and `Statifier.Session.start_link/2`. A resumed session stamps the list it is given, a recording keeps it for `Statifier.Replay`, and `Statifier.MachineState.put_function_providers/2` re-stamps it on a position a host resumes itself. A provider may not replace `In` or a predicator builtin. `Statifier.compile/2` also accepts `:function_names`, the names alone, for a tool that does not load the modules. See "Host functions for `cond` and `expr`" in `docs/extending.md`. + +### Changed + +- `Statifier.compile/2` refuses a chart whose expressions call a function that is not `In`, a predicator builtin or a declared host function, with a `Statifier.Compiler.Error` whose reason is `{:unknown_function, name, source}`. Such a chart used to compile and raise `error.execution` at every evaluation of the call. Register the function with `:function_providers`, or declare its name with `:function_names`. + ## [2.14.0] 2026-10-11 A minor release with one Breaking entry. `Statifier.Validator.validate/3`, diff --git a/README.md b/README.md index 0f9435bc..405d564e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Add `statifier` to your dependencies: ```elixir def deps do [ - {:statifier, "~> 2.14"} + {:statifier, "~> 2.15"} ] end ``` diff --git a/changelog.d/st-g648.md b/changelog.d/st-g648.md deleted file mode 100644 index 8c1d8ee1..00000000 --- a/changelog.d/st-g648.md +++ /dev/null @@ -1,7 +0,0 @@ -### Added - -- A host registers named functions a chart may call from `cond` and `expr` with the `:function_providers` option, a list of `Predicator.FunctionProvider` modules, on `Statifier.compile/2`, `Statifier.MachineState.new/2` and `Statifier.Session.start_link/2`. A resumed session stamps the list it is given, a recording keeps it for `Statifier.Replay`, and `Statifier.MachineState.put_function_providers/2` re-stamps it on a position a host resumes itself. A provider may not replace `In` or a predicator builtin. `Statifier.compile/2` also accepts `:function_names`, the names alone, for a tool that does not load the modules. See "Host functions for `cond` and `expr`" in `docs/extending.md`. - -### Changed - -- `Statifier.compile/2` refuses a chart whose expressions call a function that is not `In`, a predicator builtin or a declared host function, with a `Statifier.Compiler.Error` whose reason is `{:unknown_function, name, source}`. Such a chart used to compile and raise `error.execution` at every evaluation of the call. Register the function with `:function_providers`, or declare its name with `:function_names`. diff --git a/mix.exs b/mix.exs index 6552123a..b21653e4 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Statifier.MixProject do use Mix.Project - @version "2.14.0" + @version "2.15.0" @source_url "https://github.com/riddler/statifier-ex" def project do From acea473fca7a13a2f3e20379968afb6e7977d92c Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Mon, 12 Oct 2026 15:00:48 -0600 Subject: [PATCH 3/3] Addresses review of the 2.15.0 upgrading page - The intro says why 2.15.0's compile refusal is listed under Changed and not as a Breaking entry: it refuses only a chart whose call raised error.execution whenever it was evaluated. - The must-change bullet names a chart stored before 2.15.0 and recompiled under it, from its source or a Statifier.Chart blob. - Step 2 says that compile/2 and MachineState.new/2 raise ArgumentError for a provider list that does not resolve, where start_link/2 refuses. - Step 5 adds, as the guide says, that a chart given as content cannot call a host function. Refs: st-3tmk --- docs/upgrading.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/upgrading.md b/docs/upgrading.md index ee66d9af..de9651f8 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -37,7 +37,10 @@ delayed send fired into a budget-halted session. 2.15.0 changes one answer, and its "must change" names the hosts it reaches: a host whose charts call a function from `cond` or `expr` that is not `In`, a predicator builtin or a function the host declares, and a -host that matches the compiler's error reasons exhaustively. +host that matches the compiler's error reasons exhaustively. 2.15.0's +CHANGELOG lists that refusal under Changed, not as a Breaking entry: it +refuses only a chart that calls a function no evaluation context holds, +a call that raised `error.execution` whenever it was evaluated. A dependency requirement of `{:statifier, "~> 2.5"}` already accepts every version on this page. Raise it only when your host calls a function a later release added: each section names the @@ -551,7 +554,9 @@ while the schema does not check the order; no verdict changes. the call raised `error.execution`. Register the function with `:function_providers`, or declare its name with `:function_names`. If your host matches `Statifier.Compiler.Error`'s reasons exhaustively, add - a clause for the new reason. + a clause for the new reason. This includes a chart a host stored before + 2.15.0 and recompiles under it, from its source or from a + `Statifier.Chart` blob. **A host may start:** registering named functions a chart may call from `cond` and `expr` (ADR-0078). Requires `{:statifier, "~> 2.15"}`. @@ -564,14 +569,17 @@ while the schema does not check the order; no verdict changes. `Statifier.MachineState.new/2` and `Statifier.Session.start_link/2`. A provider may not replace `In` or a predicator builtin. A list that does not resolve makes `Statifier.Session.start_link/2` refuse with - `{:error, {:function_providers, reason}}` before it starts anything. + `{:error, {:function_providers, reason}}` before it starts anything, + and makes `Statifier.compile/2` and `Statifier.MachineState.new/2` + raise `ArgumentError`. 3. A tool that checks a chart without loading the modules passes `:function_names`, the names alone, to `Statifier.compile/2`. 4. A session started with `:resume` stamps the list it is given, and a recording keeps it for `Statifier.Replay`. A host that resumes a position itself re-stamps the list with `Statifier.MachineState.put_function_providers/2`. -5. A child session started for an `` does not inherit the list. +5. A child session started for an `` does not inherit the list, + and a chart given as `` content cannot call a host function. The guide is the section "Host functions for `cond` and `expr`" of [How to extend Statifier: `` handlers, `` types and host functions](extending.md).