Skip to content

收紧 Gen Code 插件状态与字段读取类型 - #60

Merged
tiye merged 1 commit into
mainfrom
refine/gen-code-state-readers
Nov 11, 2026
Merged

tiye merged 1 commit into
mainfrom
refine/gen-code-state-readers

Conversation

@tiye

@tiye tiye commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

对使用者的影响

现有插件调用和保存的状态继续可用。字段缺失或为 nil 时仍采用原回退值,插件事件继续使用现有匿名枚举格式。

改动与风险

插件入口保留调用方的状态类型,字段读取分别保留原输入和回退值的类型。存档结构中的状态树明确声明为 Respo States。三处签名收紧,开放字段结果和旧事件适配保留,原类型门禁保持。

验证

正式 Calcit 0.41.0 的 247 个定义、完整 strict、原质量门禁、7 项附带测试、离线流式和派发回归及 Vite 构建通过。

Summary by CodeRabbit

  • Refactor
    • Updated type declarations for state-related inputs, stored state, and fallback values in code-generation interfaces. This aligns how these values are represented across the interfaces while preserving their existing behavior. There are no user-visible feature changes in this update.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR updates the declared types for use-gen-code and read-open-field-or. It also changes the declared type of StoreData.states from Map to respo.schema/States.

Changes

Type declaration updates

Layer / File(s) Summary
Function and state type declarations
calcit.cirru
use-gen-code declares StatesInput for its states parameter. read-open-field-or declares separate Raw and Fallback types. StoreData.states uses respo.schema/States.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Refactor

Possibly related issues

  • calcit-lang/gen-code#22 — The PR adds Raw and Fallback generics to read-open-field-or, matching the issue’s request to preserve input and fallback types.

Possibly related PRs

Suggested reviewers: chenyong

Merge Risk: Minimal · up to 512b9

This change tightens plugin and state type declarations while keeping runtime behavior and fallbacks the same. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: tightening Gen Code plugin state types and field-reading types.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9e84afa5-d623-40c0-baab-4d80eb0cbe76
Commits

Reviewing files that changed from the base of the PR and between 3ecc97b and 512b9d5.

Files selected for processing: 1

  • calcit.cirru

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@tiye
tiye merged commit 4280842 into main Nov 11, 2026
1 check passed
@tiye
tiye deleted the refine/gen-code-state-readers branch November 11, 2026 13:25
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