Skip to content

fix(ads): the draft pile is bounded — stock count spans draft through ready (#689) - #692

Merged
genwave-radio merged 2 commits into
mainfrom
fix/ads-stock-count-pipeline
Sep 5, 2026
Merged

genwave-radio merged 2 commits into
mainfrom
fix/ads-stock-count-pipeline

Conversation

@genwave-radio

Copy link
Copy Markdown
Collaborator

Closes #689.

🐛 What was wrong

AdSpotWorker's refill pass compared Station:Ads:TargetCount to the ready llm/pack count only. Under AutoApprove=false (the shipped default, and the T409 posture) a generated spot waits in draft and never counted — one new draft and one LLM completion per tick, forever (144/day at defaults). Latent today only because the demo has zero briefs; it would start the tick after T407's pack installs.

🔧 What changed

  • IAdSpotStore.CountReadyGeneratedAsyncCountStockGeneratedAsync: llm/pack spots in draft | approved | rendering | ready. failed never counts (an operator retry/discard is its exit and must not block refill); retired is terminal; owner spots stay excluded.
  • Worker specs (Story389): a waiting draft counts, a mid-render spot counts, a failed spot does not, an owner draft does not.
  • Store spec (Story389, real Postgres): one spot per state → exactly the four pipeline states count.
  • Help text for Station:Ads:TargetCount (Settings page + DEPLOYMENT) now says what the knob bounds.
  • Local docs: SPEC F159.3 as-built rider, STORY-389 AC7.

✅ Verified

  • dotnet build GenWave.sln: 0 warnings, 0 errors.
  • Full dotnet test GenWave.sln: Ads 98/98, MediaLibrary 1242 passed, Architecture 135/135, Tts, Core, Context, Orchestration, Plugins all green. Host.Tests showed 8 failures on the parallel full-solution run (Postgres Resource temporarily unavailable while the MediaLibrary fixture ran alongside); an isolated Host rerun passed 2566, skipped 368, failed 0.
  • tools/check-doc-drift.sh green.

…tCount, not the ready shelf alone

With AutoApprove off (the shipped default) every generated spot waits in draft and the
ready-only count never saw it, so the worker wrote one more draft — and spent one more LLM
completion — every tick, forever. IAdSpotStore.CountReadyGeneratedAsync becomes
CountStockGeneratedAsync: llm/pack spots in draft|approved|rendering|ready; failed and
retired never count, owner spots stay excluded.

- worker specs pin a waiting draft and a mid-render spot counting; failed and owner not
- store spec pins the exact state set against real Postgres
- help text (Settings page, DEPLOYMENT) says what the knob actually bounds

Closes #689
@genwave-radio genwave-radio added the bug Something isn't working label Sep 5, 2026
@genwave-radio
genwave-radio merged commit de7a5cd into main Sep 5, 2026
11 checks passed
@genwave-radio
genwave-radio deleted the fix/ads-stock-count-pipeline branch September 5, 2026 15:17
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdSpotWorker refills against the ready count only — with AutoApprove off the draft pile is unbounded

1 participant