LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtSep 3, 2026, 11:23 AM
updatedAtSep 3, 2026, 3:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/18179
authorneo-opus-grace
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 3, 2026, 3:56 PM

DockPreviewGeometry cannot tell a staged shell from a stranded one

Closed v13.2.0/archive-v13-2-0-chunk-18 bugaitestingdashboard
neo-opus-grace
neo-opus-grace commented on Sep 3, 2026, 11:23 AM

Context

test/playwright/component/dashboard/DockPreviewGeometry.spec.mjs:59 failed twice on 2026-09-03 and passed on a re-run at the identical head both times.

# PR diff under test run outcome
1 18157 dock adoption-failure signal (JS) components fail, then green on re-run at the same commit
2 18170 button custom-override block (SCSS only) 33733566436 fail; re-run 33737571342 green at the same head

The two diffs share nothing — one is dock JavaScript, the other is six resources/scss/**/button/Base.scss files with no path to the dock host's layout. A cause common to both is therefore in the spec or the fixture, not in either change. Instance 1 was captured at the time as a defect-note to AGENT:*; instance 2 is the independent second occurrence that promotes it under ticket-create §1e.

Both engine fixes this spec was written around are already on dev: 18146 (preview overlay geometry) and 18147 (a rejected projection phase settles the host to one shell), the latter merged as 4d9c6b208e. So this recurs with both fixes in place.

Live latest-open sweep: checked the latest 20 open issues at 2026-09-03T09:18Z; no equivalent found. A2A in-flight claim sweep at the same time: no [lane-claim]/[lane-intent] on this scope. Memory Core sweep on the symptom nouns returned the 18142/18143 origin session and no prior decision on the spec's stability.

The Problem

The observed failure is scrollWidth at twice clientWidth — two full host widths in the flex row.

That is the exact signature of the defect this file exists to catch. From the spec's own header: an unpositioned preview is an in-flow .neo-layout-fit-item at flex: 1 0 100%, i.e. a second full host width, and scrollWidth === clientWidth was chosen as the assertion because "it reads the CAUSE". The reconciler also legitimately stages a second shell for a few frames mid-transaction, which produces the same number for a correct reason — the spec's beforeEach says so explicitly.

So a red here is ambiguous between:

  • (a) the fixture measured inside the staging window (a harness race), and
  • (b) a genuine regression of 18142 or 18147 — a preview back in the flow, or a strand that did not settle.

Today the team resolves that ambiguity by re-running, and a green re-run is read as "flake". If (b) ever happens, the same ritual buries it. That is the cost: this is not merely a noisy spec, it is a spec whose failure mode is indistinguishable from the regression it guards.

The Architectural Reality

beforeEach already carries a settle guard added with 18142:

await expect.poll(async () => page.evaluate(host =>
    document.querySelector(host)?.childElementCount ?? 0, HOST), {timeout: 10000}).toBe(3)

The comment reasons that child count is independent of scrollWidth — which is true, and is not the problem. The problem is that 3 is the at-rest count on BOTH sides of the event. The host holds its shell plus two persistent overlays at rest, and one more while a second shell is staged. So 3 is satisfied:

  • before the projection under test has begun staging, and
  • after it has fully settled.

expect.poll returns on its first satisfying sample, so the guard can pass pre-transaction and hand control to a measurement that then lands mid-stage. It waits for a state that the timeline visits twice, rather than for the transition it means to witness — so it cannot certify the step it is placed there to certify.

The Fix

Make the settle guard witness the transition rather than a state the timeline visits twice. Options, in preference order — the implementer picks with a red-first witness:

  1. Poll for a stable count across consecutive samples (observe 4, then 3), so the guard cannot satisfy itself before staging starts.
  2. Drive the projection from the fixture and await its settle signal directly, rather than inferring settledness from the DOM.
  3. Failing both, assert on a marker the reconciler sets only at phase 4 completion.

Whatever shape lands, the required property is that a red means a regression: a failure must no longer be explicable by "measured too early".

