Skip to content

Reserves one prefix for the conformance suite's host names - #250

Merged
johnnyt merged 1 commit into
mainfrom
sp-b3y4-conformance-injected-names-prefix
Sep 30, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sp-b3y4-conformance-injected-names-prefix

Conversation

@johnnyt

@johnnyt johnnyt commented Sep 30, 2026

Copy link
Copy Markdown
Member

What

StatifierPersistence.Testing.StorageConformance's using block defines names in every host test module that uses it. Most of them were plain names a host could already be using (private helpers such as own_chart_a/0 and prune_execution/5, attributes such as @retire_hash, nested modules such as ReentrantSerialization), so a host's own helper of the same name collided with the suite.

Every name the block defines now carries one reserved prefix, ruled by the operator, 2026-09-29:

  • module attributes and functions, private and public: conformance_
  • nested modules: Conformance (ConformanceRetiringSerialization, ConformanceReentrantSerialization)
  • the one public function, the telemetry handler, moves from __conformance_forward_adapter_call__/4 to conformance_forward_adapter_call/4

The suite's moduledoc states the prefix as the host contract, after the paragraphs on setup being the only callback: the names under the prefix are the suite's, a host that defines a name under it collides by its own doing, and every other attribute, function and nested module name is the host's. It also names the generated tests' adapter: / facade: names and the aliases the use writes.

The comment above @conformance_hash_suffix said the chart lock's key is database-wide; since the store-scoped key landed on main it is per store, and the comment now says so and keeps why the suffix still separates host modules that name one charts table the same way.

Record

A dated ## Amendment (2026-09-29) at proposed on ADR-0003 (the record whose decision 5 is the conformance suite), with its own "Status of this amendment: proposed" line, appended at the foot with zero removed lines. It states the reserved prefix as decision 5's host contract, the aliases decision, and that a host calling a helper by its old name renames the call. Its lib/ and test/ cites are to files this change adds or edits (the using block of storage_conformance.ex, the new contract test, the setup-ordering test), re-verified by anchor at this head; the record was decided under the night rule by the conductor, 2026-09-29.

Provenance

  • Prefix spelling: conformance_ rather than __conformance_. The suite's attributes already carried conformance_; only the telemetry handler used the double-underscore form, and __name__ spellings are Elixir's convention for compiler-generated reflection functions. Nested modules take the same word in module casing.
  • Aliases: named in the moduledoc, not removed. Removing them would spell every module in full across the template for no change in what a host can do; the moduledoc says an alias the host writes above the use with one of the same last names is replaced below it, and the two ways around that.
  • test/statifier_persistence/storage/setup_ordering_conformance_test.exs called the suite's input_log_execution/2 directly (the template defines it inside the host module); the rename forced its call and its sabotage notes to the prefixed name. Not in the file map; a threading edit the rename forces.

Changelog

changelog.d/sp-b3y4.md under Changed: the suite ships in lib/ and host modules use it, so its injected names are observable to a host.

Verification

  • Full mix quality green on the rebased head: format, compile (warnings as errors), doc links, dependencies, docs, credo, dialyzer, tests 1,427 of 1,427 passed at 95.8% coverage. The three skipped stages (doctor, gettext, sobelow) are not installed in this project.
  • New test/statifier_persistence/storage/reserved_prefix_conformance_test.exs: a host module that keeps an attribute, a nested module and a private function under names the suite once defined without the prefix, runs the whole suite against StatifierPersistence.Storage.InMemory beside them, and asserts each keeps the host's meaning.
  • Sabotage, each on this change's renamed lines, reverted from a copy and proven byte-equal:
    • @conformance_retire_hash back to @retire_hash: the attribute case failed on its assertion.
    • ConformanceReentrantSerialization back to ReentrantSerialization: the nested-module case failed on its assertion.
    • conformance_own_chart_a back to own_chart_a: the private-function case failed on its assertion.
  • Acceptance, checked against the head: every def, defp and defmodule the using block defines, and every module attribute of its own it sets outside its nested modules (not Elixir's @doc or ExUnit's @tag), starts with the prefix; the moduledoc states the contract; the Amendment records it.

Review tier

Contract: the suite is a public module hosts use, and the names it defines in them change.

Every attribute, function and nested module the conformance suite's
using block defines in a host test module now starts with one reserved
prefix: conformance_ for attributes and functions, Conformance for
nested modules. The telemetry handler moves from its double-underscore
spelling onto the same prefix. The moduledoc states the prefix as the
host contract, names the six aliases the use writes, and a host module
that defines a name under the prefix collides by its own doing. Ruled
by the operator, 2026-09-29.

A new host-shaped test module keeps an attribute, a nested module and
a private function under names the suite once defined unprefixed, and
runs the suite beside them. The setup-ordering test called a suite
helper by its old name and now adds the prefix.

Records the contract in a dated Amendment at proposed on ADR-0003, and
rewrites the comment above the hash suffix: the chart lock's key is per
store now, not database-wide.

Gate: full mix quality green on this exact tree (1,427 tests, 95.8%
coverage, dialyzer clean), gate lock and slot held across the commit.
@johnnyt
johnnyt force-pushed the sp-b3y4-conformance-injected-names-prefix branch from e24295f to 3b06ea5 Compare September 30, 2026 06:26
@johnnyt
johnnyt merged commit 20fb8bb into main Sep 30, 2026
1 check passed
@johnnyt
johnnyt deleted the sp-b3y4-conformance-injected-names-prefix branch September 30, 2026 06:28
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