feat(rustledger): make the component engine the default#183
Merged
Conversation
Flip the default backend from the legacy JSON-RPC engine to the in-process WASI Preview 2 / Component-Model component (rustledger beancount#1384). Closes #173. - backend.py: default -> component; `RUSTFAVA_RUSTLEDGER_BACKEND=jsonrpc` (or `json-rpc`/`json`) opts back into the JSON-RPC engine. The ImportError fallback to JSON-RPC stays, so a missing/broken wasmtime degrades rather than crashes. - pyproject: `wasmtime` moves from the optional `component` extra to a core dependency (the component is now the default, so it ships for every install); uv.lock regenerated. - docstrings updated to reflect the new default. The component backend passes the full suite (verified on the released v0.16.5 wasm): 497 passed, 0 failed — the arc from 114 failures is complete. CI's test-py now exercises the component path by default (wasmtime is a core dep). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`title` is `option<string>` on the component (present-but-None when no `option "title"`); `BeancountOptions.title` is `str`, so a None value trips typeguard's runtime check (CI's test-py-typeguard). Default on falsy, like the other option<string> fields. Caught by CI running the component path now that it's the default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
robcohen
added a commit
that referenced
this pull request
Jun 18, 2026
…184) The component engine is now the default (#183), so the wasmtime *Python package* ships as a dependency and the default backend needs no extra setup. The wasmtime *CLI* is only required for the legacy JSON-RPC backend (RUSTFAVA_RUSTLEDGER_BACKEND=jsonrpc) — including the ImportError fallback — which was previously documented as an unconditional requirement. - README: reframe the wasmtime note as the JSON-RPC opt-out requirement; PyPI install no longer lists wasmtime as a manual prerequisite. - deployment.md: add a "Backends" section covering the env var, the default, and the CLI requirement for the fallback. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
robcohen
added a commit
that referenced
this pull request
Jun 19, 2026
,#120) macOS users hit cryptic failures ("Server failed to start", "Empty response: rustledger-ffi-wasi") because the *legacy* JSON-RPC backend spawns a `wasmtime` CLI subprocess that macOS Gatekeeper blocks. The real fix is the in-process component backend, now the default (#183) — these reports predate that release. Make the remaining failure modes actionable rather than cryptic: - The "Empty response" error now explains the subprocess/Gatekeeper cause and points at the component backend. - The "wasmtime CLI not found" error explains the component backend needs no external binary. - `get_engine` no longer silently falls back from the unavailable component backend to the JSON-RPC engine (which needs a `wasmtime` CLI binary users don't have, producing exactly those cryptic errors). It falls back only if the CLI is actually present, else raises a clear "reinstall rustfava" error. This doesn't change the default path; it just makes the legacy/fallback path fail with guidance. The substantive fix for the reporters is shipping the component default in a release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
robcohen
added a commit
that referenced
this pull request
Jun 19, 2026
,#120) (#187) macOS users hit cryptic failures ("Server failed to start", "Empty response: rustledger-ffi-wasi") because the *legacy* JSON-RPC backend spawns a `wasmtime` CLI subprocess that macOS Gatekeeper blocks. The real fix is the in-process component backend, now the default (#183) — these reports predate that release. Make the remaining failure modes actionable rather than cryptic: - The "Empty response" error now explains the subprocess/Gatekeeper cause and points at the component backend. - The "wasmtime CLI not found" error explains the component backend needs no external binary. - `get_engine` no longer silently falls back from the unavailable component backend to the JSON-RPC engine (which needs a `wasmtime` CLI binary users don't have, producing exactly those cryptic errors). It falls back only if the CLI is actually present, else raises a clear "reinstall rustfava" error. This doesn't change the default path; it just makes the legacy/fallback path fail with guidance. The substantive fix for the reporters is shipping the component default in a release. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #173. Flips the default rustledger backend from the legacy JSON-RPC engine to the in-process WASI Preview 2 / Component-Model component (rustledger beancount#1384).
Changes
backend.py: default → component;RUSTFAVA_RUSTLEDGER_BACKEND=jsonrpc(orjson-rpc/json) opts back into the JSON-RPC engine. TheImportError→JSON-RPC fallback stays, so a missing/brokenwasmtimedegrades gracefully.pyproject.toml:wasmtimemoves from the optionalcomponentextra to a core dependency — the component is the default, so it ships for every install.uv.lockregenerated (via uv 0.11).Validation
test-pyvia the component by default (wasmtime is now a core dep installed by thetestgroup), so the component path is validated end-to-end in CI.jsonrpcopt-out routing verified; mypy + ruff clean on changed files.Notes
jsonrpcopt-out remains available there.