@calcit/procs 0.12.55 → 0.12.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/RFCs/07-31-unsafe-coerce-driven-static-type-boundary-plan.md +170 -0
  3. package/build.rs +36 -2
  4. package/editing-history/202607310224-strengthen-namespace-import-diagnostics.md +23 -0
  5. package/editing-history/202607311940-strengthen-unsafe-coerce-boundaries.md +20 -0
  6. package/editing-history/202608010103-warn-on-duplicate-imports.md +18 -0
  7. package/editing-history/202608010111-release-0.12.56.md +15 -0
  8. package/editing-history/202608011654-library-quality-gates.md +23 -0
  9. package/editing-history/202608011759-issue-routing-in-agent-guide.md +17 -0
  10. package/editing-history/202608011833-schema-type-symbols.md +20 -0
  11. package/editing-history/202608011852-wasm-dynamic-string-tag.md +7 -0
  12. package/editing-history/202608011908-consolidate-history.md +6 -0
  13. package/editing-history/202608012022-consolidate-cli-and-test-duplication.md +28 -0
  14. package/editing-history/202608012123-review-follow-up.md +18 -0
  15. package/editing-history/202608012320-release-0.12.57.md +5 -0
  16. package/editing-history/ARCHIVE.md +15 -0
  17. package/editing-history/README.md +21 -0
  18. package/lib/package.json +1 -1
  19. package/package.json +1 -1
  20. package/editing-history/2026-02-13-1841-trait-origin-structural-eq.md +0 -91
  21. package/editing-history/2026-02-14-2050-js-codegen-recursion-tag-migration.md +0 -39
  22. package/editing-history/2026-02-14-2358-emit-js-modularization-shift-left.md +0 -63
  23. package/editing-history/2026-02-15-0000-diagnostics-consolidated.md +0 -35
  24. package/editing-history/2026-02-15-1941-macro-diagnostics-refinement.md +0 -39
  25. package/editing-history/2026-02-16-2043-core-api-docs-cleanup.md +0 -40
  26. package/editing-history/2026-02-23-0834-migrate-to-defstruct.md +0 -91
  27. package/editing-history/2026-02-23-2321-ns-imports-code-fixes.md +0 -42
  28. package/editing-history/2026-02-25-0002-language-behavior-eval-mode.md +0 -93
  29. package/editing-history/2026-02-25-0111-guidebook-no-check-block-upgrades.md +0 -52
  30. package/editing-history/2026-02-25-0113-runtime-type-validation-and-macro-quoting.md +0 -41
  31. package/editing-history/2026-02-25-1131-check-md-eval-improvements.md +0 -13
  32. package/editing-history/2026-02-26-1324-check-md-inprocess-cache-and-path-labels.md +0 -7
  33. package/editing-history/2026-02-27-1640-unify-markdown-readers.md +0 -16
  34. package/editing-history/2026-02-27-1958-tree-rewrite-command-and-reference-model.md +0 -18
  35. package/editing-history/2026-02-27-2200-split-def-command.md +0 -29
  36. package/editing-history/2026-02-27-2212-tree-raise-wrap.md +0 -33
  37. package/editing-history/2026-02-27-2223-calcit-agent-docs-optimize.md +0 -41
  38. package/editing-history/2026-03-01-0212-query-search-entry-and-ffi-warning.md +0 -53
  39. package/editing-history/2026-03-03-1934-check-types-and-core-annotations.md +0 -17
  40. package/editing-history/2026-03-04-0000-generics-fn-typevar-identity.md +0 -30
  41. package/editing-history/2026-03-04-1331-tag-call-warning-and-dot-access-migration.md +0 -28
  42. package/editing-history/2026-03-04-1548-impl-new-dot-method-input-and-doc-hints.md +0 -33
  43. package/editing-history/2026-03-04-1645-calcit-eq-contract-refactor-and-macro-tests.md +0 -28
  44. package/editing-history/2026-03-04-2200-assert-type-assert-traits-composable-runtime-checks.md +0 -18
  45. package/editing-history/2026-03-05-0042-type-inference-argtypes-and-core-hints.md +0 -54
  46. package/editing-history/2026-03-05-0115-calcit-core-generic-refinements.md +0 -57
  47. package/editing-history/2026-03-05-1930-schema-migration-cr-edit.md +0 -30
  48. package/editing-history/2026-03-05-1939-query-schema-adaptation.md +0 -42
  49. package/editing-history/2026-03-06-0120-schema-hint-migration-batch.md +0 -38
  50. package/editing-history/2026-03-06-1416-core-macro-schema-migration.md +0 -20
  51. package/editing-history/2026-03-06-1552-core-schema-and-hintfn-migration.md +0 -63
  52. package/editing-history/2026-03-06-1936-schema-normalization-and-preprocess-preload.md +0 -12
  53. package/editing-history/2026-03-07-0000-migrate-hint-fn-to-schema.md +0 -29
  54. package/editing-history/2026-03-07-0000-remove-enum-prototype-field.md +0 -43
  55. package/editing-history/2026-03-07-0000-schema-args-type-enforcement.md +0 -66
  56. package/editing-history/2026-03-07-0142-unit-type-and-builtin-schemas.md +0 -82
  57. package/editing-history/2026-03-07-1652-decouple-snapshot-schema-to-calcit-type.md +0 -112
  58. package/editing-history/2026-03-07-1821-snapshot-schema-validation.md +0 -6
  59. package/editing-history/2026-03-07-1959-schema-def-kind-arity-validation.md +0 -96
  60. package/editing-history/2026-03-08-0031-schema-generics-quote-normalization.md +0 -35
  61. package/editing-history/2026-03-08-1905-schema-typeref-and-assert-migration.md +0 -34
  62. package/editing-history/2026-03-08-2033-schema-wrapper-migration.md +0 -45
  63. package/editing-history/2026-03-08-2315-late-schema-cleanup-and-warning-compat.md +0 -27
  64. package/editing-history/2026-03-09-1753-schema-type-fail-tests.md +0 -17
  65. package/editing-history/2026-03-10-1040-edit-schema-primitive-tag-support.md +0 -42
  66. package/editing-history/2026-03-10-1754-ns-entry-snapshot-migration.md +0 -66
  67. package/editing-history/2026-03-13-2216-validate-struct-type-arg-arity.md +0 -24
  68. package/editing-history/2026-03-16-2353-runtime-boundary-cleanup.md +0 -14
  69. package/editing-history/2026-03-17-0150-runtime-boundary-lookup-cleanup.md +0 -28
  70. package/editing-history/2026-03-20-0116-json-builtins-and-runtime-docs.md +0 -48
  71. package/editing-history/2026-03-26-2013-docs-frontmatter-and-module-search.md +0 -58
  72. package/editing-history/2026-04-07-1550-path-format-at-prefix-migration.md +0 -46
  73. package/editing-history/2026-04-12-1524-js-codegen-map-to-record.md +0 -26
  74. package/editing-history/2026-04-12-1549-map-to-record-field-validation.md +0 -29
  75. package/editing-history/2026-04-13-1600-tuple-to-enum-rewrite.md +0 -13
  76. package/editing-history/2026-04-13-2309-typeslot-enum-compile-safety.md +0 -45
  77. package/editing-history/2026-04-14-1500-loose-record-syntax.md +0 -32
  78. package/editing-history/2026-04-14-2259-bidir-type-check-refactor.md +0 -63
  79. package/editing-history/2026-04-15-0120-match-syntax-exhaustiveness.md +0 -20
  80. package/editing-history/2026-04-15-1211-record-nth-optimization.md +0 -44
  81. package/editing-history/2026-04-16-1936-predicate-narrowing-expansion.md +0 -31
  82. package/editing-history/2026-04-17-0132-monomorphize-map-filter.md +0 -50
  83. package/editing-history/2026-04-17-0135-monomorphize-includes-reverse.md +0 -31
  84. package/editing-history/2026-04-17-0140-fold-type-predicates.md +0 -44
  85. package/editing-history/2026-04-17-0154-generic-dispatch-records-tuples.md +0 -52
  86. package/editing-history/2026-04-17-0520-simplify-generic-defns-via-method-dispatch.md +0 -49
  87. package/editing-history/2026-05-21-0055-tree-show-cr-config-and-edit-cleanup.md +0 -81
  88. package/editing-history/2026-05-31-2052-macro-schema-roundtrip-and-weak-types.md +0 -6
  89. package/editing-history/2026-05-31-2105-map-generic-weak-types-followup.md +0 -15
  90. package/editing-history/2026-06-01-0003-update-callback-field-specialization.md +0 -19
  91. package/editing-history/2026-06-01-2317-data-definition-where-bounds.md +0 -6
  92. package/editing-history/2026-06-02-0114-data-definition-where-macro-followup.md +0 -21
  93. package/editing-history/2026-06-03-0000-check-md-edn-errors.md +0 -5
  94. package/editing-history/2026-06-03-1600-check-md-entry-modules.md +0 -6
  95. package/editing-history/2026-06-04-0000-check-md-app-main-init.md +0 -6
  96. package/editing-history/2026-06-04-2218-compiled-executable-runtime-backfill.md +0 -6
  97. package/editing-history/2026-06-09-0000-with-type-slot-scoped-binding.md +0 -83
  98. package/editing-history/2026-06-09-1241-remove-bind-type.md +0 -64
  99. package/editing-history/2026-06-09-1800-core-effect-tags.md +0 -57
  100. package/editing-history/2026-06-10-1200-get-def-doc-schema-builtin.md +0 -7
  101. package/editing-history/2026-06-15-1500-effects-graph-mvp.md +0 -30
  102. package/editing-history/2026-06-16-1700-effects-graph-ste-tree.md +0 -84
  103. package/editing-history/2026-06-27-0052-cli-improvements.md +0 -41
  104. package/editing-history/2026-06-27-0202-docs-indexing-improvements.md +0 -22
  105. package/editing-history/2026-06-27-0315-file-splits.md +0 -17
  106. package/editing-history/2026-06-27-0416-agent-advanced-split.md +0 -15
  107. package/editing-history/archived/2025-04-12-1453-map-to-record-rewrite.md +0 -33
  108. package/editing-history/archived/2025-04-16-0117-wasm-codegen-and-catalog-update.md +0 -40
  109. package/editing-history/archived/2025-07-16-0207-wasm-encoder-migration.md +0 -48
  110. package/editing-history/archived/2025-07-16-1633-wasm-data-structures.md +0 -61
  111. package/editing-history/archived/2026-02-13-1926-docs-tests-followup.md +0 -33
  112. package/editing-history/archived/2026-02-16-2128-docs-smoke-and-trait-errors.md +0 -20
  113. package/editing-history/archived/2026-02-25-1234-watch-mode-default-once.md +0 -5
  114. package/editing-history/archived/2026-03-07-1302-calcit-agent-docs-update.md +0 -32
  115. package/editing-history/archived/2026-03-09-1819-add-test-fail-script.md +0 -5
  116. package/editing-history/archived/2026-03-09-1944-split-type-fail-tests.md +0 -8
  117. package/editing-history/archived/2026-03-16-1449-profiling-tools-reorg.md +0 -13
  118. package/editing-history/archived/2026-03-17-2026-afternoon-runtime-boundary-optimization-summary.md +0 -87
  119. package/editing-history/archived/2026-03-18-1802-tips-level-and-overwrite-schema-preservation.md +0 -26
  120. package/editing-history/archived/2026-03-20-1229-query-window-3-with-parent-preview.md +0 -72
  121. package/editing-history/archived/2026-03-23-1137-command-echo-tool-output-cleanup.md +0 -71
  122. package/editing-history/archived/2026-04-10-0011-snapshot-empty-version-pipe-marker.md +0 -23
  123. package/editing-history/archived/2026-04-16-0131-wasm-math-and-test-integration.md +0 -28
  124. package/editing-history/archived/2026-04-16-1507-wasm-data-structures-and-rfc-rename.md +0 -27
  125. package/editing-history/archived/2026-04-16-1520-wasm-bitwise-and-match.md +0 -21
  126. package/editing-history/archived/2026-04-16-1542-wasm-cross-ns-host-imports.md +0 -38
  127. package/editing-history/archived/2026-04-17-0026-wasm-rest-args.md +0 -62
  128. package/editing-history/archived/2026-04-17-0048-wasm-type-of.md +0 -70
  129. package/editing-history/archived/2026-04-17-0051-wasm-derived-predicates.md +0 -34
  130. package/editing-history/archived/2026-04-17-2316-wasm-do-println-fixes.md +0 -41
  131. package/editing-history/archived/2026-04-18-1208-split-emit-wasm-and-bump-version.md +0 -15
  132. package/editing-history/archived/2026-04-18-1430-wasm-list-match-and-method-dispatch.md +0 -5
  133. package/editing-history/archived/2026-04-18-2041-cr-wasm-split-and-runtime-stability.md +0 -18
  134. package/editing-history/archived/2026-04-18-2045-v0.12.23-ci-wasm-fix.md +0 -13
  135. package/editing-history/archived/2026-04-21-1818-wasm-string-ops-v2.md +0 -57
  136. package/editing-history/archived/2026-04-21-2332-split-emit-wasm.md +0 -45
  137. package/editing-history/archived/2026-04-22-0114-wasm-hof-intercepts-and-set-intersection.md +0 -82
  138. package/editing-history/archived/2026-04-22-0136-wasm-enum-tuple-bool-str-fixes.md +0 -68
  139. package/editing-history/archived/2026-04-22-1340-wasm-map-diff-new-and-let-intercept.md +0 -53
  140. package/editing-history/archived/2026-04-23-1419-v0.12.26-wasm-bisection-fixes.md +0 -7
  141. package/editing-history/archived/2026-04-23-1645-release-conventions.md +0 -14
  142. package/editing-history/archived/2026-04-25-1940-wasm-suite-multi-module-entry.md +0 -53
  143. package/editing-history/archived/2026-04-25-2003-wasm-method-includes-string-and-set-refactor.md +0 -71
  144. package/editing-history/archived/2026-04-25-2010-wasm-suite-add-fn-lens-edn.md +0 -43
  145. package/editing-history/archived/2026-04-25-2051-display-by.md +0 -39
  146. package/editing-history/archived/2026-04-28-1728-fix-gensym-stable.md +0 -31
  147. package/editing-history/archived/2026-04-29-1400-fix-bind-type-precompile.md +0 -38
  148. package/editing-history/archived/2026-05-26-0957-match-docs-check-md.md +0 -24
  149. package/editing-history/archived/2026-05-31-2059-ci-docs-test-and-fn-helper-tightening.md +0 -3
  150. package/editing-history/archived/2026-06-01-0005-release-0.12.36.md +0 -16
  151. package/editing-history/archived/2026-06-01-2230-enum-struct-payload-docs.md +0 -4
  152. package/editing-history/archived/2026-06-03-1620-release-0.12.38.md +0 -6
  153. package/editing-history/archived/2026-06-04-0000-release-0.12.39.md +0 -4
  154. package/editing-history/archived/2026-06-04-2230-release-0.12.40.md +0 -5
  155. package/editing-history/archived/2026-06-12-1525-weak-types-dots-format.md +0 -15
  156. package/editing-history/archived/2026-06-13-1200-primitive_schema_tags.md +0 -9
  157. package/editing-history/archived/2026-06-20-1142-ts-declaration-d-mts.md +0 -5
  158. package/editing-history/archived/2026-06-29-0117-upgrade-doc-snapshot-migration.md +0 -2
  159. package/editing-history/archived/2026-06-29-calcit-cli.md +0 -80
  160. package/editing-history/archived/2026-06-29-typed-calcit-cli-schemas.md +0 -23
  161. package/editing-history/archived/20260630-duplication-analysis.md +0 -116
