Skip to content

feat(data-testing): add throws support to conformance cases - #186

Merged
krisnye merged 1 commit into
mainfrom
krisnye/ai-feature-tweaks
Aug 22, 2026
Merged

feat(data-testing): add throws support to conformance cases#186
krisnye merged 1 commit into
mainfrom
krisnye/ai-feature-tweaks

Conversation

@krisnye

@krisnye krisnye commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Case can now declare throws: true | "substring" instead of after/effects, asserting a transition/action rejects its input — honored uniformly by runSpec, runTransactions, and runActions via a shared expectThrows helper.
  • Fixes discoverTransitions to recognize a data/state/ module whose first case is throws-only (previously only "after" in case was checked, so such a module would silently fail to be discovered as a transition).
  • Docs: data-ai rules (state.md, conformance.md) now describe the throws case shape and its intended, narrow use (genuine precondition rejection — not the default "guard no-op, return {}" style).

Test plan

  • pnpm -r run typecheck clean across the monorepo
  • pnpm -r run test clean across the monorepo
  • New unit tests for expectThrows (expect-throws.test.ts)
  • New end-to-end fixture cases in run-spec.test.ts exercising throws: true and throws: "substring" through the real runSpec runner
  • New type-level tests in cases.type-test.ts confirming throws cases type-check and after+throws together is rejected

🤖 Generated with Claude Code

A `Case` can now declare `throws: true | "substring"` instead of
`after`/`effects` to assert a transition/action rejects its input, honored
uniformly by runSpec, runTransactions, and runActions. Also fixes
discoverTransitions to recognize a module whose first case is throws-only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@krisnye
krisnye merged commit 3b54ebe into main Aug 22, 2026
3 checks passed
@krisnye
krisnye deleted the krisnye/ai-feature-tweaks branch August 22, 2026 02:04
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.

1 participant