Repository navigation
fix(action-center): give a new brand its first actions after its first run - #844
Merged
Merged
Conversation
…t run Signal passes rode only the nightly run, and a brand's first run is a manual one, so a new brand's Action Center stayed empty until the next night. Its first stamped run now gets a pass of its own; later manual runs still do not. That pass alone found nothing: the library judged a prompt only after three days of results, and a first run is one day across every platform. Prompt and competitor stats now carry an answer count, and a prompt answered enough times counts as tracked whatever the days. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 of 37 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
A new brand opened an empty Action Center and stayed that way until the next night. This had two causes, and fixing either one alone would not have been enough.
1. No pass after the first run. Signal passes run only after a nightly (
cron) run. A brand's first run is started by onboarding or by the payment success route as an immediate (manual) run, so its first pass waited for the next night. Now, when an immediate full run stamps,runFirstSignalPassruns a pass for a brand that has never had one, recorded against that manual run. Later manual runs still do not trigger passes. The nightly pass and the catch-up sweep still read only nightly runs.2. That pass would have found nothing. The library's detectors judged a prompt only after it had 3 days of results in the window. A first run is one day, even though it answers every prompt on every platform. A read-only check on a brand created today: 25 prompts, 6 answers each, the brand is absent from all of them, and the detectors raised 0 signals.
ae_prompt_statsandae_competitor_prompt_statsnow also returncur_answers. A prompt counts as tracked on 3 days or 5 answers, whichever comes first (promptMinAnswers). Answers only accumulate inside the window, so a prompt that qualifies on day one still qualifies on day two. The signals it raises do not flap closed while the day count catches up. On the same brand, the new rule finds 23 prompts with demand and no visibility across 5 topics, plus 2 unmapped prompts.Both RPC changes are additive (a new field in a jsonb result). Code that does not read the field is unaffected, so the migration and the deploy can land in either order.
Related issue
Follow-up to #839 · tracking #818
Type of change
fix— Bug fixHow to test
cd server && npx vitest run→ 854 passing. New tests coverrunFirstSignalPass(runs once, reads any source, is a no-op after the first pass, leaves the nightly pass on cron runs only) and the answer-count rule inisTracked/classifyPrompt.signal_runsrow should appear for it within a minute of the run stamping, and the Action Center should show its first actions.Checklist
🤖 Generated with Claude Code