Skip to content

Replace instanceof checks with Effect guards - #5

Merged
K-Mistele merged 4 commits into
mainfrom
effect-error-guards
Aug 16, 2026
Merged

Replace instanceof checks with Effect guards#5
K-Mistele merged 4 commits into
mainfrom
effect-error-guards

Conversation

@K-Mistele

@K-Mistele K-Mistele commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace runtime instanceof checks with Effect guards such as Predicate.isError, Predicate.isTagged, and AiError.isAiError
  • model hook execution failures as Data.TaggedError values and expose a tag-based guard for cause inspection
  • use Predicate.hasProperty and Predicate.isString for unknown web error properties, with an explicit Effect dependency in the theme package

Verification

  • bun run typecheck
  • bun run test
  • bun run --cwd packages/fold-codex test
  • bun run --cwd packages/fold-core test
  • changed-file oxfmt and oxlint checks
  • PR-added-line audit confirms no instanceof, typeof, property in, or null checks
  • repository audit confirms no executable instanceof usage remains

@K-Mistele
K-Mistele merged commit b3125a9 into main Aug 16, 2026
5 checks passed
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