Skip to content

Replace the bars task's phantom retry with a repeating trigger - #111

Merged
mspinola merged 1 commit into
mainfrom
claude/repeating-trigger-correction
Aug 21, 2026
Merged

Replace the bars task's phantom retry with a repeating trigger#111
mspinola merged 1 commit into
mainfrom
claude/repeating-trigger-correction

Conversation

@mspinola

Copy link
Copy Markdown
Owner

What

WINDOWS_SCHEDULING.md built its whole retry story on Task Scheduler's "if the task fails, restart every N minutes." That setting fires when the scheduler cannot launch the action — not when the action exits non-zero — so it never once retried a --require-final defer.

Evidence

Measured on the producer box, which had RestartCount 20 / RestartInterval PT15M set on the bars task:

Date Action exit Launches that night
2026-08-12 1 (defer) 1
2026-08-13 1 (defer) 1
2026-08-14 1 (defer) 1
2026-08-15 1 (defer) 1

Four consecutive nights, no retry, no bars captured. Events 111 and 322–324 — the restart and queue events — never appeared at all. The store caught up on 08-16, when a run finally found Norgate ahead of it.

That self-heal is why it stayed invisible: the data was never permanently wrong, only a day late, so --check a week later looked fine and nothing alerted.

Fix

A repetition on the trigger, which fires regardless of what the previous run returned. schtasks sets it on a daily schedule with /RI and /DU, verified to emit the same <Repetition> element the Friday COT poller has always used — which is why that task worked all along while the bars task did not. The correct pattern was already on the page; the bars task just wasn't on it.

Also corrected, downstream of the same premise

  • Last Result guidance now says the opposite of what it did. Under repetition a healthy night ends non-zero, because the repeat that captured succeeded hours earlier and every repeat after it defers. A red Last Result on the bars task is no longer evidence of anything on its own.
  • The exit-code callout for run-prices.cmd no longer claims an unguarded --metadata strands the task until tomorrow. It doesn't any more — what it destroys is the only per-run signal separating a capture from a defer.
  • sync-store.cmd's exit-code normalisation rationale no longer cites a restart loop that doesn't exist.

The warning keeps the dates and event IDs rather than quietly swapping the recommendation, because the failure mode is invisible enough that someone will otherwise re-derive it from scratch.

Applied to the producer box

  • cotdata prices converted to a repeating trigger (15 min × 5 h); verified firing on exit 1.
  • cotdata COT (catch-up) had its dead RestartOnFailure element removed. It needs no polling — cotdata-cot --cot-all exits 0 on a pre-release no-op — and being daily and idempotent, the next morning's run is its own retry.

Note for reviewers

The unmerged branch claude/scheduling-doc-finals-gate touches this same file and looks superseded: its finals-gate rewrite already landed in main in evolved form, and merging it now would re-introduce the restart-on-failure paragraph this PR removes, plus pre-ADR-0007 cotdata-prices --prices commands. Worth closing rather than merging.

🤖 Generated with Claude Code

WINDOWS_SCHEDULING.md built its whole retry story on Task Scheduler's "if
the task fails, restart every N minutes". That setting fires when the
scheduler cannot LAUNCH the action, not when the action exits non-zero, so
it never once retried a --require-final defer.

Measured on the reference box, which had RestartCount 20 / RestartInterval
PT15M set on the bars task: from 2026-08-12 to 08-15 the action returned
exit 1 and the task was launched exactly once each night -- four
consecutive nights, no retry, no bars captured. Events 111 and 322-324, the
restart and queue events, never appeared at all. The store caught up on
08-16 when a run finally found Norgate ahead of it, and that self-heal is
why the failure stayed invisible: the data was never permanently wrong,
only a day late, so --check a week later looked fine and nothing alerted.

The fix is a repetition on the trigger, which fires regardless of what the
previous run returned. schtasks sets it on a daily schedule with /RI and
/DU, verified to emit the same Repetition element the Friday COT poller has
always used -- which is why that task has worked all along while the bars
task did not. The correct pattern was already on the page; the bars task
just was not on it.

Also corrected downstream of the same premise:

- The Last Result guidance now says the opposite of what it did. Under
  repetition a healthy night ENDS non-zero, because the repeat that
  captured succeeded hours earlier and every repeat after it defers.
- The exit-code callout for run-prices.cmd no longer claims an unguarded
  --metadata strands the task until tomorrow. It does not any more; what it
  destroys is the only per-run signal separating a capture from a defer.
- sync-store.cmd's exit-code normalisation rationale no longer cites a
  restart loop that does not exist.

The warning keeps the dates and event IDs rather than quietly swapping the
recommendation, because the failure mode is invisible enough that someone
will otherwise re-derive it from scratch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola merged commit 79f7497 into main Aug 21, 2026
5 checks passed
@mspinola
mspinola deleted the claude/repeating-trigger-correction branch August 21, 2026 11:58
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