Skip to content

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

  1. Parse the verdict by exact fields: schema equal to forge.smoke.verdict/1, outcome in Pass|Block|CannotRun, wouldBlock from the JSON, codes from reasons[].code. Anything else is Skipped with reason parse. Delete the loose line-prefix fallback, which can read Pass out of arbitrary text.
  2. For publish, record its exit code and the count of refs. Publish output never decides the logged result.
  3. 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 Skipped and reach the push.
  4. A stand-in's output must be one of the real payloads above, commented with its origin. Assert the negative: a payload with result and no outcome logs Skipped parse, never Pass.
  5. Add one test against the real gate: $env:FORGE_SMOKE_REAL_BIN names the Release forge-smoke.exe. It runs in a real temp repo with a local bare origin and asserts the push happened and the log holds the real outcome and 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.