# XState 6.0.0-alpha.51 - Product: XState (https://whatsnew.fyi/product/xstate) - Vendor: Stately - Date: 2026-09-03 - Version: 6.0.0-alpha.51 - Original notes: https://github.com/statelyai/xstate/releases/tag/xstate%406.0.0-alpha.51 - Permalink: https://whatsnew.fyi/product/xstate/releases/6.0.0-alpha.51 - Labels: Pre-release What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **changed** — Improve setup() state contracts with typed structural metadata, recursive state input requirements for composite and parallel entry, history-default validation, strongly typed relative targets, and shared input requirements for literal target sets - **changed** — State-level context schemas now refine the root context schema instead of replacing it, allowing narrowed context fields while retaining all root context fields in state actions, transitions, and narrowed snapshots ###### Minor Changes - 29dae8c: Improve `setup(...)` state contracts with typed structural metadata, recursive state input requirements for composite and parallel entry, history-default validation, strongly typed relative targets, and shared input requirements for literal target sets. - b44d9cb: State-level context schemas now refine the root context schema instead of replacing it. Declare only the fields narrowed by a state while retaining all root context fields in state actions, transitions, and narrowed snapshots. Nested states retain active ancestor refinements, and `xstate/fsm` uses the same refinement semantics. ```ts const machine = setup({ schemas: { context: z.object({ requestId: z.string(), draft: z.string().optional() }) }, states: { reviewing: { schemas: { context: z.object({ draft: z.string() }) } } } }).createMachine({ context: { requestId: 'req-1' }, // ... }); ```