Skip to content

test(runtime): cover which cards post a notification (#263) - #283

Merged
juancguerrerodev merged 8 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/bot-notices-263
Dec 6, 2026
Merged

juancguerrerodev merged 8 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/bot-notices-263

Conversation

@saurabhbhoir456

Copy link
Copy Markdown
Contributor

What and why

Closes #263.

Creates packages/runtime/test/bot-notices.test.ts covering noticeFor for every BotCardKind, every NOTICE_KEYS value in both locales, and withNotices over a fake cards store and notifier: a result card schedules bot-<id>-result titled by say from the key and the bot's name only (a card field's text never reaches the title), a suggestion schedules bot-<id>-needs-ok, folds schedule nothing, a bot with notifications off or not found schedules nothing, a failing notifier or bot lookup never fails the card, and the other store methods still reach the store underneath. Tests only; packages/runtime/src/bot-notices.ts is unchanged.

Vision fit

Principle 7, small, typed and tested, and the lock-screen half of it: a notification's words are code's only (a copy key and the bot's own name), and that boundary now has direct tests for every card kind.

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. These tests pin the existing behavior, so each group was checked against its code mutated in a scratch copy (source restored unchanged afterwards): mapping result cards to needs_ok fails 2 of the new tests, scheduling regardless of the bot's notify switch fails 1, and rethrowing a failed notice instead of swallowing it fails 1.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Run locally with the runtime dependency closure installed: pnpm --filter @hermit/runtime exec vitest run test/bot-notices.test.ts (8/8), the full @hermit/runtime suite (56 files, 872 tests), and @hermit/runtime typecheck (clean). CI runs the full root gates.
  • 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. n/a: tests only, no UI string changed. The test does assert that every NOTICE_KEYS value exists in both locales.
  • Tests, fixtures and screenshots use made-up data only. Made-up bot name and ids; the card field text used to check for leaks is invented.

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.
Light Deep sea
es-419
en

New dependencies and network calls

None. Tests only; packages/runtime/src/bot-notices.ts is unchanged.

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 new test file and ran the vitest suites, typecheck and the three mutation checks above, in a session directed by the author.
  • I read and ran everything in this pull request, and I can explain it.

@juancguerrerodev
juancguerrerodev merged commit f7d2794 into DojoCodingLabs:main Dec 6, 2026
4 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 which cards post a notification, and that a failed one never fails the card

5 participants