feat: dead-man gap-day monitor + preflight scripts (S6-004)#103
Merged
Conversation
A down worker can never report itself down — the dead-man blind spot in runbook section 5. Close it with operator tooling in tools/ops/ (outside the CI dorny filter; nothing in CI/tests/hooks runs or registers any of it): - Check-DailySnapshot.ps1: weekday-only check that today's entry exists in the worker's data/snapshots.json (path verified against the TradingSystem-FuncHost task cwd); on a gap, posts one orange Discord embed (webhook from gitignored local.settings.json, file -> variable -> -Uri only, -TimeoutSec 10). Diagnosable exit codes 0/1/2/3; -Date / -SnapshotPath / -WhatIf seams for fixture-driven testing. Holiday false positives accepted by design (no holiday calendar, no Polygon). - preflight.ps1: scripts runbook section 2 — TWS port probe (3s), gateway /health (WARN not FAIL per ADR-029/030 degrade), worker admin-endpoint 4-function assert, data dir; bounded timeouts throughout. - Register-GapDayMonitorTask.ps1: idempotent manual registration of TradingSystem-GapDayMonitor, weekdays 2:30 PM local (>=45 min after the EOD timer in both DST regimes); quoted -File path (Azurite-task lesson). - Runbook: preflight pointer, dead-man alert triage row, registration subsection with exit-code legend. Fixture harness: 20/20 (present/missing/file-absent/weekend/disabled/ secret-hygiene/timeout/preflight-down/parse). Suite: 632/632 green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(S6-004) Judge fix-now items, message/doc-level only: - Check-DailySnapshot.ps1 exit-1 skip branch now names WHICH condition triggered the skip (Discord disabled / webhook blank / placeholder) with a remediation hint each; exit code unchanged. - Runbook gap-day-monitor subsection: run-as clause (current user, no elevation) on registration, and the end-of-run decommission command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the dead-man gap-day monitor (
tools/ops/Check-DailySnapshot.ps1+Register-GapDayMonitorTask.ps1) and scripted preflight checks, plus the runbook subsection documenting registration, exit-code legend, run-as, and end-of-run decommission.Why
Closes the runbook's #1 triage gap: a silently dead worker can never tell the operator it is down. An independent scheduled check (2:30 PM local, weekdays) verifies today's DailySnapshot entry exists and posts an orange Discord embed when it does not. Observability only — never touches TWS, the worker, or trading state.
Test plan
Parser::ParseFile, zero errors); enriched skip warnings verified against temp fixtures with-WhatIftools/ops/**is outside the backend CI filter — CI-neutral pathNotes
05fe512(skip-reason clarity + runbook decommission/run-as notes); message/doc-level only, exit codes and fixture matrix unchanged.🤖 Generated with Claude Code