LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.
C cdebiandesktop-environmentebpffirewalllandlocklinuxlinux-distributionopen-sourceprivacyquickjsraspberry-pi-5reactsecuritywaylandwayland-compositor
Plan: System Information (0.8.5, also from the live USB), LordBench (0.8.6), community hardware reports (0.8.7) and Lumo, the local assistant; the firewall rules manager gets its own release
Federico Pereira630475d5cd9b
diff --git a/docs/BENCHMARK.md b/docs/BENCHMARK.mdnew file mode 100644index 0000000..85926fc--- /dev/null+++ b/docs/BENCHMARK.md@@ -0,0 +1,247 @@+# System Information, LordBench and hardware reports (proposal)++**Status: design proposal, nothing here is built yet.** It plans three releases and a later stage:++| Release | What |+|---|---|+| **0.8.5 — System Information** | Every piece of hardware detected, what LordOS uses (above all the GPU), the services, the paper's claims checked on this machine, JSON/Markdown reports. |+| **0.8.6 — LordBench** | Measurements of CPU, memory, GPU, the compositor, video and storage under recorded, reproducible conditions, with versioned results. |+| **0.8.7 — Community hardware reports** | Publishing reports as GitHub issues, validating them, and a tested-hardware catalogue on lordos.org that the app also reads. |+| **Later — Lumo and AutoTune** | `ROADMAP.md`, "Lumo, the local assistant": explains a report and tunes settings from what the machine measured. |++The aim is that every claim LordOS makes (memory at idle, GPU use, isolation) can be backed by a+reproducible report, not only a screenshot. Results must be technically defensible first and+attractive second.++## Architecture: the logic is not in the interface++The collector, the checks and the benchmark are native components with no UI, used by three+clients so no logic is duplicated:++```+server/src/sysreport/ collector + checks (library, read-only, no root)+server/src/bench/ LordBench workloads (library)+ │+ ├── lord-server: lord.sysinfo (js_hw.c) → apps/sysinfo (the app)+ ├── lordos-sysreport report | checks | bench [--quick|--full] --json (CLI, runs as the user)+ └── tests (fake sysfs trees, fixtures) and, later, Lumo's tools+```++- **`lordos-sysreport`** is an ordinary user command in `/usr/bin` that the user or a test script+ runs; `lord-server` never runs it. It writes the same JSON as the app, so reports can be made on+ a machine without a session (a headless Pi, a VM over SSH, CI).+- **`lord-bench`** is the helper the app starts for workloads, launched like `lord-doc` and+ `lord-media`: fixed path (`<lord-server dir>/lord-bench`), no arguments, minimal environment,+ channel on fd 3, `sandbox_apply_helper()` before any work; it gets only the render node and a+ temporary file as fds. It links libc and Mesa's EGL/GLES (already used by the GPU path), nothing+ new. The CLI links the same library directly.++## 0.8.5 — System Information++One native app, **System Information** (`apps/sysinfo`), also opened from About LordOS →+**System Report…**. Tabs: **Overview**, **Hardware**, **Compatibility**, **Checks**, **Report**+(LordBench adds **Performance** in 0.8.6).++### Hardware++A sidebar tree and a detail pane, with vendor and device names from `pci.ids` and `usb.ids`:+hardware overview (model, vendor, firmware version and date, board, chassis type, Secure Boot),+CPU (cores, threads, frequencies, caches, SSE4.2/AVX/AVX2/AVX-512/FMA, NEON/SVE, governor,+microcode), memory (total, swap, zram; per module through the read-only admin action+`hw-memory-modules`), graphics, displays (monitor name and size from the EDID, mode, refresh,+scale, card, scanout), storage (interface and link speed, size, SMART health), USB and+Thunderbolt, PCI with drivers and missing firmware, audio, network, Bluetooth, power, thermal and+fans, cameras and input, Raspberry Pi (revision, bootloader, throttling and under-voltage flags,+fan header, kernel revision), software (Debian, kernel, the kernel options LordOS depends on, the+LordOS services and their state, the code manifest).++Serials, UUIDs, MAC addresses and EDID serials are shown only on screen, on request, and never+enter a report.++### The GPU as separate layers++"Is the GPU used" is not one answer. For every card the app shows each layer on its own, with+**Available**, **Not available**, **Not checked** or **Not measurable on this driver**:++| Layer | How it is known |+|---|---|+| Device detected | PCI or platform device, vendor and model |+| Kernel driver loaded | the device's `driver` link (`amdgpu`, `i915`, `xe`, `nouveau`, `nvidia-drm`, `v3d`/`vc4`, `virtio_gpu`…) |+| DRM/KMS available | a card node with connectors, modesetting working (`kms.c`) |+| Render node | `/dev/dri/renderD*` openable by the session |+| EGL context active | `lord-server` created one; the GL renderer string; hardware or software (llvmpipe) |+| Composition | the GPU path is on, or the exact reason it's off (the same one the log gives) |+| Direct scanout | seen during a fullscreen video or app, with the count since the session started |+| Video decode | VA-API profiles per codec (`MK_HWPROBE`); on the Pi 5 the HEVC V4L2 decoder |+| Video encode | the remote desktop's encoder when it's used |+| Vulkan | ICD files present only ("Not checked"); loading Vulkan belongs to stage 2 |++Live load is shown only where the driver exposes it (`amdgpu`: busy % and VRAM); elsewhere the app+says it isn't measurable instead of showing a zero. The Nvidia proprietary driver is shown as+**untested** with an invitation to send a report.++### Checks: configured versus effective++Each check says what it verified, at one of two levels, and never claims the stronger one without+the test:++- **Configured**: the mechanism is present (a kernel option, a service running, a flag in+ `/proc`).+- **Effective**: a probe tried something that must fail, and it failed.++| Id | Paper | Configured | Effective |+|---|---|---|---|+| `sec.server-user` | §2.2 | `lord-server`'s uid ≠ 0 | — |+| `sec.app-sandbox` | §6.4 | `Seccomp: 2`, `NoNewPrivs: 1` on an isolated app | a probe app (a system package started like any isolated app) tries to read a file outside its grant, open a socket, `ptrace`, create a user namespace and reach another app's scope; every attempt must be refused |+| `sec.helper-sandbox` | §6.7 | — | `lord-bench` itself checks after its own lock-in that `open` of a path, `socket` and `execve` fail |+| `sec.landlock` | §6.4 | Landlock ABI ≥ 6 | covered by the probe app |+| `sec.netperm` | §6.6 | `lord-netperm` running, programs attached, devices and Bluetooth programs loaded | the probe app, denied the network by a temporary rule, fails to connect to a local listener |+| `sec.code` | §6.9 | manifest present | every loaded bundle verified in this session |+| `sec.remote-closed` | §11.4 | remote desktop setting | nothing listens on 5673 when it's off |+| `sec.cgroups` | §11.4 | root-owned session tree, one scope per app | — |+| `perf.idle-memory` | §7.1 | — | memory used after 60 s idle at the desktop, with the session's resolution and number of displays recorded |+| `perf.idle-cpu` | §7.1 | — | CPU idle over 30 s with nothing open |+| `perf.boot` | §7.1 | — | systemd's firmware, loader, kernel and userspace times |+| `gpu.used` | §7.3 | hardware renderer exists | GPU path on, or a warning with the reason |+| `sys.time`, `sys.firmware`, `sys.fans`, `sys.memcg`, `sys.pi-bootloader`, `sys.updates` | various | as listed in the Hardware tree | — |++Thresholds live in a signed data file (`assets/sysinfo/checks.json`, in the code manifest). A+failed check offers **Report a problem** with the bug template.++### Compatibility++A panel per component (GPU, display, storage, network, Wi-Fi, Bluetooth, audio, power, suspend)+with its state: **Works**, **Works with limits** (and which), **Doesn't work**, **Not checked**. In+0.8.5 it comes only from this machine's detection and checks; from 0.8.7 it also shows what other+users confirmed for the same device and LordOS version, marked as community data.++### Reports++A versioned JSON (`schema: 1`) and a Markdown summary, saved to `~/Documents`:++- **Built from a fixed allow-list of fields.** Serials, UUIDs, MAC and IP addresses, host and user+ names, Wi-Fi network names and home-folder paths are never collected into it; a unit test feeds a+ fake system full of such values and checks none reaches the output.+- **Preview first**: the exact text that would be shared, field by field.+- **Explicit consent** for every share, never remembered.++## 0.8.6 — LordBench++### Two kinds of tests, kept apart++- **Peak performance**: the workload gets the machine. LordBench first waits for a quiet system (CPU+ idle above a threshold for 10 s) and refuses or marks the result if something else keeps the CPU+ busy; it records the load it saw.+- **Desktop impact**: the same workloads at low priority while the compositor animates a scripted+ scene, measuring the compositor's frame times and input latency. This answers "does the desktop+ stay smooth under load", a separate question with separate results.++### Workloads++| Category | Workloads |+|---|---|+| CPU, one core and all cores | SHA-256 (`pkg/crypto.c`), deflate, a matrix multiply; LordOS's own work: layout and paint of a fixed scene, shaping a fixed paragraph in several scripts, QuickJS running a fixed script |+| Memory | bandwidth (copy, triad) and latency (pointer chase) |+| GPU | offscreen GLES on the render node: fill rate, texture upload, composing N screen-size layers, timed with fences |+| Compositor | `lord-server`'s own frame counters during a scripted window drag, CPU path and GPU path |+| Video | short test clips we generate (H.264, HEVC, VP9, AV1; 1080p and 4K) decoded in `lord-media`, hardware and software; the remote desktop's encoders |+| Storage | sequential and random I/O on a size-limited temporary file (Full only, with a warning on SD cards) |+| Sustained | several minutes of all-core load (Full only) |++### Frame times against the refresh budget++The compositor results are reported as the **real time to build a frame** (paint plus present),+and separately as the share of the display's budget it uses (16.7 ms at 60 Hz, 8.3 ms at 120 Hz,+6.9 ms at 144 Hz) and the frames missed. No fixed threshold for every display: a check passes when+the 99th percentile fits the budget of the refresh rate actually in use.++### Thermal and power safety++- The limits come from the hardware: the thermal zones' passive and critical trip points, the+ CPU's own throttle state (cpufreq dropping below the requested frequency), the Pi's throttling+ and under-voltage flags. A run stops before the passive trip point and when throttling starts in+ a peak test; in the sustained test throttling is the result, recorded with its time and+ temperature.+- No run on battery below 30 %; a laptop on battery is recorded as such.++### Recorded conditions++Each result carries what affects it: resolution, scale and refresh rate of every display, GPU path+on or off, power source and profile, governor, temperatures at start and end, throttling seen, the+system load before starting, kernel, Mesa and LordOS versions, LordBench version. Two results are+compared only when the LordBench version matches; differing conditions are shown next to the+comparison.++### Results without one magic number++Three separate verdicts, never folded into one score:++- **Performance**: per category, normalized to a set of **reference machines** (initially a+ Raspberry Pi 5 8 GB, a modest x86 PC and a VM), shown as "×N of reference" for each, so a board+ and a workstation are each compared with something similar.+- **Compatibility**: from the Compatibility panel.+- **Stability**: errors and crashes during the run, frames missed under load, throttling.++## 0.8.7 — Community hardware reports++- **Share on GitHub** saves the report as a small HTML page and opens it with the default browser+ (the existing `lord.apps.launchWith('', path)` rule). That page opens GitHub's new-issue form with+ the `hardware-report` template, title and summary filled in; the user attaches the JSON and+ submits it with their own account. LordOS sends nothing by itself and holds no token.+- A workflow validates each attached JSON against the schema, labels the issue by vendor and kind,+ and flags reports whose numbers are implausible for the hardware.+- **lordos.org/hardware**: the catalogue built from accepted reports: GPUs and drivers tested,+ boards, laptops with suspend, battery and Wi-Fi, known problems and the version that fixed them,+ real LordOS performance per device. The app's Compatibility panel reads a signed snapshot of it+ (downloaded with the package engine's checks), so it works offline.++## From the live USB, without installing++The app and LordBench are in the ISO, so anyone can start a PC from the LordOS USB stick, check+the machine and send a report without installing anything or touching its disks. This is likely+the main source of PC reports: it costs the tester nothing and answers "will LordOS work here"+before installing.++- **A boot menu entry**, *Check this computer*, starts the live session straight into System+ Information (0.8.5) and its Performance tab (0.8.6). The normal live session has it in the Dock.+- **The report says it was live**: boot medium (USB, its link speed), the overlay in RAM, no+ persistence. Live and installed results are kept apart in comparisons and in the catalogue.+- **Different references where live changes the numbers**: idle memory is compared with the+ paper's live figure (465 MB) and the overlay's size is subtracted and shown; boot time includes+ reading from the stick and is reported, not judged.+- **Nothing written to the computer's disks.** Internal disks are detected and their SMART health+ read; the storage test only runs on the live overlay in RAM and, read-only, on the USB stick, and+ says so. Measuring the internal disks waits for an installed system.+- **Where the report goes:** with no persistent home, the app saves it to a removable drive the user+ picks (a second stick, or a writable partition on the same one if present) or shares it directly+ through the browser when there is a network connection.+- **Missing firmware and drivers** are especially valuable here: the report lists what the ISO+ lacked for this machine (Wi-Fi, GPU firmware), which tells us what the ISO should carry.+- **The installer reuses the same checks** (`server/src/sysreport/`): before installing it shows+ the Compatibility summary (for example "GPU: not used, software renderer" or "Wi-Fi: firmware+ missing") so the user knows before replacing their system.+- **Limit:** machines with Secure Boot on can't start the stick until LordOS is signed for it+ (paper §10.2); the website's download page says so next to the *Check this computer* guide.++## New interfaces, all under the rules of `AGENTS.md`++- `lord.sysinfo` in `server/src/ui/js_hw.c`: `scan()`, `checks()`, `report()`; in 0.8.6+ `bench.start(kind)`, `bench.poll()`, `bench.cancel()`.+- `lordos-sysreport`, a user command (not started by `lord-server`).+- One read-only admin action, `hw-memory-modules` (anyone, no arguments): SMBIOS memory device+ entries parsed strictly in C, returning slot, size, type, speed and manufacturer only.+- The probe app for the effective checks: a signed system package started through the existing+ `lord.apps.launchPackage(id)`; no new launcher path.+- `lord-bench` (0.8.6), as above.+- Data packages `pci.ids` and `usb.ids` (Debian, architecture `all`), documented in `VM-SETUP.md`.++## Work plan for 0.8.5++1. `server/src/sysreport/`: collector, GPU layers, `pci.ids`/EDID readers, fake-sysfs fixtures+ (AMD desktop, Intel laptop, Nvidia desktop, Raspberry Pi 5, VM), the anonymization test,+ `hw-memory-modules`, `lordos-sysreport report`.+2. The app: Overview, Hardware, Compatibility; About's button; en, es, pt; right to left.+3. Checks, configured and effective, the probe app, signed `checks.json`, `lordos-sysreport checks`.+4. Reports with preview; docs; screenshots on VMs; the first real reports: the Raspberry Pi 5 with a+ monitor and the maintainer's PC (Core i9-10900, Radeon RX 580), the first real AMD data in the+ project.diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 2842d78..9e1da63 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -541,7 +541,7 @@ Details in `MAIL.md`. Tested on VM 123 against local Dovecot, Postfix and RadicaURLs allowed. Lists never override a user's explicit allow rule.- Performance budget measured as in 0.8.3 (no visible cost with thousands of list entries).-- [ ] **Firewall rules manager (0.8.5)** — a "Rules" section in the Monitor (our own design):+- [ ] **Firewall rules manager (its own release after 0.8.5)** — a "Rules" section in the Monitor (our own design):- **Sidebar:** All rules, Active, Denied, Recently modified, Recently used, Temporary, Unapproved(rules created silently, waiting for review, with a count); then Rule groups, Blocklists andProfiles, each with an on/off checkbox.@@ -572,6 +572,32 @@ Details in `MAIL.md`. Tested on VM 123 against local Dovecot, Postfix and Radica- **Command line:** `lordos-fw` to list, add and remove rules, switch profiles, export, and logallow/deny events, through the same validated API as the Monitor (no root shortcut).+- [ ] **System Information (0.8.5)** — design in `BENCHMARK.md`. A native app (`apps/sysinfo`,+ also About LordOS → System Report…) with every piece of hardware detected and what LordOS uses:+ each GPU as separate layers (device, driver, DRM, render node, EGL context, composition, scanout,+ video decode and encode), the services, a Compatibility panel, and the paper's claims checked on+ this machine, each marked *configured* or *effective* (a probe app tries what must fail). JSON+ and Markdown reports with preview, built from an allow-list of fields. The logic lives in+ `server/src/sysreport/`, shared by the app, the `lordos-sysreport` command and tests.+ - [ ] collector, GPU layers, `pci.ids`/EDID readers, fake-sysfs fixtures, anonymization test,+ the read-only `hw-memory-modules` admin action, `lordos-sysreport`;+ - [ ] Overview, Hardware and Compatibility tabs (en, es, pt, right to left);+ - [ ] Checks, configured and effective, with the probe app and a signed `checks.json`;+ - [ ] reports; first real reports from the Pi 5 with a monitor and the RX 580 PC.+ - [ ] from the live USB without installing: a *Check this computer* boot entry, reports marked+ live, nothing written to the computer's disks, saved to a removable drive; the installer shows+ the Compatibility summary before installing.+- [ ] **LordBench (0.8.6)** — `BENCHMARK.md`. Workloads in the sandboxed `lord-bench` helper+ (CPU and LordOS's own work, memory, GPU, compositor, video, storage, sustained load); peak+ performance and desktop impact measured apart; frame times against the refresh rate actually in+ use; stops on the hardware's trip points and throttling; every result records its conditions;+ three verdicts (performance against several reference machines, compatibility, stability), no+ single score; results versioned.+- [ ] **Community hardware reports (0.8.7)** — `BENCHMARK.md`. Share on GitHub with the+ `hardware-report` template (the user submits it, LordOS sends nothing), schema validation and+ labels in a workflow, and a tested-hardware catalogue on lordos.org that the Compatibility panel+ reads as a signed snapshot.+- [x] **Remote desktop over WebRTC (0.8.4)** — see `REMOTE.md`, "Video (WebRTC)". Until 0.8.3 thebrowser got PNG/JPEG tiles over a TLS WebSocket, and a connection switched the session to CPUcomposition. Now:@@ -748,6 +774,35 @@ Details in `MAIL.md`. Tested on VM 123 against local Dovecot, Postfix and Radicamail, denied and confirmation-required paths, and an external security review of thedesign and the code before it ships.+- [ ] **Lumo, the local assistant (after 0.8.7)** — an assistant that+ runs on the machine, talks with the user and uses LordOS only through the closed tools of the+ MCP item above. Input: the maintainer's design notes and the results of a prototype on another system (Qwen3 1.7B and+ 4B with llama.cpp; on the test PC the CPU beat the RX 580 offload by 2.5×, so nothing is assumed+ per vendor). Adapted to LordOS's rules:+ - **Inference in a sandboxed helper** (`lord-ai`, like `lord-media`): the only binary that links+ llama.cpp; no network, the model file as an fd, a private channel to `lord-server` (no TCP port,+ no HTTP API another app could reach). The Python prototype is reference only and doesn't ship.+ - **Models only with consent:** a signed catalogue on lordos.org (hash and licence per model),+ downloaded through the package engine's checks, loaded on demand and unloaded when idle.+ - **AutoTune** on `server/src/sysreport/` and LordBench: the CPU always measured as the baseline,+ thread counts, partial and full GPU offload where the backend allows it (Vulkan in `lord-ai`+ only), prompt and generation speed, memory; the choice and its reason stored per machine,+ re-measured after a kernel, driver or engine change; the desktop keeps its share of the CPU.+ - **Permission levels mapped to what exists:** reading (level 0) through the SDK's read-only+ calls; user actions (level 1) behind a LordOS prompt like camera and microphone; administrator+ actions (level 2) only through existing closed admin actions, with the password typed in a+ system dialog checked by the root side, never in the chat or the model's context. The level is+ LordOS's policy, never something the model declares.+ - **First demo:** "Lumo, open the calculator" opens it through `lord.apps.launch(id)` with an id+ LordOS offered, and the result shown is the launcher's real result.+ - **For the benchmark:** explain a report in plain words, compare it with published community+ reports, suggest what to try (a driver, a setting) and draft the issue text the user sends.+ - **Tests:** `lumo-agent-bench`, 50–100 scenarios (right tool, valid arguments, unknown tools,+ ambiguous requests, consent, admin without rights, real errors, prompt injection through files,+ mail and pages), scored separately from speed; a fast model that misuses tools isn't chosen.+ - **Off by default**, visible while working (menu bar indicator, every call in the Monitor), and+ reviewed like the MCP study before it ships.+- [ ] **Virtual machines**: a **free desktop virtualization app**, with the polish andway of working of the best commercial ones (not Proxmox's, which only contributes the pieces underneath: KVM, QEMU and drivers).A generic name and our own logo, icon and colors: