Skip to content

Commit 23d4aeb

Browse files
committed
OX-02 P14: three driver fixes after the first near-complete Visual Studio run
The run on a0c038d passed in Visual Studio 2026: vsix-loaded, L0, K1 (open and unsaved clean edit), K2 squiggle (10:9 'OrderProtocol.WithDraft(order, draft =>' and the witness 13:13 'draft.Submit(now);'), K2 unsaved, K2 Error List row, P9 (CS0029 beside OWN002), K3 (gone after 372 ms), disappearance p95 420 ms, UI thread max 6.5 ms, no build, never saved. Three failures were the driver's: - navigation: DTE MainWindow.HWnd is null in VS 2026; use the process's window; - edit->squiggle 0/10 although the trace has every squiggle: Windows PowerShell gives a lone PSCustomObject no .Count; always count arrays; - the orphan probe counted every dotnet.exe; check owen serve processes only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
1 parent a0c038d commit 23d4aeb

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

‎scripts/vs/owen-vs-acceptance.ps1‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ function Tags-Since($since) {
209209
Poll-Trace
210210
@($script:events | Where-Object { $_.kind -eq 'tags' -and $_.t -ge $since -and $_.data.file -like '*Use.cs' })
211211
}
212-
function Own002($tagsEvent) { @($tagsEvent.data.tags | Where-Object { $_.code -eq 'OWN002' }) }
212+
# always an array: Windows PowerShell gives a lone PSCustomObject no .Count
213+
function Own002($tagsEvent) { return ,@($tagsEvent.data.tags | Where-Object { $_.code -eq 'OWN002' }) }
213214
function Wait-Tags($since, [scriptblock]$Want, [int]$Seconds = 60) {
214215
$deadline = (Get-Date).AddSeconds($Seconds)
215216
while ((Get-Date) -lt $deadline) {
@@ -335,7 +336,7 @@ Check "K2-error-list" ($null -ne $row) "Error List row: $(if ($row) { $row.Text
335336
if ($row) { try {
336337
try { $row.Element.GetCurrentPattern([System.Windows.Automation.SelectionItemPattern]::Pattern).Select() } catch { }
337338
$r = $row.Element.Current.BoundingRectangle
338-
[Mouse]::SetForegroundWindow([IntPtr]$dte.MainWindow.HWnd) | Out-Null
339+
[Mouse]::SetForegroundWindow((Get-Process -Id $proc.Id).MainWindowHandle) | Out-Null
339340
[Mouse]::DoubleClick([int]($r.X + [Math]::Min(200, $r.Width / 2)), [int]($r.Y + $r.Height / 2))
340341
Start-Sleep -Milliseconds 1500
341342
$active = Retry { $dte.ActiveDocument }
@@ -360,7 +361,7 @@ Start-Sleep -Milliseconds 1500
360361
Front-Use
361362
$since = Now
362363
Delete-Line (Line-Of 'draft.Submit(now);')
363-
$gone = Wait-Tags $since { param($e) (Own002 $e).Count -eq 0 }
364+
$gone = Wait-Tags $since { param($e) @(Own002 $e).Count -eq 0 }
364365
$rowGone = Wait-Row 'OWN002' $false 60
365366
Check "K3-disappears" (($null -ne $gone) -and ($rowGone -eq $true)) "after deleting the line: tags without OWN002 at +$(if ($gone) { $gone.t - $since } else { '?' }) ms; Error List row gone: $($rowGone -eq $true)"
366367
Shot "k3-gone"
@@ -372,12 +373,12 @@ for ($i = 0; $i -lt $Repeats; $i++) {
372373
Start-Sleep -Milliseconds 800
373374
$since = Now
374375
Insert-Line ((Line-Of $anchor) + 1) $stale
375-
$e = Wait-Tags $since { param($x) (Own002 $x | Where-Object { -not $_.primary }).Count -gt 0 } 30
376+
$e = Wait-Tags $since { param($x) @(Own002 $x | Where-Object { -not $_.primary }).Count -gt 0 } 30
376377
if ($e) { $appear += ($e.t - $since) }
377378
Start-Sleep -Milliseconds 800
378379
$since = Now
379380
Delete-Line (Line-Of 'draft.Submit(now);')
380-
$e = Wait-Tags $since { param($x) (Own002 $x).Count -eq 0 } 30
381+
$e = Wait-Tags $since { param($x) @(Own002 $x).Count -eq 0 } 30
381382
if ($e) { $vanish += ($e.t - $since) }
382383
}
383384
function P95($xs) { $s = @($xs | Sort-Object); if ($s.Count -eq 0) { return $null }; return $s[[Math]::Max(0, [int][Math]::Ceiling($s.Count * 0.95) - 1)] }
@@ -406,8 +407,14 @@ Check "never-saved" ((Get-Content $fx.use -Raw) -eq (Get-Content (Join-Path $PSS
406407
$results.failed = $failed
407408
$results | ConvertTo-Json -Depth 8 | Set-Content (Join-Path $Out 'results.json') -Encoding UTF8
408409
try { $dte.Documents.CloseAll(2) } catch { }
410+
$services = @(Get-CimInstance Win32_Process -Filter "Name = 'dotnet.exe'" | Where-Object { $_.CommandLine -like '*ownsharp.dll*serve*' })
411+
Log "owen serve processes before devenv ends: $(@($services | ForEach-Object { $_.ProcessId }) -join ', ')"
409412
Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue
410-
Get-Process -Name dotnet -ErrorAction SilentlyContinue | ForEach-Object { Log "dotnet still running after devenv: pid $($_.Id)" }
413+
Start-Sleep -Seconds 3
414+
$orphans = @(Get-CimInstance Win32_Process -Filter "Name = 'dotnet.exe'" | Where-Object { $_.CommandLine -like '*ownsharp.dll*serve*' })
415+
Check "no-orphan" ($services.Count -ge 1 -and $orphans.Count -eq 0) "owen serve ran ($($services.Count) process(es)) and did not outlive a killed devenv ($($orphans.Count) left)"
416+
$results.failed = $failed
417+
$results | ConvertTo-Json -Depth 8 | Set-Content (Join-Path $Out 'results.json') -Encoding UTF8
411418
if ($failed) { Log "VS acceptance: FAILED"; exit 1 }
412419
Log "VS acceptance: all checks passed"
413420
exit 0

0 commit comments

Comments
 (0)