refactor(testing): remove the phantom execution-layer abstraction#848
Merged
tcoratger merged 1 commit intoJun 5, 2026
Merged
Conversation
The testing framework claimed to be layer-agnostic but has exactly one layer. The abstraction was dead scaffolding: - the --layer option, known_layers validation, and the dynamic importlib machine in the filler plugin supported one hardcoded value - the execution branches could never succeed: no execution_testing package exists anywhere - the BaseFixture / BaseConsensusFixture split kept a deliberately empty dual formats registry solely for that phantom layer Changes: - merge the two base classes into a single BaseConsensusFixture holding the hash, serialization, and metadata machinery; delete framework/test_fixtures entirely - the plugin now imports consensus_testing directly; the pre fixture loses its unreachable execution exit branch - replace the globals()-mutating dynamic fixture registration with thirteen explicit module-level fixture definitions, one per format; the formats registry and its auto-registration hook become dead code and are removed - inline the two one-line marker-check wrappers at their call sites and drop the always-identical fork-lookup callback parameter - remove --layer from the fill CLI; key download is unconditional - update the framework docs to match Emitted fixture paths and JSON output are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 5, 2026
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.
Motivation
A deep audit of
packages/testing/flagged the layer abstraction as its single biggest readability problem: the framework claims to be layer-agnostic, but exactly one layer exists. Every execution-layer codepath was unreachable dead scaffolding:filler.pyhardcoded apytest.exitfor--layer=executionand dispatched on aBaseExecutionFixturethat exists nowhere — noexecution_testingpackage has ever existedknown_layersset plus a dynamicimportlib.import_module(f"{layer}_testing")machine supported one hardcoded valueBaseFixture/BaseConsensusFixturesplit maintained a deliberately-empty dualformatsregistry solely for the phantom layerChanges
BaseConsensusFixtureholding the hash, serialization, and metadata machinery; deleteframework/test_fixtures/entirelyconsensus_testingdirectly;--layer, the layer validation, the importlib machine, and the unreachable execution branches are goneglobals()-mutating loop over a class registry) with thirteen explicit module-level fixture definitions, one per format — greppable, IDE-discoverable, no magic. Theformatsregistry and its auto-registration hook lost their only consumer and are removed--layeroption; key download is unconditional.claude/rules/, spec-diff skill, ini comments) to matchNet: −347/+184 lines. Emitted fixture paths (
fixtures/consensus/{format}/...) and JSON output are byte-for-byte unchanged.When execution-layer work actually begins, the abstraction should be reintroduced against a real second implementation — the only time an abstraction boundary can be designed correctly.
Verification
just checkpasses (ruff, format, ty, codespell, mdformat)tests/consensus/lstar/ssz: 118 vectors generated, output identical🤖 Generated with Claude Code