Reserves one prefix for the conformance suite's host names - #250
Merged
Merged
Conversation
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
force-pushed
the
sp-b3y4-conformance-injected-names-prefix
branch
from
September 30, 2026 06:26
e24295f to
3b06ea5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
StatifierPersistence.Testing.StorageConformance'susingblock 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 asown_chart_a/0andprune_execution/5, attributes such as@retire_hash, nested modules such asReentrantSerialization), 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:
conformance_Conformance(ConformanceRetiringSerialization,ConformanceReentrantSerialization)__conformance_forward_adapter_call__/4toconformance_forward_adapter_call/4The suite's moduledoc states the prefix as the host contract, after the paragraphs on
setupbeing 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 theusewrites.The comment above
@conformance_hash_suffixsaid 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. Itslib/andtest/cites are to files this change adds or edits (theusingblock ofstorage_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
conformance_rather than__conformance_. The suite's attributes already carriedconformance_; 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.usewith one of the same last names is replaced below it, and the two ways around that.test/statifier_persistence/storage/setup_ordering_conformance_test.exscalled the suite'sinput_log_execution/2directly (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.mdunderChanged: the suite ships inlib/and host modulesuseit, so its injected names are observable to a host.Verification
mix qualitygreen 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.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 againstStatifierPersistence.Storage.InMemorybeside them, and asserts each keeps the host's meaning.@conformance_retire_hashback to@retire_hash: the attribute case failed on its assertion.ConformanceReentrantSerializationback toReentrantSerialization: the nested-module case failed on its assertion.conformance_own_chart_aback toown_chart_a: the private-function case failed on its assertion.def,defpanddefmoduletheusingblock defines, and every module attribute of its own it sets outside its nested modules (not Elixir's@docor 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.