The MoonBit host (wasmhost/, build/wasmhost) is the only host now. Gone:
host-wasm/ (Rust on the wasmtime crate, ~5,700 lines incl. Cargo.lock),
the run-rust, run-drm-rust and host-wasm recipes, and `just install --rust`
(both the recipe and session/install.py now stop with an error naming the
removal instead of quietly ignoring the flag). remote-build.sh builds and
pulls build/wasmhost. README, wasmhost/README and docs no longer describe a
second host, apart from short history notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiBxpbLoeUM9xfZayq
just install now builds as you, then asks for root once and installs the
whole thing: the login session (wasm compositor on the MoonBit host,
modules, chandra-ctl, KDE colors, portal) and face unlock (helper, PAM
module, config, models). The alternatives are flags instead of recipes:
--link (was install-dev), --rust (install-rust), --native
(install-native), --pam (install-face --pam), --no-face, --no-models.
The PAM module is compiled as you into build/, so root only copies it;
without a compiler or libpam headers face unlock is skipped with a warning.
just uninstall removes face unlock too (--purge: enrolled faces).
Removed: install-dev, install-rust, install-native, install-face,
uninstall-face and the old install-session* / uninstall-session aliases.
New docs/install.md; README, docs and installer hints updated. Also drops
a committed __pycache__ file and ignores __pycache__/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkA52AocBmJHipFRqb
--x11 shows the desktop on the X server in $DISPLAY: a resizable window
under a window manager (--fullscreen asks it for fullscreen), or the whole
screen when no window manager runs, following xrandr resizes.
compositor/x11 is a pure X11 wire-protocol client (no libX11/xcb), so it
runs in the wasm compositor on both hosts and in the native build. Frames
go through MIT-SHM 1.2 (ShmAttachFd of the host frame memfd, paced by
ShmCompletion), with a core PutImage fallback. The keymap given to clients
is the X server's own (xkbcomp -xkb $DISPLAY -); X auto-repeat is dropped,
modifier/lock state comes from X's modifier map; MIT-MAGIC-COOKIE-1 auth.
chandra-session --x11 (and the new "Chandra (X11)" xsessions entry) runs
it as the login session; --login-session gives an X11 session what --drm
implied (power actions, polkit agent, system theme). just run-x11.
Docs: docs/x11.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
- face/pixi.toml + pixi.lock (python 3.12, numpy, opencv-python-headless). `just install-face`
passes the pixi on your PATH; install.py runs `pixi install --frozen` as root into
/usr/local/lib/chandra/face-env (not the checkout's .pixi: the PAM module runs this Python as
root, so it must not be user-writable), writes the helper's shebang for it and builds the PAM
module with it as the default python. No python3-opencv needed; uninstall removes the env.
- The PAM module now also refuses a Python that isn't root's; group-writable is accepted only
for group root (conda/pixi files are 0775 root:root), in the module and chandra-face's checks.
- Elevation re-runs on the same interpreter (sys.executable). "OpenCV is missing: run just
install-face" instead of naming the distro package. Dropped a stray __pycache__.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
- face/pam_chandra_face.so (`-auth sufficient`): runs `chandra-face compare` as root with a clean
environment, forwards what it says as PAM_TEXT_INFO / PAM_ERROR_MSG, and maps its exit status
to success / auth error / unavailable, so the password always still works. Skips remote
sessions (PAM_RHOST, SSH_CONNECTION), a closed lid and users without faces; refuses a helper
that isn't root's; kills one that hangs (timeout + 6 s).
- face/chandra-face (Python + OpenCV): YuNet finds the face, SFace embeds it, cosine similarity
against the enrolled embeddings (threshold 0.42, two matching frames, dark IR warm-up frames
skipped, optional require_ir). enroll / list / remove / clear / test / status / pam
enable|disable / fetch-models (sha256-pinned opencv_zoo models). Embeddings only, in
/var/lib/chandra-face/USER/faces.json (root, 0600); labels in faces.list (0644). Store, config
and models must be root's and not writable by others. Root commands re-run through run0 (or
pkexec), so polkit asks first. Settings in /etc/chandra/face.conf.
- `just install-face [--pam]`, `just uninstall-face [--purge]` (face/install.py; uninstall takes
the module out of every PAM service first). `pam enable` inserts before the first auth or
@include line (Debian's sudo has only @include common-auth), keeping a .bak.
- Password dialog: a face row ("Looking for your face…" with a sweeping ring, "Face
recognized", or why not, "Type your password instead"); typing and Enter during the scan go in
when PAM asks for the password. Howdy's pam_howdy.so messages are understood too.
- Settings > Session > Face unlock: "Use my face for passwords" (polkit-1 + sudo), the enrolled
faces (Remove takes a second click), "Add a face…", and the tool's progress. New `face-unlock`
capability: tables 24 (status) and 25 (faces), request 44, in the wasmer/wasmtime stub, the Rust
host, the MoonBit wasmhost and chandra:host/plasmoids. compositor/shell/face.mbt runs the tool
on a socket so the compositor never waits.
- Tests: face/test_face.py (fake camera of PGM frames + fake recognizer; --pam builds the module
and runs it through pamtester), dialog states and message parsing (polkit_test), the dialog via
a mock helper (auth_test, shots 14/15), Settings against a fake chandra-face (face_test).
scripts/test.sh runs them (compositor/polkit was missing from its native list), CI installs
libpam0g-dev + pamtester. Also regenerated two stale desktop-module bindings (doc comments).
- docs/face-unlock.md, including the limits of 2D face recognition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
install-session(-dev/-rust/-native) become install(-dev/-rust/-native) and
uninstall-session becomes uninstall, so installing is just `just install`.
The old names stay as hidden recipes that print a one-line note and run the
new one. Docs, scripts and comments now point at the new names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hj5zRiffcgWaggHdjv
Until now a module reload was only reachable by clicking Settings > Panel inside the session.
Now:
- The compositor listens on $XDG_RUNTIME_DIR/chandra/<wayland socket name>.sock (the login
session's is wayland-moon-0.sock) with a line protocol: ping, list, reload [NAME], help.
Replies end with an "ok ..." or "error ..." line. It lives in compositor/host/control.mbt,
runs from ChandraCompositor::step, and its fds join the idle loop's wait set, so an idle
desktop still sleeps (measured ~0.4% CPU on wasmhost, ~0.1% on host-wasm) and wakes for a
command. A path another live compositor answers on is left alone.
- DesktopShell::reload_modules(name) reloads every loaded module (or those whose module id,
stem, slot or path is NAME) in place via replace_slot: same panel position, saved
:module-config applied, a module that fails to load stays as it was and the error is
reported to the caller and shown as a notice. The catalog is rescanned.
- SIGUSR1 to the host reloads every module (result in the log and the notice): new WIT
function sys.take-sigusr1, implemented in compositor/sys (native build and wasmhost) and
host-wasm; the handler has no SA_RESTART so it interrupts the idle poll.
- session/chandra-ctl (installed to /usr/local/bin), `just reload [NAME]`, docs/reloading.md,
README.
- Tests: compositor/host/control_test.mbt (protocol, reload all / by name / by slot, order
and settings kept, failing module kept, busy socket). Checked headless on both hosts with
chandra-ctl and kill -USR1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjLJtvYcgW48okL6qQ
- scripts/as-root runs a command as root with run0 (systemd PID 1 + run0 present), else sudo,
doas or pkexec; resolves the program to an absolute path since run0 doesn't inherit PATH.
The install-session recipes use it and pass install.py by absolute path.
- session/chandra-root (installed to /usr/local/bin): run a graphical app as root inside
Chandra, passing WAYLAND_DISPLAY (absolute) and the Wayland toolkit variables through
run0 --setenv (or sudo/doas/pkexec env).
- chandra-session: refuses to run as root (CHANDRA_ALLOW_ROOT=1 overrides), fills in HOME and
XDG_RUNTIME_DIR when started without a login environment, logs when the logind session has
no seat (run0 --user / su / ssh), and starts an installed polkit agent once the socket is up
so run0/pkexec from the launcher can prompt (CHANDRA_POLKIT_AGENT picks one or 'none').
- install.py: checks for root before --remove too; installs chandra-root.
- docs/run0.md: invocations for installing, starting from a TTY, apps as root, polkit agents.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkq6Hq7AXG85g5HyJU
The Rust host stays as a fallback: just run-rust, run-drm-rust, install-session-rust
(session/install.py --rust-host). build-wasmhost.sh fetches the wasmtime C API when it is
missing and replaces build/wasmhost by renaming, so a running dev session keeps its copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
Syncs the tree to a sprite at the same absolute path (host-wasm/build.rs bakes the
checkout's .pixi lib dir into the host's rpath), builds host, compositor.wasm and the
panel modules there, and pulls the artifacts back.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hk4tUnZsmzjbobxkwy
wasmhost/ runs build/compositor.wasm with wasmtime linked as the upstream C API
library (fetched by setup-toolchain.sh) instead of compiling it: a cold build is
about 4 s against about 2 min for host-wasm. sys and font reuse the native
compositor's packages; the rasteriser is a port of host-wasm/src/raster.rs with the
pixel work in C, SVG through nanosvg. Panel modules, --drm and --window come next;
host-wasm stays the working host until then.
wit: sys.append-file. The C API moves list<u8> as one dynamic value per byte and
wasmtime caps what one call may copy, so the component writes files over 1 MiB as
write-file plus appends (host-wasm implements it too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
Add a pixi `modules` task that runs scripts/build-modules.sh. The justfile
`modules` recipe calls it, and `run` now depends on `modules` so the panel
has its wasm modules when the compositor starts.
Drop pulse, clock-digital12, moon-disc and moon-text from components.txt.
They had no source in any branch, so the build skipped them every time.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Add seatd (libseat headers and library) to the pixi workspace, so the
host-wasm build no longer needs a system libseat. Set channel priority
to disabled so the solver can resolve seatd's libsystemd0 dependency.
Activation env points CPATH, LIBRARY_PATH and LD_LIBRARY_PATH at the
pixi prefix. The justfile runs every recipe through `pixi run`, so a
plain `just run` builds and launches against the pixi environment.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.
Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.
The remote repository keeps its experiments/moon-plasma name for now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
As a login session, launched apps were put on a private dbus-daemon bus (meant
only to stop single-instance apps forwarding to a host session when nested).
That bus has no org.freedesktop.secrets, so apps D-Bus-activated a second,
locked gnome-keyring-daemon on it: unlock prompts / "create default keyring"
dialogs, even though pam_gnome_keyring had already unlocked the login keyring.
The session script also wrapped everything in dbus-run-session whenever
DBUS_SESSION_BUS_ADDRESS was unset, splitting off from systemd's user bus.
- host-wasm + native sys stub: start the private bus only when nested
(WAYLAND_DISPLAY or DISPLAY set); under --drm apps use the session bus.
- moon-plasma-session: use $XDG_RUNTIME_DIR/bus when it exists, fall back to
re-running itself under dbus-run-session; push WAYLAND_DISPLAY and
XDG_* into the D-Bus/systemd activation environment so gcr-prompter can show
unlock prompts; run gnome-keyring-daemon --start --components=secrets.
- justfile run-drm(-native): update the activation environment too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhWvZgm7r2v8NpS2g4
- New 'session' capability (wit/capabilities.wit) and 'logout' panel module: a button whose popup
asks 'Log out | Cancel' (Enter confirms, Escape cancels). Confirming makes the compositor exit,
which ends the login session; works in the wasm host and the native build. In the default panel.
- session/install.py --link (just install-session-dev): symlink the host, component, modules,
fonts and config into this checkout, so after one root install a rebuild is just
'just compositor-wasm host-wasm modules' for the next login. Plain installs still copy.
- Tests: host runtime test for the module, native end-to-end test (click, cancel, confirm).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New moonplasma:host/display import (open, poll, present, cursor, input events, close). The
wasmtime host implements it by compiling the compositor's own kms shim (libseat + DRM/KMS +
libinput + xkbcommon) via build.rs (feature drm, default on), so the native and wasm backends
share one implementation. compositor/kms gets a wasm backend with the same API, and the shared
app loop gains --drm.
- session: install.py installs the host, compositor.wasm, fonts, config, wit and modules and the
display-manager entry (--native keeps the old native session); the launcher starts the host
when installed. just run-drm / install-session use the wasm compositor; *-native keep the old.
- compositor.wasm moves to build/ (out of build/components, where the module catalog scans).
Verified: component builds with the new import, host instantiates it and renders frames, installed
layout (fonts/modules/theme from the share dir) renders correctly in a sandbox, native build and
tests unchanged. NOT exercised on a real login VT.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The whole compositor (Wayland server, window manager, scene, rasteriser, shell) now builds as
build/components/compositor.wasm: a component that imports only moonplasma:host/sys
(wit/host/sys.wit: sockets + SCM_RIGHTS, memfd, poll, spawn, files, clock) and exports run().
host-wasm/ is the native side: a wasmtime program implementing that interface with libc.
- compositor/sys: per-target backends (sys_native.mbt over the C shim, sys_wasm.mbt over the WIT
imports) behind one API; wayland/nested/host/shell/scene/renderer/gfx build for wasm unchanged.
- compositor/app: the entry point (arg parsing + main loop) as a library for both targets;
--serve keeps refreshing a PNG so a live compositor can be inspected without a display.
- compositor/font, compositor/wasm: wasm-side placeholders (bitmap font; no panel modules yet,
since a component can't embed a second wasm runtime: that becomes a host import).
- scripts/gen-native-stubs.py: native stand-ins for wasm-only generated imports.
- just compositor-wasm / host-wasm / run-wasm.
Verified: foot connects to the component's socket and renders into it; native build and
tests unchanged (16/23, the same 7 need unbuilt panel modules).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/tcc/tcc resolves the compiler (and errors with how to get one if none exists);
tcc-build stays as an optional recipe. bench no longer depends on it either.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/bench-build.sh copies the sources to a temp dir with its own target dir, so it
never touches _build/ or files being edited. just bench [runs] ["tcc cc cc-release"].
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Panel and wasm host
- The panel is built from wasm plasmoid modules (compositor/wasm: wasmer-backed host).
Modules get capabilities by importing host interfaces; the host publishes data tables
and serves a request queue (launch, focus window, set layout, inspector, load/unload
modules). New WIT: windows, layout-control, inspector, modules, system.
- Merged two competing host designs: generic tables + requests are the base; the
`system` snapshot and the id-stable `windows.all/focus` (Desktop Pulse) run on top of it.
- Panel widgets: load a .wasm from a path or file chooser, reorder by dragging,
right-click replace/remove/add, saved to panel.edn.
- Desktop widget, system sampler (sysinfo), app catalog/humanised names, Interface
Explorer (inspector), real font rendering (compositor/font, assets/fonts).
Compositor
- Drag the divider between tiled windows; lower tiled rows leave room for the title bar.
- Title-bar buttons, 12-hour clock, truncated titles, task-list/layout menus.
- DRM/KMS session, tcc debug builds (vendored tinycc incl. conftest.c), justfile
recipes (modules, run, test), pixi.toml.
Known gaps
- The sources for the pulse, tasks, layout, inspector, module-manager, moon-* and
clock-digital12 modules are not in the tree yet, so `just modules` stops at pulse and
the host tests that load those modules fail until they land.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
compositor/kms: libseat (device access, VT switching), DRM dumb buffers with page
flips and a hardware cursor, libinput keyboard/pointer, xkbcommon keymap and
modifiers. --drm runs the compositor on the real display at the monitor's native
mode. session/ holds the display-manager entry, launcher script and installer
(just install-session). Untested on hardware: refuses to start inside another
session.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
moon adds -DMOONBIT_NATIVE_NO_SYS_HEADER whenever the C compiler is tcc, which
compiles the system runtime out and breaks linking a standalone exe; the
scripts/tcc/tcc wrapper drops that flag. just tcc-build builds third_party/tinycc
into _build/tcc; build-release keeps the optimised system-cc build.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The compositor opens an xdg_toplevel on $WAYLAND_DISPLAY, presents frames via
wl_shm with frame-callback pacing and forwards host pointer input to the gfx
surface. just run now uses it (release build); run-headless keeps the old mode.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>