Skip to content

run-series.cmd: sync on a partial build, stop only on a total failure - #119

Merged
mspinola merged 1 commit into
mainfrom
claude/series-wrapper-partial-sync
Sep 25, 2026
Merged

mspinola merged 1 commit into
mainfrom
claude/series-wrapper-partial-sync

Conversation

@mspinola

@mspinola mspinola commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

The failure this fixes

The wrapper stopped on any non-zero code from the build. On 2026-09-25 that cost five sessions on both replicas: TradingView restated two put/call closes, the build refused those two by design, and the wrapper exited before its syncs while thirteen breadth series sat correct on the producer.

The change

It reads the build's new exit codes (marketdata EXIT_PARTIAL): sync on 0 and on 2, stop only on 1. The refusal stays visible, because the wrapper exits with the build's code rather than the push's, so a partial run still reports 2 to the operator and the verifier.

Mirroring on a partial is safe by construction: the store is a valid state whatever refused, since the build never writes a bad bar and writes parquet atomically, so a mirror can only make a replica fresher.

Two details worth the review:

  • Testing a specific code needs equality, not if errorlevel, which is true for that code or any larger one and would read 2 as 1. Two chained if not string compares are the cmd idiom and avoid a numeric parse on an empty ERRORLEVEL.
  • The push now captures its own ERRORLEVEL on its own line, so the final exit /b %RC% reports the build's outcome without masking a push failure.

Deployment

This is the versioned example. The live copy at C:\Users\matt\code\cotdata\scheduler\run-series.cmd has to be updated by hand, and it needs marketdata's side merged first or the wrapper will never see a 2.

Noticed, not fixed

run-series.cmd, run-prices.cmd and run-equities.cmd each carry one >= inside a REM line, which every one of these files' own headers warns against. They evidently run fine nightly, so it is latent rather than broken. I kept my additions clear of angle brackets and left the existing three alone.

Test plan

  • Suite 225 passed, ruff clean (the examples are not linted or executed by CI; this is a documented wrapper).

Build side: mspinola/marketdata#35.

🤖 Generated with Claude Code

The wrapper stopped on any non-zero code from the build. On 2026-09-25 that
cost five sessions on both replicas: TradingView restated two put/call closes,
the build refused those two by design, and the wrapper exited before its syncs
while thirteen breadth series sat correct on the producer.

It now reads the build's new exit codes (marketdata EXIT_PARTIAL): sync on 0 and
on 2, stop only on 1. The refusal stays visible, because the wrapper exits with
the build's code rather than the push's, so a partial run still reports 2.

Testing a specific code needs equality, not `if errorlevel`, which is true for
that code or any larger one and would read 2 as 1. Two chained `if not` string
compares are the cmd idiom and avoid a numeric parse on an empty ERRORLEVEL.

The live copy on the box has to be updated by hand; this is the example it is
deployed from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola merged commit 38fed68 into main Sep 25, 2026
5 checks passed
@mspinola
mspinola deleted the claude/series-wrapper-partial-sync branch September 25, 2026 18:13
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