Skip to content

test(night): cover the bots' news lines and their types (#218) - #242

Merged
juancguerrerodev merged 16 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/night-bot-news-218
Dec 6, 2026
Merged

juancguerrerodev merged 16 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/night-bot-news-218

Conversation

@saurabhbhoir456

@saurabhbhoir456 saurabhbhoir456 commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #218

packages/night/src/bot-news.ts builds the lines Hermit's report and the morning briefing show for each bot (#100), but
botNewsLines and isBotNews had no test of their own, so a change in their order or a renamed copy key would go
unnoticed.

What this PR does

  • Adds packages/night/test/bot-news.test.ts (Vitest, like the other files in packages/night/test), importing from
    ../src/bot-news.ts. Tests only: bot-news.ts is unchanged.

Tests

  • No results, nothing pending, no notes, no failures and no check-in gives an empty list.
  • One result is the one-result line, three are the count line, the same for pending.
  • A money note and a login note each add their own line, worded with the bot's name.
  • The newest failure is the one named, and no line when nothing failed.
  • An idle or a paused check-in adds its own line.
  • With everything set the lines come in that order: results, pending, money, login, failed, check in.
  • The bot's own words are never a line, only its latest result is a quote.
  • Every key the lines can return exists in both packages/copy/locales/en.json and es-419.json, and its {placeholders}
    match the values given (plus {time} when the line has at).
  • A full bot news is accepted and a partial or wrong kind is refused.

How to check

pnpm --filter @hermit/night test
pnpm --filter @hermit/night test test/bot-news.test.ts
pnpm --filter @hermit/night typecheck

Keep in mind

  • Tests only. No source change to bot-news.ts.
  • Made-up bot names only, like "Viajes" or "Recetas".
  • No em or en dashes in test names.

Pull request template

What and why

Closes #218.

Adds the missing tests for the lines a bot's news gives the report and the briefing.

Vision fit

Principle 3, the model proposes, code decides: the news lines are code's words, and a bot's own words stay data, shown only as a quote.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: n/a

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it. Tests were added for the existing bot-news code; the quoted-words assertion now checks the actual quoted text and was mutation-checked by temporarily leaking it into a line.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Gate note: privacy and guard pass on this checkout today; the rest was run per package as listed under AI agents, not as one root gate on this Windows machine, where unrelated pre-existing failures appear in the site badges, the devices table and mobile source scans.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.
  • Tests, fixtures and screenshots use made-up data only.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.

New dependencies and network calls

None. No new dependency and no new network call.

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Tinsel Alpha, an AI coding agent running in OpenCode, drafted the change and this description and ran the checks below, in a session directed by the author, who reviewed each step's report before it was pushed.
  • I read and ran everything in this pull request, and I can explain it.

What was run: pnpm --filter @hermit/night exec vitest run test/bot-news.test.ts (9/9) after the fix; before it, the full night suite (94/94 at the time), typecheck and eslint.

@juancguerrerodev

Copy link
Copy Markdown
Contributor

One fix before this can merge: bot-news.test.ts:58 checks for the word "quote", not the quoted text, so the test can't fail. Assert the actual quoted words. And the template, as on #234. 🦀

@saurabhbhoir456

Copy link
Copy Markdown
Contributor Author

Fixed: the test now asserts the bot's actual quoted words ("Bajó el vuelo.") do not appear in any line. Mutation-checked by temporarily leaking the quote into a line, which fails only this test. The pull request template is filled in too.

@juancguerrerodev
juancguerrerodev merged commit 336dab1 into DojoCodingLabs:main Dec 6, 2026
3 checks passed
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.

Bots: test the lines a bot's news gives the report and the briefing

3 participants