[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #319
Conversation
…orkflow sample Sample 330 used Promise.all directly to fan out call.workflow invocations. This inconsistency would confuse users porting Claude dynamic workflows, where parallel(thunks) is the canonical idiom for concurrent calls. It also bypasses the error-to-null-hole semantics that parallel() provides. Replace Promise.all with parallel(thunks) and destructure parallel from the workflow context to match the Claude dynamic-workflow pattern exactly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@copilot review and replace Promise.all in other samples |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated additional samples to replace Promise-based fan-out with |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — changes align with rig vocabulary and patterns. Approving.
Key themes:
parallel(thunks)alignment: All changed files now consistently useparallel(thunks)instead ofPromise.all, reinforcing the canonical rig idiom and the Claude-workflow mapping.- Null-hole semantics handled:
54-large-scale-summarization-rigs.tsfilters null results afterparallelwith a correctly typedNonNullablepredicate, preventing downstream type errors. searchPlanPromisesequencing: Moving the await outsideparallel([...])is safe — concurrency is preserved since the promise is already launched. The sequenced await also makes the data dependency onsearchPlanexplicit.
✅ Minimal, surgical diff. ✅ Sample typechecks cleanly.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 20.8 AIC · ⌖ 4.07 AIC · ⊞ 6.3K
Comment /matt to run again
Compatibility gap addressed
Sample
330-nested-workflow-composition.mdusedPromise.alldirectly to fan outcall.workflowinvocations in parallel, but the canonical Claude dynamic-workflow idiom — and the idiomatic rig equivalent — isparallel(thunks).A user porting
await parallel(thunks)from a Claude dynamic workflow would:Promise.allpattern as the rig translation.parallel()provides (rejected thunks becomenullrather than propagating, exceptWorkflowLimitErrorwhich still propagates).Why this improves transfer
The mapping in
claude-workflow-conversion.mddocumentsparallel(thunks)→parallel(thunks)as a direct equivalence. The sample now uses exactly that form, reinforcing the mapping and making it immediately recognisable to someone porting from Claude dynamic workflows.Files changed
skills/rig/samples/330-nested-workflow-composition.md— replacedPromise.all(dirs.map(...))withparallel(dirs.map((dir) => () => ...))and addedparallelto the destructured workflow context.Validation run
Result: 1 passed (402 skipped) ✓
Remaining intentional differences
None introduced. The existing documented differences in
claude-workflow-conversion.md(failure holes, budget units, no sandbox restrictions, no resume journal) remain accurate and unchanged.