@@ -1,84 +0,0 @@
1
- # effects-graph STE Tree 格式改进
2
-
3
- 日期: 2026-06-16
4
-
5
- ## 问题
6
-
7
- `cr analyze effects-graph` 默认 `sketch` 格式产出的是项目级鸟瞰图(调用树+聚合 effect/state),而非 RFC 预想的 per-function State/Transform/Effect 分解图。用户无法通过输出快速理解单个函数的功能。
8
-
9
- ## 改动
10
-
11
- ### 1. State 提取:从操作名改为目标名
12
-
13
- `record_state_operator` 原先记录操作名(如 `swap!`),现改为提取目标 atom 名称(如 `*store`)。
14
-
15
- - 新增 `extract_state_target(list, op_name)` 从 AST 列表中提取第一个参数
16
- - `swap!/reset!/deref/set!` → 提取第一个参数名
17
- - `defatom/atom` → 提取第一个参数名
18
- - 修改 `walk_expr` → `inspect_call_head` 传参,传入完整 list
19
-
20
- ### 2. Effect 分类:添加 Respo 约定函数
21
-
22
- `classify_by_name` 新增:
23
- - `render-app!/mount-app!/rerender-app!/clear-cache!/realize-ssr!` → `render`
24
- - `send-to-component!/dispatch!` → `lifecycle`
25
- - `save-store!` → `storage`
26
-
27
- `heuristic_effect_kinds` 优化:
28
- - `unknown/effect!` → `effect`(更简洁)
29
- - 函数名含 `load/init/setup` 时归类为 `io`
30
-
31
- `set!` 加入 `is_state_operator` 和 early-return 列表(之前会被误分类为 effect)
32
-
33
- ### 3. 深度截断节点保留分析
34
-
35
- 原先 `max_depth` 到达时直接返回空壳节点(`empty_shell_node`)。
36
- 现改为:始终执行 `analyze_code` 提取 state/effects/transform,仅在 children 构建时跳过。
37
- 新增 `depth_exceeded` 字段标记截断节点。
38
-
39
- ### 4. STE Tree 格式(`--format tree`)
40
-
41
- 新增 `format_as_ste_tree` 函数,输出每个函数的 State/Transform/Effect 树形分解:
42
-
43
- ```
44
- └── respo.main/main! [program]
45
- ├── State
46
- │ ├── atom *store (write)
47
- │ ├── return unit
48
- │ └── watch *store
49
- ├── Transform (calls: 3)
50
- │ ├── → respo.app.core/render-app!
51
- │ └── → respo.main/save-store!
52
- └── Effects
53
- ├── console println
54
- ├── render render-app!
55
- └── storage save-store!
56
- ```
57
-
58
- - `[program]` = 含 effect 的函数
59
- - `[transform]` = 纯变换函数
60
- - `[depth limit ↑]` = 深度截断(有分析但无子节点)
61
- - `(summary)` = 折叠节点的单行摘要(doc + effects)
62
-
63
- `cr.rs` 中 `format=tree` 调度改为 `format_as_ste_tree`(原为 `format_for_llm` mermaid)。
64
-
65
- ### 5. 其他修复
66
-
67
- - `birdview_state_labels` 匹配逻辑修复(kind 匹配而非 name 匹配)
68
- - `effect_channel_name` 新增 `storage`/`lifecycle` 通道映射
69
- - `ste_state_detail` 对 `return` 类型简化显示(仅类型,不显 "return" 前缀)
70
- - `node_transform_summary` 修复 doc 与 summary 重复问题
71
- - `empty_shell_node` 函数删除(不再使用)
72
-
73
- ## 涉及文件
74
-
75
- - `src/effects_graph.rs` — 主要改动
76
- - `src/bin/cr.rs` — tree 格式调度
77
- - `src/cli_args.rs` — 无改动(格式字符串不变)
78
-
79
- ## 验证
80
-
81
- - `cargo test effects_graph` — 5/5 通过
82
- - `cargo clippy -- -D warnings` — 通过
83
- - `yarn compile` — 通过
84
- - `cr analyze effects-graph --format tree` on respo — 产出可用的 per-function STE 分解
@@ -1,41 +0,0 @@
1
- ## CLI 改进: target-replace → search-replace, 新增 batch-delete, --parent-path
2
-
3
- ### 改动机
4
- 根据 pudica-schedule-viewer 升级过程中暴露的多次 cr 命令使用痛点:
5
-
6
- 1. `target-replace` 命名不直观("目标替换"不如"搜索替换"清晰)
7
- 2. 连续删除多个属性时需要手动从高到低删除,容易出错
8
- 3. 搜索结果的路径是叶子路径,用户需要手动去掉末尾索引得到可编辑父路径
9
- 4. map 属性中用 `$` 编辑的规则未在文档中明确
10
-
11
- ### 改动清单
12
-
13
- **src/cli_args.rs:**
14
- - `TargetReplace(TreeTargetReplaceCommand)` → `SearchReplace(TreeSearchReplaceCommand)`
15
- - `#[argh(subcommand, name = "target-replace")]` → `#[argh(subcommand, name = "search-replace")]`
16
- - 新增 `BatchDelete(TreeBatchDeleteCommand)` 枚举变体
17
- - 新增 `TreeBatchDeleteCommand` 结构体(`-p` 接受多个路径)
18
- - `QuerySearchCommand` 新增 `--parent-path` 开关
19
-
20
- **src/bin/cli_handlers/tree.rs:**
21
- - `handle_target_replace` → `handle_search_replace`
22
- - 新增 `handle_batch_delete`: 按路径降序依次调用 `handle_delete`
23
-
24
- **src/bin/cli_handlers/query.rs:**
25
- - `SearchCommonOpts` 新增 `parent_path: bool` 字段
26
- - 搜索结果中 `--parent-path` 开启时额外打印父路径
27
-
28
- **src/bin/cli_handlers/command_echo.rs:**
29
- - 更新所有 `TargetReplace` → `SearchReplace` 分发
30
- - 新增 `BatchDelete` 的三个 match arm
31
-
32
- **src/bin/cli_handlers/edit.rs:**
33
- - 错误提示 `target-replace` → `search-replace`
34
-
35
- **src/bin/cli_handlers/docs_tests.rs:**
36
- - 测试数据中 `target-replace` → `search-replace`
37
-
38
- **docs/CalcitAgent.md + 其他文档:**
39
- - 所有 `target-replace` 替换为 `search-replace`
40
- - 新增 `batch-delete` 和 `--parent-path` 用法说明
41
- - 新增 `$` 在属性 map 中的编辑指南
@@ -1,22 +0,0 @@
1
- ## 文档索引改进: abstract 字段 + --summary 模式 + Hub 标记
2
-
3
- ### 改动内容
4
-
5
- **P0: abstract/summary 字段**
6
- - `GuideDocFrontmatter` 新增 `summary: Option<String>` 字段
7
- - `parse_doc_frontmatter` 支持解析 `summary:` 键值对
8
- - `score_metadata_hit` 加入 summary 评分(exact 200,contains 130)
9
- - 8 个核心文档已添加 summary 描述
10
-
11
- **P0: `cr docs search --summary` 模式**
12
- - `DocsSearchCommand` 新增 `--summary` 开关
13
- - 搜索时只显示文档标题 + summary,不输出内容片段
14
- - 无 summary 的文档显示 `(no summary)`
15
-
16
- **P0: Hub 标记**
17
- - 搜索结果中 `kind: hub` 的文档显示 `[Hub]` 前缀
18
- - 帮助 LLM 快速识别导航页 vs 详细页
19
-
20
- **文档更新**
21
- - `docs-indexing.md` 新增 `summary` 字段规范说明和 `--summary` 用法
22
- - `docs-validation.md` 新增 `--summary` 和 hub 标记的验证用例
@@ -1,17 +0,0 @@
1
- ## 文档拆分: agent-advanced.md 和 CalcitAgent.md 的部分内容拆成独立文件
2
-
3
- ### 改动内容
4
-
5
- **从 `run/agent-advanced.md` 拆分:**
6
- - `## 快速开始` 节 (原 lines 24-58) → 新建 `run/quick-start.md` (47行)
7
- - 原文替换为交叉链接
8
-
9
- **从 `CalcitAgent.md` 拆分:**
10
- - `calcit.cirru EDN 结构` + `deps.cirru` 两节 (原 lines 156-231) → 新建 `run/project-structure.md` (82行)
11
- - `结构化策略(5 招)` 节 → 新建 `run/structural-strategies.md` (53行)
12
- - 原文替换为交叉链接
13
-
14
- ### 新文件
15
- - `docs/run/quick-start.md` — 新 LLM 快速开始工作流
16
- - `docs/run/project-structure.md` — calcit.cirru EDN 结构 + deps.cirru
17
- - `docs/run/structural-strategies.md` — cp/mv/wrap/raise/rewrite 策略
@@ -1,15 +0,0 @@
1
- ## agent-advanced.md 拆分: CLI 命令和语言基础节替换为交叉链接, 开发调试拆出独立文件
2
-
3
- ### 改动
4
-
5
- **`run/agent-advanced.md` 精简 (1598→807 行, ~49%):**
6
-
7
- - `## Calcit CLI 命令` 节 (~508行): 替换为独立文件链接列表,保留 `LLM 辅助:动态方法提示` 和 `复杂表达式分段组装策略` 两个独特子节
8
- - `## Calcit 语言基础` 节 (~266行): 替换为 cirru-syntax.md / features/tuples.md / features/static-analysis.md 链接,保留 `其他易错点`
9
- - `## 开发调试` 节 (~99行): 拆出为独立 `run/debugging.md`
10
-
11
- **新增文件:**
12
- - `run/debugging.md` — watcher 监听模式、增量更新、编译检查
13
-
14
- ### 删除的重复内容
15
- CLI 命令和语言基础的子节内容在 `run/query.md`、`run/edit-tree.md`、`cirru-syntax.md`、`features/static-analysis.md` 等文件中已有完整覆盖。
@@ -1,33 +0,0 @@
1
- # 202504121453 - Automatic map-to-record rewrite in preprocessing
2
-
3
- ## Summary
4
-
5
- When a function parameter is typed as a struct type in its schema, but the caller passes a hashmap literal `{}`, the preprocessor now automatically rewrites the hashmap to a record construction `%{}` so that runtime gets a proper record with full type checking.
6
-
7
- ## Key implementation details
8
-
9
- ### type_annotation.rs
10
- - Added `CalcitTypeAnnotation::resolve_to_struct()` — resolves `Struct`, `Record`, `TypeRef("ns/def")`, and `Optional(inner)` variants to concrete `CalcitStruct` definitions
11
- - Added `resolve_struct_from_program(ns, def)` helper — looks up struct definitions from the program registry via `lookup_runtime_ready_registered` with fallback to `lookup_def_code_registered`
12
-
13
- ### preprocess.rs
14
- - Added `try_rewrite_map_args_to_records()` — iterates processed args, checks each against `fn_info.arg_types[idx]`, calls `try_rewrite_single_map_to_record()` for potential rewrites
15
- - Added `try_rewrite_single_map_to_record()` — validates arg is `List` with `Proc(NativeMap)` head, resolves expected type to struct, validates all keys are tags, builds `[Proc(NativeRecord), Struct(def), k1, v1, ...]`
16
- - Integration point: `preprocess_list_call()` → `Calcit::Fn` match arm, between arg preprocessing and type checking
17
-
18
- ### AST transformation
19
- - Input (hashmap literal): `[Proc(NativeMap), Tag(:x), 10, Tag(:y), 20]`
20
- - Output (record literal): `[Proc(NativeRecord), Struct(Point2D), Tag(:x), 10, Tag(:y), 20]`
21
-
22
- ### Rewrite conditions
23
- - Function has schema with `:args` referencing a struct type (TypeRef, Struct, or Record)
24
- - Argument is a hashmap literal (`{}`) with tag keys
25
- - Struct definition is resolvable at preprocess time
26
- - If any condition fails, argument is left unchanged (safe fallback)
27
-
28
- ## Test
29
- - Added `Point2D`, `sum-point`, `check-point-type`, `test-map-to-record` to `calcit/test-record.cirru`
30
- - `check-point-type` uses `record?` to verify the rewrite produces actual records, not just maps
31
-
32
- ## Gotcha
33
- - `cr tree insert-after` can create doubly-nested nodes — always verify with `tree show` after insertion
@@ -1,40 +0,0 @@
1
- # 202504160117 — 优化目录更新 + WASM codegen demo
2
-
3
- ## 优化目录更新
4
-
5
- 更新 `drafts/04-15-type-directed-optimization-catalog.md`:
6
-
7
- - 标记 P0、P1、P2、P5、P7 为已完成,附 commit hash
8
- - 标记 P3、P4 为推迟,附推迟原因
9
- - 更新 Scope 行:从 `TernaryTreeList<ScopePair>` 改为 `Vec<ScopePair>`
10
- - P5 描述更新为实际采用的 Vec 方案(而非原规划的 O(1) 方案)
11
- - 新增「执行记录」节替代原「推荐执行顺序」,含基准数据(836ms→718ms,~14%)
12
-
13
- ## WASM codegen 实验性功能
14
-
15
- ### 新增文件
16
-
17
- - `src/codegen/emit_wasm.rs` — ~440 行 WAT 代码生成器
18
- - `demos/wasm-demo.cirru` — 示例程序(fibo、factorial、add-two)
19
- - `docs/wasm-codegen.md` — 使用文档 + 未来改进路线
20
-
21
- ### 修改文件
22
-
23
- - `src/codegen.rs` — 注册 `emit_wasm` 模块
24
- - `src/cli_args.rs` — 新增 `EmitWasmCommand`(`cr <entry> wasm`)
25
- - `src/bin/cr.rs` — 新增 `run_wasm_codegen` 入口
26
-
27
- ### 设计要点
28
-
29
- - **纯 WAT 文本输出** — 零额外依赖,不引入 wasm-encoder 等 crate
30
- - **All-f64 类型策略** — 所有值统一为 f64,Bool 用 1.0/0.0
31
- - **支持子集** — defn、if、let、算术(&+/&-/&\*/&/)、比较(&</&>/&=)、recur、函数调用
32
- - **不支持** — 字符串、Record/Map/Set、method dispatch、IO、可变参数
33
-
34
- ### 验证
35
-
36
- - wasmtime compile 验证 WAT 合法
37
- - wasmtime run 验证 fibo(10)=89、factorial(10)=3628800、add-two(3.5,2.5)=6
38
- - cargo test 246/246 pass
39
- - cargo clippy -- -D warnings clean
40
- - yarn check-all pass
@@ -1,48 +0,0 @@
1
- # wasm-encoder 迁移:WAT 文本 → 二进制 .wasm
2
-
3
- ## 概要
4
-
5
- 将 WASM codegen 从手工拼接 WAT 文本字符串改为使用 `wasm-encoder` crate 直接生成二进制 `.wasm`,
6
- 同时将测试运行时从 wasmtime CLI 替换为 Node.js 内置的 `WebAssembly` API。
7
-
8
- ## 动机
9
-
10
- - wasmtime 是重量级依赖,CI 需要额外安装步骤,且跨版本 CLI 接口不稳定(v14/v25 breaking changes)
11
- - WAT 字符串拼接容易出错且难以调试
12
- - Node.js 自带 WebAssembly 运行时,零额外依赖
13
-
14
- ## 关键知识点
15
-
16
- ### wasm-encoder 用法
17
-
18
- - `wasm-encoder = "0.246.2"`,仅 1 个传递依赖 `leb128fmt`
19
- - TypeSection → FunctionSection → ExportSection → CodeSection → module.finish()
20
- - `F64Const` 接受 `Ieee64` 而非 `f64`,需 `Ieee64::from(val)` 包装
21
- - `Function::new(locals_vec)` + `instruction(&Instruction::...)` + `instruction(&Instruction::End)`
22
-
23
- ### WASM block depth 追踪
24
-
25
- - `br N` 中 N 是相对深度(0 = 当前块)
26
- - `if` 块会增加一层嵌套,所以在 `if` 内部 `br` 到外层 `loop` 需要 depth=1
27
- - 解决方案:`WasmGenCtx` 添加 `block_depth` 字段,`emit_if` 时 +1,`recur` 使用 `Br(ctx.block_depth)`
28
-
29
- ### 两阶段编译
30
-
31
- - 函数互调需要预知 fn_index,所以:
32
- 1. 第一遍:收集函数签名和索引映射 `HashMap<String, u32>`
33
- 2. 第二遍:编译函数体,失败的函数用 stub `[f64_const(0.0)]` 保持索引稳定
34
-
35
- ### 比较运算的 i32→f64 转换
36
-
37
- - WASM 比较指令(f64.lt/gt/eq)返回 i32
38
- - 用 `select(1.0, 0.0, cmp_result)` 转为 f64
39
- - `if` 条件用 `f64.ne(val, 0.0)` 转回 i32
40
-
41
- ## 修改文件
42
-
43
- - `src/codegen/emit_wasm.rs` — 完全重写
44
- - `scripts/test-wasm.mjs` — 新增 Node.js 测试运行器
45
- - `scripts/test-wasm.sh` — 简化为生成 + node 调用
46
- - `.github/workflows/test.yaml` — 移除 wasmtime 安装步骤
47
- - `Cargo.toml` / `Cargo.lock` — 添加 wasm-encoder
48
- - `docs/wasm-codegen.md` — 更新文档
@@ -1,61 +0,0 @@
1
- # WASM Data Structures: List, Map, Set + Optional Args + Raise
2
-
3
- ## Summary
4
-
5
- Comprehensive data structure support for WASM codegen: list (16 ops), map (9 ops), set (6 ops), plus `raise` and optional argument handling.
6
-
7
- ## Changes
8
-
9
- ### 1. Optional Args (`CalcitArgLabel::OptionalMark`)
10
- - `compile_fn`: Skip `OptionalMark` markers — they aren't parameters, just annotations. The actual Idx labels become WASM params.
11
- - Added `fn_arity` map alongside `fn_index` to track each function's WASM arity (counting only `Idx` labels).
12
- - At call sites (`Calcit::Import`, `Calcit::Symbol`), pad missing optional args with `f64.const 0` (nil) to match target arity.
13
- - **Key insight**: The Calcit preprocessor doesn't always fill nil for omitted optional args in the code tree; WASM codegen must handle the arity mismatch at the call site.
14
-
15
- ### 2. Raise
16
- - `CalcitProc::Raise` → evaluate and drop all args, emit `Instruction::Unreachable`.
17
-
18
- ### 3. Memory Layouts
19
- - **List**: `[count:f64] [elem0:f64] [elem1:f64] ...` — size `(1+count)*8`
20
- - **Map**: `[count:f64] [key0:f64] [val0:f64] [key1:f64] [val1:f64] ...` — size `(1+count*2)*8`
21
- - **Set**: Same as list — `[count:f64] [elem0:f64] ...`
22
-
23
- ### 4. Helper Functions
24
- - `emit_bump_alloc_dynamic(ctx, size_local, ptr_local)` — bump allocator with dynamic size
25
- - `emit_ptr_to_i32(ctx, expr)` — evaluate expression to i32 pointer in a local
26
- - `emit_load_count_i32(ctx, ptr)` — load count from first f64 slot as i32
27
- - `emit_addr_offset(ctx, base, offset)` — compute base+offset into new local
28
- - `emit_copy_f64_loop(ctx, dst, src, n)` — copy N f64 slots between addresses
29
- - `emit_ds_count(ctx, args)` — shared count accessor (list/map/set)
30
- - `emit_ds_empty(ctx, args)` — shared empty? check
31
- - `emit_alloc_with_count(ctx, count, total_slots)` — allocate and write count header
32
-
33
- ### 5. List Operations (16)
34
- - Constructor: `emit_list_new` — `[] elem0 elem1 ...`
35
- - Access: `emit_list_nth`, `emit_list_first`, `emit_list_rest`
36
- - Mutation: `emit_list_append`, `emit_list_prepend`, `emit_list_butlast`
37
- - Slicing: `emit_list_slice`, `emit_list_reverse`, `emit_list_concat`
38
- - Update: `emit_list_assoc`, `emit_list_dissoc`
39
- - Query: `emit_list_contains`, `emit_list_includes`
40
-
41
- ### 6. Map Operations (9)
42
- - Constructor: `emit_map_new` — `&{} key val ...`
43
- - Access: `emit_map_get_op` — linear key scan, return value or nil
44
- - Mutation: `emit_map_assoc` (scan for existing key, branch: update vs append), `emit_map_dissoc` (scan + copy-with-skip)
45
- - Query: `emit_map_contains`, `emit_map_includes`
46
- - Transform: `emit_map_to_pairs` — creates list of 2-elem lists (nested allocation in loop)
47
-
48
- ### 7. Set Operations (6)
49
- - Constructor: `emit_set_new` — `#{} elem ...`
50
- - Access: `emit_set_includes` (delegates to list_includes — same layout)
51
- - Mutation: `emit_set_include` (scan + conditional append), `emit_set_exclude` (scan + copy-with-skip)
52
-
53
- ## WASM Patterns Used
54
- - **Copy loop**: `block/loop/br_if/br` with i32 counter for bulk f64 element copying
55
- - **Scan loop**: Same pattern with `f64.eq` comparison for key/value lookup; `found_idx` local with -1 sentinel
56
- - **Conditional allocation**: `if/else` for map_assoc (new key vs update) and set_include (already present vs append)
57
- - **Select instruction**: For boolean returns (`contains?`, `empty?`) — `select(true_val, false_val, condition)`
58
-
59
- ## Test Results
60
- - 90 WASM checks (55 existing + 35 new) — all pass
61
- - 246 cargo tests — all pass
@@ -1,33 +0,0 @@
1
- # 2026-02-13 19:26 文档与测试补充(跟进)
2
-
3
- ## 背景
4
-
5
- 在完成 trait/macro 相关优化(P1/P2/P3)后,补做“是否需要补充测试与文档”的审计。
6
-
7
- ## 本次结论
8
-
9
- 需要补充,且已补最小必要范围:
10
-
11
- 1. 文档:
12
- - `guidebook/docs/features/macros.md`
13
- - 增加 `with-gensyms` 用法示例。
14
- - 增加 `macroexpand`/`macroexpand-1`/`macroexpand-all` 的展开链路说明(stderr)。
15
- - `guidebook/docs/features/traits.md`
16
- - 增加 `warn-dyn-method` 下的新增诊断说明。
17
- - 明确 `&trait-call` 按 impl 的 trait origin 匹配,而非仅按名称文本匹配。
18
-
19
- 2. 测试:
20
- - `src/calcit/calcit_trait.rs`
21
- - 新增 default identity 单测:
22
- - `def_ref` 相同 => trait 相等且 hash 一致;
23
- - 无 `def_ref` 时走函数元信息 fallback,并校验等价/不等价边界。
24
-
25
- ## 验证
26
-
27
- - `cargo test -q calcit_trait::tests` 通过。
28
- - `yarn check-all` 通过(本轮补丁后再跑)。
29
-
30
- ## 经验点
31
-
32
- - 文档应及时反映“诊断开关”边界(默认流程 vs `warn-dyn-method`)。
33
- - identity 规则变化必须配对 hash/eq 回归测试,避免后续 refactor 引入行为漂移。
@@ -1,20 +0,0 @@
1
- # Docs smoke cases and trait misuse error normalization
2
-
3
- ## Summary
4
-
5
- - Added executable docs smoke tests for key trait semantics.
6
- - Integrated smoke tests into main test entry.
7
- - Normalized high-frequency misuse messages with `Expected/Actual/Fix` guidance.
8
- - Stabilized cross-runtime smoke assertions so `yarn check-all` passes in both eval and js modes.
9
-
10
- ## Knowledge points
11
-
12
- - `assert-traits` first argument is enforced at preprocess as local-only.
13
- - `impl-traits` targets definition-level values (`struct`/`enum`), not instances.
14
- - Error string matching in JS runtime should avoid host-error-dependent formatting; keep strict message-content checks in eval mode.
15
-
16
- ## Validation
17
-
18
- - `cargo fmt`
19
- - `cargo run --bin cr -- calcit/test.cirru -1`
20
- - `yarn check-all` (exit code 0)
@@ -1,5 +0,0 @@
1
- # watch mode default-once update
2
-
3
- - Unified run mode behavior for `cr`, `cr js`, and `cr ir`: default to once.
4
- - Added explicit `-w/--watch` switches for top-level direct run and `ir` subcommand.
5
- - Updated watch-mode related docs in `Agents.md` and `docs/CalcitAgent.md`.
@@ -1,32 +0,0 @@
1
- # 2026-03-07 CalcitAgent.md 文档更新
2
-
3
- ## 修改内容
4
-
5
- ### 1. 新增 `--no-tips` 全局标志文档
6
-
7
- 在「主要运行命令」小节中,`cr js --check-only` 之后新增:
8
-
9
- ```
10
- - `cr --no-tips <subcommand> ...` - 隐藏所有编辑/查询命令输出的 "Tips:" 提示行(适合脚本/Agent 使用)
11
- - 示例:`cr --no-tips demos/calcit.cirru query def calcit.core/foldl`
12
- ```
13
-
14
- **背景**:`aa21b3a` 提交新增了 `--no-tips` 全局开关(`TIPS_SUPPRESSED: AtomicBool`,通过 `suppress_tips()` 设置),文档中缺少记录。
15
-
16
- ### 2. 新增 HOF 高阶函数回调类型检查说明
17
-
18
- 在「类型标注与检查 → 3. 支持的类型标签」之后,`约定:动态类型标注…` 注释的下方新增章节:
19
-
20
- **高阶函数(HOF)回调类型检查:**
21
- `foldl`、`sort`、`filter`、`find`、`find-index`、`filter-not`、`mapcat`、`group-by` 等内置 HOF 的回调参数已强制要求 `:fn` 类型,传入非函数值时预处理阶段会触发类型警告。附正/误示例。
22
-
23
- **背景**:`aa21b3a` 提交修复了以下两条路径的类型检查:
24
-
25
- - Cirru `defn` schema (`calcit-core.cirru`):`filter-not`/`find`/`find-index`/`foldl`/`foldl'`/`foldl-compare`/`mapcat`/`group-by`/`sort` 的回调参数由 `:dynamic` 改为 `:fn`(部分带泛型注解)
26
- - `ProcTypeSignature` (`proc_name.rs`):`Foldl`/`Sort`/`FoldlShortcut`/`FoldrShortcut` 的回调参数 `dynamic` → `some_fn()`/`optional_fn()`
27
-
28
- ## 知识点
29
-
30
- - **文档中不需要描述 `ProTypeSignature` 实现细节**,面向 Agent 只需说明行为:哪些 HOF 要求 `:fn` 参数。
31
- - **`--no-tips` 定位**:全局开关,放在 subcommand 前;所有 `Tips::print()` 调用均受其控制。
32
- - CalcitAgent.md 未发现旧 `-s/--stdin` 残留,无需清理。
@@ -1,5 +0,0 @@
1
- # add test-fail script
2
-
3
- - 在 `package.json` 中新增 `yarn test-fail`,用于日常单独执行 schema/type-fail 相关测试。
4
- - 该命令当前映射到 `cargo test -q --bin cr type_fail_`,覆盖 `src/bin/cr.rs` 中新增的 fixture 测试。
5
- - 更新 `calcit/type-fail/README.md`,补充 `yarn test-fail` 的使用说明。
@@ -1,8 +0,0 @@
1
- # split type-fail tests into separate file
2
-
3
- - 将 `src/bin/cr.rs` 中与 `type-fail` fixture 相关的 helper 和测试拆分到独立文件 `src/bin/cr_type_fail_tests.rs`。
4
- - 在 `src/bin/cr.rs` 顶部通过 `#[cfg(test)] mod cr_type_fail_tests;` 挂载测试模块。
5
- - 保留 `cr.rs` 中的通用 schema/type 覆盖测试,减少主文件体积。
6
- - 验证通过:
7
- - `cargo test -q --bin cr`
8
- - `yarn test-fail`
@@ -1,13 +0,0 @@
1
- # Profiling tools reorganization
2
-
3
- ## Summary
4
-
5
- - Moved profiling scripts from `scripts/` into dedicated `profiling/` directory.
6
- - Added `profiling/README.md` with end-to-end usage for xctrace and samply workflows.
7
- - Removed obsolete `scripts/profiling.sh` flamegraph helper script.
8
-
9
- ## Knowledge notes
10
-
11
- - Keep profiling tooling isolated under `profiling/` to reduce script namespace clutter.
12
- - `samply` profiling should run against built `target/*/cr` binaries to avoid sampling `rustc` compile threads.
13
- - Preserve `.tmp-profiles/` as transient output directory for trace artifacts.
@@ -1,87 +0,0 @@
1
- # 2026-03-17 下午至晚间改动总结(1739-2031)
2
-
3
- ## 总览
4
-
5
- - 时间段:`2026-0317-1739` 至 `2026-0317-2031`
6
- - 主要改动:测试减法、program/preprocess 架构减法、类型注解热路径优化、samply 验证、计划文档同步
7
-
8
- ## 关键变更(按时间顺序)
9
-
10
- ### 1) 测试减法(1739 / 1745)
11
-
12
- - 清理 `src/program/tests.rs` 中 helper/重复语义测试:
13
- - `runtime_snapshot_fallback_only_allows_runtime_only_defs`
14
- - `preprocess_ns_def_accepts_compiled_only_value_without_source_lookup`
15
- - 保留行为级回归用例,继续覆盖 snapshot/runtime-only 与 compiled-only 消费边界。
16
-
17
- ### 2) preprocess 推断逻辑去重(1751)
18
-
19
- - 文件:`src/runner/preprocess.rs`
20
- - 抽取 `infer_return_type_from_compiled_callable(...)`,统一 `Import`/`Symbol` 分支的 compiled callable 返回类型推断。
21
- - 保留 `Symbol` 分支对源码 tag 的回退解析行为。
22
-
23
- ### 3) program snapshot helper 内联(1753)
24
-
25
- - 文件:`src/program.rs`
26
- - 删除并内联单次用途 helper:
27
- - `collect_referenced_compiled_def_ids(...)`
28
- - `should_use_runtime_snapshot_fallback(...)`
29
- - 逻辑并入 `collect_snapshot_fill_tasks(...)` 与 `build_snapshot_fill_compiled_def(...)`。
30
-
31
- ### 4) 文档刷新 + 首轮热路径减法(1812)
32
-
33
- - 文件:`drafts/runtime-boundary-refactor-plan.md`
34
- - 修正过时描述:`run_program_with_docs` 现状与 preprocess 返回值关系。
35
- - 将阶段状态与 `samply` 观察、下一步优先级对齐。
36
- - 文件:`src/runner/preprocess.rs`
37
- - 去除 `drop_left` 中间列表分配。
38
- - `resolve_generic_return_type` 改为接收迭代器,调用处直接 `iter().skip(1)`。
39
-
40
- ### 5) materialize executable fast path(2012)
41
-
42
- - 文件:`src/program.rs`
43
- - `materialize_compiled_executable_payload(...)`:
44
- - `Proc | Syntax` 直接返回 `preprocessed_code`。
45
- - `Fn | Macro` 继续 `evaluate_expr` materialize。
46
- - `LazyValue | Value` 继续保持不可执行语义。
47
- - 删除无调用 helper:`with_compiled_executable_payload(...)`。
48
-
49
- ### 6) type-annotation 单次扫描收敛(2023)
50
-
51
- - 文件:`src/calcit/type_annotation.rs`
52
- - 在 `parse_fn_annotation_from_schema_form` 中引入 `collect_fn_schema_fields`,由多次 key 扫描改为一次遍历收集。
53
- - 删除无用 helper:`schema_has_any_field`。
54
-
55
- ### 7) schema key 热路径进一步减法(2031)
56
-
57
- - 文件:`src/calcit/type_annotation.rs`
58
- - 新增单 key 快路径:
59
- - `schema_key_matches(...)`
60
- - `extract_schema_value_single(...)`
61
- - 将常见单 key 查询点改为快路径:
62
- - `extract_return_type_from_hint_form`
63
- - `extract_generics_from_hint_form`
64
- - `extract_arg_types_from_hint_form`
65
- - 清理过渡遗留 helper:
66
- - `schema_key_matches_any(...)`
67
- - `extract_schema_value(...)`
68
-
69
- ## 验证汇总
70
-
71
- - 多轮定向测试均通过:
72
- - `cargo test -q program::tests`
73
- - `cargo test -q runner::preprocess::tests`
74
- - `cargo test -q calcit::type_annotation::tests`
75
- - 全量 Rust 测试持续通过:`cargo test -q`(会话末保持全绿)
76
- - 语义门禁持续通过:`yarn check-all`
77
-
78
- ## profiling 结论汇总
79
-
80
- - 使用既有流程:`profiling/samply-once.sh` + `profiling/samply-summary.py`
81
- - 在 materialize 目标链路过滤中,样本权重由 14 降至 7(单轮观测,方向符合预期)。
82
- - 在 schema-key 相关过滤中,基线 `fibo-release-iter5-20260317.samply` 为 21,本轮新采样 `fibo-release-20260317-203129.samply` 为 5,方向上显著下降。
83
-
84
- ## 本轮经验
85
-
86
- - 以“删 helper/删重复分支/删中间分配”为主线做减法,优先保证行为级测试覆盖。
87
- - 每次改动后固定执行“定向测试 → 全量 Rust → `yarn check-all`”可有效阻断语义回退。
@@ -1,26 +0,0 @@
1
- ## Summary
2
-
3
- This commit finalizes two CLI workflow improvements:
4
-
5
- 1. **Tips policy refactor**
6
- - Added `--tips-level` support (`minimal|full|none`) as a unified switch.
7
- - Kept `--tips` as a shortcut for full tips output.
8
- - Updated handlers so tips rendering is centralized and priority-aware.
9
- - Updated docs to align with the new default behavior (minimal, high-priority-first hints).
10
-
11
- 2. **`cr edit def --overwrite` metadata safety**
12
- - Fixed overwrite behavior to preserve existing definition metadata (`doc`, `examples`, `schema`).
13
- - Overwrite now updates only the `code` field when the definition already exists.
14
- - This avoids accidental schema loss during whole-definition rewrites.
15
-
16
- ## Files touched (high level)
17
-
18
- - CLI args and command wiring for tips level handling.
19
- - Query/tree/tips handler integration and output behavior updates.
20
- - `edit` handler overwrite logic for metadata-preserving updates.
21
- - Agent docs and advanced workflow docs reflecting the new tips model.
22
-
23
- ## Validation notes
24
-
25
- - Rust formatting/lint/tests were run during implementation iterations.
26
- - Manual end-to-end verification confirmed schema is retained after `--overwrite`.