Skip to content

[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #319

Merged
pelikhan merged 2 commits into
mainfrom
rig-claude-compat/2026-07-31-97c1bf07ba74579b
Jul 31, 2026
Merged

[rig-claude] Improve Claude dynamic-workflow compatibility for rig#319
pelikhan merged 2 commits into
mainfrom
rig-claude-compat/2026-07-31-97c1bf07ba74579b

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Compatibility gap addressed

Sample 330-nested-workflow-composition.md used Promise.all directly to fan out call.workflow invocations in parallel, but the canonical Claude dynamic-workflow idiom — and the idiomatic rig equivalent — is parallel(thunks).

A user porting await parallel(thunks) from a Claude dynamic workflow would:

  1. Not recognise the Promise.all pattern as the rig translation.
  2. Lose the error-to-null-hole semantics that parallel() provides (rejected thunks become null rather than propagating, except WorkflowLimitError which still propagates).

Why this improves transfer

The mapping in claude-workflow-conversion.md documents parallel(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 — replaced Promise.all(dirs.map(...)) with parallel(dirs.map((dir) => () => ...)) and added parallel to the destructured workflow context.

Validation run

npm run sample -- --testNamePattern="skill markdown samples typecheck"

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.

Generated by Daily Rig Claude Dynamic Workflow Compatibility · sonnet46 41.2 AIC · ⌖ 7.92 AIC · ⊞ 5.4K ·

…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>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot review and replace Promise.all in other samples

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@copilot review and replace Promise.all in other samples

Updated additional samples to replace Promise-based fan-out with parallel(thunks) where applicable. Included executable sample src/samples/54-large-scale-summarization-rigs.ts and aligned wording in skills/rig/samples/54-large-scale-summarization.md. Addressed in commit a420e9f.

Copilot AI requested a review from pelikhan July 31, 2026 10:33
@pelikhan
pelikhan marked this pull request as ready for review July 31, 2026 11:38
@pelikhan
pelikhan merged commit 3cfbe7c into main Jul 31, 2026
1 check passed
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design — changes align with rig vocabulary and patterns. Approving.

Key themes:

  • parallel(thunks) alignment: All changed files now consistently use parallel(thunks) instead of Promise.all, reinforcing the canonical rig idiom and the Claude-workflow mapping.
  • Null-hole semantics handled: 54-large-scale-summarization-rigs.ts filters null results after parallel with a correctly typed NonNullable predicate, preventing downstream type errors.
  • searchPlanPromise sequencing: Moving the await outside parallel([...]) is safe — concurrency is preserved since the promise is already launched. The sequenced await also makes the data dependency on searchPlan explicit.

✅ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants