Skip to content

docs: prefer branch-first decision examples - #223

Merged
rlippmann merged 1 commit into
mainfrom
decision_cleanup
Aug 3, 2026
Merged

docs: prefer branch-first decision examples#223
rlippmann merged 1 commit into
mainfrom
decision_cleanup

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • updated the README and API reference to show branch-first Decision handling
  • updated the ambiguity and integration examples to branch with is_error(...) / is_update(...) before reading variant payloads
  • updated the shared example utility to read decision["message"] and decision["state"] only inside the matching branch

Why

  • Decision is now a true discriminated union, so examples and presentation code should teach the natural union-usage pattern
  • this keeps get_error_message(...) and get_decision_state(...) available as compatibility conveniences without making them the preferred style

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann
rlippmann merged commit 3cb924d into main Aug 3, 2026
18 checks passed
@rlippmann
rlippmann deleted the decision_cleanup branch August 3, 2026 07:31
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