Throwaway prototypes for Sausage v3. Plan and decisions: ~/research/sausage-v3/PLAN.md. Results and evidence: the spike READMEs.
30 lines
1.5 KiB
Markdown
30 lines
1.5 KiB
Markdown
# S1: V8 harness
|
|
|
|
This spike runs pi-durable examples 21 and 23 in Rust through deno_core.
|
|
Rust owns the SQLite file. The portable adapter queues transactions and calls rusqlite through a Rust op.
|
|
The JavaScript uses Deno's Web API crates, not Node.
|
|
|
|
The sources adapt the upstream examples at:
|
|
https://github.com/earendil-works/pi/tree/main/packages/durable/test/examples
|
|
|
|
Install and bundle:
|
|
|
|
```sh
|
|
npm install --prefix /tmp/s1-v8-harness @earendil-works/pi-durable@1.5.0 @earendil-works/pi-ai@1.5.0 @earendil-works/chord@1.5.0 esbuild@0.28.2
|
|
NODE_PATH=/tmp/s1-v8-harness/node_modules /tmp/s1-v8-harness/node_modules/.bin/esbuild spikes/s1-v8-harness/21.ts spikes/s1-v8-harness/23.ts spikes/s1-v8-harness/real.ts --bundle --format=esm --platform=browser --outdir=/tmp/s1-v8-harness/bundles
|
|
nix develop -c cargo build --manifest-path spikes/s1-v8-harness/Cargo.toml -j 2
|
|
```
|
|
|
|
Run all three cases with `nu spikes/s1-v8-harness/verify.nu`.
|
|
The real call requires `PI_PROXY_BASE_URL` and `PI_PROXY_API_KEY`.
|
|
The examples retain their SQLite files in `/tmp/s1-v8-harness/`.
|
|
Example 21 uses a new request ID for each run and preserves it across reopen.
|
|
|
|
The host loads bundles as ES modules, so `import.meta` and top-level await work.
|
|
Deno fetch also requires the net and telemetry extensions.
|
|
The host uses deno_ast to transpile Deno's internal telemetry TypeScript.
|
|
The host does not enable telemetry export.
|
|
|
|
Both restart examples and the real proxy call passed.
|
|
The report at `.board/T1.report.md` records the commands, measurements, and remaining limits.
|