Skip to content

refactor(conformance): introduce StoryboardStepHintBase for kind+message invariant#951

Closed
bokelley wants to merge 1 commit into
mainfrom
claude/issue-950-storyboard-step-hint-base
Closed

refactor(conformance): introduce StoryboardStepHintBase for kind+message invariant#951
bokelley wants to merge 1 commit into
mainfrom
claude/issue-950-storyboard-step-hint-base

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Closes #950

Summary

  • Adds StoryboardStepHintBase<K extends string> interface (no = string default) to src/lib/testing/storyboard/types.ts
  • ContextValueRejectedHint extends StoryboardStepHintBase<'context_value_rejected'>, removing the duplicate kind and message declarations
  • Exports StoryboardStepHintBase from storyboard/index.ts and src/lib/testing/index.ts alongside StoryboardStepHint and ContextValueRejectedHint
  • Includes patch changeset

What was tested

  • tsc --noEmit on the lib tsconfig shows only pre-existing environment errors (@types/node missing, deprecated moduleResolution); zero new type errors introduced
  • ContextValueRejectedHint extends the base with a concrete literal — discriminated union narrowing confirmed unaffected
  • buildHint object literal in rejection-hints.ts continues to typecheck (explicit kind: 'context_value_rejected' satisfies the base + concrete fields)

Notes

  • Wire format unchanged — TypeScript-only structural change
  • StoryboardStepHintBase<string> is the recommended supertype for fallback renderers (see JSDoc on the interface)
  • The = string default was intentionally omitted: callers must supply the literal type argument, preventing future kinds from accidentally inheriting kind: string and losing discriminant narrowing

Pre-PR review:

  • code-reviewer: approved — no breaking change, discriminated union narrowing intact, buildHint typechecks; nit on type keyword in inner barrel unfounded (already inside export type { block)
  • dx-expert: approved — export placement correct, StoryboardStepHintBase<string> supertype pattern is sound; two nits (inline JSDoc example, comment explaining absent default) noted for follow-up

Session: https://claude.ai/code/session_01P4h7SnRH8N5djMswLnFzf7


Generated by Claude Code

@bokelley

Copy link
Copy Markdown
Contributor Author

Superseded by #959 — landed there as part of the structured StoryboardStepHint taxonomy.

@bokelley bokelley closed this Apr 25, 2026
@bokelley

Copy link
Copy Markdown
Contributor Author

Superseded by #959StoryboardStepHintBase landed there as part of the structured StoryboardStepHint taxonomy.

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.

refactor(conformance): introduce StoryboardStepHintBase for kind+message invariant

2 participants