Skip to content

layout golden: refuse a re-seed that is not append-only unless named (TODO l.1829-1831) - #980

Merged
MattJackson merged 1 commit into
predevfrom
lane-proof-layout-reseed
Oct 15, 2026
Merged

MattJackson merged 1 commit into
predevfrom
lane-proof-layout-reseed

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

TODO l.1829-1831: the layout golden must refuse a re-seed whose diff is a reorder/resize/insert, instead of printing a sentence (crates/busbar-contract/tests/layout_golden.rs, seed path at :2497).

  • New layout_breaks(old, new), per struct. These are breaks: a moved field offset, a size or align change with nothing appended, a field inserted inside the old size, a removed field or struct. These are not: a new struct, or fields appended at or past the old size.
  • BUSBAR_UPDATE_GOLDEN=1 now refuses any break and lists the breaks. BUSBAR_UPDATE_GOLDEN=break names a deliberate layout edit, which the owner allowed pre-tag on 2026-09-28 (BUSBAR-1.6.0.md R9). From the tag on, R9 requires the kind ABI version bump.
  • RED: a_reseed_that_is_not_append_only_is_refused covers the moved, resized, inserted and removed cases. Control: append, new struct, and identity are clean.

Hunks are disjoint from #561/#778 (compute_layout, l.1405-1473).

…med (TODO l.1829-1831)

BUSBAR_UPDATE_GOLDEN=1 wrote whatever layout it found; the rule against re-seeding a
reorder/resize/insert was a sentence in an assert message the seed path never reached, and the
airlock resize (TODO l.1806) was re-seeded through it.

layout_breaks classifies the old golden against the new layout per struct: a moved field, a size or
alignment change with nothing appended, a field inserted inside the old size, and a removed field or
struct are breaks; a new struct or fields appended at/after the old size are not. The seed refuses a
break unless BUSBAR_UPDATE_GOLDEN=break names it -- pre-tag a v1 layout edit is re-seeded with no
version bump (owner 2026-09-28, BUSBAR-1.6.0.md R9); from the tag on it needs the kind ABI bump.

RED: a_reseed_that_is_not_append_only_is_refused (moved, resized, inserted, removed are each a break;
control: append, new struct and identity are clean).
@MattJackson

Copy link
Copy Markdown
Collaborator Author

Rule 20 note from #1030 (row 155): one disjoint hunk in crates/busbar-contract/tests/layout_golden.rs (OnPieceOut record list gains tap_fault). A test merge is clean.

@MattJackson
MattJackson merged commit 44b9451 into predev Oct 15, 2026
1 check passed
@MattJackson
MattJackson deleted the lane-proof-layout-reseed branch October 15, 2026 03:31
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