Skip to content

LEAP Architecture & Offline Security

LEAP (Linked Exploratory Analysis & Plotting) is a free, open-source, Rust-first, standalone native statistical application, licensed under GPL-3.0-or-later. This document describes the crate layout, the license audit, the zero-network/zero-telemetry static guarantee, offline builds, the HiDPI stability contract, and the sandboxed offline plugin model.

Crate layout

Crate Role
leap-core Shared contracts: stable IDs, versioned schemas, analysis-platform and selection types, structured errors, CancelToken. No GUI coupling, no direct access to a mutable global dataset.
leap-data Data import/round-trip: RFC-4180-ish CSV with header inference, Parquet import (Arrow), duplicate-header/ragged-row rejection, row_id handling, plugin registry + trust store.
leap-stats The validated statistics core: OLS, t-tests, nonparametric tests, contingency, GLM, PCA, distribution fits, SPC, capability, Gage R&R, survival, lifetest, Cox, ALT, mixed models, time-series, ARIMA, FFT, filters, Bayesian models, DOE. No I/O; deterministic given inputs and seeds.
leap-plot Shared versioned PlotSpec (layers, scales, scope, selection_contract, precision, export) and the SVG backend (plotters svg_backend); the same spec drives on-screen rendering and publication export.
leap-app Native desktop application (leap-desktop binary): eframe/egui UI, workspace (.leapw) persistence, reports, DOE/Quality/Reliability workbench panels, live state, harness orchestration, PNG capture, headless-render verification.
leap-cli The leap binary (clap Parser/Subcommand): thin CLI over leap-data import + leap-stats core; emits pretty-printed JSON (or compact single-line JSON with --json).

Layering rule: leap-core is the shared contract layer; leap-stats and leap-data are pure/core; leap-app and leap-cli are front-ends over those cores. The GUI and CLI execute the same leap-stats core, so panel results and CLI results agree by construction.

GPL-3.0-or-later license audit

The workspace declares GPL-3.0-or-later (root LICENSE, workspace license inheritance). The license audit is a static check, not a manual review:

python3 scripts/audit_licenses.py --check

This runs cargo metadata --offline --locked --format-version 1, extracts every resolved dependency crate (name, version, SPDX license expression, repository, authors) and checks each against an allowlist compatible with GPL-3.0-or-later (MIT, Apache-2.0, BSD-2/3-Clause, ISC, Zlib, BSL-1.0, CC0-1.0, Unlicense, Unicode-3.0/DFS-2016, MPL-2.0, LGPL-2.1/3.0-or-later, GPL-3.0-or-later, CDLA-Permissive-2.0, plus an explicit verified-allowlist for internal workspace crates and font-only crates). Exit status 0 means every crate is compatible and the notices file (if present or requested) matches; anything else is a failure.

G6 audit tests additionally check, statically:

  • root LICENSE exists and is GNU GPL v3 (g6_root_license_is_gpl_v3).
  • every workspace product crate declares license.workspace = true or GPL-3.0-or-later in its manifest (g6_workspace_crates_declare_gpl_license).
  • Cargo.lock contains zero prohibited network/HTTP/telemetry crates (g6_no_prohibited_network_or_telemetry_crates).

Zero-network / zero-telemetry static guarantee

The static proof is g6_no_prohibited_network_or_telemetry_crates (in crates/leap-app/tests/g6_release_audit.rs): it reads Cargo.lock, extracts every package name, and asserts that none of

reqwest, hyper, ureq, curl, surf, isahc, tonic, sentry, opentelemetry

are present. In practice, no core feature performs network I/O at runtime; there are no accounts, no cloud services, and no telemetry. The application is 100% offline. The G6 suite also renders the UI headlessly across all ThemeModes × WorkspaceProfiles × engineering tabs on a simulated 2x HiDPI viewport and asserts zero panics, zero zoom/ppp drift, and zero third-party trademark strings in rendered text.

Offline --offline --locked builds

All builds and tests lock the committed Cargo.lock and run without network:

cargo test --workspace --offline --locked
cargo build --release --offline --locked

--offline makes cargo fail rather than fetch, and --locked makes it fail rather than silently resolve a different dependency graph. Crate sources must already be in the local cargo registry cache (or a vendored directory configured in .cargo/config.toml). The pinned toolchain is Rust 1.98.0 (edition 2024); do not substitute a different toolchain or update the lockfile for a release build. See docs/REPRODUCIBLE_BUILD.md for the full release recipe.

HiDPI stability contract: zoom_factor only

egui is driven by a small, fixed contract in leap-app:

  • Only pixels_per_point (via native DPI) and zoom_factor (via the harness and assert_stable) are read; the application never scales UI by hand.
  • WorkspaceConfig::apply_to_ctx sets the egui viewport DPI from the native viewport and never touches zoom_factor — zoom stays exactly 1.0 across frames.
  • The assert_stable harness step verifies that pixels_per_point, zoom_factor and screen_rect do not drift or oscillate over N consecutive frames (tolerance 1e-4 for ppp/zoom, 0.5 pt for size).
  • Headless render tests (g6_headless_render_all_themes_profiles_tabs_hidpi, and the harness hidpi_apply_to_ctx_is_stable_across_frames test) assert that every frame keeps native 2.0 HiDPI scale with zoom 1.0 — correctness of the HiDPI contract, not a visual judgment.

Sandboxed offline plugins

LEAP ships an offline, sandboxed plugin registry and host (ADR-0005):

  • Plugins are discovered from a registry root (plugin.json or a directory of plugin roots) via leap-data::plugin_registry.
  • The CLI exposes leap plugin list|trust|revoke|run <root>:
  • list — shows each plugin's id, name, version, command, capabilities, timeout_ms, max_output_bytes, sha256, and trust state.
  • trust — explicit opt-in; persists a pinned sha256 in trust.json.
  • revoke — removes trust for an id (optionally only one sha256).
  • run — runs only a TrustedPinned plugin; refuses otherwise.
  • Execution is sandboxed: each plugin is run with a declared timeout and a bounded output size; the request is a single JSON object (protocol_version, plugin_id, method: "run", params, rows, columns) and the response is a JSON object (ok, metrics, table, warnings, error). The CLI serializes a table into the response when present (and can plot its first numeric column as an SVG).
  • Plugins are offline by design: there is no network access path in the registry or host. Trust state is persisted in trust.json inside the registry root and is required before run will execute anything.