Architecture
Ossiframe has three layers: Apps compose modules, and modules use Core. Dependencies point one way: App → Modules → Core. Rationale: decisions. Trust boundaries and guarantees: security.md. Build, CLI and module development: developer-guide.md.
System overview
The app runs on your computer and talks to your servers over SSH. Outside services: Trust boundaries.
- The dotted arrow exists only in apps that include
ai-assistant, and only when you click. - The UI sends typed commands only. Rust builds each remote command. Nothing is installed on the server.
Layers
- Modules are
modules/*crates (ossiframe-mod-<name>) with optional UI folders. Apps areapps/doctor,apps/deployand apps generated fromtemplates/starter. - Core never depends on a module or an app, and has no Laravel, PHP, NGINX or MySQL knowledge. Doctor and Deploy never depend on each other.
- A module is a trusted Rust crate that an app registers at compile time. There are no dynamic plugins. Its manifest (id, version, dependencies, capability text) is metadata, not a sandbox. The registry rejects missing dependencies and cycles.
Crates and cargo features
| Crate | Contents |
|---|---|
ossiframe-core | Validated identifiers, Executor trait, CommandSpec, quoting, redaction, operation records and states, module manifests, registry |
ossiframe-ssh | The only crate that uses russh: authentication, host keys, sessions, command execution, optional PTY, SFTP and forwarding channels |
ossiframe-desktop | Tauri integration, SQLite, keychain, IPC helpers, sessions, operation engine, opt-in terminal, files and tunnels support |
Optional code is behind cargo features. An app that does not enable a feature does not compile that code.
Source: [features] tables of crates/ossiframe-ssh/Cargo.toml, crates/ossiframe-desktop/Cargo.toml and modules/*/Cargo.toml, read with cargo metadata.
Notes:
ubuntu-provisioninghas no cargo feature. Itsprovision_*commands live inossiframe-desktopbehindprovisioning, which an app enables itself.linux-inventory,linux-monitoringand the example module have no features or IPC commands. Withoutwrite, Files is read-only.- Doctor enables none of
provisioning,terminal,filesandtunnels. CI checks this (security.md).
Modules
Source: dependencies in each module manifest (modules/*/src/lib.rs, examples/custom-module), as printed by cargo run -p ossiframe-cli -- list --json.
| Module | What it provides |
|---|---|
linux-inventory | 8 read-only operations: server-info, services, listening-sockets, software, service-status, service-logs, nginx-error-log, http-check |
linux-audit | 8 scan steps, reports (audit_build_report, audit_save_report) |
linux-monitoring | Live CPU, memory, disk, network and process metrics |
linux-logs | Journal and log reads with live tail, logs_save |
ai-assistant | Optional bring-your-own-key assistant, 11 ai_* commands |
ubuntu-provisioning | Preflight, plan and install of a base stack, as root through sudo -n |
app-deploy | 19 app_* commands: create, deploy, roll back, remove, HTTPS, environment, releases |
ssh-terminal | Interactive terminal, 6 terminal_* commands |
ssh-filesystem | SFTP browsing and transfers, 8 read and 5 write files_* commands |
ssh-tunnel | Local port forwarding on 127.0.0.1, 6 tunnel_* commands |
ports (example) | Listening TCP sockets, in examples/custom-module |
Opt-in modules need a generator flag: developer guide.
Apps
Source: .register(...) calls in apps/doctor/src-tauri/src/lib.rs and apps/deploy/src-tauri/src/lib.rs; cargo tree -p ossiframe-doctor -e features and -p ossiframe-deploy; apps/*/src/modules.ts; opt-in flags from cargo run -p ossiframe-cli -- list --json.
- Doctor registers five modules, enables only
ossiframe-desktop/tauriand has no mutating or privileged command.linux-audit's Overview replaces the inventory page. - Deploy registers eight modules and uses
app-deploythrough its commands and setup, not.register. That dependency'staurifeature enablesossiframe-desktop/provisioning. - Generated apps get only the modules you select. Presets never enable an opt-in flag. Flags and presets: developer guide.
- Each app has a React frontend in
src/, a Tauri backend insrc-tauri/and its own SQLite file (doctor.sqlite3,deploy.sqlite3).
Request path
Source: crates/ossiframe-desktop/src/dispatch.rs (run_operation, poll_operation), service.rs, provisioning/engine.rs, crates/ossiframe-core/src/executor.rs, crates/ossiframe-ssh/src/{exec,shell,sftp,forward}.rs.
- Module operations go through
run_operation, which wraps the connection inReadOnly. It refuses every privilege exceptPrivilege::Userbefore the SSH executor is called. It guards only code handed the wrapper. - Commands are a program, argv, timeout, privilege and optional stdin (up to 1 MiB, never in argv or logs). Core quotes every word.
Privilege::Rootrenders as/usr/bin/sudo -n -- <program> ...andPrivilege::RunAsassudo -n -u <user>, neverroot. - Results are bounded and redacted, and not streamed to the frontend.
- Separate channels (PTY, SFTP, direct-tcpip) exist only in builds that enable them and live inside
ossiframe-ssh. Modules, the operation engine and the assistant never use them (security.md).
Operation engine
One engine in ossiframe-desktop runs provisioning and deployment. It needs the provisioning feature, so Doctor does not contain it. It calls a Provisioner trait defined in Core, which ubuntu-provisioning implements and app-deploy reuses.
Source: crates/ossiframe-desktop/src/provisioning/, remote_lock.rs, activity.rs, modules/app-deploy/src/commands.rs.
- Plan and approval. A deterministic plan is held in memory with its SHA-256 digest. A newer plan for the same server replaces it, and approval consumes it. Approval checks the plan id, expiry, digest, server identity (host, port, user, pinned host key), the connection, and that no operation is active or
UnknownOutcome. The module then rechecks for drift. Only the plan store can produce anApprovedPlan. - Steps. Long steps run as transient systemd units under
sudo -n, independent of the SSH session. The engine stores the unit name first and pollssystemctl show. - States.
Pending,Running,Verifying,Succeeded,Failed,Cancelled,UnknownOutcome. A disconnect, deadline, identity mismatch or crash givesUnknownOutcome. Nothing is retried, and the remote process is not stopped. Cancel is honoured between steps. Settling anUnknownOutcome(provision_reconcile,provision_mark_resolved): user guide. - Remote lock. The transient unit
ossiframe-provision-lockis taken at approval and kept until a terminal state other thanUnknownOutcome. systemd refuses a second unit with that name. The lock is cooperative (limits). A reboot clears it. - ServerActivity. One in-process registry per app. Under one mutex, an operation claim fails while file writes run on that server, and a file write fails while a claim is held. At most one claim exists per server.
- Verification. A component is verified only when all its
essentialchecks pass. - History. Operations keep an identity snapshot, so history survives profile removal. A profile with an unresolved operation cannot be removed, re-pointed or have its host key replaced. At startup, in-flight rows become
UnknownOutcome.
Evidence: verification/. Open checks: known-limitations.md.
Storage
| Data | Location |
|---|---|
| Profiles, pinned host keys, operations, events and steps, applications, releases, saved tunnels, installation id | SQLite in the OS app-data directory, one file per app |
| Passwords, key passphrases, AI provider keys | OS keychain, service name per app (credentials) |
| Doctor reports | Exported through a save dialog |
| Hosted application data | The server only |
- Tables:
servers,host_keys,operations,operation_events,operation_steps,meta,apps,releases(shared migrations, applied in every app), andtunnel_configs(its own migration list, applied only with thetunnelsfeature). - Observed server state is the source of truth. Cached data shows its age. SQLite and keychain code lives only in
ossiframe-desktop.
Module UI composition
A module's ui/ folder exports a ModuleUi (or several) and optional lifecycle hooks. The app lists the pages in src/modules.ts and passes them to ServerWorkspace from @ossiframe/ui. linux-audit replaces linux-inventory's page so Doctor's Overview shows both. Duplicate page ids are an error. Fields and exports: Module UI contract. Navigation: design-system.md.
Project generation
tools/ossiframe-cli resolves modules with the same registry code, renders templates/starter/, and writes a standalone project with a project record, ossiframe.json. Commands, flags and presets: developer guide. ADR-0007 decides how generated projects reference Core.
Runtime independence
A server is a set of observed facts and installed capabilities, not a "PHP server". NGINX and the database are shared. Each application has its own Linux user, directory, .env and logs. Managed config files use an ossiframe- prefix. Other files are never overwritten.
