@calcit/procs 0.13.45 → 0.13.46

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.
Binary file
@@ -0,0 +1,9 @@
1
+ # Finish bundled core macro contracts
2
+
3
+ - Audited all 86 `defmacro` entries bundled in `calcit.core`, `calcit.internal`, and `calcit.test`, rather than relying only on macros reached by `calcit/test.cirru`.
4
+ - Migrated the remaining 21 legacy schemas, including aliases, Option/Result binding macros, anonymous enums, JS objects, logging helpers, deprecated compatibility macros, and open collection lookup helpers.
5
+ - Kept broad collection payloads explicitly `Dynamic` where list/string/enum/open-data behavior cannot yet be represented safely by one static contract; used concrete `String`, `Enum`, `JsObject`, `Option`, `Result`, `Nil`, and generic identity contracts where the semantics support them.
6
+ - Added a snapshot inventory test that rejects any bundled `defmacro` using a legacy whole-Dynamic schema and records the audited count.
7
+ - Added an exact `js-object` round-trip assertion for its `SyntaxList` input, `JsObject` expansion, and `:js-ffi` backend feature so schema indentation cannot silently drop the feature metadata.
8
+ - Confirmed the existing core corpus remains at 2,393 pure/cache-eligible expansions plus 39 declared-capability expansions, with zero legacy expansions. The migration itself does not implement caching, so it improves diagnostics and cache safety prerequisites without claiming a present speedup.
9
+ - Compared 12 alternating release `--check-only` runs on Respo against the installed 0.13.45 binary: both warm medians were 0.12s. The release binary grew from 9,586,224 to 9,586,256 bytes (+32 bytes), so this final schema pass shows neither a visible speed gain nor a material regression.
@@ -0,0 +1,7 @@
1
+ # Result-returning parsing methods
2
+
3
+ - Added `.parse-cirru`, `.parse-cirru-list`, `.parse-cirru-edn`, and `.parse-json` to the core String method bag. Their function-form compatibility entry points are `try-parse-*`.
4
+ - Recoverable parse failures now return nominal `Result` values instead of requiring user code to catch exceptions or interpret nil. CirruQuote/List successes retain their known outer shape; open EDN/JSON payloads deliberately remain Dynamic.
5
+ - Moved detailed Cirru parser diagnostics into `CalcitErr.msg` and removed unconditional stderr printing, so a caught failure retains line/column/nearby-input context.
6
+ - Added definition-attached native tests, native/JS examples, and EDN documentation. Full Calcit gates and latest Respo/Recollect native, JS, docs, and WASM regressions passed after refreshing locked modules and toolchains.
7
+ - A separate narrow typed Macro IR experiment reduced the measured Respo macro-evaluator phase by about 12% but did not produce a stable end-to-end check improvement; it was not landed and the evidence is recorded on issue #436.
@@ -0,0 +1,5 @@
1
+ # Cross-backend parser failure examples
2
+
3
+ - Added a malformed-input example to each Result-returning String parser method.
4
+ - Native and JavaScript example runners now exercise both `:ok` and caught `:err` paths for Cirru, Cirru-list, Cirru-EDN, and JSON parsing.
5
+ - The JavaScript Cirru-EDN parser still emits its existing parser-library diagnostic while returning the caught Result; this PR preserves compatibility and verifies the Result semantics without claiming that host parser output is fully silent.
@@ -0,0 +1,4 @@
1
+ # Document parser backend boundary
2
+
3
+ - Clarified that Result-returning parser methods are currently native/JavaScript APIs.
4
+ - Distinguished a green whole-project WASM regression from support for parser definitions: WASM deliberately skips the unsupported parser/`try` definitions while validating all supported exports.
@@ -0,0 +1,30 @@
1
+ # Typed decode Result syntax
2
+
3
+ ## Summary
4
+
5
+ - Added `try-parse-cirru-edn-as text TypeExpr` and `try-decode-map-as value TypeExpr`.
6
+ - Decoder graphs are still derived during preprocessing. Invalid or open target types remain compile-time errors.
7
+ - Runtime parse and recursive shape failures now become nominal `Result<T,String>` errors with their structural path intact.
8
+ - Known non-String text inputs are rejected during preprocessing; Dynamic boundaries retain runtime validation.
9
+ - Native and generated JavaScript implement the same Result contract. WASM keeps the existing explicit typed-decoder unsupported boundary.
10
+
11
+ ## Backend consistency
12
+
13
+ Generated JavaScript `try` handlers previously received a host `Error` object even though native Calcit and the public guide specify a String message. JS codegen now normalizes `Error.message` (or stringifies a non-Error throw) before invoking the handler. The new Result syntaxes use the same normalization, so their `:err` payload is a String on both supported backends.
14
+
15
+ ## Type and performance assessment
16
+
17
+ The visible benefit is semantic and static: successful expressions infer `Result<T,String>` with the complete target type, malformed input is explicit in control flow, invalid target schemas fail before runtime, and known invalid text arguments are rejected during preprocessing. This slice does not claim a speedup. Decoder work is unchanged and the safe success path additionally constructs one Result value; callers should choose it for recoverable external input rather than throughput.
18
+
19
+ ## Validation
20
+
21
+ - `cargo fmt`
22
+ - `cargo clippy -- -D warnings`
23
+ - `cargo test` (520 library, 246 CLI, 24 caps, 4 WASM tests)
24
+ - `yarn compile`
25
+ - `yarn check-all` (native, generated JS, IR, WASM, 228 core tests)
26
+ - `yarn check-agent-interface` (17/17)
27
+ - Native and generated-JS attached examples for success, failure, exact type, and String error payload
28
+ - `docs/data/edn.md` 24/24 and `docs/features/error-handling.md` 9/9 markdown blocks
29
+ - Latest Respo main: 27/27 tests and 111/111 documentation blocks
30
+ - Latest Recollect main: 9/9 native tests, generated JS, and required WASM checks
@@ -0,0 +1,17 @@
1
+ # Conservative pure macro expansion cache
2
+
3
+ - Added a watch-mode raw expansion cache for strict macros with no declared
4
+ compile-time capabilities. Once-mode builds bypass it to avoid cold-build
5
+ overhead.
6
+ - Keyed entries by stable macro call site, macro runtime identity, phase-aware
7
+ signature, and exact raw syntax including source locations. Macro/helper
8
+ reloads recreate the macro identity; signature and input changes have separate
9
+ invalidation reasons in `--macro-metrics`.
10
+ - Preserved hygiene by recording the per-definition gensym position and only
11
+ reusing generated-symbol expansions when the sequence still matches. Cache
12
+ hits advance the counter by the recorded delta.
13
+ - Cached only successfully validated raw expansions. Emitted code is still
14
+ preprocessed and type-checked on every hit, so this slice cannot reuse stale
15
+ type/import results and does not claim the higher post-preprocess speedup yet.
16
+ - Kept legacy and capability-bearing macros on the general evaluator with
17
+ explicit bypass reasons.
@@ -0,0 +1,20 @@
1
+ # Upgrade ternary-tree to 0.0.21
2
+
3
+ - Upgraded `im_ternary_tree` from 0.0.20 to 0.0.21. The upstream release
4
+ removes redundant cloning in owned vector construction and finger-tree
5
+ updates, and reports substantially faster full iteration and search
6
+ microbenchmarks.
7
+ - Compared optimized Calcit binaries built from the same source snapshot, with
8
+ only the ternary-tree version changed. Runs alternated old/new order on Apple
9
+ arm64 to reduce thermal and background-load drift.
10
+ - Over 30 paired process runs, `--check-only calcit/test.cirru` improved by
11
+ about 0.83% at the median and the native literal-path benchmark improved by
12
+ about 0.39%. Over 20 paired macro-metric runs, post-preprocessing improved by
13
+ about 1.22%, while macro evaluation remained effectively unchanged.
14
+ - Treat the small aggregate gains as evidence of no regression plus a modest
15
+ end-to-end benefit. Calcit parsing, type analysis, evaluation, and process
16
+ startup dominate these workloads, so the upstream collection microbenchmark
17
+ gains are not expected to transfer proportionally to whole-program timings.
18
+ - Revalidated Rust formatting, Clippy with warnings denied, the full Rust test
19
+ suite, self-hosted compilation, Agent CLI protocol checks, native/JS/IR/WASM
20
+ integration tests, and collection-path performance smoke tests.
@@ -0,0 +1,16 @@
1
+ # Preserve nested macro gensym positions on cache hits
2
+
3
+ - Fixed pure macro expansion caching so its replay delta contains only gensyms
4
+ emitted by the cached macro evaluator. The evaluator end position is captured
5
+ before recursively preprocessing the returned syntax tree.
6
+ - Excluded gensyms emitted by nested macros during post-processing from the
7
+ outer cache entry. Nested macros still run or replay their own gensym progress
8
+ when the cached outer syntax is preprocessed, preventing double advancement.
9
+ - Added a regression test that compares miss and hit paths for an outer macro
10
+ whose output invokes a gensym-producing inner macro, and verifies that the
11
+ following gensym position is identical.
12
+ - Kept the Calcit package at 0.13.45 in this functional PR. Package versions are
13
+ updated together in `Cargo.toml` and `package.json` by the separate release
14
+ commit after the feature PR merges.
15
+ - Validated formatting, Clippy with warnings denied, all 799 Rust tests, and the
16
+ full native/JS/IR/WASM integration suite through `yarn check-all`.
@@ -0,0 +1,11 @@
1
+ # Release 0.13.46
2
+
3
+ - Released the completed macro-contract, safe Result parsing/typed decode, and
4
+ pure macro expansion-cache work accumulated after 0.13.45.
5
+ - Included `im_ternary_tree` 0.0.21, which has a small measured end-to-end
6
+ improvement in Calcit check/preprocessing workloads without regressions.
7
+ - The macro cache remains a conservative watch-mode-only optimization for
8
+ strict macros with no compile-time capabilities. Its nested-macro gensym
9
+ replay is covered by a regression test.
10
+ - Kept Cargo and npm package versions in lockstep at 0.13.46 and refreshed the
11
+ workspace lockfile before tagging the main branch.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.13.45",
3
+ "version": "0.13.46",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^25.7.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.13.45",
3
+ "version": "0.13.46",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^25.7.0",