Skip to content

test(core): check the A2A task states table against itself (#223) - #243

Merged
juancguerrerodev merged 2 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/a2a-states-223
Dec 6, 2026
Merged

juancguerrerodev merged 2 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/a2a-states-223

Conversation

@saurabhbhoir456

@saurabhbhoir456 saurabhbhoir456 commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #223

The allowed A2A 1.0 moves in packages/core/src/a2a-store.ts live in one table read by canTransition(), and
TASK_STATES with OPEN_TASK_STATES and TERMINAL_TASK_STATES say which states are open and which are terminal. The
store tests try some moves, but nothing checked the table and the two lists against each other, so a new state could be
added to one and forgotten in another.

What this PR does

  • Adds a describe("A2A task states") block to packages/core/test/a2a-store.test.ts, going through canTransition()
    only. Tests only: a2a-store.ts is unchanged, and ALLOWED_TRANSITIONS is not exported.

Tests

  • The open and terminal lists do not share a state, and together they hold every state in TASK_STATES exactly once.
  • A terminal state cannot move anywhere.
  • No state can move to itself.
  • Nothing can move back to TASK_STATE_SUBMITTED.
  • From every open state, some chain of allowed moves reaches a terminal state (a short breadth first search over
    TASK_STATES).
  • Spot checks that match A2A 1.0: submitted to working, working to input required, input required to working, and auth
    required to canceled are allowed; submitted to completed and input required to completed are not.

How to check

pnpm --filter @hermit/core test test/a2a-store.test.ts
pnpm --filter @hermit/core test
pnpm --filter @hermit/core typecheck

Keep in mind

  • Tests only. If the table disagrees with the A2A 1.0 spec, open a bug report with a link to the spec and leave the
    table alone here.
  • No em or en dashes in test names.

Pull request template

What and why

Closes #223.

Checks the A2A task state table and the open and terminal lists against each other.

Vision fit

Principle 7, small, typed and tested: the handoff state machine's rules are pinned by tests that go through canTransition().

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 table; expectations were break-checked during development.
  • 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/core exec vitest run test/a2a-store.test.ts (13/13); full @hermit/core test; typecheck; eslint on the changed file.

@juancguerrerodev

Copy link
Copy Markdown
Contributor

Ready to merge once the pull request template is filled in, including the "I read and ran everything" box (details on #234). 🦀

@juancguerrerodev
juancguerrerodev merged commit 1ddb62e 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 the A2A task states and the moves between them

3 participants