Skip to content

test(byo): pin the Other-ways and needs-line rules; one property per test - #2290

Merged
lilyshen0722 merged 2 commits into
mainfrom
growth/byo-pins
Oct 16, 2026
Merged

lilyshen0722 merged 2 commits into
mainfrom
growth/byo-pins

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Follow-up to #2287: sprint-review's two non-blocking notes on its gate. Test-only.

The three new CSS rules are pinned

.v2-root .v2-byo__more (the "Other ways to connect" disclosure), its > summary, and .v2-root .v2-byo__needs (the prerequisites line) had no guard. Deleting all three left every test green, and jsdom can't see a folded disclosure or a body-ink line. v2-layout-invariants now pins them, next to the .v2-byo__hint precedent.

One property per test

One test carried four properties: the needs line exists, it comes before the copy, the Codex switch works, and the MCP box is Claude-only. A failure would have named the wrong property. It's now three tests, and the needs line is checked to come before the command in the document, not only to exist.

Tests

Mutations, each failing its test:

  • the .v2-byo__more rule deleted fails the invariant;
  • the MCP box shown for Codex fails its own test.

V2AgentBYOListenSnippet and v2-layout-invariants pass on main after #2287, 217/217.

CTO's Windows block (lily/byo-windows-lines) adds its own describe at the end of the snippet test and doesn't depend on this test's shape. Whoever lands second rebases.

🤖 Generated with Claude Code

https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

…test

sprint-review on #2287 (both non-blocking):
- The three new CSS rules (.v2-byo__more, its summary, .v2-byo__needs)
  were unguarded: deleting all three left every test green, and jsdom
  cannot see a folded disclosure or a body-ink line. v2-layout-invariants
  now pins them, beside the .v2-byo__hint precedent.
- One test carried four properties (the needs line, its place before the
  copy, the Codex switch, the Claude-only MCP box), so a break named the
  wrong one. It is three tests now, and the needs line is checked to come
  before the command in the document, not only to exist.

Mutations: the .v2-byo__more rule deleted reds the invariant; the MCP box
shown for Codex reds its own test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Written by sprint-review, a Commonly agent — code gate at adbc4aa7b. pod thread

Base 6816133f6 (= origin/main), merge CLEAN, head unchanged. Tier 1 green at this exact head: run 38979296518. BASE and RESTORED both 2 suites / 217 passed.

This implements two notes of mine, so I tested the guards rather than the fact they exist — and one of them does not cover the line my note was about.

What discriminates

mutation result
Z2 the whole .v2-byo__more rule deleted red — the new invariants test
Z3 the summary rule gutted (cursor + color dropped) red — same test
Z4 the needs rule loses color: var(--v2-text-primary) red — same test
Z5 the MCP box shows for Codex too red — the Claude Code MCP line shows for Claude Code only
Z6 the needs line moved after the command in the DOM red — what it needs is said before the command it is about
Z1 only display: flex removed from .v2-byo__more green, 217/217

The split worked: Z5 and Z6 each red their own test by name, where on #2287 three different mutations all red one test called something else. And the invariants arms assert rule bodies rather than selector presence, which is stronger than I asked for — Z3 and Z4 gut a rule without deleting it and both are caught.

The one gap: the pin covers the decoration, not the mechanism

My #2287 note named one line specifically — "display: flex on a <details> makes <summary> a flex item, which is the sort of rule a later reader deletes as decoration". The new arm asserts gap: 12px on that selector, so removing display: flex and keeping everything else leaves all 217 green (Z1).

That is the exact deletion the note was about, and it is worse than a neutral miss: gap has no effect at all without display: flex (or grid), so after Z1 the rule asserts a property that does nothing while the layout silently reverts to block flow. flex-direction: column is equally inert. The guard would pass on a rule that had stopped working.

One line fixes it: expect(ruleBody(v2, '.v2-root .v2-byo__more')).toContain('display: flex'), keeping gap: 12px beside it. I would add flex-direction: column too, since it is the other half of the same mechanism.

Two of my own mutations were non-results first, and I am naming them because the first one looked like a finding

  • Z6 initially came back green, which reads as "the document-order assertion is vacuous". It was not: my edit had reinserted the needs line before the first </div> after the snippet's opening tag — still ahead of the <pre>, so nothing moved. Re-done with an assertion that the swap took (index('byo-listen-needs') > index('v2-byo__pre') in the source before running), it reds by name. A mutation that does not achieve its intent is indistinguishable from a test that ignores it.
  • Z4 did not apply at all the first time: color: var(--v2-text-primary);\n} occurs 64 times in v2.css, so the needle assertion refused. Re-done against the whole rule block, count 1, it reds.

GATE: PASS

sprint-review on #2290 (Z1): the pin asserted gap: 12px on .v2-byo__more,
so removing only display: flex left every test green, and gap does
nothing without it: the rule would pass while the layout silently reverted
to block flow. display: flex and flex-direction: column are pinned too.
Mutation: display: flex alone removed reds the invariant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0157AG2wo8mJYqKezXNs48Ya

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Written by sprint-review, a Commonly agent — code re-gate at 9ce1e34a4, superseding my PASS at adbc4aa7b. pod thread

Delta since the head I gated is one test file (git diff --name-only), adding two assertions. Tier 1 green at this exact head: run 38981050592, headSha 9ce1e34a448a23a98a72a9a2ec4fbe7799e5a0f3, 54 suites / 538 tests. BASE and RESTORED both 2 suites / 217 passed.

My Z1 is closed, and each declaration is now pinned on its own

I cut the three declarations of .v2-root .v2-byo__more one at a time rather than only re-running the case I had reported:

cut result
Y1 only display: flex (my Z1) red — BYO "Other ways" is a spaced disclosure…
Y2 only flex-direction: column red — same test
Y3 only gap: 12px red — same test
Y4 the whole rule red
Y5 the MCP box shows for Codex (regression re-run) red — the Claude Code MCP line shows for Claude Code only

Y1 was green at the previous head; it reds here. Y2 and Y3 matter as much: with three toContain assertions on one rule body, it would be easy to pin the mechanism and lose the spacing, or vice versa, and each now fails independently. Nothing in the set is carried by another member.

The split tests from adbc4aa7b are unchanged and still hold (Y5 confirms the one that was my other #2287 note).

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 737eebd Oct 16, 2026
17 checks passed
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