Repository navigation
feat(content): generate three opportunities per run instead of five to fifteen - #735
Merged
Merged
Conversation
…o fifteen The prompt asked for five to fifteen and the model reliably landed near ten: across ten days of production it produced 9.9 to 10.6 per brand per night. That is more than anyone works through in a day, and generation appends, so whatever goes unread accumulates — the open list already averages 147 rows per brand and reaches 773 on the largest. A short list that gets read beats a long one that gets scrolled past. Three changes the instruction as well as the number. At ten the ranking barely mattered because the good findings arrived alongside the filler; at three there is no room for filler, so the rule now says the slots go to the highest-impact opportunities the data supports rather than to whichever the model composes first. The prompt data reaching the model is already score-ordered. The rule was written twice — once in the generator fired after each tracking cycle, once in the queued generator behind the Generate button — as a hand-written sentence and a schema ceiling apiece, and the two had already drifted in wording. Both now read one shared constant, so the button and the nightly run cannot disagree about how many a brand gets. Tests fail if a literal is written back into either file. This does not address the accumulation itself: three a night still adds ninety a month, and the automatic path appends while the manual path replaces. That asymmetry needs its own decision. Closes #730
2 tasks done
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 prompt asked for five to fifteen opportunities and the model reliably landed near ten — 9.9 to 10.6 per brand per night across ten days of production. That is more than anyone works through in a day, and because generation appends nightly, whatever goes unread accumulates: the open list already averages 147 rows per brand and reaches 773 on the largest.
Three per run. A short list that gets read beats a long one that gets scrolled past.
The instruction changed, not just the number
At ten the ranking barely mattered — the good findings arrived alongside the filler. At three there is no room for filler, so the rule now names what the slots are for:
The prompt data reaching the model is already ordered by score, which is what "provided" refers to.
Why a shared constant rather than two edited numbers
The rule lived in two places:
server/src/lib/opportunity-generator.js— fired automatically after each tracking cycleserver/src/workers/content-worker.js— the queued run behind the Generate buttonEach carried its own hand-written sentence and its own
.max(20), and the two had already drifted in wording ("depending on data richness" in one, not the other). Editing two literals is how they drifted in the first place, so both now import one constant. The button and the nightly run cannot disagree about how many a brand gets.opportunity-limits.test.jsfails if a literal ceiling or a hand-written count sentence is written back into either generator. That is the regression worth pinning — the numbers agreeing today says nothing about them agreeing after the next edit.What this does not fix
Accumulation. Three a night is still ninety a month, and the two paths write differently: the automatic one appends, skipping only rows whose
prompt_idand title match an existingnewrow exactly, while the manual one deletes everynewrow before inserting. So a manual Generate replaces the list and the nightly run grows it.Reducing the count slows that down; it does not settle it. Whether the nightly run should replace, expire, or genuinely deduplicate is a separate decision and deliberately not made here. #731, now merged, at least makes the backlog clearable.
Related issue
Closes #730
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromserver/)yarn format:checkpasses (run fromserver/)Server suite passes: 287 tests, including 6 new ones. No
web/files are touched.