Skip to content

Round 1 brief: fix sync-push findings (Gronktayvius)

Fix rows 18 to 24 of C:\Users\fives\source\repos\fleet-harness-wt\WT-0cdb-FLT-322\docs\forge-gates\council-round1.md. The first rule stands: nothing may change whether or how the push and the peer pulls happen. Keep the UTF-8 BOM on sync-push.ps1. It must run under Windows PowerShell 5.1 and pwsh.

Working directory: C:\Users\fives\source\repos\fleet-repo-sync-wt\WT-0cdb-FLT-322. Edit sync-push.ps1, tests/sync-push-shadow.Tests.ps1, docs/flt-322-sync-push-report.md. Do not commit or push. Always -SkipPeers -SkipMacs in tests.

How

Replace Start-Process in the helper with one small function using System.Diagnostics.Process and ProcessStartInfo: UseShellExecute=false, CreateNoWindow=true, both streams redirected to pipes, read through ReadToEndAsync() tasks, and every wait bounded (WaitForExit(ms), then Task.Wait(ms)). If the wait expires, abandon the task. No temp files. This removes rows 19 and 23. Use it for the git probes too, with a 2 second bound, which removes row 22.

  • Row 18: verify alone writes result, wouldBlock and codes. A later publish failure writes only publishReason. An exception after verify finished must not change them.
  • Row 20: ProcessStartInfo.ArgumentList does not exist on .NET Framework, so build the Arguments string. Accept --commit and --base only as 40 hex. If the repo path or remote contains ", log Skipped with reason unsafe-arg and continue to the push. If the remote has userinfo (user:token@), skip publish only, with publishReason userinfo.
  • Row 21: the verdict's commit must equal HEAD. Otherwise Skipped reason parse.
  • Row 24: if verify timed out, do not run publish.

Add a test for each row: Block survives a publish timeout, a " in the origin URL, a remote with userinfo, a verdict for another commit, no publish after a verify timeout, and CreateNoWindow proved by a stand-in gate that records its console window handle (GetConsoleWindow through a small C# stand-in or PowerShell Add-Type). A stand-in may also just assert no new visible window if that is more reliable; say which.

Check

Run pwsh -NoProfile -NonInteractive -File docs/run-shadow-tests.ps1 powershell, and the same with pwsh, and with existing. Run each at most three times. Each takes about 2 minutes. Update the report, short, with real output. If a call is denied, name it and stop.