Skip to content

scheduling: key the sync guard on delivery, ungate the remote push - #129

Merged
mspinola merged 3 commits into
mainfrom
docs/delivery-keyed-sync-guard
Oct 27, 2026
Merged

mspinola merged 3 commits into
mainfrom
docs/delivery-keyed-sync-guard

Conversation

@mspinola

Copy link
Copy Markdown
Owner

What broke

The 2026-10-23 COT release reached neither replica. The fetch half was fine: CFTC published at 15:28:31 (Last-Modified on the annual zips), and the producer had all four reports cached by 15:30:05, inside 90 seconds. Everything after that failed quietly.

1. The poll guard fired only on the repeat that watched the data arrive. It snapshotted newest_data before the fetch and after, and synced on the difference. The 15:29 repeat captured 2026-10-20, called the syncs, the SMB mirror delivered nothing, and the wrapper exited. Every repeat through 16:10 then read BEFORE == AFTER and skipped the syncs as "nothing new landed". One failed delivery was final for the day. Both replicas sat on 2026-10-13 until a human noticed, and the public dash only got the week because someone fetched CFTC on it by hand.

The guard now compares the store against the fingerprint recorded by the last run in which every replica took the data. A failed delivery is retried on the next repeat; a delivered week is still skipped, so a quiet Friday costs what it always did. It also needs no "before" reading, so it no longer matters which repeat sees the data land.

2. An errorlevel gate sat between the SMB mirror and the remote push. So an unreachable laptop on the LAN starved the internet-facing replica, the one with actual readers. sync-store.cmd already refuses this between its own two store passes, for the reason stated there: one broken thing should not present as two. The wrappers never applied it one level up. Each delivery now reports its own code and the exit is the worst of them.

What is in this PR

  • docs/WINDOWS_SCHEDULING.md: the delivery-keyed guard, with the incident as the measured warning, and a new rule against gating one replica's delivery on another's.
  • docs/examples/windows/run-equities.cmd, run-series.cmd: the two tracked templates that carried the gated chain.

run-series.cmd keeps its build code as the headline exit, as its comment asks, but a partial build can no longer hide a failed mirror: the delivery codes are echoed and a clean build with a broken delivery exits non-zero.

Not in this PR

The live wrappers on the producer box (run-cot.cmd, run-prices.cmd, run-equities.cmd, run-series.cmd under the scheduler folder) are not tracked in this repo. They were patched in place, with .bak-20261023 copies beside them. The delivery-keyed guard itself has no tracked counterpart because the run-cot.cmd template carries no chain and no guard, so WINDOWS_SCHEDULING.md is the versioned record of the contract.

Docs and examples only, no code paths touched.

🤖 Generated with Claude Code

mspinola and others added 3 commits October 23, 2026 16:52
Two faults in the chained replica deliveries, both of which fired on the
2026-10-23 COT release and between them cost the whole window.

The poller's guard compared a newest_data fingerprint from before the fetch
against one from after, so it fired only on the single repeat that happened to
watch the map move. CFTC published at 15:28, the 15:29 repeat captured
2026-10-20 and called the syncs, the SMB mirror delivered nothing, and every
repeat after it read BEFORE == AFTER and skipped the syncs as "nothing new
landed". One failed delivery was therefore final for the day: both replicas sat
on 2026-10-13 until a human noticed. Key the guard on the fingerprint of the
last run in which every replica took the data instead, so a failed delivery is
retried on the next repeat while a delivered week is still skipped.

The second fault is the `if errorlevel 1 exit /b` between sync-store.cmd and
push-to-server.cmd: an unreachable laptop on the LAN kept the week from the
internet-facing replica, the one with readers. sync-store.cmd already refuses
this between its own two store passes ("one broken thing presenting as two");
the wrappers never applied it one level up. Capture each code and exit the
worst. run-series.cmd keeps its build code as the headline, but no longer lets
a partial build hide a failed mirror.

Docs only here, plus the two templates that carried the gated chain. The live
wrappers on the producer box are not tracked in this repo and were patched in
place; WINDOWS_SCHEDULING.md is the versioned record of the contract.

Co-Authored-By: Claude Opus 5 <[email protected]>
The mirror failure was a ten-second one: the destination took a new DHCP lease
seconds before the copy, and the identical robocopy ran clean 90 minutes later
(156 files, 0 failed). robocopy /R:2 /W:5 gives up in about ten seconds, so a
wireless re-association on the far end loses a pass. What turned that into a
lost release was the guard refusing to try again, which is the lesson the
warning is there to carry.

Co-Authored-By: Claude Opus 5 <[email protected]>
/R:2 /W:5 gives up in about ten seconds, which is less than a wireless
re-association on the destination. That is what lost the 2026-10-23 COT
release: the SMB destination took a new DHCP lease at 15:30:19, the capture
pass called the mirror seconds later, and the identical copy ran clean ninety
minutes afterwards (156 files, 0 failed).

Six attempts over sixty seconds rides that out without pretending to ride out
an outage. The comment states the ceiling, because /R and /W are per failure:
the budget multiplies by the file count on a destination flaky enough to fail
file after file, and is bounded only because an unreachable share fails once at
the directory level rather than per file. It also notes the two consequences a
future tuner needs: the exit codes are unchanged, and during a real outage the
2-minute COT poller stretches by a minute or two because Task Scheduler will
not start a second instance while one runs.

/TBD is named in the comment but not added: nothing has produced an ERROR 67 to
test it against.

Co-Authored-By: Claude Opus 5 <[email protected]>
@mspinola
mspinola merged commit f574c88 into main Oct 27, 2026
5 checks passed
@mspinola
mspinola deleted the docs/delivery-keyed-sync-guard branch October 27, 2026 13:44
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