Skip to content

Adds core.checkpoint, the point of no return - #781

Merged
johnnyt merged 1 commit into
mainfrom
sb-1otr-checkpoint-block
Nov 20, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sb-1otr-checkpoint-block

Conversation

@johnnyt

@johnnyt johnnyt commented Nov 20, 2026

Copy link
Copy Markdown
Member

What this adds

core.checkpoint, the core block an author places as a point of no return (ADR-0002, Amendment of 2026-11-20, C12d), and its trail clear (ADR-0004, Amendment of 2026-11-20, L6). The design was ruled by the operator, 2026-11-19: "A core block (working name core.checkpoint) the author places; passing it clears the trail; sub-path boundaries, loop iterations and parallel lanes also count", and "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".

  • The block (StatifierBlocks.Core.Checkpoint): as C12d gives it, no slots, no config, the default done outcome, no returnable?/1, the injected io/1 of %{}, version 1, entry 18 of the "Structure" group labelled "Checkpoint". Its description, explain/0 and sentence/1 ("No going back past this point") are new prose, kind-neutral. emit/2 is the step that does nothing (D5), the same emission as core.placeholder.
  • The registry row: Palette.core_types/0 gains "core.checkpoint", so Palette.manifest/1 of core/0 gains {"core.checkpoint", 1}.
  • The clear: StatifierBlocks.Compiler.Trail treats the checkpoint as a boundary whose state's entry alone clears the trail of the scope it belongs to (the document, a core.foreach body or a core.parallel lane), first in its <onentry>, owned by the checkpoint block under the role :trail. A scope with no returnable step gets no clear, so a checkpoint there compiles to the placeholder's bytes (L8). The module, not the type name, is what is matched, so a host's other name for the module clears as well.
  • The editor entry: the palette browser draws it from its palette_entry/0 like every Structure type; it is the group's last row, with a new flag glyph in the shipped default icon set, and it carries no "Returnable step" marker.
  • The Map rendering: a leaf box in its slot's flow, titled "Checkpoint", its sentence on the line under it, joined to the steps either side. Nothing in StatifierBlocks.Map is specific to it.

Hashes and bytes

  • A document that does not use the block compiles to the same bytes as before: the trail pass adds nothing for a document without a checkpoint, and the compiled-hash tests on main stay green unchanged.
  • palette_hash covers only the entries a compile resolved (StatifierBlocks.Compiler, defp palette_hash/1), so it moves only for a document that uses the block.
  • The core manifest moves by the one row above. The shipped block document schema (priv/schemas/block-document.schema.json) gains a core.checkpoint definition, which schema_drift_test.exs requires for every core type.

Provenance

Forced edits the file map did not name, each required by adding a core type: the shipped schema definition; the counts pinned in the palette browser, armed palette, icon set, view model, manifest, core types and signup wizard tests; the Palette moduledoc's "Ordering a group" paragraph (now 0 through 18, next 19); the Core moduledoc's table and its io/1 paragraph; the icon set moduledoc's glyph count. The flag glyph is new: every other Structure entry but the placeholder declares an icon, and none of the existing glyphs reads as a point of no return.

Tests and sabotage

New: test/statifier_blocks/core/checkpoint_test.exs (the declarations), checkpoint tests in trail_test.exs (the clear's bytes, entry only, Back after it, provenance, the no-step case equal to the placeholder, no trail created by placing one, inside a loop body, inside a parallel lane, a host's other name), the checkpoint's palette row in palette_body_test.exs and its Map box in map_test.exs. Every new test carries a one-line sabotage note; each mutation was applied, turned the named test red on an assertion, and was reverted from a copy.

Review

Gate tier for the code; the in-turn review ran a diff critic and a test critic before this request opened. Accepted and fixed: tests for a checkpoint inside a loop body and a parallel lane, and for a host's other name for the module; a helper comment moved back to its function; Code.ensure_loaded!/1 before the function_exported?/3 refutes; word boundaries in the explain guard.

The gate (mix quality) is green on this commit.

A core block an author places: no slots, no config, the one outcome
done, not itself a returnable step, entry 18 of the Structure group.
It compiles to the step that does nothing, and the trail pass puts a
clear of its scope's trail first in its state's onentry, only where
that scope has a returnable step. The core manifest gains its row,
the shipped schema its definition and the icon set a flag glyph.

Refs: sb-1otr
@johnnyt
johnnyt merged commit a016c7b into main Nov 20, 2026
2 checks passed
@johnnyt
johnnyt deleted the sb-1otr-checkpoint-block branch November 20, 2026 16:21
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