fix(archive): persist consolidated_report to S3 — closes 2-month dashboard archive stale#208
Merged
Merged
Conversation
…doesn't stale
archive_writer was building the consolidated morning brief into
`consolidated_report` state, passing it to email_sender for the
weekly email, and then dropping it on the floor —
ArchiveManager.save_consolidated_report() existed but had no caller
for ~2 months. Last `consolidated/{date}/morning.md` write was
2026-03-16; from then through 2026-05-20 the dashboard's Research
Briefing Archive page correctly showed "Latest 2026-03-16" because
that was genuinely the last persisted artifact in S3.
The wiring loss almost certainly happened in the mid-March LangGraph
refactor — the persistence call lived in the legacy pre-graph
path and didn't get carried into the new archive_writer node.
Fix: 3 lines in archive_writer right next to write_signals_json,
same try/except shape so a save failure doesn't block the rest of
the archive pipeline.
Regression tests:
- save_consolidated_report writes consolidated/{date}/morning.md
to S3 with the brief body.
- archive_writer's source contains `save_consolidated_report` —
structural pin so removing the call again fails CI instead of
silently staling the archive surface for another two months.
Dashboard reads from `consolidated/` so no consumer change needed;
the next Saturday SF research run will repopulate from 2026-05-23
onward. Historical 2026-03-16 → 2026-05-17 gap can't be backfilled
(the briefs were emailed, not retained anywhere else).
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
archive_writerwas building the weekly consolidated brief intostate.consolidated_report, handing it off toemail_senderfor the morning email, and then dropping it.ArchiveManager.save_consolidated_report()existed but had no caller anywhere in the codebase — the persistence wire tos3://alpha-engine-research/consolidated/{date}/morning.mdwas lost.Evidence of the wiring loss: last
morning.mdwrite to S3 was 2026-03-16. Every week since (~10 runs) emailed the brief to the user but never persisted it. The dashboard's Research Briefing Archive page was correctly showing the last actually-persisted artifact — that's why "Latest" displayed2026-03-16while EOD emails kept landing in the same date partition.Fix
3 lines in
archive_writerright next towrite_signals_json, same try/except shape so a save failure doesn't block the rest of the archive pipeline.Tests
test_save_consolidated_report_writes_morning_md_to_s3— pins the producer side:save_consolidated_report("2026-05-20", brief)writes oneput_objectcall withKey=consolidated/2026-05-20/morning.mdand the brief body.test_archive_writer_wires_save_consolidated_report— structural pin viainspect.getsource(archive_writer). If the wiring is dropped again, this fails at CI time instead of silently staling the archive surface for two months.Backfill
Historical 2026-03-16 → 2026-05-17 gap can't be backfilled — those briefs were emailed only, not retained anywhere else. Next Saturday SF research run (2026-05-23) populates the first new
morning.mdand the archive page surfaces it the next time the dashboard refreshes its cache (TTL 15 min).🤖 Generated with Claude Code