Skip to content

types: adopt exact schema candidates - #86

Merged
tiye merged 1 commit into
mainfrom
types/adopt-exact-schema
Oct 29, 2026
Merged

tiye merged 1 commit into
mainfrom
types/adopt-exact-schema

Conversation

@tiye

@tiye tiye commented Oct 29, 2026

Copy link
Copy Markdown
Member

Requested by Jon · project thread

按 analyze weak-types --schema-evidence 的 exact 候选逐个人工审查后,把 1 个定义的 schema 从 Dynamic 收紧成精确类型,unresolved 弱类型从 100 降到 99。只改 schema,不改代码;用仓库钉住的 calcit 0.31.0 和干净安装的依赖验证通过。

中文

改了什么

定义 原 schema 新 schema
app.comp.container/style-body :: 'Dynamic :: 'Map 'Tag 'String

没有采纳的候选

  • *states:空 cursor 推出 List :never,不采纳。
  • app.style/link:异构 map(Tag 和 String 混合),候选误报成 String,不采纳。
  • style-body 的候选也是误报的 String,按实际值写成 Map Tag String。

验证

用 calcit 0.31.0(与 deps.cirru 一致)和 caps --ci 新装的依赖,在改动前后各跑一遍并对比:

  • calcit calcit.cirru edit format 之后没有额外改动
  • --check-only(CI 用到的各个 entry)通过;--check-only --all-defs 在 main 上本来就有失败的定义(与本改动无关),改动前后失败列表一致。
  • fix --workflow strict --verify 通过,0 条诊断
  • CI 里的测试和 js 编译通过
  • analyze weak-types 的 unresolved:100 → 99

English

After reviewing each exact candidate from analyze weak-types --schema-evidence by hand, narrows the schema of 1 definition from Dynamic to a precise type. Unresolved weak types go from 100 to 99. Schema-only change, no code changes.

Changes

See the table above.

Candidates not adopted

  • *states: the empty cursor yields List :never; skipped.
  • app.style/link: heterogeneous map (Tag and String values), mis-reported as String; skipped.
  • style-body hit the same String mis-report and is declared Map Tag String from its actual value.

Verification

With calcit 0.31.0 (as pinned in deps.cirru) and dependencies freshly installed by caps --ci, before and after the change:

  • calcit calcit.cirru edit format produces no further diff
  • --check-only passes for every entry used in CI; --check-only --all-defs already fails on main for unrelated definitions; the failing set is identical before and after this change.
  • fix --workflow strict --verify passes with 0 diagnostics
  • CI tests and the js build pass
  • analyze weak-types unresolved: 100 → 99

Generated by Claude Code

Narrow Dynamic schemas to the exact types reported by
analyze weak-types --schema-evidence, after reviewing each candidate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bPdukx61niAgnGLUK1Ddu
@tiye tiye self-assigned this Oct 29, 2026
@tiye
tiye merged commit a191a77 into main Oct 29, 2026
1 check passed
@tiye
tiye deleted the types/adopt-exact-schema branch October 29, 2026 10:10
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.

2 participants