Skip to content

Repair the nightly margin and anchors tests the go-to hint change left red - #339

Merged
max-sixty merged 2 commits into
mainfrom
fix/margin-target-shadow
Sep 6, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/margin-target-shadow

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

test_render_* is nightly-marked, so the PR gate never ran the two files #336's hint migration rewrote; both went red on main the moment it landed. tests/test_render_margin.py rebinds target — a page.locator("#jobs") the test still uses seventy lines later — to the hint's phase id string, so the run dies at expect(target).not_to_have_class(...) with ValueError: Unsupported type: <class 'str'>; renaming the new binding to phase is the whole fix. tests/test_render_anchors.py reads the Ask option's key face while the go-to chord is armed, and the chord is a nearer keyboard layer that takes the Ask digit projection back while it stands, so the face is display: none and never becomes visible.

Both were verified here against main: each failure reproduces on a4eb323f and passes on b7703fb9, the commit before the merge.

The anchors repair, and one behavior worth confirming

The test's new comment claims bare g "paints the page's generated target letters without replacing the Ask projection." Probed on the merged runtime, it replaces it: with focus in #tq-one .lf-pick the two .lf-address faces read 1:block/2:block, and after g they read :none. That matches what asks/view.js says it intends — "A nearer keyboard layer suppresses the row and both projections … so a digit never stays promised after a chord, text box, or modal has taken it" — so this change follows the runtime and reads the option's face before arming the chord rather than during it. If the projection was meant to survive bare g instead, the repair belongs in paintActionProjections and this test should go back to one frame.

The face reads are also now one task each. Resolving a locator handle in one round trip and measuring it in the next let the standing paint detach the element in between, and a detached element has no computed style at all — every property came back ''. That reproduced on the chip, the key line, and the hint layer in turn, which is why FACE is applied through document.querySelector inside a single page.evaluate for every face compared.

The c press before the focus stays: the Ask projection paints on a keyboard gesture, and opening the composer is the gesture the test already had. Bare .focus() with a 300ms settle paints nothing, before or after the migration.

Verification
  • uv run pytest tests/test_render_anchors.py tests/test_render_margin.py — 155 passed, on 83f69563.
  • uv run pytest tests — 891 passed, 6 skipped.
  • pre-commit run --files tests/test_render_anchors.py tests/test_render_margin.py — passed.
  • The anchors case run five times in a row for stability — passed each time.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the repair independently rather than restating the PR's own numbers, because the ci PR gate cannot run either changed file. On the merge base 83f69563 both cases fail — test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure with ValueError: Unsupported type: <class 'str'>, and test_one_key_keeps_one_keyboard_face_across_the_page at expect(picked).to_be_visible() with the .lf-address span resolving hidden, which is the projection suppression the PR body describes. At d10463fd, uv run pytest tests/test_render_anchors.py tests/test_render_margin.py --run-nightly is 155 passed. The phase rebinding is safe: the only other phase in that test is assert_status's parameter, which is function-local and unaffected by an assignment in the enclosing scope, and target still names the page.locator("#jobs") binding the later expect(target) class assertions read.

The gap the PR body names in passing is worth its own change. ci.yaml's pull_request step runs uv run pytest tests, which skips every test_render_* module, so a PR whose entire diff is those files goes green having exercised none of it — including this one. That is how #336 landed a rewrite of these two files, and #338 is in the same position right now with tests/test_render_margin.py and tests/test_render_navigation.py. Running the nightly-marked files a PR actually touches would close it at the cost of those files rather than the whole 22–41 minute nightly suite. Flagging rather than folding it in here, since it is a separate concern and the gate's cost is a maintainer call.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

No change to this PR from the review — it verifies the repair independently and confirms the phase rebinding and the anchors face read.

The gate gap it names is now #340, kept separate as the review suggested. The everyday suite deselects the nightly-marked modules, so a pull request whose whole diff is one of them — this one included — goes green having exercised none of it; #340 runs the touched modules with -m nightly on a pull request, which costs those files rather than the whole nightly suite. #338 is the case still open: its tests/test_render_margin.py and tests/test_render_navigation.py changes are unexercised by its gate today.

@leaf-agent

Copy link
Copy Markdown
Collaborator Author

This is the fix for the red ci on main: run 34045094569 on 83f69563 failed its nightly leg on exactly these two cases — test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure with ValueError: Unsupported type: <class 'str'> and test_one_key_keeps_one_keyboard_face_across_the_page with the option's .lf-address hidden — so main stays red until this lands.

Reproduced both on 83f69563 in a separate checkout before finding this PR, and reached the same two causes: the target rebinding at tests/test_render_margin.py#L2345, and the go-to chord taking the Ask digit projection back while it stands. On the anchors case I also confirmed the two presses are separable: dropping the g and keeping c alone paints 1/2 on the option faces and turns the case green, which matches the reading in your details block — c opens the panel and the chord is what suppresses the projection.

max-sixty added a commit that referenced this pull request Sep 6, 2026
The feature gallery's existing Button section showed a composed cluster
but not the complete visual grammar. This adds a gallery-only atlas
built from the canonical margin Button factory, with every role,
behavior, tone, and lifecycle state visible together.

The same section now carries a real suggestion through failure, animated
delivery, the transient Accepted acknowledgment, settled content and
Undo, handoff status, and active work. Atlas coverage is checked against
the runtime-owned `BUTTON_GRAMMAR`, so a new Button value cannot leave
the gallery and its test green but incomplete.

The standalone-export probe now recognizes content deliberately retired
by a standing decision as absent by design. This branch also
incorporates the two browser-test repairs from
#339, keeping current `main`'s
nightly anchor and margin files aligned with generated go-to hints.

> _This was written by Codex on behalf of max-sixty_
@max-sixty
max-sixty merged commit 1588aab into main Sep 6, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/margin-target-shadow branch September 6, 2026 20:09
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 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]>
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