fix(workflow): unblock draft compile previews from plan-IR strictness - #18
Conversation
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)
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
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. Comment |
There was a problem hiding this comment.
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.
| if src_port.type != tgt_port.type and not ( | ||
| {"any", "unknown"} & {src_port.type, tgt_port.type} | ||
| ): |
There was a problem hiding this comment.
改进建议:提高代码可读性与运行效率
当前代码使用集合交集 {"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"}:
What
Integration 5 个红测 (patch / langgraph·langchain import / demand-draft) 一个根因簇: draft 编译预览被按"已定稿工作流"的 canonical 校验卡死。
plan_ir/validation:orphan_merge对 draft 图豁免 — 导入/需求草稿合法存在"只接了一条入边的 merge", 操作员在 studio 里补完; 非 draft 校验 (POST /plan-ir/validate, publish 关口) 严格规则不变plan_ir/validation: 端口类型检查把unknown当通配, 与 compiler 自己的_types_compatible语义对齐 —external.tool.capability节点 (fallback 型unknown) 恢复可连compiler:intelligence.output.inbox入口items[]→recordCandidate[]— 与 kind 级 fallback 和姊妹collection-result对齐, 旧型号导致 normalize → inbox 永远连不上Test
关联