Skip to content

feat: add FastAPI checkpoint continuation example#17

Merged
rlippmann merged 1 commit into
mainfrom
fast-api-checkpoint-continuation
Jun 28, 2026
Merged

feat: add FastAPI checkpoint continuation example#17
rlippmann merged 1 commit into
mainfrom
fast-api-checkpoint-continuation

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

Adds a FastAPI checkpoint-continuation example.

The example demonstrates checkpoint continuation across stateless HTTP request boundaries. A travel-booking itinerary change enters a confirmation-required state, the host persists a checkpoint, and a later request restores that checkpoint into a fresh engine. Only a post-restore confirmation causes the booking change to be applied.

Why

The generic checkpoint-continuation examples demonstrate the concept in isolation.

This example shows the same enforcement point in a realistic web-service environment where requests are stateless and continuation state must survive between requests.

The example reinforces that:

  • Context Compiler owns authoritative state and pending continuation state.
  • The host owns persistence, routing, and booking mutation.
  • Restoring authoritative state alone is insufficient to resume a pending confirmation flow.
  • This is not prompt reinjection.

Example metadata

  • Enforcement point: checkpoint continuation
  • Domain: travel booking
  • Technology/runtime: FastAPI
  • Example type: reference integration
  • Does this use directive drafter? should normally be no: no
  • Does this derive state from model output? must be no for primary examples: no

Checklist

  • Repository scaffolding / governance change
  • One primary enforcement point
  • Explicit authoritative state
  • No model-derived state mutation
  • Adversarial stub or equivalent test
  • Observable runtime behavior change
  • Domain vocabulary is natural
  • Framework is secondary to the enforcement point
  • Docs updated
  • Tests/smoke checks added where practical

Notes

The example includes tests covering:

  • pending confirmation creation
  • checkpoint persistence
  • checkpoint restore into a fresh engine
  • confirmation after restore applies the change
  • rejection after restore does not apply the change
  • unrelated/adversarial input does not resolve the continuation
  • authoritative-state-only restore is insufficient to resume the pending flow

The implementation uses an in-memory checkpoint store and booking store to keep the example focused on checkpoint continuation rather than infrastructure concerns.

@rlippmann
rlippmann merged commit 3003b9b into main Jun 28, 2026
5 checks passed
@rlippmann
rlippmann deleted the fast-api-checkpoint-continuation branch June 28, 2026 05:30
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