Skip to content

Run a pull request's touched nightly test modules in CI - #340

Merged
max-sixty merged 1 commit into
mainfrom
gate/pr-runs-touched-nightly-modules
Sep 7, 2026
Merged

max-sixty merged 1 commit into
mainfrom
gate/pr-runs-touched-nightly-modules

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The everyday suite ci runs on a pull request deselects every nightly-marked module, so a pull request whose whole diff is one of those modules goes green having exercised none of it. That is how #336 landed a rewrite of tests/test_render_margin.py and tests/test_render_anchors.py under a green gate and reddened main the moment it merged — #339 is the repair — and #338 is in the same position right now with tests/test_render_margin.py and tests/test_render_navigation.py.

This names the touched modules back. A new pull-request step diffs the merge commit against its base parent, collects the tests/test_*.py files the diff touches, and runs them with -m nightly: conftest.py already runs what an explicit file selection names, -m nightly leaves a mixed module's everyday cases to the step above rather than running them twice, and pytest's exit 5 is what a pull request that touches no nightly case gets. The cost is the touched files, not the 22–41 minute nightly suite, and a pull request that touches no test module pays nothing. A change to the runtime those modules drive is still the nightly run's to catch; this reaches the modules themselves.

Verification

The step's shell was run locally against real commit ranges, with uv run pytest swapped for the same invocation:

  • 83f69563..d10463fd (Repair the nightly margin and anchors tests the go-to hint change left red #339's two nightly modules) — selects both, 155 nightly cases collected.
  • ff580ecb..867c526b (touches tests/test_render_mcp.py, which carries no nightly mark) — selects it, no tests ran, exit 5 tolerated, step exits 0.
  • An empty range — No test module touched., exit 0.
  • d10463fd..83f69563 (the same diff reversed, so the range reads as deletions) — the [ -f ] filter drops what is not on disk and the step still selects correctly.

End-to-end, uv run pytest tests/test_render_drawing.py -m nightly -q is 21 passed, so the invocation drives real browser cases rather than only collecting them.

Suite and lint on this branch:

  • uv run pytest tests — 891 passed, 6 skipped.
  • uv run pytest tests/test_interact_layer.py — 157 passed, 6 skipped (this is the module that reads ci.yaml; the new step declares no working-directory, so the gate-naming test is unaffected).
  • pre-commit run --files .github/workflows/ci.yaml CLAUDE.md tests/CLAUDE.md — passed, including actionlint's shellcheck pass over the new run: block.

fetch-depth: 2 on the test job's checkout is what gives the merge commit its base parent; the default depth of 1 has no HEAD^1 to diff against.

`uv run pytest tests` deselects the nightly-marked modules, so a pull
request whose whole diff is one of them goes green having exercised none
of it. #336 rewrote tests/test_render_margin.py and
tests/test_render_anchors.py under that gate and reddened main the moment
it landed; #338 sits in the same position now.

Name the touched modules back on a pull request. An explicit file
selection runs what it names, `-m nightly` leaves a mixed module's
everyday cases to the step above, and pytest's exit 5 is what a pull
request touching no nightly case gets. A change to the runtime those
modules drive is still the nightly run's to catch.
max-sixty added a commit that referenced this pull request Sep 6, 2026
Three nightly tests have been red on `main` since #341, and nightly runs
after `main` moves, so PR CI and `wt merge` both stay green while nobody
sees them. All three are the same seam: the live interaction gallery
injects its playback row from the runtime and leaves the authored page
owning it.

**The ring census.** The page drew `outline: var(--here-ring)` on the
injected presses without naming the ring, so the floor below divided by
a population short of it. It was drawing the ring twice over: `offer`
marks those buttons `data-lf-offer="button"`, so the theme's pressable
floor already carries the hand, the hover tint, the disabled treatment,
and a ring that names itself. The page's copies are gone and the floor's
answer stands alone. No other authored page in the corpus draws the
layer's ring.

**The control-row sweep.** The row is a control row nothing had
declared. Declaring it means proving it holds still, and it did not: the
toggle rewrites its own word as a demo runs — Loading…, Play, Pause,
Played — so pressing Replay moved the button beside it, and the live
status line changed length on the same line as both presses. The toggle
now reserves the width of every word it can say, through `reserve`, the
layer's own helper, called where the runtime builds the row —
`scripts/corpus.py` copies each source's `<main>` and none of its
`<head>`, so a rule in the gallery's head would not reach the generated
corpus, which is the page this sweep actually walks. The status line
stands under the two presses at every width rather than only on a phone;
reserving its width instead would hold the row open at the width of its
longest sentence. `interaction-playback` is the new archetype; an
archetype may now name an `example`, because a demo is a scenario the
module names rather than markup the synthetic stability page can
compose, so its proof runs on the gallery itself. Replay is the press
for the same reason the diff's review press is: the button that has to
hold still is the toggle, and pressing Replay is what sends it through
every word it has.

**The injected-surfaces walk.** The gallery's own counts had moved on:
#341 added a live undecided suggestion and a second stored version, and
merging `main` brought the playground package's ask, so the walk now
sees thirteen asks and three version rows.

`tests/test_site.py` asserted the status line's `margin-left: 0` at
390px, which the layout change makes vacuous; it now reads the invariant
that replaced it.

## Checks

`uv run pre-commit run --all-files` is clean, and `uv run pytest tests
--run-nightly` passed whole — 2096 tests — on this branch before `main`
moved under it.

On the merged tree that full run reports 11 failures. A paired control,
a detached checkout of `ca4ac82d` with none of this branch on it, fails
10 of the same tests, so they arrived with the eight PRs that landed
while the first run was going. The eleventh,
`test_a_failed_preview_bootstrap_hears_the_replacement_server[theme.css]`,
passes on its own here and on the control: a flake in a 27-minute run.
The three tests this PR is about pass.

Nightly is red on `main` for two reasons this PR does not reach, both
worth someone's attention:

- the playground package's Reset, Copy instruction and Apply card share
rows and match no archetype, so
`test_the_composed_corpus_declares_every_control_row_archetype` fails on
`main` for that reason now instead;
- `.lf-resolve.lf-icon-action` (#347) has the left edge of its focus
ring under `.lf-react-trigger` (#349) in the ship-review thread, two
independent PRs whose rows now overlap by two pixels, which
`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`
reports as 2 faults over 714 stops.

Plus pre-existing reds in `test_render_anchors`, `test_render_export`,
`test_render_projection` and `test_render_widgets`, all present on the
control. **#340 is the standing
fix for the shape of this: nightly modules a PR touches never run before
it lands.

## Overlapping PRs

**#353 repairs the same three
readings, and opened while this branch's first suite was running. It
took the `reserve` route from the start, which is where this one has now
arrived; it also rehomes the scenarios' `#bg-motion-*` lookups onto the
stage, which this does not. One of the two should close, and which is
Max's call.

## Note for #351

**#351 deletes this same block
of gallery CSS and rehomes none of it, which would leave the injected
buttons without their pill shape or their `--aim-floor` aim target.
Whichever lands first, the other conflicts here.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Q7ZBoNLYxFVhWgDsXH1RTx

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 4cbef41 into main Sep 7, 2026
4 checks passed
@max-sixty
max-sixty deleted the gate/pr-runs-touched-nightly-modules branch September 7, 2026 00:48
max-sixty pushed a commit that referenced this pull request Sep 7, 2026
The everyday suite `ci` runs on a pull request deselects every
nightly-marked module, so a pull request whose whole diff is one of
those modules goes green having exercised none of it. That is how #336
landed a rewrite of `tests/test_render_margin.py` and
`tests/test_render_anchors.py` under a green gate and reddened `main`
the moment it merged — #339 is the repair — and #338 is in the same
position right now with `tests/test_render_margin.py` and
`tests/test_render_navigation.py`.

This names the touched modules back. A new pull-request step diffs the
merge commit against its base parent, collects the `tests/test_*.py`
files the diff touches, and runs them with `-m nightly`: `conftest.py`
already runs what an explicit file selection names, `-m nightly` leaves
a mixed module's everyday cases to the step above rather than running
them twice, and pytest's exit 5 is what a pull request that touches no
nightly case gets. The cost is the touched files, not the 22–41 minute
nightly suite, and a pull request that touches no test module pays
nothing. A change to the runtime those modules drive is still the
nightly run's to catch; this reaches the modules themselves.

<details><summary>Verification</summary>

The step's shell was run locally against real commit ranges, with `uv
run pytest` swapped for the same invocation:

- `83f69563..d10463f` (#339's two nightly modules) — selects both, 155
nightly cases collected.
- `ff580ecb..867c526` (touches `tests/test_render_mcp.py`, which
carries no nightly mark) — selects it, `no tests ran`, exit 5 tolerated,
step exits 0.
- An empty range — `No test module touched.`, exit 0.
- `d10463fd..83f6956` (the same diff reversed, so the range reads as
deletions) — the `[ -f ]` filter drops what is not on disk and the step
still selects correctly.

End-to-end, `uv run pytest tests/test_render_drawing.py -m nightly -q`
is 21 passed, so the invocation drives real browser cases rather than
only collecting them.

Suite and lint on this branch:

- `uv run pytest tests` — 891 passed, 6 skipped.
- `uv run pytest tests/test_interact_layer.py` — 157 passed, 6 skipped
(this is the module that reads `ci.yaml`; the new step declares no
`working-directory`, so the gate-naming test is unaffected).
- `pre-commit run --files .github/workflows/ci.yaml CLAUDE.md
tests/CLAUDE.md` — passed, including actionlint's shellcheck pass over
the new `run:` block.

`fetch-depth: 2` on the `test` job's checkout is what gives the merge
commit its base parent; the default depth of 1 has no `HEAD^1` to diff
against.

</details>

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Sep 7, 2026
#373)

`main` has been red on the nightly ring census since #365. The corpus
walk waits for the page to stop moving and it never does: three CSS
transitions on a reaction pill's tooltip label restart every frame, so
the label never outlives its own 90ms delay — it is invisible for the
page's whole life — and `pageSettled` can never go true.

## The loop

A docked margin row is floated back into the rail every pass to ask
whether it fits now, and docked again when it does not. That round trip
runs through `moveHost`, which relocates a cluster that may hold the
reader's focus: the move emits `focusout` and the restore emits
`focusin`, both of which reach `paintHere()`, and the resulting paint
runs `syncLayout` → `dockSeats` → another pass.

#365 made the cycle reachable from both ends. `dockSeats` schedules a
pass whenever a reaction seat stands anywhere on the page, and the six
emoji it moved into the margin mean one always does; and it put the
focused control inside the host being moved, which is what turns a
placement into focus traffic.

`anchors.js`'s `dockSeats` comment records the same shape being cut once
before — "a whole margin render every frame with nothing dispatched and
nothing moving… ~350ms of main thread a frame". This is that cycle
closing again through a consumer that did not exist then.

## The change

A dock is an answer about a width, so it holds while the width it
answered about holds. The pass remembers the room each row docked
against and keeps that answer until the room changes or the row restates
itself through `registerMarginRow`/`updateMarginRow`, whose own size is
the other half of the answer. The measurement that could not have
answered differently no longer moves the reader's focus to prove it.

The tooltip is user-facing, not only a probe: before this, focusing a
reaction pill showed no label at all, and the page never stopped
animating.

## Verification

-
`test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus`
passes; it failed five times running on `main`
- Paired control: the same test passes at `5d571319` (the four merges
before #365) and fails at `06daeef3`, isolated `-n0`, same machine
- `uv run pytest tests/test_render_margin.py
tests/test_render_controls.py tests/test_render_navigation.py
--run-nightly` on the merged tree: 250 passed, 5 failed
- Four of those five are `main`'s own, confirmed against a detached
checkout of `8fbf925c` carrying none of this branch: both
`test_an_unchanged_heartbeat_restates_no_margin_name` cases and both
`test_the_small_screen_map_is_a_complete_accessible_sheet` cases
- The fifth,
`test_unchanged_margin_refresh_cost_is_bounded_by_refresh_count` at `22
<= 20`, was contention from `-n 2`; isolated it passes
- `uv run pre-commit run --files
skills/leaf/assets/runtime/margin-layout.js` clean

Review found one fault in the first version of this change and
`41f940d0` folds it in: a row the posture read keeps docked reached the
classification loop with `hangs === true` and its docked rect, so
`rect.right > room` was false and it fell through to `inMargin` —
counted as hanging in the margin while standing in flow. Every
`staysDocked` member used to carry `hangs === false` and re-enter the
docked branch on its own, which is the invariant the new member broke.

## The other #365 red, and where it went

`test_other_responses_can_turn_the_compact_field_into_a_suggestion` was
red on `main` for a second, unrelated reason: one Tab from the compact
composer focuses the fab bar's Other responses trigger, which raises the
margin surface, and `.lf-fab-bar[data-lf-margin-raised] { display: none
!important }` then hides the bar the reader is standing in.

That was #365 moving where Other responses renders, not a fault, and
#372 has since settled it: the case is now
`test_reactionless_other_responses_can_turn_the_compact_field_into_a_suggestion`,
which serves a layer with the reaction tokens stripped and asserts
Suggest stays in the compact fallback there. Both readings pass on this
branch with `main` merged in, so `main` goes green on the nightly ring
census and on that case together.

## Why nothing caught it

#340's gate runs the nightly modules a pull request edits. #365 edited
twelve test modules, and neither of the two it broke was among them. The
full nightly behind that gate has not completed on `main` since
`934bfc4c`: four of the six runs after it were cancelled by the next
merge landing first.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 11, 2026
…two nightly readings (#583)

The scheduled complete suite came back **36 failed, 2406 passed, 6
skipped** on [run
34591215585](https://github.com/max-sixty/leaf/actions/runs/34591215585),
the first nightly to read `main` at `19f3ba5f`. Thirty of those are
already owned — eight by #582 and twenty-two by #547 — and six are new
since [run
34562158190](https://github.com/max-sixty/leaf/actions/runs/34562158190),
which is to say they arrived with #576, #579 or #580. This repairs four
of the six. The other two are below, with what each needs from you.

## A copy dropped the label off a control it kept

`test_an_exported_page_fixture_stands_on_its_own[corpus]` and
`[notification-playground]` fail on a critical axe finding:
`#notification-simulator-pressure`, a range input the copy keeps, has no
accessible name. The page builds a label for it, and the live page is
fine; the bake removes the label.

`offer()` writes a generated label the empty offer marker, and an
explicit label — `for` naming the control rather than wrapping it — is
an element with only words inside it. That is the shape [the removal
pass](https://github.com/max-sixty/leaf/blob/a537b954b4390ceedefe93e9701f1fcb6449cc7d/skills/leaf/scripts/leaf/render-checks/standalone.js#L323)
reads as "leaf chrome with no element inside it: a mutable status word",
so the label goes while the input it names stays. The pass's own comment
says the opposite — "a checkbox, **a label** and a § link stay" — which
held for as long as every generated label in the tree wrapped its
control, and `:has(*)` kept those. #580's page-authored module is the
first to write `for`, and it found the hole.

So this is a product fix rather than a fixture one: the bake now keeps a
generated label whose control survives the same pass. Asked of the
control, so a label whose control does leave still leaves with it and no
word is orphaned. Both export fixtures are the regression reading, and
the run that takes it is the nightly one: `test_render_export.py` is
nightly-marked, a pull request's `uv run pytest tests` deselects it, and
#433 removed the touched-module selector #340 had added. So `ci` on this
pull request does not exercise the fix — the review's own selection and
the next nightly are what do.

## A handoff colours the control, not a second margin row

`test_a_copy_keeps_applied_widget_state_and_drops_live_handoff_status`
waits on `[data-lf-margin-for='d-open'] [data-lf-behavior='status']` and
finds nothing. #576 is why: canonical pickup and work receipts now
colour the target's surviving semantic control, and only a target with
no carrier gets a separate activity reading. The draft has a pencil, so
the pickup rides on it as `data-lf-agent-phase="picked_up"` and no
status row is built.

The subject of the test is unchanged — a file carries the edited draft
and no record that an agent picked it up — so it now reads the pencil's
phase on the live page, and asks the copy for both seats a handoff can
speak from. The copy already drops the pencil with the rest of the
presses, so this is a fixture realignment and not a hole: verified
against the exported file, where every remaining `data-lf-agent-phase`
is a selector in the inlined stylesheets.

## Two class ledgers name what #576 and #579 dressed

`test_a_coined_class_cannot_reach_the_chromes_rules` holds two lists of
names the chrome scopes privately and something at document level also
dresses, each widened on purpose. Eleven names arrived in the
authored-theme list and one in the runtime sheet's shared vocabulary,
all from deliberate rules:

- #579 seats the one canonical composer in a widget's own Thread outlet,
where a scoped rule cannot reach it, and [dresses that seat in the
authored
theme](https://github.com/max-sixty/leaf/blob/a537b954b4390ceedefe93e9701f1fcb6449cc7d/skills/leaf/assets/theme.css#L2087)
under `[data-lf-presentation="inline"]` — the bar, the composer, the
field's control, the target press and the response options behind it.
- #576 gives a thread card its turn-ownership paint in one
document-level rule over `.lf-thread` and `.lf-conversation-thread`, and
writes the same paint over `.lf-margin-entry` and `.lf-page-map-action`
together. The margin entry stands in the page, so the rule is at
document level and the Page Map row is named there rather than in a
second scoped copy the two could drift through.

Each entry carries the reason, the way #398 added the living margin's
rail.

## The two this leaves

Neither is a repair that follows from the failure.

-
`test_render_controls.py::test_each_control_archetype_holds_its_neighbours_still[diff-review]`
fails on its premise: "diff-review has no neighbouring control to hold".
#579 moved the review press out of `.lf-diff-file` into a new
`.lf-diff-file-actions` wrapper, which theme.css draws back onto the
summary line. The press still shares that line, and the contract the
archetype exists for — pressing Review must not reflow the summary
beside it — is still worth proving; the sweep reads a row as the
target's parent's children, and the summary is now a level further out.
Widening that reading to the file is the obvious move and it is the
wrong one: I tried `el.closest('.lf-margin-cluster, .lf-diff-file')` and
it puts every file's summary and every file-level `+` into
`test_the_composed_corpus_declares_every_control_row_archetype`'s
undeclared list, turning five entries into dozens. The alternatives are
a row scope declared per archetype — which would leave the two sweeps
disagreeing about what a row is — or a corpus diff bound to data, so the
`+` stands beside Review as it does in the PR example. Both are your
call about what the row is.
-
`test_render_startup.py::test_the_thread_follows_the_decision_that_still_stands`
fails on the withdrawn reject: the widget goes back to `accept` as the
test expects and the thread stays open for the whole five-second wait.
It does not reproduce here — the complete `test_render_startup.py`
passes 93/93 under the default parallelism and the case passes alone
under `-n0` — so it is either a state race that needs the whole suite's
load or a first-and-only sighting. Worth re-reading if the next nightly
repeats it.

## Verification

- `tests/test_render_export.py` complete: **51 passed, 2 failed**. Both
failures are this container's, not the branch's:
`test_the_example_preview_command_exports_a_file_that_opens_on_its_own`
and `test_exporting_an_example_leaves_the_live_preview_untouched` drive
the installed launcher, and no browser on this host launches through it.
Neither is in the run's failure list.
- `tests/test_render_startup.py` complete: **93 passed**.
-
`tests/test_render_controls.py::test_each_control_archetype_holds_its_neighbours_still`
complete: **11 passed** — the reverted experiment above left nothing
behind.
- The everyday suite: **1009 passed, 3 failed**, all three this
container's — the two IPv6 wildcard cases `tests/CLAUDE.md` names and
one that writes to a read-only `/tmp`.
- `pre-commit run --files` over the three changed files: passed.

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants