Skip to content

fix: First bus event ingestion captures full history#109

Merged
evansenter merged 1 commit into
mainfrom
fix/bus-ingest-first-run-108
Feb 9, 2026
Merged

fix: First bus event ingestion captures full history#109
evansenter merged 1 commit into
mainfrom
fix/bus-ingest-first-run-108

Conversation

@evansenter

Copy link
Copy Markdown
Owner

Summary

  • First-run ingestion no longer applies a days timestamp cutoff — it ingests ALL events from the event-bus database
  • Subsequent runs continue using the high-water mark for incremental updates
  • Prevents the scenario where a days=7 first run permanently skips older events (discovered immediately after merging feat: Complete event-bus ingestion integration #107)

Closes #108

Test plan

  • test_first_run_ignores_days_param — verifies days=1 still gets all 5 events including 10-day-old one
  • All 23 bus ingest tests pass
  • make check passes

🤖 Generated with Claude Code

First run no longer applies a timestamp cutoff — it ingests ALL events
from the event-bus database. Subsequent runs continue using the
high-water mark for incremental updates. This prevents the scenario
where a days=7 first run permanently skips older events.

Closes #108

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Feb 9, 2026

Copy link
Copy Markdown

Prompt: evansenter/dotfiles/.../claude-review.md

Code Review

Summary

This PR fixes a bug where first-run bus event ingestion applied a timestamp cutoff (defaulting to 7 days), permanently skipping older events due to the high-water mark pattern. The fix removes the timestamp cutoff on first run so all historical events are ingested, while keeping incremental behavior for subsequent runs.

Issues Found

Critical

None

Important

None

Suggestions

  • bus_ingest.py:27 - The days parameter is now unused but still accepted and documented as "kept for backward compatibility". Since this is an internal function (not a public API with external consumers), consider removing the parameter entirely rather than leaving dead code. The MCP tool in server.py:299 and CLI in cli.py:1016 both still pass days through, and guide.md:91 still documents ingest_bus_events(days?) — all of which now do nothing. Removing the parameter would be cleaner than leaving a no-op argument that misleads callers into thinking it has an effect.

  • tests/test_bus_ingest.py:117-148 - Several tests (test_incremental_ingestion, test_incremental_picks_up_new_events, test_raw_events_dedup) still pass days=30 to ingest_bus_events, which is now a no-op argument. These should be updated to not pass days at all (like the other updated tests), to avoid implying the parameter is functional and to keep the test suite consistent with the change.

  • server.py:299-305 - The MCP tool ingest_bus_events still exposes days: int = 7 as a parameter and passes it through. Since the underlying function ignores it, this is a misleading interface — LLM consumers will see days as a configurable parameter and may try to use it. The docstring also still says "Days to look back (default: 7)". This should either be removed or the docstring updated to note it is unused.

Verdict

REQUEST_CHANGES - The core fix is correct and well-tested, but the days parameter should be cleaned up rather than left as dead code across the function signature, MCP tool, CLI, guide, and tests.


Automated review by Claude Code

@evansenter evansenter merged commit 8327e3e into main Feb 9, 2026
3 checks passed
@evansenter evansenter deleted the fix/bus-ingest-first-run-108 branch February 9, 2026 02:50
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.

fix: Bus event first ingestion skips historical events due to high-water mark

1 participant