Skip to content

fix(morning-enrich): refresh daily_data health stamp on success#98

Merged
cipher813 merged 1 commit into
mainfrom
fix/morning-enrich-writes-daily-data-stamp
Apr 27, 2026
Merged

fix(morning-enrich): refresh daily_data health stamp on success#98
cipher813 merged 1 commit into
mainfrom
fix/morning-enrich-writes-daily-data-stamp

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

  • Closes the latent gap that aborted today's weekday SF after the SSM-timeout fix unblocked the SF: _run_morning_enrich never refreshed the daily_data health stamp, so on Mondays the executor's 26h staleness gate fired against Friday's post-close stamp (~65h gap). Today was the first Monday since MorningEnrich shipped (PR weekday SF: add MorningEnrich step (polygon overwrite before predictor inference) #91, 2026-04-24).
  • Stamp now refreshes on success only. Failure paths intentionally leave the prior stamp in place — writing a fresh "ok" stamp on failure would mask outages from the gate. Dry runs also skip the write.

Test plan

  • 3 new unit tests cover: stamp written on success with morning_enrich=true in summary, stamp NOT written on PolygonForbiddenError, stamp NOT written in --dry-run.
  • Full suite: 218/218 passes.
  • Tomorrow's 13:05 UTC weekday SF (Tuesday) is the live verification — though Tuesday's case isn't structurally broken (post-close stamp from Monday afternoon will be fresh). The real proof is next Monday morning (2026-05-04).

Follow-ups (separate PRs)

  • daily_append perf: ~12 min for one row × ~900 universe symbols is dominated by per-ticker sequential read() + update() to S3-backed Arctic. read_batch with date_range tail + threadpooled writes should bring it back under a minute.
  • Executor IAM: alpha-engine-executor-role lacks cloudwatch:PutMetricData_emit_unscored_count_metric warning-logs but doesn't block.

🤖 Generated with Claude Code

2026-04-27 weekday SF dropped through to executor with a 65h-stale
daily_data stamp because _run_morning_enrich (added 2026-04-24 PR #91)
never refreshed it. The post-close DailyData run is the only writer of
the stamp; on Mondays, that's Friday afternoon — well past the executor's
26h staleness gate. Today was the first Monday since MorningEnrich
shipped, which is why this surfaced now.

Fix: on the success path, _run_morning_enrich now calls
_write_module_health(module_name="daily_data", ...) with the polygon
overwrite results in the summary, so the stamp's last_success refreshes
to the morning-enrich run time. Failure paths intentionally leave the
prior stamp untouched — writing a fresh "ok" stamp on failure would mask
outages from the executor's gate. Dry runs also skip the write.

3 new tests cover: stamp written on success with morning_enrich=true in
the summary, stamp NOT written on PolygonForbiddenError, stamp NOT
written in dry-run. Full suite: 218/218 passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit baf39ea into main Apr 27, 2026
1 check passed
@cipher813 cipher813 deleted the fix/morning-enrich-writes-daily-data-stamp branch April 27, 2026 14:14
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