Desktop development host
Implementation status
M002 adds a Tauri 2 host around the shared Vue frontend. M003 adds Direct MySQL/MariaDB live profiles (read-only at first); M004 adds Direct PostgreSQL and natively chosen SQLite files (development builds only); M005 adds SSH tunnels and macOS Keychain secret references; M006 adds read-write SQL execution (on by default since A15) and live CRUD; M007 adds live SQL/CSV/JSON export and SQL/CSV import. The desktop app is live-only: it has no sample connections or Mock mode, which remain in the browser build. Server vault, updater and HTTP server are not exposed. Browser development remains available through npm run dev without native imports.
Use Node 26 and the pinned Rust toolchain. Install the Tauri platform prerequisites first.
npm ci
npm run desktop:build
npm run desktop:run
npm run desktop:test
npm run desktop:smokeThe smoke command opens the actual native window, checks that Vue rendered, round-trips lossless synthetic values, and exits. Its 15-second deadline prevents a stalled WebView being reported as a pass. This debug-only smoke is not a signed distribution test. Build embeds apps/frontend/dist; rebuild after frontend changes. Standard OS window decorations retain native dragging. See the download and install guides for the published betas.
Platform status (v0.1.0-beta.2)
| Platform | Package | Status |
|---|---|---|
| macOS arm64 and x86_64 | DMG, ad-hoc signed (desktop:dmg:adhoc, tauri.macos-adhoc.conf.json), not notarized | arm64 verified on macOS 27.0.1; x86_64 built but not run on Intel hardware. Developer ID signing and notarization remain pending (M009) |
| Windows x64 | NSIS installer (tauri.windows-nsis.conf.json): per-user (currentUser, installs to %LOCALAPPDATA%\StoneQL), WebView2 downloadBootstrapper, unsigned | Direct connections and read-write (Windows outcome-journal port with accepted gaps: no ACL check, no directory fsync); DPAPI credential store. No SSH tunnel and no renderer-crash recovery. Verified on GitHub Windows Server 2025 runners only |
| Linux x86_64 | .deb (desktop:deb, tauri.linux-deb.conf.json; package stone-ql, binary stoneql-desktop), built on Ubuntu 22.04 with tools/linux-deb/; Depends libwebkit2gtk-4.1-0 (>= 2.38), libdbus-1-3; unsigned | Direct and SSH, read-write, Secret Service or master-password file, renderer-crash recovery through WebKitGTK web-process-terminated. Verified on the Ubuntu 26.04 build server under Xvfb and by install-and-launch in Ubuntu 22.04 and Debian 12 containers; real-desktop checks pending. AppImage approved for later |
Details: Verification.
IPC boundary
The native adapter lives in apps/desktop/src-tauri. Shared core/contracts contain no Tauri types. Rust generates contracts/generated/v1.ts; the browser-safe nativeHost.ts bridge uses that contract without importing an SDK. Requests have a version, correlation ID and strict bounded payload. Unknown fields, unsupported versions, forged sessions, untrusted origins and auxiliary windows are rejected.
The application manifest explicitly registers protected commands. Only the main local window receives host-info, synthetic contract-probe, close-resolution and the database command permissions described below. No renderer filesystem, shell, dialog or remote-origin permissions are granted. The dialog plugin is used only by trusted Rust code: the shutdown fallback and the native SQLite and SSH key file pickers. CSP excludes remote scripts, frames and connections.
Native close/quit requests reuse the existing unsaved-change confirmation. Cancel preserves edits; an unresponsive renderer receives a native warning before forced close. The fallback dialog's manual interaction remains unverified. Failed IPC bootstrap disables the bridge (host state unavailable); it never implies a real connection.
Local verification and remaining gates
macOS ARM real native smoke previously completed in 609 ms; latest verification results are recorded in M002's milestone. Four native IPC tests cover ACLs, exact values, protocol rejection and cancellation of close. Two browser-shim tests cover Light/Dark unsaved-close dialogs; they do not replace real WebView/OS testing. The original 17 browser scenarios remain intact.
Real-window checks on macOS arm64 (A1, 2026-11-16): npm run desktop:profile builds the optimized host with the non-shipped smoke feature and launches it 30 times (30/30 passed; host start → renderer ready median 607 ms, p95 701 ms, max 715 ms; spawn → exit median 624 ms). The journal_window example (development harness, needs the sqlite feature) drives the window through System Events: fallback freezes the renderer and verifies the native "not responding" dialog (shown by macOS's UserNotificationCenter) — Cancel keeps the app running, Close StoneQL exits with status 0; reload verifies Cmd+R, the WebView context-menu Reload and the Web Inspector reload are refused while a lease or job is held; picker verifies the native SSH key-file picker (Escape gives no grant, a chosen file gives an opaque grant). npm run desktop:bundle:adhoc bundles StoneQL.app and a drag-to-Applications DMG with the pinned Tauri CLI (2.12.4) and tauri.macos-adhoc.conf.json: an ad-hoc signature (codesign -s -) with hardened runtime and no entitlements. It verifies with codesign --verify --deep --strict, launches, renders through the native bridge and exits 0 from the window close button; Gatekeeper rejects it and it is not notarized. Ad-hoc signing is a development stand-in, not release signing. Developer ID signing and notarization, Keychain prompts on a Developer ID build and release-build IPC overhead remain pending (the startup budgets were approved 2026-11-17, A3, and met by the beta DMG). GitHub Actions runs the Rust foundation workflow (.github/workflows/rust.yml) on macOS 15 and Windows Server 2025 runners; on release branches it also builds and smoke-tests the Windows installer. It does not run the macOS native smoke, DMG bundle or Docker fixture commands.
A full-lockfile dependency audit currently fails on transitive Linux GTK dependencies: GLib RUSTSEC-2024-0429 and proc-macro-error RUSTSEC-2024-0370. GLib's fixed version is a different major API line; changing the lockfile alone cannot upgrade Tauri's GTK dependency graph. The shipped Linux graph is audited by npm run audit:release:linux with exactly these two advisories as documented exceptions, approved by the user on 2026-11-17 and re-checked at every Tauri upgrade (see Verification); the macOS release audit has no exceptions. M002 security acceptance remains open. This does not affect the independently evaluated M001 core/contracts dependency graph.
M003 native binding verification
The active connection dialog and existing SQL workspace use connect_direct, read_only_query, disconnect_database and database_status. All enforce the local main-window origin, native session identity and owned opaque handles. Connection/query admission is limited to 16 concurrent requests and eight logical pools. Shutdown rejects new work and awaits pool cleanup before exit. No secret-bearing request derives Debug; ordinary profile persistence excludes passwords, PEM contents and handles.
Run npm run test:native-database with local Docker and Rust tooling. It provisions owned TLS fixtures and executes actual Tauri handlers (MockRuntime) against MySQL/MariaDB: exact raw values, duplicate labels, refusal, packet recovery and independent disconnect. This is real IPC-handler/database integration, not native WebView interaction.
The browser suite has 22 scenarios, including two new Light/Dark live-bridge simulations exercising the actual UI, password/CA non-persistence, connection switching, SQL results/errors and narrow dialog actions. The real macOS smoke separately checks Wry startup and the mounted frontend. These three checks do not constitute a complete native GUI-to-real-database end-to-end test. Native GUI interaction, real-hardware Windows and real-desktop Linux runs, aggregate allocation profiles and indirect view/function trust remain open gates.
M004 PostgreSQL and SQLite commands
connect_direct also accepts postgresql. Two further commands are registered for the main window only: pick_sqlite_file shows the native OS file picker from trusted Rust code and returns an opaque grant plus file name (or nothing when cancelled), and connect_sqlite opens a grant. The renderer still has no filesystem or dialog permission and never sends a path; strict envelopes reject a path field. A renderer bootstrap revokes outstanding grants together with pools. The trusted authorize_sqlite_file function used by the picker is public only to Rust callers and tests, never IPC. The real picker interaction is not automated; see PostgreSQL and SQLite adapters.
Reload cleanup
A new host_info bootstrap nonce rotates the renderer token and closes existing pools; retrying the same nonce is idempotent. The existing frontend sends a fresh UUID-based nonce per startup. No command, capability, DTO field or persistence key was added. A native regression first demonstrated that the original code reused a host-lifetime token. Runtime tests now cover pool closure/capacity reuse and stale registration, while real fixtures verify idle database-session removal, stale-token/handle rejection and all eight slots being available after bootstrap. This is command-handler integration; native graphical reload behavior still needs separate OS/WebView testing.
M005 SSH and secret commands
Five further main-window commands are registered: ssh_host_key (scan a presented host key for explicit enrollment; never trusts it), pick_ssh_key_file (native picker → opaque, owner-scoped key grant), cancel_connect (cancel an owned in-flight setup), and write/delete-only store_secret/delete_secret (plus secret_store_status, unlock_secret_store and reset_secret_store for the Linux master-password file; see Linux credential stores). connect_direct accepts optional passwordRef, ssh and attemptId. The host owns the agent socket (SSH_AUTH_SOCK captured at startup) and the OS secret store; tests inject a private agent and a dedicated Keychain service through app_builder_with. The capability description lists the new grants; the renderer still has no filesystem, shell or dialog permission and cannot read a secret back. The trusted authorize_ssh_key_file is public only to Rust callers and tests. Run npm run test:ssh for the owned SSH/database fixtures; see SSH transport and secret references.
Live behaviour details
Technical details of the live desktop behaviour that the user guide leaves out. User-facing steps live there.
- Catalog and Browse. For MySQL, MariaDB and PostgreSQL the Explorer lists tables and views from
information_schema(MySQL/MariaDB: every database the account can see; PostgreSQL: the session's current database and schema only). Browse reads server-side pages with filter and sort and an exact total fromCOUNT(*); if the count does not finish within the native query deadline, the page is shown and the total reported as unavailable. Structure shows columns, types, NULL, defaults and auto-increment as the catalog reports them, plus indexes and foreign keys with their rules; PostgreSQL shows each index's own definition and reads primary keys frompg_catalog. Every catalog and browse statement is an ordinary read-only SELECT through the same engine-enforced path as the SQL tab; filter text containing a backslash is refused by that subset. - Catalog limits. MariaDB hides foreign-key rules from SELECT-only accounts (shown as not visible to this account). A PostgreSQL composite foreign key lists its columns in column order, not necessarily paired by position. PostgreSQL types and defaults are shown as the catalog spells them (for example
character varying(40)or'x'::text). MySQL 8 reports some catalog columns as binary, which StoneQL decodes as UTF-8. - Evidence. The catalog, browse and count statements run over verified TLS against the MySQL 8.4.6, MariaDB 11.4.8 and PostgreSQL 17.6 fixtures (and were probed on MySQL 8.4.11 and MariaDB 11.4.13 through the runtime's MySQL cell decoder). In the packaged v0.1.0-beta.1 app the graphical flow was checked by hand against MySQL over Direct only; MariaDB, PostgreSQL and SSH were verified through the native command handlers, not in the packaged app.
- Row edits. Each change is one statement addressed by the full primary key and run as a read-write job; a change matching no row is reported as a conflict. Inside an open transaction a change is reported as such and appears in Browse after COMMIT. Tables without a primary key, views and binary columns stay read-only.
- Testing a connection. A test opens and closes a separate real session; with a blank default database it signs in to
information_schema(MySQL/MariaDB) orpostgres(PostgreSQL). Saved profiles keep TLS on unless turned off; a failed TLS connection is never retried without TLS. With TLS off, a fullcaching_sha2_password/sha256_passwordsign-in (for example after a server restart) uses RSA only as the profile chooses: a trusted server public key, or an explicit opt-in to fetch the key unverified; otherwise it stops withENCRYPTED_LOGIN_REQUIREDbefore the password is sent (D027). PostgreSQL connections refuse Unix-socket hosts and will not start whilePGSSLROOTCERT,PGSSLCERT,PGSSLKEYorPGOPTIONSare set. - Sessions. Each profile has independent SQL tabs, results and connection state. Disconnect or closing its workspace releases its owned native pool; shutdown closes all pools. Sessions expire after one hour. Profile status is checked on tab switches and every 30 seconds (registry status, not a network health probe). A fresh renderer bootstrap invalidates the old session token and closes its pools before live controls are enabled; a late completion racing bootstrap is closed. No automatic reconnect is attempted.
- SSH. The agent is the one StoneQL inherited at startup (
SSH_AUTH_SOCK); agent forwarding is never requested. Private keys are read natively at connect time and never enter the window. With a saved secret the renderer waits up to 75 seconds, otherwise 8; a connection completing after the wait is closed. A tunnel whose SSH server goes away is released automatically (within about two minutes when the network path silently stops). Details: SSH and credentials. - Saved credentials. The profile keeps only an opaque reference; the saved secret works only for the same server, account and route. Development builds before 2026-11-16 used the Keychain service
app.dbadmin.desktop.credentials; current builds never read those items. macOS uses the login Keychain, Windows DPAPI-encrypted files and Linux the Secret Service or a master-password file (details). Passwords, CA contents, file grants and native handles are never saved in local storage. - Read-only results. A read-only connection runs each engine's own small SELECT subset inside an engine-enforced read-only transaction (PostgreSQL uses double-quoted identifiers and rejects
::casts; SQLite acceptstypeof()). Results keep ordered columns (including duplicate labels), exact integer/decimal strings, raw temporal text, NULL and hexadecimal binary/unknown values. Limits: 1,000 rows, 1 MiB serialized result, 2 MiB per incoming protocol packet; a three-second native deadline is not confirmation of server cancellation. Errors use fixed messages without raw driver diagnostics; there is no automatic retry or mock fallback. Read-only enforcement cannot establish that views or indirect functions are harmless. See read-only SQL safety and read-write SQL execution. - Transfers. Export SQL values are exact text literals (
_utf8mb4 X'…'on MySQL/MariaDB,E'…'on PostgreSQL); MySQL/MariaDB structure comes fromSHOW CREATE TABLE. Rows are read in one read-only snapshot (MySQL/MariaDB consistent snapshot, PostgreSQL repeatable read) and streamed into a temporary file beside the destination, renamed into place only when complete; cancel, failure, reload or quit removes the temporary file. The native save/open dialogs run in trusted Rust code, so the window never sees the path. SQL import reads the whole file once, validates it with the SQL tab's splitter and refusals, then runs statements from that same copy one at a time with autocommit on its own connection. See the transfer architecture. - Gatekeeper. A build compiled locally is not quarantined and opens without the first-launch approval; the bundle identifier is
me.thixpin.stoneql. - SQLite. Live SQLite files are a development-build feature: release builds exclude SQLite (A5, because the bundled SQLite library has an open advisory with no upgrade path) and show "This build does not include SQLite". See PostgreSQL and SQLite.