Skip to content

refactor(langgraph): adapter reflects CompiledStep.executionPlan on node metadata#86

Merged
SingleSourceStudios merged 2 commits into
mainfrom
refactor/consume-execution-plan-adapter
May 27, 2026
Merged

refactor(langgraph): adapter reflects CompiledStep.executionPlan on node metadata#86
SingleSourceStudios merged 2 commits into
mainfrom
refactor/consume-execution-plan-adapter

Conversation

@SingleSourceStudios
Copy link
Copy Markdown
Collaborator

@SingleSourceStudios SingleSourceStudios commented May 27, 2026

Part of #75 (LangGraph adapter half). Companion to the executor half.

Summary

#65 added CompiledStep.executionPlan (ExecutionPlan | null). The LangGraph adapter built nodes without it, so the serialized state graph carried no fan-out/fan-in. This reflects the compiled plan onto StateGraphNode.metadata.executionPlan.

  • Read from compiledStep.executionPlan (the adapter already holds the CompiledStep in buildGraphDefinition), gated by includeMetadata and omitted when null, mirroring the existing retryPolicy reflection. A LangGraph builder can construct parallel/conditional edges from this without reaching back into the un-compiled spec.
  • Consume-and-reflect only; no concurrent scheduler.

Tests

  • Loop-closing test (src/__tests__/execution-plan-source.test.ts) wraps compileWorkflow to attach an executionPlan to the compiled step while the source spec declares no parallel structure, proving the adapter reflects the compiled artifact and not the spec. Verified RED before the fix, GREEN after.

Reviewer-relevant caveats (please read before merge)

The adapters/langgraph package is outside all root gate commands: it is not in the root workspaces (packages/* only), is excluded from biome (!**/adapters), is not referenced by tsconfig.build.json, and is not a vitest project (root vitest projects: ["packages/*"]). Root npm test / typecheck / lint therefore do not exercise it and remain green.

On main, before this change, the adapter package already fails its own suite (4 failing tests) and does not typecheck (~8 tsc --noEmit errors) due to stale drift against the current core API (console/lib config, ParseResult.data, DagResult.levels/order) — all unrelated to executionPlan. This change does not introduce or fix any of that; it is purely additive (one metadata field + one passing test), verified by running the adapter suite directly (my test passes; the 4 pre-existing failures persist unchanged).

Recommendation: merge the executor half (#85) unconditionally. For this PR, either merge as-is and track a follow-up to repair the adapter's API drift and bring it under a gate, or fold this field into that repair so the adapter re-enters CI green in one move. I did not touch root config or repair the drift, as both are out of scope for #75.

🤖 Generated with Claude Code


Summary by cubic

Reflects the compiled parallel execution plan onto LangGraph node metadata so consumers can build fan-out/fan-in edges without reading the source spec. Part of #75; no scheduler changes.

  • Refactors
    • Read from CompiledStep.executionPlan and write to StateGraphNode.metadata.executionPlan when includeMetadata is true; omitted when null.
    • Updated types to include ExecutionPlan from @logic-md/core and added a test verifying the adapter uses the compiled artifact, not the spec.

Written for commit 0560a24. Summary will update on new commits. Review in cubic

#65 added CompiledStep.executionPlan (ExecutionPlan | null). The LangGraph
adapter built nodes without it, so the serialized state graph carried no
fan-out/fan-in. Consumer side of #65, parallel-execution analog of the
verification gap.

Reflect compiledStep.executionPlan onto StateGraphNode.metadata.executionPlan,
read from the compiled artifact (the adapter already holds the CompiledStep in
buildGraphDefinition), gated by includeMetadata like retryPolicy and omitted
when the step has no plan. A LangGraph builder can construct parallel/conditional
edges from this without reaching back into the un-compiled spec. Consume-and-reflect
only; no concurrent scheduler.

Loop-closing test wraps compileWorkflow to attach an executionPlan to the compiled
step while the source spec declares no parallel structure, proving the adapter
reflects the compiled artifact and not the spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@SingleSourceStudios, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37ff83a4-3f73-4191-aa06-65d0d111f93c

📥 Commits

Reviewing files that changed from the base of the PR and between 6eddce5 and 0560a24.

📒 Files selected for processing (3)
  • adapters/langgraph/src/__tests__/execution-plan-source.test.ts
  • adapters/langgraph/src/adapter.ts
  • adapters/langgraph/src/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/consume-execution-plan-adapter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@SingleSourceStudios SingleSourceStudios enabled auto-merge (squash) May 27, 2026 07:16
@SingleSourceStudios SingleSourceStudios merged commit e225f8f into main May 27, 2026
4 checks passed
@SingleSourceStudios SingleSourceStudios deleted the refactor/consume-execution-plan-adapter branch May 27, 2026 07:17
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