fix(slack): require per-date evidence before crediting raw agentic-traffic projection#2487
Open
akshaymagapu wants to merge 1 commit into
Open
fix(slack): require per-date evidence before crediting raw agentic-traffic projection#2487akshaymagapu wants to merge 1 commit into
akshaymagapu wants to merge 1 commit into
Conversation
…affic projection The agentic-traffic DB status check was permissively crediting any raw `wrpc_import_agentic_traffic` projection_audit row in the lookup window as "raw OK for dateStr", regardless of which date the row actually covered. Raw rows carry no per-date metadata, so a raw run for an earlier date inside the window (e.g. dateStr-2) was indistinguishable from a raw run for dateStr itself. This produced false "raw OK, daily missing" diagnostics for sites whose raw + daily had both been missing for days. Raw is now credited for dateStr only via one of two date-specific signals: 1. A daily refresh audit row whose `dailyRefreshDates` includes dateStr. Daily refresh is a post-success message from raw, so this proves raw succeeded for dateStr. 2. Fallback for "raw OK, daily not yet run": a raw audit row whose `projected_at` is on or after dateStr+1 day UTC (raw projector runs the day after the traffic day) with `output_count > 0`. Co-Authored-By: Claude Opus 4.7 <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
The `check agentic traffic db status` Slack command was permissively crediting any raw `wrpc_import_agentic_traffic` projection_audit row in the lookup window as "raw OK for dateStr", regardless of which date the row actually covered. Raw rows carry no per-date metadata, so a raw run for an earlier date inside the window was indistinguishable from a raw run for `dateStr` itself.
This produced false "raw OK, daily missing" diagnostics. Concrete example from the 2026-05-25 report:
Fix
Raw is now credited for `dateStr` only via one of two date-specific signals:
Also adds `output_count` to the projection_audit select.
Test plan
🤖 Generated with Claude Code