renkin 0.27.0 → 0.28.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
@@ -622,6 +622,7 @@ see "Earlier milestones" below for older shipped work.
622
622
 
623
623
  ### Recently shipped
624
624
 
625
+ - [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.
625
626
  - [x] **Reproducible Route Audit** (`audit_manifest` on `renkin audit-route --output json`, shipped v0.27.0) — *Reproduce what was audited, from which input, with which stock and policy.* Every audit report now records RENKIN version, report schema version, source format/version, input/stock content SHA-256 hashes, and audit policy — tested for byte-identical determinism (auditing the same input twice), not just claimed. Adds a shared adapter conformance suite across RENKIN-native and AiZynthFinder route inputs, plus a written [reproducibility/compatibility contract](https://kent-tokyo.github.io/renkin/guides/audit-reproducibility-contract/) (verified-vs-supported versions, unknown-field tolerance, report-schema rules, adapter-fixture runbook). The [browser playground](https://kent-tokyo.github.io/renkin/playground/) also got a safety/UX pass this release: search runs off the main thread with cancel/time-budget support, structure rendering stays local by default (no third-party SMILES transmission), and search settings round-trip exactly through Copy CLI/Python.
626
627
  - [x] **RENKIN Bridge — Cross-Tool Route Audit** (`renkin audit-route`, RENKIN-native adapter shipped v0.25.0, AiZynthFinder adapter shipped v0.26.0) — *Keep AiZynthFinder. Audit its routes with RENKIN.* A tool-neutral route audit model: 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 — never a silently force-passed boolean. v0.26.0 adds a real AiZynthFinder adapter (single-target and gzip batch JSON, verified against captured v4.4.1 output — see [`PROVENANCE.md`](tests/fixtures/aizynthfinder/v4.4.1/PROVENANCE.md)) plus `--format auto` detection, so both tools' routes run through the exact same audit pipeline; auditing the real fixtures also surfaced and fixed a shared forward-replay bug where precursor ordering, not just chemistry, affected the verdict. `renkin audit-route route.json --stock stock.smi --output json` audits every route in a file and aggregates the results into one machine-readable report, regardless of which tool produced it.
627
628
  - [x] Coverage mode (`--search-mode coverage`, [#101](https://github.com/kent-tokyo/renkin/issues/101), shipped v0.24.0) — opt-in Stage-1/Stage-2 template-count escalation, addressing the candidate-generation coverage gap below. Confirmed by a one-shot 500-target formal-TEST (`data/coverage_mode_formal_test/protocol_v2.md`): coverage +6.0pp, net gain +30, zero regressions, zero reranker failures, Stage-2 timeout rate 0.25% — all against pre-registered thresholds. See the Key Features table above for the shipped surface
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.27.0",
8
+ "version": "0.28.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/renkin.d.ts CHANGED
@@ -1,6 +1,30 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * Audit a pasted/uploaded route export (WASM entry point) -- the browser
6
+ * counterpart to `renkin audit-route`, calling the identical
7
+ * `bridge::build_audit_route_report` pipeline so a route audited in the
8
+ * playground gets exactly the same pass/fail/partial verdict the CLI would
9
+ * produce for the same input, not a separately-maintained copy.
10
+ *
11
+ * # Arguments
12
+ * * `content` - Route export JSON text (RENKIN `--format json` output,
13
+ * or an AiZynthFinder single-route/batch export). Plain
14
+ * JSON only -- unlike the CLI, this has no gzip support;
15
+ * a browser paste/upload never needs it.
16
+ * * `format` - `"auto" | "renkin" | "aizynthfinder"`, same vocabulary
17
+ * as the CLI's `--format` flag.
18
+ * * `stock_text` - Optional `.smi`-style stock listing (one SMILES per
19
+ * line, `#`-comments allowed), or `""` for "no stock to
20
+ * check against".
21
+ *
22
+ * Returns a JSON string: either the `AuditRouteReport` shape (same as
23
+ * `renkin audit-route --output json`) or `{"error": "..."}` on a bad
24
+ * input (malformed JSON, unrecognized format, ...).
25
+ */
26
+ export function audit_route(content: string, format: string, stock_text: string): string;
27
+
4
28
  /**
5
29
  * Static capabilities of this WASM build (browser edition), as a JSON
6
30
  * string -- real counts read from the same compiled-in data `find_routes`
@@ -56,14 +80,15 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
56
80
 
57
81
  export interface InitOutput {
58
82
  readonly memory: WebAssembly.Memory;
83
+ readonly audit_route: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
59
84
  readonly capabilities: () => [number, number];
60
85
  readonly find_routes: (a: number, b: number, c: number, d: number, e: number) => [number, number];
61
86
  readonly find_routes_v2: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number];
62
87
  readonly version: () => [number, number];
63
88
  readonly __wbindgen_externrefs: WebAssembly.Table;
64
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
65
89
  readonly __wbindgen_malloc: (a: number, b: number) => number;
66
90
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
91
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
67
92
  readonly __wbindgen_start: () => void;
68
93
  }
69
94
 
package/renkin.js CHANGED
@@ -1,5 +1,50 @@
1
1
  /* @ts-self-types="./renkin.d.ts" */
2
2
 
3
+ /**
4
+ * Audit a pasted/uploaded route export (WASM entry point) -- the browser
5
+ * counterpart to `renkin audit-route`, calling the identical
6
+ * `bridge::build_audit_route_report` pipeline so a route audited in the
7
+ * playground gets exactly the same pass/fail/partial verdict the CLI would
8
+ * produce for the same input, not a separately-maintained copy.
9
+ *
10
+ * # Arguments
11
+ * * `content` - Route export JSON text (RENKIN `--format json` output,
12
+ * or an AiZynthFinder single-route/batch export). Plain
13
+ * JSON only -- unlike the CLI, this has no gzip support;
14
+ * a browser paste/upload never needs it.
15
+ * * `format` - `"auto" | "renkin" | "aizynthfinder"`, same vocabulary
16
+ * as the CLI's `--format` flag.
17
+ * * `stock_text` - Optional `.smi`-style stock listing (one SMILES per
18
+ * line, `#`-comments allowed), or `""` for "no stock to
19
+ * check against".
20
+ *
21
+ * Returns a JSON string: either the `AuditRouteReport` shape (same as
22
+ * `renkin audit-route --output json`) or `{"error": "..."}` on a bad
23
+ * input (malformed JSON, unrecognized format, ...).
24
+ * @param {string} content
25
+ * @param {string} format
26
+ * @param {string} stock_text
27
+ * @returns {string}
28
+ */
29
+ export function audit_route(content, format, stock_text) {
30
+ let deferred4_0;
31
+ let deferred4_1;
32
+ try {
33
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
34
+ const len0 = WASM_VECTOR_LEN;
35
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
36
+ const len1 = WASM_VECTOR_LEN;
37
+ const ptr2 = passStringToWasm0(stock_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
38
+ const len2 = WASM_VECTOR_LEN;
39
+ const ret = wasm.audit_route(ptr0, len0, ptr1, len1, ptr2, len2);
40
+ deferred4_0 = ret[0];
41
+ deferred4_1 = ret[1];
42
+ return getStringFromWasm0(ret[0], ret[1]);
43
+ } finally {
44
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
45
+ }
46
+ }
47
+
3
48
  /**
4
49
  * Static capabilities of this WASM build (browser edition), as a JSON
5
50
  * string -- real counts read from the same compiled-in data `find_routes`
package/renkin_bg.wasm CHANGED
Binary file