Files: test/playwright/component/dashboard/DockPreviewGeometry.spec.mjs, and the fixture app under test/playwright/component/apps/dock-preview-geometry/ if the settle signal has to be published.

Acceptance Criteria

  • The beforeEach settle guard cannot be satisfied by the pre-transaction at-rest state — demonstrated, not asserted (a witness that fails against the current guard and passes against the new one).
  • Both arms of the describe block run green across at least 20 consecutive repeats, including under load (a concurrent components run), since the failure is load-tipped.
  • A deliberately reintroduced in-flow preview (the 18142 defect) still turns the spec red — the guard change must not have bought stability by weakening the assertion.
  • A deliberately stranded second shell (the 18143 defect) is distinguishable in the failure message from a mid-stage measurement.
  • No change to scrollWidth === clientWidth as the assertion; it reads the cause and stays.

Out of Scope

  • The engine's reconciler transaction itself. Nothing here claims 18147 is incomplete; that arm is left open by the evidence and would be its own ticket with its own reproduction.
  • DockRailLazyModule.spec.mjs, which flaked separately on the components tier the same morning (observed on 18176 by two reviewers). Same tier, different spec, unproven common cause — bundling them would assert a shared mechanism nobody has measured.
  • Any general "quarantine flaky specs" mechanism. One spec, one measured mechanism.

Avoided Traps

  • Labelling it a flake and moving on. Two occurrences on unrelated diffs is exactly the point at which "flaky" starts laundering a real signal — and here the signal it would launder is a regression of two freshly-fixed defects.
  • Waiting on scrollWidth to settle. That is the property under test; using it as the settle signal makes the arms vacuous, which the existing comment already warns against and which the fix must not reintroduce.
  • Widening the tolerance (accepting scrollWidth up to 2×). That converts the guard into one that cannot see the defect at all.

Decision Record impact

none — test-only; the engine contract is unchanged.

Related

  • 18142 / PR 18146 — the preview-geometry defect this spec witnesses, and where the settle guard was introduced.
  • 18143 / PR 18147 — the stranded-shell defect whose signature the failure is indistinguishable from.
  • 18152 — the completeness-guard sibling; unrelated mechanism, same suite.

unowned-rationale: filed from a nightshift heartbeat run that makes no working-tree writes (a sibling session holds the shared checkout mid-lane), so the implementation cannot start or finish in the same run. Left claimable rather than claimed, per finish-or-release. The measurement above is complete; the next agent needs no reproduction work to begin.

Origin Session ID: 20f43adc-6acd-4cbb-8a25-da750540ea68

Handoff Retrieval Hints: query_raw_memories on "DockPreviewGeometry staged shell settle guard scrollWidth twice clientWidth"; the 18142/18143 origin session is f6da5bf6-e688-454c-8fea-1ee269327016 (Vega, the live Neural Link read that found both defects). CI anchors: failing run 33733566436, green re-run 33737571342, both at PR 18170's head.

neo0007777
neo0007777 Sep 3, 2026, 11:41 AM

Hi @neo-opus-grace, I would like to take this up. Could you please assign this issue to me?

The diagnosis on the settle guard race makes total sense. Because childElementCount is 3 both before the projection begins staging and after it settles, expect.poll can satisfy immediately on its initial sample pre-transaction, allowing readGeometry to execute right into the 4-child staging window where scrollWidth is legitimately 2x clientWidth.

My approach is to replace the static state check with a transition witness. I plan to update the guard to observe the staging phase before settling back to 3 (witnessing 4 -> 3), or await the projection settle signal directly from the fixture app if exposed. I will back this with a red-first witness to demonstrate the fix against the current race, run repeated test sweeps under load to confirm stability, and ensure a deliberate in-flow preview regression still fails cleanly without altering the scrollWidth === clientWidth assertion.

  • 2026-09-03T12:17:38Z @neo-opus-vega cross-referenced by #18201
  • 2026-09-03T12:28:14Z @neo-opus-grace cross-referenced by PR #18203
  • 2026-09-03T15:07:05Z @neo-opus-ada cross-referenced by PR #18214