parsanol 1.5.22 → 1.5.24

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/README.md CHANGED
@@ -128,10 +128,11 @@ accepts only integer budgets in `1..8192`. Existing methods retain their default
128
128
  budget; rule-reference and shape limits are independent. Both Node and browser
129
129
  entries expose this method. The budget is the enforcement ceiling, not a depth
130
130
  guarantee: recursion past the host stack surfaces as a host `RangeError` before
131
- the budget is reached (engine frames grew across releases, so the achievable
132
- depth is engine- and host-specific). A stack-exhausted call can leave the
133
- artifact's ownership guard stuck — it still parses, but `free()` may throw;
134
- drop the whole runtime in that case instead.
131
+ the budget is reached. Engine 1.5.22's frame diet roughly doubled the
132
+ achievable depth on the shipped wasm (depth 400 recurses in the standard
133
+ harness); the bound remains engine- and host-specific. A stack-exhausted call
134
+ can leave the artifact's ownership guard stuck — it still parses, but `free()`
135
+ may throw; drop the whole runtime in that case instead.
135
136
 
136
137
  Binding shape JSON has a separate 512-container budget. `applyBindings` and
137
138
  `applyBindingsArtifact` throw `ShapeDepthLimitExceeded` (`category: "shape_depth_limit"`,
@@ -58,6 +58,7 @@ export declare class PargRuntimeCore {
58
58
  readonly renderSpec: Record<string, RenderSegment[]>;
59
59
  readonly entry: string;
60
60
  readonly defaultEntry: string | null;
61
+ private disposed;
61
62
  /** parsanol-ts#5 provenance: SHA-256 of the .parg source text and the
62
63
  * compiler version. Null for artifacts compiled before these fields
63
64
  * existed (unverifiable, not stale). */
@@ -90,6 +91,12 @@ export declare class PargRuntimeCore {
90
91
  private rebind;
91
92
  /** Parse with the native wasm engine; returns the parsanol-shape tree. */
92
93
  parseShape(input: string): unknown;
94
+ /** Release the native artifact, tolerating a stranded ownership guard.
95
+ * A host-stack-exhausted parse can leave the wasm-bindgen borrow flag
96
+ * set (the trap skips the Rust drop), after which the generated
97
+ * `free()` throws; the runtime is still disposable — the wasm object
98
+ * is left to the host GC. Safe to call twice. */
99
+ dispose(): void;
93
100
  /** Explicit historical memo/causal-diagnostic policy; old APIs remain strict.
94
101
  * This is a parse result, not a best-effort recovery capture envelope. */
95
102
  parseShapeWithCompatibility(input: string, compatibility: ParsingCompatibility): CompatibilityEnvelope;
@@ -70,6 +70,7 @@ export class PargRuntimeCore {
70
70
  renderSpec;
71
71
  entry;
72
72
  defaultEntry;
73
+ disposed = false;
73
74
  /** parsanol-ts#5 provenance: SHA-256 of the .parg source text and the
74
75
  * compiler version. Null for artifacts compiled before these fields
75
76
  * existed (unverifiable, not stale). */
@@ -159,6 +160,20 @@ export class PargRuntimeCore {
159
160
  return rethrowNative(error);
160
161
  }
161
162
  }
163
+ /** Release the native artifact, tolerating a stranded ownership guard.
164
+ * A host-stack-exhausted parse can leave the wasm-bindgen borrow flag
165
+ * set (the trap skips the Rust drop), after which the generated
166
+ * `free()` throws; the runtime is still disposable — the wasm object
167
+ * is left to the host GC. Safe to call twice. */
168
+ dispose() {
169
+ if (this.disposed)
170
+ return;
171
+ this.disposed = true;
172
+ try {
173
+ this.artifact.free();
174
+ }
175
+ catch { /* the guard stayed set; GC reclaims */ }
176
+ }
162
177
  /** Explicit historical memo/causal-diagnostic policy; old APIs remain strict.
163
178
  * This is a parse result, not a best-effort recovery capture envelope. */
164
179
  parseShapeWithCompatibility(input, compatibility) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parsanol",
3
- "version": "1.5.22",
3
+ "version": "1.5.24",
4
4
  "description": "PARG artifact runtime for TypeScript \u2014 checksum-verified artifact load, wasm parse, bindings, schema-driven materialization",
5
5
  "type": "module",
6
6
  "main": "dist/runtime.js",
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "repository": "https://github.com/parsanol/parsanol-rs",
3
3
  "upstream_base": "0985ab5a647a87f347da51529ea4ee47adbf9324",
4
- "source_commit": "36d864dad0a03705c1d49e1db24691c5b270d7d3",
5
- "built_source_commit": "36d864dad0a03705c1d49e1db24691c5b270d7d3",
4
+ "source_commit": "b6696e81b11a962edd7e409e5a0a4a4d75aa7376",
5
+ "built_source_commit": "b6696e81b11a962edd7e409e5a0a4a4d75aa7376",
6
6
  "source_tree": "140ed1ded3bbda04174357867fb8cbea94dfec3f",
7
7
  "built_source_tree_equal": true,
8
- "crate_version": "1.5.21",
8
+ "crate_version": "1.5.23",
9
9
  "unreleased_candidate": false,
10
10
  "target": "nodejs",
11
11
  "profile": "release",
@@ -17,12 +17,12 @@
17
17
  "wasm_vm_atom_calls": 1024
18
18
  },
19
19
  "lockfile": "scripts/wasm-build/Cargo.lock",
20
- "lockfile_sha256": "8482f06b3b84ca523c98d5114a55beca2c393fb5b69638d29e210f926fe8fff0",
20
+ "lockfile_sha256": "79fcfdeca03cae64eaa3341be461a89a10074e799359fbfa0675d149e728c275",
21
21
  "files": {
22
- "parsanol_bg.wasm": "b5b44bd197b5cf154f7d8b90fec1b45fa0de6b594885bef91fafbfd66a869160",
22
+ "parsanol_bg.wasm": "df46830f1cc34a6158f6da102276a8b1844f846d785529da024a2894dc1e97cf",
23
23
  "parsanol.d.ts": "6ab38f3e1b965e02ed5f5c2c325a9c053e01a5ebab81d7edc47bae310d5af7c9",
24
24
  "LICENSE": "47f4778bc0bfbeb3614d173dd1ec09ddd8cab994039193e2d3de2edcd7886c7e",
25
- "parsanol.cjs": "1bad1744a822d3ecfd94f98b54eb04d5af91a019ddc1c357527c4ed906b6f81f",
25
+ "parsanol.cjs": "3d648a22e5490babba584ea069ea3dfc72f853358494daedacaa16a12e145eba",
26
26
  "parsanol_bg.wasm.d.ts": "628aeab600cac0fffb121c2d8d9133376e04cf13726e8d366ca4687c4a22aad7"
27
27
  },
28
28
  "shape_json_max_depth": 512
@@ -603,7 +603,7 @@ function __wbg_get_imports() {
603
603
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
604
604
  }
605
605
  },
606
- __wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
606
+ __wbg_getRandomValues_8b6f1f663e6f188d: function() { return handleError(function (arg0, arg1) {
607
607
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
608
608
  }, arguments); },
609
609
  __wbg_new_37eb45aaf5eeb820: function() {
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "package": "@parsanol/wasm",
3
3
  "version": "1.5.4",
4
- "crate_version": "1.5.21",
4
+ "crate_version": "1.5.23",
5
5
  "target": "web",
6
6
  "repository": "https://github.com/parsanol/parsanol-rs",
7
7
  "tarball": "https://registry.npmjs.org/@parsanol/wasm/-/wasm-1.5.4.tgz",
8
8
  "integrity": "sha512-oeYj52TYg6DomXRIP4iyY5Yj3NwdljcMUok/LQlozO4OlMqyYfvrReaihf2ox9oqqk5aLi0UcQrEYuEfOFRtmw==",
9
9
  "tarball_sha256": "6f9ea6f9277776f9ac96e7423df54693aa5dcce8cf1c7abef85b39fa724b3b3c",
10
10
  "files": {
11
- "parsanol_bg.wasm": "b5b44bd197b5cf154f7d8b90fec1b45fa0de6b594885bef91fafbfd66a869160",
11
+ "parsanol_bg.wasm": "df46830f1cc34a6158f6da102276a8b1844f846d785529da024a2894dc1e97cf",
12
12
  "parsanol.d.ts": "f4ffbf833368dffe1ecb9c611e7f172920ef383d26e6de23daee151de9b3eabb",
13
13
  "LICENSE": "47f4778bc0bfbeb3614d173dd1ec09ddd8cab994039193e2d3de2edcd7886c7e",
14
- "parsanol.js": "7c500cc0b826a6d4d1658c244633de772cd74d6dea5a49ae3fc5f0b618a97a03",
14
+ "parsanol.js": "32f1dec81b386a00db016bea5816a7de8bc7f1ae9fe0f48c59570311cf931e61",
15
15
  "parsanol_bg.wasm.d.ts": "628aeab600cac0fffb121c2d8d9133376e04cf13726e8d366ca4687c4a22aad7",
16
16
  "README.md": "577c2d75ac98c331379a50698624b68c773eb4603648108f80f4399fde33d339"
17
17
  },
18
- "source_commit": "36d864dad0a03705c1d49e1db24691c5b270d7d3",
19
- "lockfile_sha256": "8482f06b3b84ca523c98d5114a55beca2c393fb5b69638d29e210f926fe8fff0",
20
- "built_source_commit": "36d864dad0a03705c1d49e1db24691c5b270d7d3",
18
+ "source_commit": "b6696e81b11a962edd7e409e5a0a4a4d75aa7376",
19
+ "lockfile_sha256": "79fcfdeca03cae64eaa3341be461a89a10074e799359fbfa0675d149e728c275",
20
+ "built_source_commit": "b6696e81b11a962edd7e409e5a0a4a4d75aa7376",
21
21
  "built_source_tree_equal": true,
22
22
  "upstream_base": "0985ab5a647a87f347da51529ea4ee47adbf9324",
23
23
  "unreleased_candidate": false
@@ -599,7 +599,7 @@ function __wbg_get_imports() {
599
599
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
600
600
  }
601
601
  },
602
- __wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
602
+ __wbg_getRandomValues_8b6f1f663e6f188d: function() { return handleError(function (arg0, arg1) {
603
603
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
604
604
  }, arguments); },
605
605
  __wbg_new_37eb45aaf5eeb820: function() {