fix: add retry logic, size guards, and quality gates to facts pipeline#52
Merged
fix: add retry logic, size guards, and quality gates to facts pipeline#52
Conversation
The facts extraction pipeline had zero retry logic, no response logging on failure, and no aggregation size guards. This caused 9 error stubs (2.3% of 393 files) to be committed and propagated downstream. Pipeline resilience (extract-facts.py): - Add retry loop (2 attempts, 5s delay) for all failure modes - Add completion token sanity check (<200 = truncated, skip parsing) - Log missing fields and response preview on validation failure - Save raw LLM response to .debug/ sidecar on final failure Aggregation guard (aggregate-sources.py): - Cap user_summaries at 200KB to prevent token explosion (2026-01-15 was 984KB / 392K tokens, now capped at 200KB / ~50K) - Warn when estimated_tokens > 100K - Add missing import sys Workflow improvements (extract_daily_facts.yml): - Quality-gated daily.json permalink (only overwrite on success) - Workflow-level retry with 30s delay (4 total attempts with script retry) - Data quality alert to Discord on error stubs Backfill results: 9/9 error stubs regenerated successfully. Retry logic recovered 2 dates (2026-01-26, 2025-07-22) on second attempt. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks
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
user_summariesat 200KB to prevent token explosion (2026-01-15 was 984KB/392K tokens), warn when estimated tokens >100K, fix missingimport sysdaily.jsonpermalink (only overwrite on success), workflow-level retry with 30s delay (4 total attempts combined with script retry), Discord alert on error stubsTest plan
status: success(392 facts files, 0 errors)🤖 Generated with Claude Code