Skip to content

test(core): cover how a bot's read kinds are kept (#261) - #276

Merged
juancguerrerodev merged 3 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/core-read-kinds-261
Dec 6, 2026
Merged

juancguerrerodev merged 3 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/core-read-kinds-261

Conversation

@saurabhbhoir456

Copy link
Copy Markdown
Contributor

What and why

Closes #261.

Adds a describe("read kinds") block to packages/core/test/bots.test.ts covering normalizeReadKinds, encodeReadKinds and decodeReadKinds from packages/core/src/bots.ts, which until now were only reached through the stores that use them. Canonical order and duplicate dropping, the four values the kinds CHECK in packages/core/src/schema.ts allows, decoding of empty and unknown values, and an encode/decode round trip. Tests only; bots.ts is unchanged.

Vision fit

Principle 7, small, typed and tested: the read-kind provenance a bot writes on its notes and cards now has direct tests for the pure helpers, including every subset in every order against the four CHECK values.

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 new case was checked against its helper mutated in a scratch copy (source restored unchanged afterwards): preserving input order instead of the canonical order fails 4 of the new tests, joining with - instead of , fails 3, and decoding without normalizing 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: pnpm --filter @hermit/core exec vitest run test/bots.test.ts (11/11) and the full @hermit/core suite (44 files, 809 tests). @hermit/core typecheck in this filtered local install reports pre-existing implicit-any errors in unrelated files, identical on a clean tree; CI runs the full 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.

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/core/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 describe block and ran the vitest suites 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

Copy link
Copy Markdown
Contributor

Thanks! A small ask for the next ones: the issues say to take one at a time, so newcomers joining this week find some left. 🦀

@juancguerrerodev
juancguerrerodev force-pushed the test/core-read-kinds-261 branch from 51f01f6 to bd13ab9 Compare December 6, 2026 09:10
@juancguerrerodev
juancguerrerodev merged commit bd13ab9 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.

Core: test how a bot's read kinds are kept

4 participants