Skip to content

fix(T-33): alert when the curator matches none of the repos it was given - #28

Merged
DamengRandom merged 2 commits into
masterfrom
fix/T-33-alert-on-failed-curation
Aug 1, 2026
Merged

fix(T-33): alert when the curator matches none of the repos it was given#28
DamengRandom merged 2 commits into
masterfrom
fix/T-33-alert-on-failed-curation

Conversation

@DamengRandom

Copy link
Copy Markdown
Owner

Closes #27

The bug

An empty curation was logged at info level as a routine skip:

⏭️ No repos curated — skipping send and save.

It cannot be a routine skip. collectTopRepos returns null when nothing is trending and never an empty array, so curateOrNotify always receives at least one repo. An empty result can only mean the curator matched none of them — total failure, classified as a non-event.

The failure comes from mergeSummaries, which drops any repo the model did not echo back by exact name. Only prose in the prompt asks for that, and withStructuredOutput keeps the response schema-valid either way — so the retry loop never saw it. curateNode retries on a JSON parse error or a schema mismatch, and this is neither.

Net effect on an unattended morning run: no digest, no rows, no alert, no retry — and it looks identical in the logs to a genuinely quiet day.

The fix

An empty curation is now a retryable error carrying the exact name the model failed to match, so the retry and alert machinery that already exists applies to it. One condition in curateNode; no new plumbing.

The dead !curated.length branch in curateOrNotify is removed, since runCuratorGraph now returns null or a non-empty array. The comment that asserted the false premise is corrected.

Verification

Ran the real mergeSummaries and the real runCuratorGraph against three ordinary LLM reformattings:

model returned before after
next.js (owner dropped) 1 attempt, silent skip 2 attempts → curated=null → alert
Vercel/Next.js (title-cased) 1 attempt, silent skip 2 attempts → curated=null → alert
" vercel/next.js " (padded) 1 attempt, silent skip 2 attempts → curated=null → alert
exact (control) 1 attempt, curated 1 attempt, curated — unchanged

Recovery also works. When the model corrects itself on the retry, the digest goes out instead of vanishing:

retry feedback → curator returned summaries for none of the 2 repos it was given — repo_name must match exactly...
attempts=2  curated=2
  • pnpm test — 73 pass (2 new), pnpm tsc and pnpm format:check clean

Deliberately not in scope

A partial mismatch still shrinks the digest silently. Issue #27 explicitly excludes it, and it may well be acceptable behaviour — worth deciding separately rather than bundling here.

🤖 Generated with Claude Code

DamengRandom and others added 2 commits August 1, 2026 19:36
An empty curation was logged as "⏭️ No repos curated — skipping send and save."
and treated as a quiet day. It cannot be one: collectTopRepos returns null when
nothing is trending and never an empty array, so curateOrNotify always receives
at least one repo. An empty result can only mean the curator matched none of
them.

That happens in mergeSummaries, which drops any repo the model did not echo back
by exact name. Only prose in the prompt asks for exact names, and the response
stays schema-valid either way — so the retry loop never saw it. curateNode
retries on a parse error or a schema mismatch, and this is neither.

An empty curation is now a retryable error carrying the exact name the model
failed to match, so the existing retry and alert machinery applies. Verified
against three ordinary reformattings:

  owner dropped         attempts=2  curated=null → notifyError fires
  title-cased           attempts=2  curated=null → notifyError fires
  whitespace padded     attempts=2  curated=null → notifyError fires
  exact (control)       attempts=1  curated 2

Previously every one of those was attempts=1 with no digest and no alert. A
model that corrects its names on the retry now recovers and the digest goes out.

The dead `!curated.length` branch in curateOrNotify is removed — runCuratorGraph
now returns null or a non-empty array.

Closes #27

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5CmYPdQcMeLzzJc3iDQ2u
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5CmYPdQcMeLzzJc3iDQ2u
@DamengRandom
DamengRandom merged commit 851ae49 into master Aug 1, 2026
4 checks passed
@DamengRandom
DamengRandom deleted the fix/T-33-alert-on-failed-curation branch August 1, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A curator that echoes back no matching repo_name is logged as "nothing to curate" — no digest, no retry, no alert

1 participant