Skip to content

test(runtime): cover runEnd, rosterStatus and isModeSetting (#262) - #281

Merged
juancguerrerodev merged 7 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/bots-rules-262
Dec 6, 2026
Merged

juancguerrerodev merged 7 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/bots-rules-262

Conversation

@saurabhbhoir456

Copy link
Copy Markdown
Contributor

What and why

Closes #262.

Creates packages/runtime/test/bots-rules.test.ts covering runEnd, rosterStatus and isModeSetting from packages/runtime/src/bots.ts by name, with AloneTurnResult values built by hand: a final turn is done with no reason; changed tracks a successful step or a blocked step waiting as a suggestion; error turns fail with their code (or error with none); needs_user, budget and stopped fail with their own kind; every returned reason is in ROUTINE_RUN_REASONS; roster status precedence follows ROSTER_STATUSES; and only bots.mode and its per-bot keys are mode settings. Tests only; bots.ts is unchanged.

Vision fit

Principle 7, small, typed and tested: the rules that decide what a person sees about their bots, when a routine ran and why it failed, and which settings only the permission modes may write, now have direct tests.

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 helpers, so each group was checked against its helper mutated in a scratch copy (source restored unchanged afterwards): dropping the blocked-step term from changed fails 1 of the new tests, swapping the waiting/results precedence in rosterStatus fails 1, and dropping the dot from the isModeSetting prefix 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/bots-rules.test.ts (7/7), the full @hermit/runtime suite (56 files, 871 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.
  • Tests, fixtures and screenshots use made-up data only. Skill ids in executed and blocked are made up.

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/bots.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 4f18d82 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 runEnd, rosterStatus and isModeSetting

5 participants