@calcit/procs 0.13.49 → 0.13.51
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.
- package/.yarn/install-state.gz +0 -0
- package/README.md +7 -9
- package/RFCs/05-12-program-diff-rfc.md +4 -4
- package/build.rs +7 -36
- package/editing-history/20260827-1225-retire-snapshot-configs.md +6 -0
- package/editing-history/202608270316-ffi-buffer-protocol-v1.md +6 -0
- package/editing-history/202608270326-ffi-buffer-review-followup.md +6 -0
- package/editing-history/202608270334-release-0.13.50.md +5 -0
- package/editing-history/202608270956-fs-path-file-effects.md +33 -0
- package/editing-history/202608271407-audit-legacy-macro-schemas.md +20 -0
- package/editing-history/202608271427-review-legacy-macro-inventory.md +19 -0
- package/editing-history/202608271444-release-0.13.51.md +6 -0
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Core design:
|
|
|
19
19
|
|
|
20
20
|
Current direction:
|
|
21
21
|
|
|
22
|
-
- `calcit.cirru` is the
|
|
22
|
+
- `calcit.cirru` is the canonical source snapshot; retired `compact.cirru` inputs receive migration guidance
|
|
23
23
|
- CLI-first development with `calcit` and `caps`, designed to work well with AI agents in terminal workflows
|
|
24
24
|
- Better CLI editing and validation for CI, docs lookup, module management, and incremental updates
|
|
25
25
|
|
|
@@ -62,18 +62,16 @@ calcit eval 'range 100'
|
|
|
62
62
|
calcit eval -- '-> 100 range (map $ \ * % %)'
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
Run with
|
|
65
|
+
Run with the canonical runtime snapshot `calcit.cirru`:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
calcit calcit.cirru # run once (default)
|
|
69
|
-
calcit
|
|
70
|
-
|
|
71
|
-
calcit # by default, it picks `calcit.cirru`, then falls back to `compact.cirru`
|
|
69
|
+
calcit # reads calcit.cirru from the current directory
|
|
72
70
|
|
|
73
71
|
calcit -w # watch mode (explicit flag required)
|
|
74
72
|
```
|
|
75
73
|
|
|
76
|
-
By default Calcit reads `:init-fn` and `:reload-fn` from `calcit.cirru`
|
|
74
|
+
By default Calcit reads `:init-fn` and `:reload-fn` from `calcit.cirru` `:entries.default`. You may also specify functions:
|
|
77
75
|
|
|
78
76
|
```bash
|
|
79
77
|
calcit --init-fn='app.main/main!' --reload-fn='app.main/reload!'
|
|
@@ -150,7 +148,7 @@ Use `caps add --dev <org/repo>@<ref>` and `caps remove --dev <org/repo>` to mana
|
|
|
150
148
|
|
|
151
149
|
`:calcit-version` helps with version checks and provides hints in [CI](https://github.com/calcit-lang/setup-calcit).
|
|
152
150
|
|
|
153
|
-
To load modules, use `:modules` configuration and the runtime snapshot file `calcit.cirru
|
|
151
|
+
To load modules, use `:modules` configuration and the runtime snapshot file `calcit.cirru`:
|
|
154
152
|
|
|
155
153
|
```cirru.no-check
|
|
156
154
|
:entries $ {}
|
|
@@ -161,7 +159,7 @@ To load modules, use `:modules` configuration and the runtime snapshot file `cal
|
|
|
161
159
|
Paths defined in `:modules` load from the snapshot directory's `.calcit/modules/`, e.g.
|
|
162
160
|
`.calcit/modules/memof/calcit.cirru`. Run `caps` to materialize or refresh that project-local view.
|
|
163
161
|
|
|
164
|
-
Modules ending with `/` are automatically suffixed with `calcit.cirru
|
|
162
|
+
Modules ending with `/` are automatically suffixed with `calcit.cirru`. A module containing only retired `compact.cirru` is rejected with migration guidance.
|
|
165
163
|
|
|
166
164
|
Inspect and verify the resolved graph with:
|
|
167
165
|
|
|
@@ -203,7 +201,7 @@ yarn check-all
|
|
|
203
201
|
```
|
|
204
202
|
|
|
205
203
|
- [Cirru Parser](https://github.com/Cirru/parser.rs) for indentation-based syntax parsing.
|
|
206
|
-
- [Cirru EDN](https://github.com/Cirru/cirru-edn.rs) for runtime snapshot
|
|
204
|
+
- [Cirru EDN](https://github.com/Cirru/cirru-edn.rs) for canonical runtime snapshot parsing (`calcit.cirru`).
|
|
207
205
|
- [Ternary Tree](https://github.com/calcit-lang/ternary-tree.rs) for immutable list data structure.
|
|
208
206
|
|
|
209
207
|
Other tools:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- `calcit analyze program-diff <GIT REF>`
|
|
13
13
|
|
|
14
|
-
该命令从 Git 中读取指定版本的完整运行时快照文件(默认沿用当前 `calcit`
|
|
14
|
+
该命令从 Git 中读取指定版本的完整运行时快照文件(默认沿用当前 `calcit` 的 canonical `calcit.cirru` 输入路径;退休的 `compact.cirru` 会被拒绝并提示迁移),确保**历史版本**与**当前工作区版本**都能被正确解析为 Calcit snapshot,然后做**结构化 diff**。
|
|
15
15
|
|
|
16
16
|
输出目标不是纯文本行 diff,而是面向程序结构的树形 diff:
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
当前针对运行时快照文件的版本对比主要依赖 Git 行 diff,但它有几个明显问题:
|
|
29
29
|
|
|
30
|
-
1. **对结构不友好**:`calcit.cirru
|
|
30
|
+
1. **对结构不友好**:`calcit.cirru` 是机器生成的 snapshot,行 diff 容易受格式、字段顺序和长表达式影响;
|
|
31
31
|
2. **对表达式内部变化不友好**:definition 代码改动往往是局部子树变化,行 diff 很难快速看出 AST 层面的增删改;
|
|
32
32
|
3. **对 LLM / CLI 阅读不友好**:调用 `git diff` 后很难一眼区分“只是某个 def 变了”还是“整个 namespace 被搬动了”;
|
|
33
33
|
4. **缺少 parse guard**:历史版本文件如果本身损坏,应该先明确报解析失败,而不是直接进入错误 diff。
|
|
@@ -43,7 +43,7 @@ calcit analyze program-diff <GIT REF>
|
|
|
43
43
|
语义:
|
|
44
44
|
|
|
45
45
|
- `<GIT REF>` 可以是 `HEAD~1`、tag、branch、commit SHA 等;
|
|
46
|
-
- 当前侧使用 `calcit`
|
|
46
|
+
- 当前侧使用 `calcit` 输入路径(默认是 canonical `calcit.cirru`;退休的 `compact.cirru` 不参与 diff);
|
|
47
47
|
- 历史侧使用 `git show <ref>:<repo-relative-input-path>` 读取文件内容;
|
|
48
48
|
- 两边都必须先经过:
|
|
49
49
|
1. `cirru_edn::parse`
|
|
@@ -177,7 +177,7 @@ list 内部子节点对比采用“带替换代价的序列对齐”策略:
|
|
|
177
177
|
|
|
178
178
|
## 7. 预期收益
|
|
179
179
|
|
|
180
|
-
- 更适合 review `calcit.cirru
|
|
180
|
+
- 更适合 review canonical `calcit.cirru` 的语义变化;
|
|
181
181
|
- 更容易理解大型 definition 的局部 AST 改动;
|
|
182
182
|
- 对 agent/LLM 更友好,能直接拿到层级化变化;
|
|
183
183
|
- 为后续抽象成 Cirru diff 模块提供实现样本。
|
package/build.rs
CHANGED
|
@@ -64,20 +64,6 @@ pub struct SnapshotEntry {
|
|
|
64
64
|
pub target: Option<String>,
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
68
|
-
pub struct LegacySnapshotConfigs {
|
|
69
|
-
#[serde(rename = "init-fn", deserialize_with = "deserialize_ns_def")]
|
|
70
|
-
pub init_fn: String,
|
|
71
|
-
#[serde(rename = "reload-fn", deserialize_with = "deserialize_ns_def")]
|
|
72
|
-
pub reload_fn: String,
|
|
73
|
-
#[serde(default)]
|
|
74
|
-
pub modules: Vec<String>,
|
|
75
|
-
#[serde(default)]
|
|
76
|
-
pub version: String,
|
|
77
|
-
#[serde(default, rename = "type-slots")]
|
|
78
|
-
pub type_slots: HashMap<String, String>,
|
|
79
|
-
}
|
|
80
|
-
|
|
81
67
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
82
68
|
pub struct CodeEntry {
|
|
83
69
|
pub doc: String,
|
|
@@ -613,30 +599,15 @@ fn main() {
|
|
|
613
599
|
|
|
614
600
|
let files = parse_files(data.get_or_nil("files")).unwrap_or_else(|e| panic!("failed to parse calcit-core `:files`: {e}"));
|
|
615
601
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
let mut entries = parse_entries(data.get_or_nil("entries")).unwrap_or_else(|e| panic!("failed to parse calcit-core `:entries`: {e}"));
|
|
623
|
-
if let Some(configs) = &legacy_configs {
|
|
624
|
-
entries.insert(
|
|
625
|
-
"default".to_owned(),
|
|
626
|
-
SnapshotEntry {
|
|
627
|
-
mode: SnapshotRunMode::Native,
|
|
628
|
-
init_fn: configs.init_fn.clone(),
|
|
629
|
-
reload_fn: configs.reload_fn.clone(),
|
|
630
|
-
description: String::new(),
|
|
631
|
-
modules: configs.modules.clone(),
|
|
632
|
-
type_slots: configs.type_slots.clone(),
|
|
633
|
-
feature_policy: HashMap::new(),
|
|
634
|
-
target: None,
|
|
635
|
-
},
|
|
636
|
-
);
|
|
602
|
+
if data.contains_key("configs") {
|
|
603
|
+
panic!("calcit-core uses retired top-level `:configs`; migrate it with Calcit 0.13.50 before building")
|
|
604
|
+
}
|
|
605
|
+
let entries = parse_entries(data.get_or_nil("entries")).unwrap_or_else(|e| panic!("failed to parse calcit-core `:entries`: {e}"));
|
|
606
|
+
if !entries.contains_key("default") {
|
|
607
|
+
panic!("calcit-core `:entries` must contain `:default`");
|
|
637
608
|
}
|
|
638
609
|
let version = match data.get_or_nil("version") {
|
|
639
|
-
Edn::Nil =>
|
|
610
|
+
Edn::Nil => String::new(),
|
|
640
611
|
value => from_edn(value).unwrap_or_else(|e| panic!("failed to parse calcit-core `:version`: {e}")),
|
|
641
612
|
};
|
|
642
613
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Retire legacy Snapshot config aliases
|
|
2
|
+
|
|
3
|
+
- Stop decoding top-level `:configs` at runtime and while embedding `calcit.core`; point legacy projects to Calcit 0.13.50 for the one-way `:entries.default` migration.
|
|
4
|
+
- Remove silent `calcit.cirru` to `compact.cirru` path aliasing across runtime, query, docs, and diff commands while retaining sibling detection for an actionable error.
|
|
5
|
+
- Remove the formatter advisory for a shape that current Calcit no longer loads, and align README, Agent guidance, and Snapshot docs with the released filename cutoff.
|
|
6
|
+
- Validate the strict loader against the latest `Respo/respo` and `calcit-lang/recollect` main branches: native checks/tests, Markdown examples, generated JavaScript tests, quality gates, and production Vite builds remain green.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Add the synchronous FFI byte-buffer protocol
|
|
2
|
+
|
|
3
|
+
- Added a versioned C ABI for synchronous FFI calls using owned UTF-8 Cirru EDN buffers.
|
|
4
|
+
- Made method migration incremental by preferring `<method>_calcit_ffi_v1` and retaining the build-ID-guarded Rust ABI as a fallback.
|
|
5
|
+
- Kept output ownership in the dylib through `calcit_ffi_buffer_free`, with host-side invariant and size checks before decoding.
|
|
6
|
+
- Added focused tests for protocol versioning, symbol derivation, and request encoding; callback migration remains a separate phase.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# FFI buffer protocol review follow-up
|
|
2
|
+
|
|
3
|
+
- Corrected the FFI documentation heading hierarchy.
|
|
4
|
+
- Made nonzero-status payloads obey the same strict UTF-8 contract as successful EDN responses.
|
|
5
|
+
- Added a focused regression test that rejects malformed error bytes rather than replacing them lossily.
|
|
6
|
+
- Kept the original 03:16 history timestamp because it records the actual Asia/Shanghai commit time.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Release 0.13.50
|
|
2
|
+
|
|
3
|
+
- Published synchronous C-safe FFI buffer protocol v1 merged in #477.
|
|
4
|
+
- Retained per-method fallback to the build-ID-guarded Rust ABI for incremental ecosystem migration.
|
|
5
|
+
- Kept Cargo and npm package versions synchronized and refreshed the workspace lockfile.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# FsPath file-effect boundary
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
- Removed `.read-file`, `.read-dir`, and `.write-file` from the built-in String method table.
|
|
6
|
+
- Added the nominal, UTF-8-backed `FsPath` type and the explicit `fs:path` constructor.
|
|
7
|
+
- Added `FsPath` methods `.read-text`, `.write-text`, `.read-dir`, `.walk-dir`, and `.to-string` through a nominal trait implementation.
|
|
8
|
+
- Kept `try-read-file`, `try-read-dir`, `try-write-file` and the raw raising primitives as String-path compatibility APIs.
|
|
9
|
+
|
|
10
|
+
## Design notes
|
|
11
|
+
|
|
12
|
+
- `path` remains available for generic AST, data, and query path concepts; the filesystem-specific type is named `FsPath`.
|
|
13
|
+
- Calcit uses one immutable path value rather than copying Rust's borrowed `Path` versus owned mutable `PathBuf` split.
|
|
14
|
+
- `fs:path` stores the original UTF-8 text without lexical normalization or filesystem access.
|
|
15
|
+
- `.read-dir` is non-recursive and `.walk-dir` is recursive, avoiding an `Option<Bool>` mode in the new public method API.
|
|
16
|
+
- Text operations are named `.read-text` and `.write-text` so future byte-oriented operations have an unambiguous place.
|
|
17
|
+
|
|
18
|
+
## Implementation lesson
|
|
19
|
+
|
|
20
|
+
Keep `defstruct FsPath` directly inside the public `FsPath` definition before `impl-traits`, matching the core `Result` pattern. Hiding the base struct in an intermediate `FsPath0` definition prevents required-field analysis from resolving `:value` through the nominal reference.
|
|
21
|
+
|
|
22
|
+
For an expression receiver, prefix method syntax such as `.read-text $ fs:path |file` is always explicit. The ergonomic suffix form should use a typed binding such as `source.read-text`; `(fs:path |file) .read-text` is not a general runtime rewrite for arbitrary expression receivers.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
- `cargo fmt --all`
|
|
27
|
+
- `cargo clippy --all-targets -- -D warnings`
|
|
28
|
+
- `cargo test`
|
|
29
|
+
- `yarn check-all`
|
|
30
|
+
- changed Markdown snippets via `calcit docs check-md`
|
|
31
|
+
- latest Respo main: 27/27 tests, 111/111 documentation blocks, JS codegen
|
|
32
|
+
- latest Recollect main: 9/9 native tests, generated-JS tests, production build, and required WASM checks
|
|
33
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Legacy macro schema inventory
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
- Added the stable `W_LEGACY_MACRO_SCHEMA` diagnostic to `analyze check-types`.
|
|
6
|
+
- Preserved whether a compatibility macro came from an old runtime `Fn` schema or a whole `Dynamic` schema.
|
|
7
|
+
- Added check-types JSON schema v2 fields for the aggregate count and per-definition source, legacy signature, Snapshot path, and migration guidance.
|
|
8
|
+
- Kept compatibility loading and execution unchanged; the analyzer does not infer phase-aware contracts.
|
|
9
|
+
|
|
10
|
+
## Release constraint
|
|
11
|
+
|
|
12
|
+
Release audits must use `check-types --deps` against resolved module artifacts. A dependency's main branch may already be strict while its published module still exposes legacy macro schemas. Migrate and release providers before setting consumer graphs to a zero-legacy target.
|
|
13
|
+
|
|
14
|
+
## Validation
|
|
15
|
+
|
|
16
|
+
- `cargo fmt --all`
|
|
17
|
+
- `cargo clippy --all-targets -- -D warnings`
|
|
18
|
+
- `cargo test`
|
|
19
|
+
- `yarn check-all`
|
|
20
|
+
- latest Respo and Recollect source plus Recollect's resolved published dependency graph
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Legacy macro inventory review follow-up
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
- Persisted the `Dynamic` legacy macro origin through canonical Snapshot serialization instead of reclassifying it as `Fn` after reload.
|
|
6
|
+
- Limited legacy macro parameter-shape validation to old `Fn` contracts; a whole-`Dynamic` schema carries no arity contract.
|
|
7
|
+
- Corrected the Agent guide to use the complete `data.summary.legacy_macro_schemas` JSON path.
|
|
8
|
+
|
|
9
|
+
## Compatibility
|
|
10
|
+
|
|
11
|
+
Old wrapped macro schemas omit `:legacy-origin` and continue to load as `Fn`. Only whole-`Dynamic` compatibility schemas write `:legacy-origin :dynamic`, so existing `Fn` serialization remains unchanged.
|
|
12
|
+
|
|
13
|
+
## Validation
|
|
14
|
+
|
|
15
|
+
- focused origin round-trip and Dynamic-parameter regression tests
|
|
16
|
+
- `cargo fmt --all -- --check`
|
|
17
|
+
- `cargo clippy --all-targets -- -D warnings`
|
|
18
|
+
- `cargo test -- --test-threads=1`
|
|
19
|
+
- `yarn check-all`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Release 0.13.51
|
|
2
|
+
|
|
3
|
+
- Added nominal `FsPath` values and explicit filesystem effect methods.
|
|
4
|
+
- Retired top-level `:configs` and the `compact.cirru` filename alias after the 0.13.50 migration window.
|
|
5
|
+
- Added dependency-aware legacy macro schema inventory and schema-v2 `check-types` diagnostics for the staged strict-macro rollout.
|
|
6
|
+
- Kept Cargo and npm package versions synchronized and refreshed the workspace lockfile.
|
package/lib/package.json
CHANGED