Skip to content

refactor(workflow): model operational failures with better-result#101

Open
Waishnav wants to merge 1 commit into
pr/dw-7-typed-contracts-zodfrom
pr/dw-8-result-errors
Open

refactor(workflow): model operational failures with better-result#101
Waishnav wants to merge 1 commit into
pr/dw-7-typed-contracts-zodfrom
pr/dw-8-result-errors

Conversation

@Waishnav

Copy link
Copy Markdown
Owner

Summary

  • Add a Better Result error taxonomy for workflow files, store transitions, worktrees, providers, schema enforcement, and corrupt persisted data.
  • Introduce Result-returning operational cores while preserving throwing compatibility wrappers and the ergonomic workflow-script agent() API.
  • Normalize provider failures at adapter boundaries; native schema fallback now branches on a typed unsupported-schema error rather than arbitrary exceptions.
  • Map the same tagged errors exhaustively to journal error kinds, CLI exit codes, and structured MCP tool errors.
  • Preserve primary worktree failures, attach cleanup failures, and stop silently degrading corrupt structured replay data to text.

Stack

Test plan

  • npm run typecheck
  • npm test
  • npm run build
  • Result-path tests for files, providers, store transitions, schema exhaustion, worktrees, CLI/MCP serialization
  • Regression test: worktree setup failure is not replaced by a missing journal-call error
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 21, 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b68ff279-8a51-47fa-9ffb-a66f95ee464c

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/dw-8-result-errors

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.

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