Skip to content

docs(flare-workflow): design-spec for saga rollback/compensation handlers - #495

Merged
getappz merged 1 commit into
masterfrom
task/118-design-spec-rollback-compensation-handle
Aug 14, 2026
Merged

docs(flare-workflow): design-spec for saga rollback/compensation handlers#495
getappz merged 1 commit into
masterfrom
task/118-design-spec-rollback-compensation-handle

Conversation

@getappz

@getappz getappz commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Committed crates/flare-workflow/ROLLBACK_COMPENSATION_DESIGN.md (design doc only, no code changes, per the item's instructions).

Summary of what the doc resolves:

  • Data model: reuses StepExecutor<D> (no new trait) — StepDefinition.rollback: Option<Arc<dyn StepExecutor<D>>> + rollback_retry_policy: Option<RetryPolicy>. The forward step's {output} is supplied by reconstructing a fresh WorkflowContext<D> from that step's own journaled StepRun success snapshot (the journal already stores full serialized context, not just a status flag). Rollback is only valid on Sequential/FanOut/Loop steps (the only modes that journal a context snapshot); validate() rejects it elsewhere.
  • Durability: new JournalEntry::Rollback variant, same CompletableEntry pattern as everything else, no schema migration — recommended over Cloudflare's own (weaker, undocumented) guarantee because the marginal cost is small and the failure mode of not having it (double-compensation or dropped compensation on crash) is worse.
  • Ordering: reverse StepState.started_at (already durable), tied-broken by reverse declaration order — no new monotonic counter needed for v1.
  • Trigger: exactly when execute_workflow settles to WorkflowStatus::Failed (both existing settlement points, factored into one finish_workflow_failed helper); ContinueNextStep/RetryIndefinitely/cancellation are explicitly excluded with reasoning, not silently half-supported.
  • Rollback's own failures: best-effort per step (extends the existing on_failure-hook precedent), continues unwinding the rest of the saga, reports via new events rather than inflating WorkflowStatus.

Also specifies concrete engine.rs integration (a new src/rollback.rs module mirroring waits.rs's layout) and calls out what's explicitly deferred (JSON-workflow exposure, a RollingBack status, sub-ms ordering) with reasoning for each. Ready for review before any implementation task is scoped.

…lers

Agentflare-Agent: claude-code
Agentflare-Branch: task/118-design-spec-rollback-compensation-handle
Agentflare-Item: 118
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 444cf975-f245-4c08-a9d0-7a33f8ab25c5

📥 Commits

Reviewing files that changed from the base of the PR and between caf5845 and 3610e4d.

📒 Files selected for processing (1)
  • crates/flare-workflow/ROLLBACK_COMPENSATION_DESIGN.md

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

@getappz getappz changed the title design-spec: rollback/compensation handlers for flare-workflow steps docs(flare-workflow): design-spec for saga rollback/compensation handlers Aug 14, 2026
@getappz
getappz merged commit ba59207 into master Aug 14, 2026
17 of 18 checks passed
@getappz
getappz deleted the task/118-design-spec-rollback-compensation-handle branch August 14, 2026 14:41
getappz added a commit that referenced this pull request Aug 16, 2026
…ailure reason (#528)

Fetching origin's target branch before branching a new task branch off it
silently swallowed the actual git error and fell back to the (possibly
stale) local ref on any failure. This caused a real incident: item #495
(issue #483) branched off a stale local master because a transient fetch
failure went unlogged, missing an already-merged fix for the very issue
it was meant to work on.

Adds a single retry with a short fixed delay, and logs the real stderr/
error on the fallback path instead of a generic message.

Agentflare-Agent: claude-code_2-1-233_agent
Agentflare-Branch: task/496-worktree-log-real-git-error-on-fetch-fal
Agentflare-Item: 496
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