Commit facd7c1
committed
fix(retry): use plain Cause.done + Pull.isDoneCause
Both reviewers (spec + quality, codex-5.3) flagged that retry.ts:129/131
used Effect.failCause(Cause.Done(...) as unknown as Cause.Cause<number>)
with double casts to terminate the schedule. Plan A.2.2 specifies
'return Cause.done(meta.attempt)' directly; the cast pattern was hiding
a type mismatch and making the control flow harder to reason about.
- retry.ts: replace both Effect.failCause casts with plain
Cause.done(meta.attempt) — the Effect<never, Done<number>> that
fromStepWithMetadata already expects as a stop signal.
- retry.test.ts: my original A.2.1 assertion used Cause.isDone(cause),
which takes a Done value and returned false on a Cause<Done>. Switch
to Pull.isDoneCause(cause), which correctly recognizes a Cause whose
reason is a Done marker. Drop unused Cause import.
All 54 targeted tests pass, typecheck clean. Addresses spec+quality
review of 2176730.1 parent 2176730 commit facd7c1
2 files changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
312 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| |||
0 commit comments