test(formats): invert the primitives tripwire to pin the fix (#38, option A) #40

Merged
fabi merged 1 commits from fix/38-invert-primitives-tripwire into main 2026-09-16 17:02:35 +00:00
Owner

Implements #38, option A. Keeps include_primitives off by default and turns the tripwire
into a guard that the fix holds. Test-only: no library code changes.

The change

before after
name the_derived_order_puts_primitives_last_and_that_wipes_screens no_build_is_wiped_with_primitives_on
assertion wiped_on > 0 — the bug still reproduces assert_eq!(wiped_on, 0) — the fix still holds
default include_primitives: false unchanged

The old name asserted the bug, so it's renamed, as #38 specifies. The old name survives in the
doc comment for anyone searching from the issue. The new failure message says what a failure
now means (forced_backdrop regressed), and says not to "fix" it by turning primitives off
in the test. Nothing else in the repo cited the old name.

It's the only end-to-end check of the rule: the four tests in ui_forced_backdrop_disc.rs pin
its mechanics, and none of them composes with primitives on.

Verified with the corpus present — including that it can fail

run result builds with a visible primitive wiped, primitives on
the fix 3 passed 125 0
forced_backdrop disabled (return false;) 🔴 FAILED, new message 125 36
restored 3 passed 125 0

📌 The control's 36 is exactly the "36 builds … wiped by our own sort" that 53f8345 and
ui-forced-backdrop.md report. The guard reproduces the fix's own documented number on its
own, so it measures exactly what was repaired rather than a nearby proxy.

The control was a one-line edit, reverted afterwards; git diff showed only this test file
before committing. cargo fmt --all --check clean; no clippy hits in the file.

⚠️ CI will be green here for the same reason it was green on main

The runner has no corpus, so this suite self-skips and reports ok either way. The table
above is the evidence for this PR, and only a machine with the disc can produce it.
On
main @ e0187d6 the disc suite currently reads 45 suites / 376 passed / 1 failed — this
PR should bring that to 377 / 0.

⚠️ Merging closes #38 — one item on it is not filed anywhere else

#38 also carries the Pi's separate note about the loop briefs: the tripwire stayed red for 15
days because an agent reported a subset of test files as green. That note isn't an issue of
its own yet. File it separately before or when this merges, or it closes with #38.

Closes #38

🤖 Generated with Claude Code

**Implements #38, option A.** Keeps `include_primitives` off by default and turns the tripwire into a guard that the fix holds. Test-only: no library code changes. ## The change | | before | after | |---|---|---| | name | `the_derived_order_puts_primitives_last_and_that_wipes_screens` | `no_build_is_wiped_with_primitives_on` | | assertion | `wiped_on > 0` — the bug still reproduces | `assert_eq!(wiped_on, 0)` — the fix still holds | | default | `include_primitives: false` | **unchanged** | The old name asserted the bug, so it's renamed, as #38 specifies. The old name survives in the doc comment for anyone searching from the issue. The new failure message says what a failure now *means* (`forced_backdrop` regressed), and says not to "fix" it by turning primitives off in the test. Nothing else in the repo cited the old name. It's the only end-to-end check of the rule: the four tests in `ui_forced_backdrop_disc.rs` pin its mechanics, and none of them composes with primitives on. ## Verified with the corpus present — including that it can fail | run | result | builds with a visible primitive | wiped, primitives on | |---|---|---|---| | the fix | ✅ 3 passed | 125 | **0** | | `forced_backdrop` disabled (`return false;`) | 🔴 **FAILED**, new message | 125 | **36** | | restored | ✅ 3 passed | 125 | **0** | 📌 **The control's 36 is exactly the "36 builds … wiped by our own sort"** that `53f8345` and `ui-forced-backdrop.md` report. The guard reproduces the fix's own documented number on its own, so it measures exactly what was repaired rather than a nearby proxy. The control was a one-line edit, reverted afterwards; `git diff` showed only this test file before committing. `cargo fmt --all --check` clean; no clippy hits in the file. ## ⚠️ CI will be green here for the same reason it was green on `main` The runner has no corpus, so this suite self-skips and reports `ok` either way. **The table above is the evidence for this PR, and only a machine with the disc can produce it.** On `main` @ `e0187d6` the disc suite currently reads 45 suites / 376 passed / **1 failed** — this PR should bring that to **377 / 0**. ## ⚠️ Merging closes #38 — one item on it is not filed anywhere else #38 also carries the Pi's separate note about the loop briefs: the tripwire stayed red for 15 days because an agent reported a *subset* of test files as green. That note isn't an issue of its own yet. File it separately before or when this merges, or it closes with #38. Closes #38 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fabi added 1 commit 2026-09-16 17:01:34 +00:00
test(formats): invert the primitives tripwire to pin the fix (#38, option A)
All checks were successful
CI / Native — linux (pull_request) Successful in 2h0m48s
CI / WASM — Web (pull_request) Successful in 30m51s
CI / Formatting (pull_request) Successful in 1m16s
42936e4e18
`the_derived_order_puts_primitives_last_and_that_wipes_screens` asserted that
switching primitives on still flattened at least one screen (`wiped_on > 0`),
and said to turn `include_primitives` on by default the day it stopped.
`53f8345` made that day arrive — a keyless primitive that would hide the screen
is now forced to paint first — and the wire had been red since 2026-08-29,
invisible to CI because the runner has no corpus and the suite self-skips.

#38 chose option A: keep the default off, and pin the fix instead. The flatness
proxy stood in for "paint order is solved", and the fix's own record says that
is only partly true — "This does **not** make `include_primitives` safe by
default" (docs/re/structures/ui-prm-primitives.md). So:

  * renamed to `no_build_is_wiped_with_primitives_on` — the old name asserted
    the bug; it survives in the doc comment for anyone searching from #38;
  * `wiped_on > 0`  ->  `assert_eq!(wiped_on, 0)`, with a message saying what a
    failure now means (`forced_backdrop` regressed) and that it must not be
    "fixed" by turning primitives off in the test;
  * `include_primitives` stays `false`; no library code changes.

It is the only end-to-end check of the rule: the four tests in
`ui_forced_backdrop_disc.rs` pin its mechanics, and none composes with
primitives on.

Verified with the corpus present, including that it can fail:

  fix                        3 passed   125 builds draw a primitive, 0 wiped
  forced_backdrop disabled   FAILED     36 of 125 wiped — the new message fired
  restored                   3 passed   125 builds, 0 wiped

The control's 36 is exactly the "36 builds ... wiped by our own sort" that
`53f8345` and `ui-forced-backdrop.md` report — the guard independently
reproduces the fix's own number, so it measures precisely what was repaired.
The control was a one-line `return false;` in a scratch copy; the working tree
was restored and `git diff` showed only this test file before committing.

Closes #38

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fabi merged commit 705196b1f6 into main 2026-09-16 17:02:35 +00:00
Sign in to join this conversation.