Skip to content

Re-resolve the graph parent while waiting for workspace chrome - #443

Merged
coneilen merged 1 commit into
mainfrom
gate-reresolve-graph-parent
Sep 24, 2026
Merged

coneilen merged 1 commit into
mainfrom
gate-reresolve-graph-parent

Conversation

@coneilen

Copy link
Copy Markdown
Collaborator

Problem

#442 fixed the detail-children assertion by re-resolving the four children from the live tree instead of polling cached references. The next run failed one assertion earlier, on the chrome mount loop:

workspace chrome omitted the toolbar identity child

Same root cause, one level up. The mount loop already re-queries its children on every attempt, but it queries them from a $graph reference captured at line 1526 — before the project row and loop row are invoked at 1551–1552. That invocation is exactly what transitions the canvas into the workspace view, and it remounts the graph fragment itself.

So the parent can already be dead when the loop starts. Get-DirectChildren on a dead parent returns nothing for as long as it is asked, which is why the previous hardening kept failing in this block no matter how the budget was adjusted: widening 10s to 20s gave a dead reference more time to stay dead. This is the same trap as #442 — polling something that cannot change — just applied to the parent rather than the children.

It also explains the long-standing non-determinism here, where a single commit produced different failure sites in this block across runs with no code change: which assertion you land on depends only on where the remount falls relative to the loop.

Fix

Re-resolve the parent alongside the children on every attempt, so each attempt observes one live generation of the tree. Applied in both places that walk this subtree: the chrome mount loop and #442's detail-children loop, which had the same latent exposure through its own cached $graph.

Evidence

RED: CI run 35954040424 -> FAIL workspace chrome omitted the toolbar identity child at uia-live-gate.ps1:447, after the mount loop had consumed its full 20s budget against a parent captured before the invocation that remounts it.

GREEN: the windows-shell live gate now resolves the workspace chrome and advances past the block -> see the windows-shell check on this PR.

REGRESSION: Tools\windows\Tests\WindowsShell.Tests.ps1 -ZigExecutable $env:GRAPHCODE_ZIG0152 -> All 266 tests passed, Windows shell scaffold contract: PASS (40 source files executed).

Verification

  • Parses clean.
  • Require predicates are byte-identical to main: 379 on main, 379 here, Compare-Object reports no differences in either direction. This change is purely about which element reference is inspected; no assertion was added, removed, or weakened.
  • No C# touched, so the shared Add-Type block and its declaration counts are unaffected.

The mount loop re-queried its children every attempt but from a \
reference captured before the project and loop rows were invoked. That
invocation transitions the canvas and remounts the graph fragment, so the
captured parent can already be dead when the loop starts, and
Get-DirectChildren on a dead parent yields nothing for as long as it is
asked. Waiting longer could never recover from that.

Re-resolve the parent alongside the children on every attempt, in both the
chrome mount loop and the detail-children loop, so each attempt observes one
live generation of the tree.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen
coneilen merged commit 984889b into main Sep 24, 2026
10 checks passed
@coneilen
coneilen deleted the gate-reresolve-graph-parent branch September 24, 2026 05:05
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