Skip to content

feat: server-parity — load_compare, /load fields, permissions fix#4

Open
paddymul wants to merge 1 commit into
feat/load-backend-xorqfrom
feat/parity-load-compare
Open

feat: server-parity — load_compare, /load fields, permissions fix#4
paddymul wants to merge 1 commit into
feat/load-backend-xorqfrom
feat/parity-load-compare

Conversation

@paddymul

Copy link
Copy Markdown
Contributor

Stacks on #1 (feat/load-backend-xorq). Closes the remaining gaps between the plugin's IPC surface and what buckaroo.server actually exposes.

Summary

  • New buckaroo_load_compare Rust command + loadCompare() JS helper. Mirrors server POST /load_compare — diff two files via col_join_dfs, return the merged frame with diff styling and per-column eqs.
  • buckaroo_load_path now forwards prompt and component_config (already accepted by the server's /load, already accepted by our buckaroo_load_expr, was the one missing spot).
  • build.rs + permissions/default.toml now register all seven commands. The prior expand-surface PR (Docs recommend non-existent 'buckaroo[xorq]' extra; sidecar fails to import tornado #1) added buckaroo_load_expr and buckaroo_diagnostics as IPC handlers but forgot to list them in COMMANDS — so a webview using buckaroo-tauri:default couldn't actually call them. Fixed here while the file was already being touched.

Parity matrix (after this PR)

Server route Plugin command
GET /health buckaroo_health (Rust-side liveness; not a proxy by design)
GET /diagnostics buckaroo_diagnostics
POST /load buckaroo_load_path (+ prompt, component_config now)
POST /load_expr buckaroo_load_expr
POST /load_compare buckaroo_load_compare new
WS /ws/<id> buckaroo_send + events

The only remaining intentional gap is buckaroo_pick_file, which is still a stub pending tauri-plugin-dialog integration (called out in the README).

Test plan

  • cargo build -p buckaroo-tauri clean (regenerates autogenerated permission tomls).
  • tsc --noEmit clean on buckaroo-tauri-adapter.
  • Playwright DOM tests on the example app still pass (6/6 — no functional change to the example).
  • Manual: loadCompare(p1, p2, ["id"], { session: "s1" }) against a sidecar with two parquets that share an id column produces a merged view with diff styling and a populated eqs.
  • Manual: a host using only buckaroo-tauri:default can invoke buckaroo_load_expr, buckaroo_diagnostics, and buckaroo_load_compare without Tauri's permission system rejecting the call (verifies the build.rs fix).

🤖 Generated with Claude Code

… fields + permissions fix

Brings the buckaroo-tauri plugin to full parity with `buckaroo.server`'s
HTTP surface. Adds the remaining `/load_compare` passthrough, the two
optional `/load` fields the plugin wasn't forwarding (`prompt`,
`component_config`), and fixes the permissions registration that the
prior expand-surface PR missed for `load_expr` and `diagnostics`.

## Rust (crates/buckaroo-tauri/src)

- New `LoadCompareArgs` + `buckaroo_load_compare` command. POSTs
  `/load_compare` with `{session, path1, path2, join_columns, how?,
  no_browser: true}` and opens the internal WS to the returned session
  — same end-of-call wiring as `buckaroo_load_path` / `_load_expr`.
  Unlike the other two, `session` is a required field on the Rust side
  because the server's `/load_compare` requires it.
- `LoadPathArgs` gains `prompt` and `component_config` (forwarded
  verbatim into the POST body when present). Mirrors what
  `LoadExprArgs` already accepts. Pre-existing callers that omit these
  fields are unaffected.
- `buckaroo_load_compare` registered in `init()`.
- `build.rs` `COMMANDS` updated to list all seven commands. Previously
  it still listed only the original four — `load_expr` and
  `diagnostics` (added in the prior PR) weren't being registered with
  the Tauri 2 permission system, so a host that opted into
  `buckaroo-tauri:default` could not actually call them. The
  autogenerated per-command tomls are regenerated by `cargo build`.
- `permissions/default.toml` updated to allow all seven commands.

## JS adapter (packages/buckaroo-tauri-adapter)

- New `loadCompare(path1, path2, join_columns, { session, how? })`
  helper paired with `buckaroo_load_compare`. Required-`session`
  signature surfaces the server-side contract at the type level so
  callers don't discover it via a 400.
- `loadPath` opts gain `prompt` and `component_config`, forwarded to
  the Rust command.
- `loadCompare` exported from `index.ts`.

## Parity matrix

| Server route       | Plugin command         | Status (before → after) |
|--------------------|------------------------|-------------------------|
| `GET /health`      | `buckaroo_health`      | unchanged (Rust-side liveness, not a `/health` proxy by design) |
| `GET /diagnostics` | `buckaroo_diagnostics` | unchanged (passthrough) |
| `POST /load`       | `buckaroo_load_path`   | adds `prompt`, `component_config` |
| `POST /load_expr`  | `buckaroo_load_expr`   | unchanged |
| `POST /load_compare` | `buckaroo_load_compare` | **new** |
| `WS /ws/<id>`      | `buckaroo_send` + events | unchanged (passthrough) |

## Test plan

- [x] `cargo build` clean.
- [x] Existing Playwright DOM tests on the example app still pass (6/6).
- [x] `tsc --noEmit` clean on the adapter package.
- [ ] Manual: `loadCompare(p1, p2, ["id"], { session: "s1" })` against
      a sidecar with two parquets that share an `id` column produces
      a merged view with diff styling and `eqs` populated.
- [ ] Manual: a host using `buckaroo-tauri:default` capability can
      invoke `buckaroo_load_expr`, `buckaroo_diagnostics`, and
      `buckaroo_load_compare` without Tauri's permission system
      rejecting the call (verifies the build.rs fix).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant