Skip to content

Asserts the upgrade host's palette pre-flight - #227

Merged
johnnyt merged 1 commit into
mainfrom
se-2q0v-upgrade-host-palette-preflight
Oct 11, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-2q0v-upgrade-host-palette-preflight

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 11, 2026

Copy link
Copy Markdown
Member

Resolves se-2q0v.

What

A test in the upgrade host asserts that StatifierBlocks.Palette.preflight/1 over the host's palette and Palette.preflight/2 over the loan document, decoded from its canonical JSON the way a host stores it, both answer [] at the pinned statifier_blocks 0.42.1. Until now the empty answers were only recorded in a pull request, so a later upgrade step could not rerun them.

The test is in upgrade_host/test/upgrade_host/loan_document_test.exs, describe "the palette pre-flight". It asserts the palette first: the authoring edits write the same values as the defaults, so a field type that refuses its default also refuses the edit, and the document half could not be built to judge. Before the document half it asserts that every stored block resolves through the palette, because preflight/2 passes over a block it cannot resolve, and an empty answer is then a judgement rather than a skip.

No lib/ file changes, and no pin or lock line in upgrade_host/mix.exs or upgrade_host/mix.lock moves.

Sabotage

  • AssessFine's assign_to field declared :integer with its default still "fine": the preflight/1 assertion failed, listing that default.
  • The root block authored with config %{"event" => 7}: the preflight/2 assertion failed, listing the stored block's event.
  • UntilReturned.current_version/0 answering 0: the resolve assertion failed, the stored root block being too new.

Each mutation was reverted from a copy and the restore checked byte-equal before the next check and before the gates ran.

Gates

On the head rebased onto main:

  • Root: mix quality green.
  • Upgrade host (the CI job's commands): mix deps.get --check-locked, mix compile --warnings-as-errors and mix test green.

Review

An in-turn review of the diff and of the new test. Taken: the resolve assertion (the document half could otherwise pass over blocks it did not judge) and a more exact comment on why the palette is asserted first. No record text in this PR.

The upgrade host recorded empty Palette.preflight/1 and /2 answers in
a pull request, but no test asserted them. A test now checks both at
the pinned statifier_blocks: the host's palette, and the loan document
read back from its canonical JSON, each stored block resolving first.
@johnnyt
johnnyt merged commit 52edb85 into main Oct 11, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-2q0v-upgrade-host-palette-preflight branch October 11, 2026 09:37
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