FLT-322 fix brief: sync-push shadow wiring (Cedric)¶
Read docs/flt-322-sync-push-brief.md first: its requirements stand. Susie's run hit its time limit with no report and no commit. Her uncommitted sync-push.ps1 and tests/sync-push-shadow.Tests.ps1 are in this worktree. They have not been proven to work. Keep what is sound and rewrite the rest.
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 and docs/flt-322-sync-push-report.md. Do not commit or push. No test may reach a real machine. Always pass -SkipPeers -SkipMacs in tests.
The known bug¶
The draft reads $o.result and treats $o.reasons as strings. The gate has no result field. Against the real binary every run would log Skipped, while tests with invented stand-in output stay green. The real output, verbatim from the Release binary:
{"schema":"forge.smoke.verdict/1","mode":"shadow","commit":"53b33b9dcea76e493a70088707ae47334fde1b3a","outcome":"Pass","wouldBlock":false,"wouldPage":false,"reasons":[],"flags":["PartAdded"],"changed":[{"path":".forge/smoke.json","class":"Mapped","parts":["probe"]}]}
{"schema":"forge.smoke.publish/1","mode":"shadow","commit":"53b33b9dcea76e493a70088707ae47334fde1b3a","refs":["refs/forge/smoke-shadow/53b33b9dcea76e493a70088707ae47334fde1b3a/probe/inSystem"]}
A verdict with reasons looks like "reasons":[{"code":"NoManifest","part":null,"stage":null,"path":null,"detail":"..."}]. The contract is C:\Users\fives\source\repos\fleet-harness-wt\WT-0cdb-FLT-322\docs\forge-gates\contract.md.
Fix¶
- Parse the verdict by exact fields:
schemaequal toforge.smoke.verdict/1,outcomeinPass|Block|CannotRun,wouldBlockfrom the JSON, codes fromreasons[].code. Anything else isSkippedwith reasonparse. Delete the loose line-prefix fallback, which can readPassout of arbitrary text. - For
publish, record its exit code and the count ofrefs. Publish output never decides the logged result. - Shrink it. The draft adds 172 lines where the brief asked for one small helper. Remove scriptblock indirection that is not needed. A failure anywhere must still log
Skippedand reach the push. - A stand-in's output must be one of the real payloads above, commented with its origin. Assert the negative: a payload with
resultand nooutcomelogsSkippedparse, neverPass. - Add one test against the real gate:
$env:FORGE_SMOKE_REAL_BINnames the Releaseforge-smoke.exe. It runs in a real temp repo with a local bare origin and asserts the push happened and the log holds the realoutcomeand reason code (NoManifest, since the repo has no manifest). If the variable is unset, the test must fail, not skip.
The worst-case bound is about 24 seconds of added push time. If you can tighten it, do. If a case could exceed it, report that.
Check¶
Run the file with hidden windows. Bound the run: timeout 600, or a job with the same limit. Susie's run may have stalled here, so if a case hangs, name it and fix the hang rather than waiting.
$env:FORGE_SMOKE_REAL_BIN='C:\Users\fives\source\repos\fleet-harness-wt\WT-0cdb-FLT-322\src\Forge.Gates.Smoke.Cli\bin\Release\net10.0\forge-smoke.exe'
$env:FRS_TEST_HOST='powershell'; Invoke-Pester tests/sync-push-shadow.Tests.ps1 -Output Detailed
$env:FRS_TEST_HOST='pwsh'; Invoke-Pester tests/sync-push-shadow.Tests.ps1 -Output Detailed
Also run the existing tests/fleet-repo-sync.Tests.ps1 under one host, to show it still passes.
If your sandbox blocks the bare-remote push or Pester itself, state the exact refused call and stop. Do not change execution policy to work around anything; if a script launch is blocked, say so.
Report¶
docs/flt-322-sync-push-report.md, short: real output, anything not passing, and any path by which this could still stop or delay a push.