Skip to content

feat(graph): require payload cases in traversal - #5818

Merged
davidkpiano merged 2 commits into
nextfrom
feature/graph-event-cases
Oct 19, 2026
Merged

davidkpiano merged 2 commits into
nextfrom
feature/graph-event-cases

Conversation

@davidkpiano

@davidkpiano davidkpiano commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Why

Payload-free defaults can make payload-reading transitions throw or leave states unreached. Graph discovery now requires samples for known event types with required payload fields.

What changed

  • Add keyed events cases and snapshot generators. Maps retain unconfigured payload-free, wildcard, invoke completion, error, and delayed samples.
  • Check required event-type samples in maps and explicit lists. Keep fixed-sequence replay independent and preserve custom path generator typing.
  • Update docs, README examples, diagnostic integration tests, and Changeset.

Scope

  • Coverage remains sample-based. Erased types and widened array annotations cannot prove runtime payload completeness; traversal does not validate schemas.
  • Static function-target inference and the devtools dock are outside this PR.

Blast radius

Callers with known required payload events must now provide cases. Event arrays and callbacks returning arrays keep replacement semantics; keyed maps augment applicable machine events.

Verification

  • pnpm test --maxWorkers=2 --minWorkers=1 --silent: 4,507 passed, 32 skipped, 3 todo across 270 files.
  • Graph suite: 120 passed, 3 existing skipped. Six exact/wildcard regressions failed before the fix with a missing destination and pass afterward.
  • Build, strict built declarations, adapter consumers, packed consumers, export stability, package files, type-error snapshots, typecheck, lint, and formatting pass. Independent review found no remaining issues.

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 26f4866

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
xstate Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a47392a7-bfae-46b4-9e46-6127bb6af16a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/core/src/graph/graph.ts
Address "Keyed cases erase wildcard fallback paths" and tag public traversal types for export stability.
@davidkpiano
davidkpiano merged commit 8773a22 into next Oct 19, 2026
3 checks passed
@davidkpiano
davidkpiano deleted the feature/graph-event-cases branch October 19, 2026 21:27
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