Skip to content

fix(workflow): unblock draft compile previews from plan-IR strictness - #18

Merged
2233admin merged 1 commit into
mainfrom
fix/workflow-plan-ir-draft-validation
Jul 18, 2026
Merged

fix(workflow): unblock draft compile previews from plan-IR strictness#18
2233admin merged 1 commit into
mainfrom
fix/workflow-plan-ir-draft-validation

Conversation

@2233admin

Copy link
Copy Markdown
Owner

What

Integration 5 个红测 (patch / langgraph·langchain import / demand-draft) 一个根因簇: draft 编译预览被按"已定稿工作流"的 canonical 校验卡死

  1. plan_ir/validation: orphan_merge 对 draft 图豁免 — 导入/需求草稿合法存在"只接了一条入边的 merge", 操作员在 studio 里补完; 非 draft 校验 (POST /plan-ir/validate, publish 关口) 严格规则不变
  2. plan_ir/validation: 端口类型检查把 unknown 当通配, 与 compiler 自己的 _types_compatible 语义对齐 — external.tool.capability 节点 (fallback 型 unknown) 恢复可连
  3. compiler: intelligence.output.inbox 入口 items[]recordCandidate[] — 与 kind 级 fallback 和姊妹 collection-result 对齐, 旧型号导致 normalize → inbox 永远连不上

Test

关联

Integration suite had 5 red tests in the patch/import/demand-draft family,
all one root cause cluster: compile previews (always PlanGraph(draft=True))
were failing canonical-lifecycle checks meant for finalized graphs.

- plan_ir/validation: skip orphan_merge on draft graphs — imports and
  demand drafts legitimately hold partially wired merges the operator
  finishes in the studio; non-draft validation (POST /plan-ir/validate,
  publish gates) keeps the strict rule
- plan_ir/validation: port-type check now honors 'unknown' as a wildcard,
  same semantics as the compiler's own _types_compatible — imported
  external.tool.capability nodes (fallback type 'unknown') stay connectable
- compiler: intelligence.output.inbox input port items[] -> recordCandidate[],
  aligning with its kind-level fallback and the collection-result sibling;
  the stale type made normalize -> inbox unconnectable

tests/integration: 383 passed, 5 skipped (was 378/5 red)
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@2233admin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc1a2374-a008-4854-bad9-b6636f89c191

📥 Commits

Reviewing files that changed from the base of the PR and between 50f48c8 and 201e0a1.

📒 Files selected for processing (2)
  • backend/plan_ir/validation.py
  • backend/workflow/compiler.py

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the validation logic to exempt draft graphs from orphan merge checks and adds "unknown" as a wildcard port type alongside "any". Additionally, it updates the input port contract type for intelligence.output.inbox to recordCandidate[] in the compiler. Feedback is provided to optimize the wildcard type check in _check_port_type_mismatches for better readability and performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +259 to +261
if src_port.type != tgt_port.type and not (
{"any", "unknown"} & {src_port.type, tgt_port.type}
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

改进建议:提高代码可读性与运行效率

当前代码使用集合交集 {"any", "unknown"} & {src_port.type, tgt_port.type} 来判断端口类型是否包含通配符。虽然这种写法很巧妙,但在循环中为每条边都创建两个新的集合并进行交集运算,会带来不必要的内存分配和性能开销。

建议改用更直观且符合 Python 惯例的 not in 条件判断。这样不仅能提高代码的可读性,还能避免在循环中频繁创建集合对象,提升校验性能。

        if src_port.type != tgt_port.type and src_port.type not in {"any", "unknown"} and tgt_port.type not in {"any", "unknown"}:

@2233admin
2233admin merged commit bb2f7aa into main Jul 18, 2026
5 checks passed
@2233admin
2233admin deleted the fix/workflow-plan-ir-draft-validation branch July 18, 2026 11:51
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