Skip to content

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

Merged
pelikhan merged 1 commit into
mainfrom
rig-claude-compat/2026-08-27-1afd3f5bd2efef07
Aug 27, 2026
Merged

[rig-claude] Improve Claude dynamic-workflow compatibility for rig#497
pelikhan merged 1 commit into
mainfrom
rig-claude-compat/2026-08-27-1afd3f5bd2efef07

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Compatibility gap addressed

The rig/globals test section covered call(), call.text(), and call.workflow() but had no coverage for pipeline() and parallel() from "rig/globals". This left the flat-port migration pattern — the most common first step when porting a Claude dynamic workflow to rig — untested.

A flat Claude dynamic workflow uses injected globals (agent, pipeline, parallel) at the module top level. The rig equivalent imports all three from "rig/globals":

import { call, pipeline, parallel } from "rig/globals";

Without a test covering the complete trio, there was no signal if the ambient pipeline/parallel delegation ever broke.

Why this improves transfer from Claude dynamic workflows to rig

When someone reads 340-flat-workflow-port.md or claude-workflow-conversion.md and learns the "rig/globals" migration path, they can now see the behavior is validated end-to-end — call, pipeline, and parallel all route through the active workflow context, matching the Claude dynamic workflow globals trio.

Files changed

  • src/workflow.test.ts — added one test in the rig/globals describe block: "pipeline() and parallel() from rig/globals run inside the active context — flat Claude workflow port pattern". Also updated the import to include ambientPipeline and ambientParallel.

Validation

npm run typecheck  ✓
npm test           ✓  src/workflow.test.ts (28 tests, was 27)

The two pre-existing failures in launcher-default-engine.test.ts are unrelated to this change.

Remaining intentional differences

None introduced. All existing intentional differences documented in claude-workflow-conversion.md (failure holes, pipeline stage signature, budget units, no sandbox, no resume journal) are unchanged.

Generated by Daily Rig Claude Dynamic Workflow Compatibility · sonnet46 118.5 AIC · ⌖ 8.09 AIC · ⊞ 5.4K ·

…ort pattern

Add a test in the rig/globals describe block that validates pipeline() and
parallel() from rig/globals delegate to the active workflow context — the same
as call() does. This is the missing coverage for the incremental flat-port
migration pattern documented in 340-flat-workflow-port.md and
claude-workflow-conversion.md.

The flat-port style (import call/pipeline/parallel from "rig/globals" at the
module top level) is the most common first step when porting a Claude dynamic
workflow to rig. The test shows the complete trio working together, mirroring
the Claude dynamic workflow globals (agent/pipeline/parallel).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 27, 2026 14:41
@pelikhan
pelikhan merged commit 9516da2 into main Aug 27, 2026
1 check passed
@github-actions

github-actions Bot commented Aug 27, 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 /tdd — one suggestion on test completeness.

📋 Key Themes & Highlights

Key Themes

  • Out-of-context error coverage gap: The call() ambient has a dedicated "throws outside a workflow run" test, but pipeline() and parallel() don't get the same treatment. Completing the trio would ensure regressions on those error paths are caught.

Positive Highlights

  • ✅ Clean Arrange/Act/Assert structure — the test is easy to read and understand
  • ✅ Mirrors the documented flat-port migration pattern faithfully
  • ✅ Covers real return-value semantics (10, 20, 30 / 40, 50) rather than just checking no-throw
  • ✅ PR description is thorough and links the change to the documented migration guide

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 25.1 AIC · ⌖ 5.8 AIC · ⊞ 6.3K
Comment /matt to run again

Comment thread src/workflow.test.ts
pipelineResult: [10, 20, 30],
parallelResult: [40, 50],
});
});

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.

[/tdd] Missing out-of-context throw tests for pipeline() and parallel() — the existing call() out-of-context test (line 467) establishes a pattern not mirrored here. Without equivalent guard tests, a regression that silently swallows the out-of-context error for ambientPipeline/ambientParallel would go undetected.

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.

1 participant