renkin 0.34.0 → 0.36.0

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
@@ -21,7 +21,7 @@
21
21
 
22
22
  ---
23
23
 
24
- **Keep your planner. Audit every route.** Audit retrosynthesis routes from AiZynthFinder, Syntheseus, or RENKIN — locally, reproducibly, and without sending molecular structures anywhere.
24
+ **Keep your planner. Audit every route.** Audit retrosynthesis routes from AiZynthFinder, Syntheseus, SynPlanner, or RENKIN — locally, reproducibly, and without sending molecular structures anywhere.
25
25
 
26
26
  [**Audit a route in your browser →**](https://kent-tokyo.github.io/renkin/playground/) · [**Python quick start ↓**](#audit-a-route) · [**Route planning engine ↓**](#quick-start)
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  ## What is RENKIN?
31
31
 
32
- RENKIN Bridge is a tool-neutral **route auditor**: it checks structural integrity, stock coverage, and declared-reaction forward-replay for routes from **AiZynthFinder**, **Syntheseus**, or RENKIN's own planner — the identical `pass`/`fail`/`partial` pipeline regardless of which tool produced the route, entirely local and reproducible (every audit records a verifiable [`audit_manifest`](https://kent-tokyo.github.io/renkin/guides/audit-reproducibility-contract/)), structures never leaving your machine unless you explicitly ask.
32
+ RENKIN Bridge is a tool-neutral **route auditor**: it checks structural integrity, stock coverage, and declared-reaction forward-replay for routes from **AiZynthFinder**, **Syntheseus**, **SynPlanner**, or RENKIN's own planner — the identical `pass`/`fail`/`partial` pipeline regardless of which tool produced the route, entirely local and reproducible (every audit records a verifiable [`audit_manifest`](https://kent-tokyo.github.io/renkin/guides/audit-reproducibility-contract/)), structures never leaving your machine unless you explicitly ask.
33
33
 
34
34
  RENKIN is also, in its own right, an open-source **retrosynthesis engine** for **computer-aided synthesis planning (CASP)** that automatically discovers chemical reaction routes from a target molecule back to cheap, commercially available starting materials.
35
35
 
@@ -85,9 +85,21 @@ report = json.loads(renkin.audit_route(route_json, format="syntheseus"))
85
85
  print(report["summary"])
86
86
  ```
87
87
 
88
+ **SynPlanner**
89
+
90
+ ```python
91
+ import json
92
+ import renkin
93
+
94
+ report = json.loads(
95
+ renkin.audit_route(open("routes.json").read(), format="synplanner")
96
+ )
97
+ print(report["summary"])
98
+ ```
99
+
88
100
  **In your browser** — no installation, no upload, no server: [**Try the Playground →**](https://kent-tokyo.github.io/renkin/playground/)
89
101
 
90
- Full walkthroughs with real output, end to end: [AiZynthFinder](https://kent-tokyo.github.io/renkin/guides/aizynthfinder-audit-demo/) · [Syntheseus](https://kent-tokyo.github.io/renkin/guides/syntheseus-audit-demo/).
102
+ Full walkthroughs with real output, end to end: [AiZynthFinder](https://kent-tokyo.github.io/renkin/guides/aizynthfinder-audit-demo/) · [Syntheseus](https://kent-tokyo.github.io/renkin/guides/syntheseus-audit-demo/) · [SynPlanner](https://kent-tokyo.github.io/renkin/guides/synplanner-audit-demo/).
91
103
 
92
104
  ---
93
105
 
@@ -393,7 +405,7 @@ for the full acceptance criteria and licensing split.
393
405
  | **Ring-context safety guard** | `--ring-context-policy conservative --ring-context-sidecar <path>` — opt-in match-level filter that rejects an extracted template's ring-opening/closing disconnection when its historical training data never observed that bond as ring-forming/-breaking; default `disabled` (unchanged legacy behavior) — see [Issue #72](https://github.com/kent-tokyo/renkin/issues/72) |
394
406
  | **LightGBM candidate reranker** | `--reranker-model`/`--reranker-freq-table` (CLI) or `reranker_model_path`/`reranker_freq_table_path` (Python) — opt-in, ordering-only re-ranking via a frozen LightGBM model; never changes which candidates are generated, only their order, and reproduces legacy ordering byte-for-byte when off. Paired 100-target route-search gate: `route_to_configured_stock` 16→20 (+4/-0). `python3 scripts/fetch_reranker_model.py` fetches the frozen model (SHA-256-verified, not bundled in any package — see [Roadmap](#roadmap)) |
395
407
  | **Coverage mode** (opt-in) | `--search-mode coverage --coverage-templates <path>` (CLI) or `search_mode="coverage"`, `coverage_templates_path=...` (Python) — if the default template set finds no route, automatically escalates to a larger, separately loaded template set, cooperatively cancellable via `--coverage-timeout-secs`. Standard-mode output is byte-for-byte unchanged when not used. `python3 scripts/fetch_coverage_templates.py` fetches the frozen 2,000-template Stage-2 set (SHA-256-verified, not bundled in any package, same reasoning as the reranker model — see [Roadmap](#roadmap)) |
396
- | **RENKIN Bridge / `audit-route`** | `renkin audit-route route.json [--format auto\|renkin\|aizynthfinder\|syntheseus] [--stock stock.smi] [--output human\|json]` — tool-neutral route audit: structural integrity, stock, and declared-reaction forward-replay validation, each reported independently as `pass`/`fail`/`not_evaluable`, rolled up into a route-level `pass`/`fail`/`partial` verdict. Reads RENKIN-native route JSON (v0.25.0), real AiZynthFinder route JSON — single-target and gzip-compressed batch output, verified against AiZynthFinder 4.3.2, 4.4.0, and 4.4.1 specifically, not claimed for every version (v0.26.0, version matrix widened v0.32.0) — and Syntheseus routes via the optional `renkin.syntheseus_exporter`'s `syntheseus-route-v1` interchange schema, since Syntheseus itself has no native route export (v0.30.0); `--format auto` detects the input shape and hard-errors rather than guessing on anything ambiguous. [AiZynthFinder walkthrough →](https://kent-tokyo.github.io/renkin/guides/aizynthfinder-audit-demo/) · [Syntheseus walkthrough →](https://kent-tokyo.github.io/renkin/guides/syntheseus-audit-demo/) |
408
+ | **RENKIN Bridge / `audit-route`** | `renkin audit-route route.json [--format auto\|renkin\|aizynthfinder\|syntheseus\|synplanner] [--stock stock.smi] [--output human\|json]` — tool-neutral route audit: structural integrity, stock, and declared-reaction forward-replay validation, each reported independently as `pass`/`fail`/`not_evaluable`, rolled up into a route-level `pass`/`fail`/`partial` verdict. Reads RENKIN-native route JSON (v0.25.0), real AiZynthFinder route JSON — single-target and gzip-compressed batch output, verified against AiZynthFinder 4.3.2, 4.4.0, and 4.4.1 specifically, not claimed for every version (v0.26.0, version matrix widened v0.32.0) — Syntheseus routes via the optional `renkin.syntheseus_exporter`'s `syntheseus-route-v1` interchange schema, since Syntheseus itself has no native route export (v0.30.0) — and real SynPlanner 1.6.0 `write_routes_json` exports directly, no exporter package needed (v0.34.0); `--format auto` detects the input shape and hard-errors rather than guessing on anything ambiguous. [AiZynthFinder walkthrough →](https://kent-tokyo.github.io/renkin/guides/aizynthfinder-audit-demo/) · [Syntheseus walkthrough →](https://kent-tokyo.github.io/renkin/guides/syntheseus-audit-demo/) · [SynPlanner walkthrough →](https://kent-tokyo.github.io/renkin/guides/synplanner-audit-demo/) |
397
409
  | **Route scoring** | `confidence`, `step_confidence`, `success_probability` (Retro-prob style), `convergency`, `atom_economy`, `route_cost` (`Σ BB cost + steps×0.5`, or actual prices via `--bb-prices`/`--stock`) per step/route — see caveat below the table |
398
410
  | **Step metadata provenance** | Each step reports `metadata_source`/`metadata_scope` so it's machine-readable whether `conditions`/`reaction_family` came from a rule-author default vs. something more grounded; absent (not fabricated) for extracted templates |
399
411
  | **Pareto multi-objective search** | `--format pareto` returns a Pareto front across `route_cost`/`success_probability`/`steps`; objectives configurable via `--objectives` |
@@ -551,7 +563,7 @@ The JSON output includes `avg_nodes_expanded`, `avg_confidence`, `avg_convergenc
551
563
  | `plan_with_constraints` | Constraint-DSL planning (element filters, step limits, confidence thresholds) |
552
564
  | `estimate_diversity` | Route diversity and coverage metrics |
553
565
 
554
- The server auto-detects `data/building_blocks.smi` and `data/templates_extracted_5000.smi` in the working directory. Falls back to the embedded `DEFAULT_BUILDING_BLOCKS` / `default_rules()` defaults if not found (152 unique building blocks per `ChemEnv::bb_count()`, 27 handcrafted rules — verified 2026-08-22, after `aryl_amine_retro`'s removal (issue #77) dropped the count from 28; a "509-BB / 20-rule" figure was previously documented here without verification).
566
+ The server auto-detects `data/building_blocks.smi` and `data/templates_extracted_5000.smi` in the working directory. Falls back to the embedded `DEFAULT_BUILDING_BLOCKS` / `default_rules()` defaults if not found (152 unique building blocks per `ChemEnv::bb_count()`, 21 handcrafted rules — verified 2026-08-29, after `heck_retro`'s removal (ring-fusion connectivity-collapse defect on internal alkenes fused to the same aromatic ring the leaving-group Br attaches to, confirmed by direct `apply_retro` reproduction on indene) dropped the count from 22, which itself followed `negishi_retro`'s and `grignard_addition_retro`'s removal (v0.36.0 rule-safety census: same ring-fused-atom-duplication defect as `aryl_amine_retro`/`buchwald_hartwig_retro`) dropping it from 24; a "509-BB / 20-rule" figure was previously documented here without verification).
555
567
 
556
568
  ```bash
557
569
  cargo build --release
@@ -590,7 +602,7 @@ Target SMILES
590
602
  ┌─────────────────────────┐
591
603
  │ chem_env.rs │ ← chematic wrapper
592
604
  │ - SMILES parse │ canonical-SMILES FxHashSet BB lookup (O(1))
593
- │ - 20 built-in + up to 50k via --templates │ fragment sanitization + ring-leak filter
605
+ │ - 22 built-in + up to 50k via --templates │ fragment sanitization + ring-leak filter
594
606
  │ - Building block check │ apply_retro memoization cache
595
607
  └────────────┬────────────┘
596
608
  │ par_iter (rayon / sequential on WASM)
@@ -669,6 +681,7 @@ see "Earlier milestones" below for older shipped work.
669
681
 
670
682
  ### Recently shipped
671
683
 
684
+ - [x] **SynPlanner Bridge** (`--format synplanner`, shipped v0.34.0) — *Keep SynPlanner. Audit its routes with RENKIN.* A fourth route adapter, and the first whose native export carries real, forward-replayable atom mapping: `renkin audit-route --format synplanner` (also auto-detected) reads real SynPlanner 1.6.0 `write_routes_json` exports directly, no exporter package needed. Confirmed against real SynPlanner output twice — hand-constructed reactions through SynPlanner's own exporter, and a real CPU-only MCTS-searched planning run through the real `synplan planning` CLI end to end — every one of 317 real reaction nodes across a 167-route real search carries a structurally valid atom map, and real routes reach a genuine `pass` verdict, not just `not_evaluable`. New 4-way (RENKIN-native/AiZynthFinder/Syntheseus/SynPlanner) structural and policy-verdict parity tests. The [browser playground](https://kent-tokyo.github.io/renkin/playground/)'s Audit tab gained SynPlanner as a fourth format option, with a one-click real-MCTS-output example. [5-minute walkthrough with real output →](https://kent-tokyo.github.io/renkin/guides/synplanner-audit-demo/)
672
685
  - [x] **Syntheseus Bridge** (`--format syntheseus`, shipped v0.30.0) — *Syntheseus has no route export. RENKIN built one — and audits it exactly like every other adapter.* A third route adapter alongside RENKIN-native and AiZynthFinder: the optional `renkin.syntheseus_exporter` (`pip install renkin[syntheseus]`) turns a real Syntheseus `SynthesisGraph` into the `syntheseus-route-v1` interchange schema, which `renkin audit-route --format syntheseus` (also auto-detected) consumes through the identical audit pipeline every adapter shares. Forward validation honestly reports `not_evaluable` for every real Syntheseus route today — `reaction_smiles` carries no atom mapping, never faked into a pass. The [browser playground](https://kent-tokyo.github.io/renkin/playground/)'s Audit tab gained Syntheseus as a third format option. [5-minute walkthrough with real output →](https://kent-tokyo.github.io/renkin/guides/syntheseus-audit-demo/)
673
686
  - [x] **Audit Policy Profiles** (`--policy informational|standard|strict`, shipped v0.29.0) — *One set of findings. Three ways to derive the verdict.* Audit the same route under `informational`, `standard`, or `strict` policy without ever hiding or changing the underlying findings — policy only changes how the overall pass/fail/partial verdict is derived from findings already collected, recorded in `audit_manifest.policy`. Consistent across every surface: `renkin audit-route --policy`, the Rust API, the first Python binding for route auditing (`renkin.audit_route()`), and a new WASM `audit_route_v2()` (the existing `audit_route()` stays as a `standard`-policy wrapper). The [browser playground](https://kent-tokyo.github.io/renkin/playground/)'s Audit tab gained a policy selector.
674
687
  - [x] **Audit Playground** (`[ Audit a Route ]` tab, shipped v0.28.0) — *Audit a route in your browser — the same pipeline, the same verdict, zero network calls.* The [browser playground](https://kent-tokyo.github.io/renkin/playground/) now audits a RENKIN or AiZynthFinder route export (single-route or Pandas batch) and an optional stock list entirely client-side, via a new `audit_route` WASM export that calls the identical report-building pipeline `renkin audit-route` uses — the same pass/fail/partial verdict either way, not a separately-maintained copy. Paste or upload, run off the main thread, download the JSON report.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "kent-tokyo <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "Ultra-fast retrosynthesis engine for computer-aided synthesis planning (CASP) — pure Rust, WASM-ready, Python bindings via PyO3",
8
- "version": "0.34.0",
8
+ "version": "0.36.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/renkin.d.ts CHANGED
@@ -84,6 +84,60 @@ export function find_routes(target: string, depth: number, max_routes: number, b
84
84
  */
85
85
  export function find_routes_v2(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string): string;
86
86
 
87
+ /**
88
+ * Same as [`find_routes_v2`], plus `spectator_bond_policy`
89
+ * (`docs/design/spectator-bond-fail-closed-gating-v0.md`): `"off"`
90
+ * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
91
+ * CLI's `--spectator-bond-policy` flag and the Python binding's
92
+ * `spectator_bond_policy` kwarg. `"gated"` can change which candidates
93
+ * (and therefore which `routes`) come back -- v1 scope only: rules with
94
+ * no `#` in their SMIRKS, others stay diagnostics-only regardless of this
95
+ * setting. A distinct function name rather than a 5th parameter on
96
+ * `find_routes_v2`, matching that function's own stated reasoning (a
97
+ * caller on an older build gets a real "no such export" `TypeError`
98
+ * instead of a silently-ignored argument). Findings/gated-out records
99
+ * themselves aren't surfaced in this output yet -- WASM has no
100
+ * `search_diagnostics`-equivalent block at all today, for any
101
+ * `CrowdOutDiagnostics` field, not just this one; only the policy control
102
+ * itself (and its effect on `routes`) is in scope here.
103
+ */
104
+ export function find_routes_v3(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string): string;
105
+
106
+ /**
107
+ * Same as [`find_routes_v3`], plus `beam_diversity_policy`/
108
+ * `beam_diversity_slots` (`docs/design/diversity-reserved-beam-v0.md`):
109
+ * `"off"` (default) | `"diagnostics_only"` | `"active"`, same vocabulary
110
+ * as the CLI's `--beam-diversity-policy` flag and the Python binding's
111
+ * `beam_diversity_policy` kwarg. `"active"` can change which candidates
112
+ * (and therefore which `routes`) come back, same caveat as
113
+ * `spectator_bond_policy`'s own `"gated"`. A distinct function name
114
+ * rather than extending `find_routes_v3`'s signature, matching that
115
+ * function's own stated reasoning. `beam_diversity_stats` isn't surfaced
116
+ * in this output either, for the same reason `spectator_bond`'s findings
117
+ * aren't -- WASM has no `search_diagnostics`-equivalent block at all
118
+ * today, for any `CrowdOutDiagnostics` field; only the policy control
119
+ * itself (and its effect on `routes`) is in scope here.
120
+ */
121
+ export function find_routes_v4(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string;
122
+
123
+ /**
124
+ * Same as [`find_routes_v4`], plus `element_accounting_policy`
125
+ * (`docs/design/candidate-time-element-accounting-gate-v0.md`): `"off"`
126
+ * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
127
+ * CLI's `--element-accounting-policy` flag and the Python binding's
128
+ * `element_accounting_policy` kwarg -- an independent axis from
129
+ * `spectator_bond_policy`, never folded together. `"gated"` can change
130
+ * which candidates (and therefore which `routes`) come back, same caveat
131
+ * as `spectator_bond_policy`'s own `"gated"`. A distinct function name
132
+ * rather than extending `find_routes_v4`'s signature, matching that
133
+ * function's own stated reasoning. `element_accounting_gated_out` isn't
134
+ * surfaced in this output either, for the same reason `spectator_bond`'s
135
+ * findings aren't -- WASM has no `search_diagnostics`-equivalent block at
136
+ * all today, for any `CrowdOutDiagnostics` field; only the policy control
137
+ * itself (and its effect on `routes`) is in scope here.
138
+ */
139
+ export function find_routes_v5(target: string, depth: number, max_routes: number, beam_width: number, avoid_elements: string, require_elements: string, spectator_bond_policy: string, element_accounting_policy: string, beam_diversity_policy: string, beam_diversity_slots: number): string;
140
+
87
141
  /**
88
142
  * Return the crate version string.
89
143
  */
@@ -98,6 +152,9 @@ export interface InitOutput {
98
152
  readonly capabilities: () => [number, number];
99
153
  readonly find_routes: (a: number, b: number, c: number, d: number, e: number) => [number, number];
100
154
  readonly find_routes_v2: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number];
155
+ readonly find_routes_v3: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
156
+ readonly find_routes_v4: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => [number, number];
157
+ readonly find_routes_v5: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => [number, number];
101
158
  readonly version: () => [number, number];
102
159
  readonly __wbindgen_externrefs: WebAssembly.Table;
103
160
  readonly __wbindgen_malloc: (a: number, b: number) => number;
package/renkin.js CHANGED
@@ -182,6 +182,152 @@ export function find_routes_v2(target, depth, max_routes, beam_width, avoid_elem
182
182
  }
183
183
  }
184
184
 
185
+ /**
186
+ * Same as [`find_routes_v2`], plus `spectator_bond_policy`
187
+ * (`docs/design/spectator-bond-fail-closed-gating-v0.md`): `"off"`
188
+ * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
189
+ * CLI's `--spectator-bond-policy` flag and the Python binding's
190
+ * `spectator_bond_policy` kwarg. `"gated"` can change which candidates
191
+ * (and therefore which `routes`) come back -- v1 scope only: rules with
192
+ * no `#` in their SMIRKS, others stay diagnostics-only regardless of this
193
+ * setting. A distinct function name rather than a 5th parameter on
194
+ * `find_routes_v2`, matching that function's own stated reasoning (a
195
+ * caller on an older build gets a real "no such export" `TypeError`
196
+ * instead of a silently-ignored argument). Findings/gated-out records
197
+ * themselves aren't surfaced in this output yet -- WASM has no
198
+ * `search_diagnostics`-equivalent block at all today, for any
199
+ * `CrowdOutDiagnostics` field, not just this one; only the policy control
200
+ * itself (and its effect on `routes`) is in scope here.
201
+ * @param {string} target
202
+ * @param {number} depth
203
+ * @param {number} max_routes
204
+ * @param {number} beam_width
205
+ * @param {string} avoid_elements
206
+ * @param {string} require_elements
207
+ * @param {string} spectator_bond_policy
208
+ * @returns {string}
209
+ */
210
+ export function find_routes_v3(target, depth, max_routes, beam_width, avoid_elements, require_elements, spectator_bond_policy) {
211
+ let deferred5_0;
212
+ let deferred5_1;
213
+ try {
214
+ const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
215
+ const len0 = WASM_VECTOR_LEN;
216
+ const ptr1 = passStringToWasm0(avoid_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
+ const len1 = WASM_VECTOR_LEN;
218
+ const ptr2 = passStringToWasm0(require_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
219
+ const len2 = WASM_VECTOR_LEN;
220
+ const ptr3 = passStringToWasm0(spectator_bond_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
221
+ const len3 = WASM_VECTOR_LEN;
222
+ const ret = wasm.find_routes_v3(ptr0, len0, depth, max_routes, beam_width, ptr1, len1, ptr2, len2, ptr3, len3);
223
+ deferred5_0 = ret[0];
224
+ deferred5_1 = ret[1];
225
+ return getStringFromWasm0(ret[0], ret[1]);
226
+ } finally {
227
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Same as [`find_routes_v3`], plus `beam_diversity_policy`/
233
+ * `beam_diversity_slots` (`docs/design/diversity-reserved-beam-v0.md`):
234
+ * `"off"` (default) | `"diagnostics_only"` | `"active"`, same vocabulary
235
+ * as the CLI's `--beam-diversity-policy` flag and the Python binding's
236
+ * `beam_diversity_policy` kwarg. `"active"` can change which candidates
237
+ * (and therefore which `routes`) come back, same caveat as
238
+ * `spectator_bond_policy`'s own `"gated"`. A distinct function name
239
+ * rather than extending `find_routes_v3`'s signature, matching that
240
+ * function's own stated reasoning. `beam_diversity_stats` isn't surfaced
241
+ * in this output either, for the same reason `spectator_bond`'s findings
242
+ * aren't -- WASM has no `search_diagnostics`-equivalent block at all
243
+ * today, for any `CrowdOutDiagnostics` field; only the policy control
244
+ * itself (and its effect on `routes`) is in scope here.
245
+ * @param {string} target
246
+ * @param {number} depth
247
+ * @param {number} max_routes
248
+ * @param {number} beam_width
249
+ * @param {string} avoid_elements
250
+ * @param {string} require_elements
251
+ * @param {string} spectator_bond_policy
252
+ * @param {string} beam_diversity_policy
253
+ * @param {number} beam_diversity_slots
254
+ * @returns {string}
255
+ */
256
+ export function find_routes_v4(target, depth, max_routes, beam_width, avoid_elements, require_elements, spectator_bond_policy, beam_diversity_policy, beam_diversity_slots) {
257
+ let deferred6_0;
258
+ let deferred6_1;
259
+ try {
260
+ const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
261
+ const len0 = WASM_VECTOR_LEN;
262
+ const ptr1 = passStringToWasm0(avoid_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
263
+ const len1 = WASM_VECTOR_LEN;
264
+ const ptr2 = passStringToWasm0(require_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
+ const len2 = WASM_VECTOR_LEN;
266
+ const ptr3 = passStringToWasm0(spectator_bond_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
267
+ const len3 = WASM_VECTOR_LEN;
268
+ const ptr4 = passStringToWasm0(beam_diversity_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
269
+ const len4 = WASM_VECTOR_LEN;
270
+ const ret = wasm.find_routes_v4(ptr0, len0, depth, max_routes, beam_width, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, beam_diversity_slots);
271
+ deferred6_0 = ret[0];
272
+ deferred6_1 = ret[1];
273
+ return getStringFromWasm0(ret[0], ret[1]);
274
+ } finally {
275
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
276
+ }
277
+ }
278
+
279
+ /**
280
+ * Same as [`find_routes_v4`], plus `element_accounting_policy`
281
+ * (`docs/design/candidate-time-element-accounting-gate-v0.md`): `"off"`
282
+ * (default) | `"diagnostics_only"` | `"gated"`, same vocabulary as the
283
+ * CLI's `--element-accounting-policy` flag and the Python binding's
284
+ * `element_accounting_policy` kwarg -- an independent axis from
285
+ * `spectator_bond_policy`, never folded together. `"gated"` can change
286
+ * which candidates (and therefore which `routes`) come back, same caveat
287
+ * as `spectator_bond_policy`'s own `"gated"`. A distinct function name
288
+ * rather than extending `find_routes_v4`'s signature, matching that
289
+ * function's own stated reasoning. `element_accounting_gated_out` isn't
290
+ * surfaced in this output either, for the same reason `spectator_bond`'s
291
+ * findings aren't -- WASM has no `search_diagnostics`-equivalent block at
292
+ * all today, for any `CrowdOutDiagnostics` field; only the policy control
293
+ * itself (and its effect on `routes`) is in scope here.
294
+ * @param {string} target
295
+ * @param {number} depth
296
+ * @param {number} max_routes
297
+ * @param {number} beam_width
298
+ * @param {string} avoid_elements
299
+ * @param {string} require_elements
300
+ * @param {string} spectator_bond_policy
301
+ * @param {string} element_accounting_policy
302
+ * @param {string} beam_diversity_policy
303
+ * @param {number} beam_diversity_slots
304
+ * @returns {string}
305
+ */
306
+ export function find_routes_v5(target, depth, max_routes, beam_width, avoid_elements, require_elements, spectator_bond_policy, element_accounting_policy, beam_diversity_policy, beam_diversity_slots) {
307
+ let deferred7_0;
308
+ let deferred7_1;
309
+ try {
310
+ const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
311
+ const len0 = WASM_VECTOR_LEN;
312
+ const ptr1 = passStringToWasm0(avoid_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
313
+ const len1 = WASM_VECTOR_LEN;
314
+ const ptr2 = passStringToWasm0(require_elements, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
+ const len2 = WASM_VECTOR_LEN;
316
+ const ptr3 = passStringToWasm0(spectator_bond_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
317
+ const len3 = WASM_VECTOR_LEN;
318
+ const ptr4 = passStringToWasm0(element_accounting_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
319
+ const len4 = WASM_VECTOR_LEN;
320
+ const ptr5 = passStringToWasm0(beam_diversity_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ const len5 = WASM_VECTOR_LEN;
322
+ const ret = wasm.find_routes_v5(ptr0, len0, depth, max_routes, beam_width, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, beam_diversity_slots);
323
+ deferred7_0 = ret[0];
324
+ deferred7_1 = ret[1];
325
+ return getStringFromWasm0(ret[0], ret[1]);
326
+ } finally {
327
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
328
+ }
329
+ }
330
+
185
331
  /**
186
332
  * Return the crate version string.
187
333
  * @returns {string}
package/renkin_bg.wasm CHANGED
Binary file