Repository navigation
Pins pre-Back compile bytes at v0.45.0 - #782
Merged
Merged
Conversation
A document with no returnable step compiles to the bytes and chart identity it compiled to at v0.45.0, as ADR-0004's Amendment of 2026-11-20 says in L8. A new ratchet test holds every stored fixture document the shared fixture palette resolves, the migration guide's composite pair, the byte corpus and the editor and map fixture documents to SHA-256 and chart identity pins captured in a checkout of the v0.45.0 tag, under the plain, terminate and child use modes. The capture also confirms the literal subchart pins hold at v0.45.0. The moving case is pinned beside it: the signup wizard with its host step type declaring returnable?/1 compiles to other bytes and another chart identity, the same ones on every compile. A changelog fragment names the move for the upgrading note: no switch, ruled by the operator, 2026-11-19. Refs: sb-7622
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
A ratchet test that holds documents with no returnable step to the bytes and chart identity they compiled to at the
v0.45.0release, the last release before returnable steps, Back andcore.checkpoint. ADR-0004's Amendment of 2026-11-20,L8, is the rule: a document with no returnable step compiles byte-identically. The test enumerates; the record does not.The operator's ruling it carries: "No switch: Back exists exactly where a returnable step exists; upgrading moves no hash; a host opts in by declaring its type returnable, and those documents move once" (ruled by the operator, 2026-11-19).
Re-running the ratchet
One command, on any checkout of this branch or of main after it merges:
The pieces
test/support/compile_ratchet.ex(StatifierBlocks.CompileRatchet): the enumeration, the pin shape andcapture/1, which writes the pins file. Its moduledoc says what the enumeration covers, what it leaves out and why, and how to re-derive the pins.test/fixtures/compile_ratchet/v0.45.0.json: the pins. Each key is a document name and a compile mode (plain,terminate: true,child_use: true); each value is the SHA-256 of the compiled bytes and the chart identity (or, for a compile that is refused, the sorted finding codes), plus the document's own content hash, so a fixture whose input changed is told apart from a compiler whose output did.test/statifier_blocks/compiler/compile_ratchet_test.exs: one test per document and mode against its pin; a test that the pins and the enumeration name the same documents in both directions; a test that no enumerated document has a returnable step; and the moving case.changelog.d/sb-7622.md, under Changed, for the release's upgrading note: a document with no returnable step keeps its bytes and chart identity, and a host that declares a block type returnable moves the bytes and chart identity of every document using it, once.What the enumeration covers
test/fixtures/that decodes and whose block types the shared fixture palette resolves.What it leaves out, each with its reason in the moduledoc: stored documents whose host types are defined inside one test file, the insert probe and the assignability worked example (their host types are stubs that refuse to emit), JSON files that are not block documents, the run-time sub-path document added after
v0.45.0, the document generator (fresh block ids on every call), and the card and live run fixtures (they need statifier-ui, and the ratchet also runs in the headless job).The literal
core.subchartfixtures are not pinned a second time: they keep their existing pins.capture/1recomputes every one of those pins under the tree it runs on and raises if any differs, so the capture atv0.45.0also proves those pins were already true atv0.45.0.How the pins were captured, and how to trust them
The pins were written by
capture/1in a detached checkout of thev0.45.0tag (1a6af24), withcompile_ratchet.exandsubchart_byte_fixtures.excopied into itstest/support/. Neither file existed there, but every fixture module they call did, and none of those modules has changed since. The same capture run on this branch's base (a016c7b) produced a byte-equal file. The moduledoc gives the commands to re-derive it.The moving case
The byte corpus's signup wizard is compiled twice. Under the shared palette it matches its pin. With its host step type swapped for one that declares
returnable?/1true, it compiles to other bytes and another chart identity, with the document trail root in the datamodel. A second compile gives the same moved bytes and identity.Sabotage
Trail's survey count every block as a returnable step: every pin test whose document compiles goes red on its assertion, and so does the moving case's unchanged-palette check. The pins for refused compiles stay green, as they should.BlockType.returnable?/2answer false for every type: the moving case goes red on its first refute.Both mutations were restored byte-equal and the build was forced before the next run.
Gate
Full
mix qualitygreen on the committed tree.