Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

Remove finished planning documents

oxydizer121b15446209
diff --git a/docs/plans/i18n.md b/docs/plans/i18n.md
deleted file mode 100644
index 2ceca3b..0000000
--- a/docs/plans/i18n.md
+++ /dev/null
@@ -1,398 +0,0 @@
-# Plan: translating the RediWM UI
-
-Status: implemented with the language work on 2026-10-20. The original survey
-and design below describe the groundwork. Compiled catalogs, extraction,
-validation, lint, pseudo-language, shell/Control Center/app conversion and
-review tooling now exist. See [languages.md](languages.md) and
-[the contributor guide](../../po/README.md); native review remains pending.
-
-Scope: this is the groundwork only. It stops hardcoding English so that a
-language can be added later by dropping in one `po/<lang>.po` file, with no
-code change. No real translation ships as part of it; the `qps`
-pseudo-locale is what proves the machinery works.
-
-## Starting point (original survey)
-
-Every user-facing string is an English literal at its call site
-(`"Cancel"`, `"Forget Device"`, `"Delete {s}?"` through `std.fmt.allocPrint`).
-There is no gettext, string table or catalog. A rough grep finds ~1,300
-capitalised literals under `src/`: `control_center` 609, `files` 361, top-level
-`src/*.zig` 531 (power menu, taskbar, notifications, dialogs), `network` 104,
-`start_menu` 68, `images` 65, `ui` 56, `desktop` 55, `screenshot` 47,
-`editor` 43, `pdf` 38, `polkit` 34. A large share of that is not UI text
-(IPC error names, D-Bus members, widget ids, log lines), so the real count is
-an output of Phase 0, not an input.
-
-What already exists and the plan builds on:
-
-* `[region] language` is an installed glibc locale (`en_NZ.utf8`).
- `child_env.applyRegion` writes it into `LANG`, `LC_MESSAGES` and `LC_CTYPE`
- of every app the compositor launches, so GTK/Qt apps already follow it.
-* `[region] formats` drives the clock (`Taskbar.zig` keeps a private
- `locale_t`) and the `LC_TIME`/`LC_NUMERIC`/... categories for children.
-* `start_menu/applications.zig` parses `Name[de]=` locale keys in `.desktop`
- files.
-* Text goes through FreeType + HarfBuzz (`ui/text.zig`) with fontconfig
- fallback for missing glyphs, so CJK, accents and emoji draw. The Editor uses
- Pango and has `ime.zig`.
-* Tests find widgets by `name` (`ui.find(name, panel=...)`), not by label, so
- most of the suite is insulated from wording. Six files still reference
- English labels (`app_activation`, `keyboard_shortcuts`, `notifications`,
- `bluetooth`, `control_center`, `power`); they run in English and stay valid.
-
-What is missing: any lookup, any catalog, plural handling, and a layout that
-tolerates strings of other lengths.
-
-## Goals and non-goals
-
-Goals:
-
-* One lookup API used by the compositor, the standalone apps (Files, Images,
- PDF, Editor, share picker), the lock screen, polkit dialog and greeter.
-* English stays the source of truth and the zero-cost default.
-* No new runtime library: catalogs are compiled in.
-* No per-frame cost: no allocation, no string hashing, no wakeups, no
- growth in idle CPU (`AGENTS.md` "Idle makes no wakeups").
-* A pseudo-locale that makes clipped or fixed-width layouts visible without
- knowing any language.
-
-Non-goals (separate plans if wanted):
-
-* **Right-to-left languages.** `ui/text.zig` runs HarfBuzz per run with
- `hb_buffer_guess_segment_properties` but has no bidi reordering (no
- FriBidi) and widgets do not mirror. Arabic/Hebrew/Persian need both.
- Translated Arabic strings would render in the wrong visual order.
-* **Input methods in the shell's own text fields.** Only the Editor has IME
- support. A Japanese UI whose control-center fields cannot take Japanese
- input is half-done. Confirmed in Phase 0: the shell has no IME.
-* Translating IPC, logs, config keys, `rediwm-msg`, or text produced by other
- programs (D-Bus error messages from NetworkManager/bluez/logind, notification
- bodies, tray menu labels). Those stay as received.
-
-## Design
-
-### The `i18n` module
-
-A leaf named module with no dependencies, importable from `ui`, `config`,
-the compositor and every executable, like `ui`/`dbus`/`config` (`AGENTS.md`
-"Build and platform").
-
-```zig
-i18n.tr("Cancel") // msgid is the English text
-i18n.trc("menu", "Open") // context, for same word / different sense
-i18n.trn("{n} item", "{n} items", n) // plural
-i18n.fmt(buf, i18n.tr("Delete {name}?"), .{ .name = user })
-```
-
-* **English text is the msgid.** Conversion is mechanical (`"Cancel"` →
- `tr("Cancel")`), readable at the call site, and an untranslated string
- falls back to itself. `trc` disambiguates the few collisions.
-* **`tr` is allocation-free and hash-free at runtime.** The msgid is a
- comptime literal, so its hash is computed at compile time; the runtime step
- is one probe into the active catalog's open-addressed table plus one `memcmp`
- to confirm. Catalogs are static data in rodata. English is the identity
- with no table at all.
-* **Formatting needs a runtime formatter.** `std.fmt` takes a comptime format
- string, and a translated one is only known at runtime. `i18n.fmt` therefore
- substitutes named placeholders (`{name}`, `{n}`) from a struct of strings
- and integers, so translators can reorder arguments. Every existing
- `allocPrint("Delete {s}?", ...)` that carries wording converts to this.
-* **Plurals** use CLDR rules, one function per rule family (English/German,
- French, Russian/Polish, Japanese/Chinese: one form, ...). Phase 1 ships the
- rule table; adding a language that needs a new family is a one-function
- change plus a test.
-* **Language resolution.** The compositor takes `[region] language` and falls
- back to its own `LC_ALL`/`LC_MESSAGES`/`LANG`. Standalone apps and the
- share picker read the POSIX environment, which `applyRegion` already sets
- when the compositor launches them. Tag `en_NZ.utf8` resolves through
- `en_NZ` → `en` → English. A language with no catalog leaves RediWM's own
- UI in English while apps still get the locale.
-* **Pseudo-locale** `qps` (expanded ~40%, accented, bracketed:
- `[Çàñçéł !!!]`) is an ordinary generated catalog selected through the normal
- config key, not an environment hook, so it respects "No test hooks in
- production". It is unlisted in the language picker.
-
-### Catalogs and tooling
-
-* Source: `po/rediwm.pot` (extracted) and `po/<lang>.po`. Standard PO files
- mean contributors can use Poedit, Weblate or any editor, and the format
- carries context and plural forms.
-* Extraction and compilation are `build.zig` steps built from one small Zig
- tool (`tools/i18n.zig`), no gettext toolchain needed on the build machine:
- * `zig build i18n-extract` regenerates the `.pot` from `tr`/`trc`/`trn`
- call sites.
- * The normal build compiles each `.po` into a generated Zig file with the
- hash table, embedded in the binaries that use it.
- * `zig build i18n-check` fails on a `tr` literal missing from the `.pot`,
- a stale entry, a placeholder set that differs between msgid and
- translation, or a wrong plural-form count.
-* Catalogs are per product, not per executable, so the compositor,
- `rediwm-files` and the rest share one table layout; each binary embeds only
- what it uses if size matters (measure in Phase 1).
-
-### Keeping untranslated strings from creeping back
-
-The risk after the conversion is someone adding `.label = "Foo"`. Two layers:
-
-* `zig build i18n-lint` flags a bare string literal passed to a known UI sink
- (`.label`, `.placeholder`, `text(...)`, `button.paint` labels, dialog
- titles, Cairo `drawText`). A `// i18n: raw` comment marks intentional
- exceptions.
-* The lint is opt-in per directory and the list grows with each phase, so it
- never reports the not-yet-converted code.
-
-Widget `name` ids, which tests use, are never translated.
-
-### Switching language
-
-* **Compositor UI:** treated like a theme or scale change. Config reload
- invalidates cached text and rebuilds the panels (taskbar, start menu,
- control center, power menu). No polling; it rides the existing reload path.
-* **Running app clients:** pick up the new language on next launch. Nothing
- broadcasts; the Control Center says so next to the setting. (Revisit only
- if users ask.)
-
-### Layout
-
-Translated text is typically 20–40% longer (German, Russian, Finnish) and CJK
-text is taller. Likely trouble spots:
-
-* 129 `fixed = N` sizes in `control_center`, `start_menu` and `ui`.
-* Hand-placed Cairo layouts with literal offsets and widths, for example the
- Editor close dialog (`.w = 115`, `.w = 120`) and parts of Files.
-* Fixed-height rows where a fallback font (CJK, Indic) has taller metrics than
- Manrope.
-
-Policy: prefer content-sized or flex layouts; where a width is unavoidable,
-measure the translated string and ellipsize through the existing text API
-instead of overflowing. The pseudo-locale is the detector: IPC screenshots in
-`qps` for every panel, compared against English.
-
-## Phases
-
-**Phase 0: survey (small). Done, see [Phase 0 results](#phase-0-results).**
-Classify the ~1,300 literals by sink (UI / protocol / log / id) to get the
-real count per area; confirm which standalone apps get `LC_MESSAGES` from
-`applyRegion` (Files, Images, PDF, Editor, share picker); check whether the
-IPC widget tree exposes text extents, which would allow an automated
-overflow assertion; check IME in shell text fields; check dead keys and
-compose in every text field (see
-[First languages](#first-languages-spanish-and-portuguese)); check how
-`applications.zig` picks its `Name[xx]` locale and make it use the same
-resolver.
-
-**Phase 1: module and tooling.**
-`i18n` with `tr`/`trc`/`trn`/`fmt`, plural rules, language resolution, the PO
-compiler, `i18n-extract`/`-check`/`-lint`, the `qps` generator. Unit tests for
-plural rules, placeholder substitution, fallback chain and catalog lookup.
-Convert one small surface end to end as the proof (the power menu: 7 labels
-plus the `"Uptime {d}h {d}m"` format). Measure binary size and confirm
-`tr` adds nothing to the frame profile (`perf stat`, instructions).
-
-**Phase 2: shell chrome.**
-Power menu, taskbar, start menu, calendar and battery popups, notification
-toast/OSD text we own, delete/rename dialogs, screenshot selector, tray
-chrome, lock screen, polkit dialog. First `qps` layout pass. Lock screen and
-polkit dialog are security-sensitive: the strings only change language, never
-which action a button performs; keep buttons identifiable by position and
-role, not wording.
-
-**Phase 3: Control Center.**
-The largest area (609 literals). Most formatted strings live here
-(`"Account details · {s}"`, `"Boot time: {s}"`, `"Delete {s}?"`) and need
-`fmt`/`trn`. The Region section's language list should show which locales
-RediWM itself is translated into. One section per commit; extend the lint list
-after each.
-
-**Phase 4: app clients.**
-Files (361), Images, PDF, Editor, share picker. Resolve language from the
-environment in each `*_main.zig`, before the first frame, alongside theme
-loading. Files has selection-count strings
-(`"{n} selected, {size}"` built with `if (n == 1) "" else "s"`) that become
-`trn`. Audit the hand-drawn Cairo layouts.
-
-**Phase 5: login.**
-`rediwm --greeter` and `rediwm-dm`. The greeter writes nothing under `$HOME`
-and has no user config, so it takes the system locale (`/etc/locale.conf` via
-the DM's environment) or a per-user choice only if the DM already knows it;
-this is a decision, see below. `rediwm-dm` and the accounts helper run as root
-and must not parse catalogs or build user-facing text: they return error codes
-and the unprivileged UI maps them to strings. Audit both for English text
-that crosses the boundary.
-
-**Phase 6: docs (last phase of the groundwork).**
-Document how to add a language in the wiki (`docs/wiki`), `README.md` and
-`TESTING.md`: copy `po/rediwm.pot` to `po/<lang>.po`, translate, run
-`zig build i18n-check`, build.
-
-**Later, not part of this plan: adding actual languages.**
-Each one is a `.po` file plus a check of fonts and fallback metrics on real
-text. A language whose plural rules are not yet in the table needs one
-function and a test. Planned in [languages.md](languages.md).
-
-## Phase 0 results
-
-Done 2026-10-08. Read-only; nothing in `src/` changed.
-
-**How many strings.** A script over non-test `src/**/*.zig` (skipping `test`
-blocks, comments, log/error/compare lines) classified distinct capitalised or
-multi-word literals by whether they feed a UI sink. It misses lower-case
-labels and multi-line `\\` literals, so treat the figures as +/-20%.
-
-* In UI-facing areas: 404 distinct strings reach a UI sink, and 814 more are
- unclassified. A 25-string sample of the remainder was ~80% UI text (the rest
- were D-Bus members, config templates, log text). Expect **about 1,000
- translatable strings** (range 800–1,200), not the 1,300 occurrences first
- counted.
-* Sink-matched + remainder by area: `control_center` 241+318, `files` 84+134,
- top-level `src/*.zig` 20+155, `network` 22+65, `images` 12+46, `editor`
- 13+25, `screenshot` 10+26, `pdf` 3+33, `desktop` 1+33, `polkit` 2+31,
- `start_menu` 7+13, `share_picker` 4+10, `taskbar` 2+4, `notifications` 0+5,
- `ui` 1+6.
-* Not translated (protocol, CLI, config template or logs): `ipc` (~290),
- `msg`, `config`, `dbus`, `dm`, `accounts_helper`, `input`, `audio`,
- `capture`, `night_light`, `config_runtime`. Exception: `session` holds a few
- user-facing power/logind errors ("Blocked by an active inhibitor lock.",
- "Lost contact with login service. Try again."), converted by hand in Phase 2.
-* Keybinding descriptions ("Increase system volume.", "Move the relevant split
- divider left.") are user-visible and numerous; they count toward
- `control_center`.
-
-**Language reaches launched apps, but not the apps' own code.**
-`child_env.apply` calls `applyRegion` (`child_env.zig:34`) and every launch
-path goes through `applyChildEnv*`, so apps get `LANG`/`LC_MESSAGES`/`LC_CTYPE`
-from `[region] language`, and `LC_ALL`/`LANGUAGE` are removed. The standalone
-clients (`files_main`, `images_main`, `pdf_main`, `editor_main`,
-`share_picker_main`) read no language variable today; Phase 4 adds the
-resolver there, reading `LC_ALL` → `LC_MESSAGES` → `LANG`.
-
-**The compositor does not follow `[region] language` yet.** `applyRegion`
-edits only child environments; the compositor's own process environment is
-unchanged. `start_menu/applications.zig` builds its `Locale` from that process
-environment at startup (`Locale.fromEnv`, and the cache key in
-`catalog_cache.envKeys` uses the same variables), so `Name[xx]` desktop-entry
-names follow the login locale, not the setting, and do not update when it
-changes. The shared resolver replaces both: the cache key must include the
-resolved language, and a language change must rescan.
-
-**IPC widget tree.** `WidgetNodeData` carries `label`, `box`, `global_box`,
-`clipped` and `text_length`, but not the measured text width, so a test cannot
-assert overflow. Phase 1 adds a `text_width` field (layout pixels); the `qps`
-tests then assert `text_width <= box.w` for every labelled widget.
-
-**IME in the shell.** None. `input/text_input.zig` relays text-input-v3 and
-input-method-v2 for client apps only. The shell's own fields (control center,
-start menu, lock, polkit) and the Files/Images/PDF fields take xkb keysyms
-only. Irrelevant for Spanish and Portuguese; it confirms CJK input would be a
-separate project.
-
-**Dead keys: confirmed broken everywhere but the Editor.**
-
-* Checked with libxkbcommon: on `latam`, `es`, `br`, `pt` and `us(intl)`
- the dead keys (acute, grave, tilde) return **0 bytes** from
- `xkb_state_key_get_utf8`.
-* Every text path outside the Editor uses that call with no
- `xkb_compose_state`: `Keyboard.zig:819,847,885` (compositor shell: start
- menu, control center fields, lock screen, polkit, wifi popup, desktop),
- `files/main.zig:547,554`, `images/main.zig:476,483`, `pdf/main.zig:404,411`.
- By code reading, an empty result is dropped (`utf8.len > 0` else no
- character). I have not typed it on a live session.
-* Beyond names and search: the **lock screen and polkit password fields**
- read the same way, so a password containing an accent typed with a dead key
- cannot be entered. The same applies to the greeter, which is the same
- compositor. That is a lockout risk for exactly the target users.
-* The compose table depends on locale, and not only for tidiness:
- `´`+`c` composes to `ć` in `C`, `en_US` and `es_MX` but to `ç` in
- `pt_BR`. A table loaded from the wrong locale gives Brazilian users the wrong
- letter. `C`/`C.UTF-8` do resolve to a working table (á, ã); an invalid or
- uninstalled locale returns no table and logs an xkbcommon error, so the
- loader needs a fallback to `C.UTF-8`.
-* Fix: move `editor/compose.zig` to `ui/compose.zig`; one compose state per
- keyboard in the compositor (reset on focus or layout change) and one per
- client; build the table from the resolved UI language. Composed text for
- lock and polkit goes through the existing `clearKeyScratch` scrub, and a
- pending dead key is cleared when a secret field loses focus. This is a
- separate small change that does not wait for the `i18n` module.
-* **Fixed 2026-10-08 (uncommitted).** `ui/compose.zig` replaces
- `editor/compose.zig`: lazy shared table built from the user's language
- (`[region] language` in the compositor, `LC_ALL`/`LC_CTYPE`/`LANG` in app
- clients), locale names normalised to `ll_CC.UTF-8` (a bare `pt_BR` maps to
- the unparseable ISO 8859-1 file), fallback to `C.UTF-8`. Wired into
- `Keyboard.composeShell` (start menu, control center, lock, polkit, wifi
- popup, desktop), Files, Images, PDF (table preloaded before its sandbox) and
- the Editor. A dead key, or the key completing a sequence, never repeats.
- `tests/dead_keys.py` types through a virtual `latam` keyboard under `pt_BR`
- and `es_MX`. Known limits: a key that does not fit a pending sequence is
- swallowed (as in the Editor); a dead key left pending across a lock/unlock
- cycle can combine with the first key of the next lock prompt; text-input-v3
- clients are unaffected (they compose themselves).
-
-## Testing
-
-* Unit tests (`zig build test`): plural rules for every family, placeholder
- substitution and mismatch rejection, fallback chain, PO parser, catalog
- round trip.
-* Existing integration tests run unchanged in English. They are the proof
- that the default path is untouched.
-* One new integration test per phase launches with `[region] language` set to
- the `qps` locale (with a scratch `XDG_STATE_HOME`, or the run clobbers the
- live autosave layout), opens each converted panel, and checks
- that widgets are still found by `name`, that bounds do not overflow, and
- that IPC screenshots differ from English only in text.
-* Per `AGENTS.md`: build Debug and ReleaseSafe, and `strings` the ReleaseSafe
- binary to confirm no test hook leaked.
-
-## Risks
-
-* **The mechanical conversion hides non-text strings.** Wrapping an ID or an
- IPC name in `tr` breaks behaviour only when a translation exists, so it
- would pass English tests. Mitigation: Phase 0 classification by sink, and
- `i18n-check` rejecting `tr` on strings used as map keys or `std.mem.eql`
- operands in the same function where it can see them.
-* **Cached rasters keyed by text** stay correct (the key includes the text),
- but anything caching measured widths across a language change must be
- invalidated with the rest on reload.
-* **Translations drift** as English changes. `i18n-check` reports stale and
- missing entries; fuzzy-matching is left to the translation tools.
-* **Scope creep into RTL and IME**, which are each a project of their own.
-
-## Decisions
-
-Made 2026-10-08, taking the recommendations:
-
-1. **UI language is `[region] language`.** One "Language" setting; no
- separate `ui_language` key.
-2. **English text is the msgid**, with `trc` for the few collisions. No
- symbolic keys.
-3. **Greeter uses the system locale only** for v1; no per-user choice at
- login.
-4. **Translations are `.po` files contributed by pull request.** No hosted
- translation tool.
-5. **Right-to-left is out of scope** and needs its own plan (bidi
- reordering plus mirrored layouts).
-
-## First languages: Spanish and Portuguese
-
-The intended first additions (Latin America is the target audience), added
-after this plan. Neither needs RTL, an input method or special fonts: Manrope
-covers the accents. What they do need from the groundwork:
-
-* **Regional chains.** Locales arrive as `es_MX`, `es_AR`, `es_CO`, `pt_BR`,
- `pt_PT`. Resolution tries the exact tag, then the language, so ship one
- neutral `es` (imperative forms, no voseo or regional vocabulary, serves all
- of Latin America and Spain) and `pt_BR` (`pt` resolves to it unless a
- `pt_PT` catalog exists). Regional overrides are small `.po` files that
- carry only the strings that differ.
-* **Plural rules.** Spanish: `n == 1` is singular. Brazilian Portuguese
- differs: 0 and 1 are both singular ("0 arquivo"), European Portuguese
- follows Spanish. CLDR also defines a `many` form for exact multiples of a
- million ("1 millón de archivos"); the table ignores it and uses `other`,
- which is wrong only for counts that large.
-* **Length.** Both run roughly 15–30% longer than English, so the `qps`
- pseudo-locale (+40%) is a sufficient stress test.
-* **Dead keys and compose (prerequisite, not i18n).** Confirmed broken
- outside the Editor and fixed 2026-10-08; details in
- [Phase 0 results](#phase-0-results).
-* **Other dependencies.** `region.formats` already handles LATAM date and
- number differences (comma decimals, 24-hour clock). Desktop entries use the
- same resolver as the UI, so `Name[es]`/`Name[pt_BR]` fall in line.
diff --git a/docs/plans/languages.md b/docs/plans/languages.md
deleted file mode 100644
index 6219862..0000000
--- a/docs/plans/languages.md
+++ /dev/null
@@ -1,379 +0,0 @@
-# Plan: shipping UI languages
-
-Status: implementation and draft catalogs, 2026-10-20. L0 and the i18n
-prerequisites are implemented; all five catalogs are machine drafts. Native
-review and approval of the screenshot findings remain release gates. See
-[po/README.md](../../po/README.md) for the glossary and review status.
-
-Scope: ship real translations of RediWM's own UI for the common languages,
-for now Spanish, Brazilian Portuguese, German, French and Russian. It builds on [i18n.md](i18n.md), which provides the
-machinery (`i18n` module, `tr`/`trc`/`trn`/`fmt`, `.po` catalogs, `qps`
-pseudo-locale, extraction and checks) and ends where this plan starts: "adding
-actual languages". This plan covers what a language needs beyond a `.po`
-file, the order to ship them in, and how a translation is judged ready.
-
-## Where we are
-
-* `src/i18n`, `tools/i18n.zig`, the PO template and five catalogs now exist.
- The shell, Control Center and app clients use the compiled lookup API.
- Draft entries remain fuzzy and fall back to English until reviewed.
-* The original survey estimated about 1,000 strings. The implemented
- template contains 1,879 messages, including app clients, keybinding
- descriptions and Control Center search keywords; `i18n-check` reports
- current coverage.
-* Dead keys and compose work in every text field since 2026-10-08
- (`ui/compose.zig`, `tests/dead_keys.py`).
-* **Fonts are not a blocker for the first languages.** Bundled Manrope
- (`assets/fonts/Manrope-VariableFont_wght.ttf`) has every letter of German,
- French, Spanish, Portuguese, Italian, Polish, Czech, Turkish, Romanian,
- Russian, Ukrainian, Greek and Vietnamese, plus `…`, `–`, `—`, curly quotes,
- U+00A0 and U+2011. It lacks **U+202F** (narrow no-break space, which French
- typesetting puts before `;:!?` and inside `« »`). This machine has no CJK
- font installed (`fc-list :lang=ja` is empty).
-
-The following pre-implementation findings motivated L0. Their code excerpts
-and line references describe the original state; the implementation record
-below records the fixes and remaining review gates:
-
-* **Case-insensitive matching is ASCII-only.** Start menu search lowercases
- with `std.ascii.lowerString` (`start_menu/search.zig:91,143`), Control
- Center search uses `std.ascii.eqlIgnoreCase` (`control_center/search_index.zig:147,164`),
- and the Files filter uses `std.ascii.indexOfIgnoreCase`
- (`files/app_listing.zig:280`). Typing `терм` does not find `Терминал`, and
- `camara` does not find `Cámara`.
-* **Files sorts names by raw bytes.** `lessThan` ends in
- `std.mem.order(u8, a.text(), b.text())` (`files/app_listing.zig:306`), so it
- is case-sensitive (`Zebra` before `apple`), and `Äpfel`, `Élan` and every
- Cyrillic name sort after `z`. `files/worker.zig:627` and
- `files/associations.zig:169` use `std.ascii.lessThanIgnoreCase`, which
- only folds ASCII.
-* **The calendar is English regardless of locale.** Month names are a
- literal array (`calendar.zig:192`), and the date heading is
- `strftime("%A, %B %-d, %Y")` in the compositor's C locale
- (`calendar.zig:148`). The taskbar clock already formats with a private
- `locale_t` for `[region] formats` (`taskbar/clock.zig:42`).
-* **Two more places read the process locale, not `[region] language`:**
- besides the start menu's `Locale.fromEnv` (i18n.md Phase 0), the polkit
- agent registers with `LC_ALL`/`LC_MESSAGES`/`LANG` from its own
- environment (`polkit/agent.zig:83`). polkitd localises the action
- message from that, so a German UI would still show the English polkit
- message.
-* **The language picker lists only installed glibc locales** (`locale -a`,
- filtered through `newlocale`, `control_center/sections/region.zig:116`),
- labelled with glibc's English language name (`localeLabel`). On Arch-family
- systems a language nobody uncommented in `/etc/locale.gen` cannot be
- chosen, and nothing shows which languages RediWM itself is translated
- into.
-* **Widget text is single-line and ellipsized** (`ui/text.zig`
- `fitWithEllipsis`); the few hand-wrapped paragraphs break at ASCII spaces
- only (`control_center/sections/printers.zig` `wrapLabels`). That is fine
- for every language in this plan, but German compounds have no space to
- break at, so long ones will ellipsize where English wrapped.
-* **Keyboard shortcuts with a Cyrillic layout.** `config/keymap.zig`
- `bindingSyms` falls back to layout 0's keysyms when the active layout
- matches no binding, so the usual `us,ru` setup keeps Super+letter
- shortcuts. A keymap with only `ru` (or `ua`) has no Latin layout to fall
- back to, so letter bindings never match. Needs checking in a nested session
- before Russian ships.
-
-## Goals and non-goals
-
-Goals:
-
-* Five languages that read as written by a native speaker, not as a word
- substitution, on every surface RediWM draws: shell, Control Center, lock
- screen, polkit dialog, greeter, Files, Images, PDF, Editor, share picker.
-* Search, sorting and dates behave correctly in those languages.
-* A repeatable per-language process, so the ninth language costs only
- translation and review.
-* No cost for English and no per-frame cost (i18n.md goals stand).
-
-Non-goals:
-
-* **CJK (Chinese, Japanese, Korean).** Displaying them needs a fallback font
- dependency (none is bundled) and line breaking without spaces; using them
- needs an input method in the shell's own fields, which does not exist
- (i18n.md Phase 0). A separate plan if wanted.
-* **Right-to-left languages**, as in i18n.md.
-* Translating the wiki, `README.md`, man pages, IPC, logs or `rediwm-msg`
- output.
-* Translating text from other programs (NetworkManager, bluez, logind
- errors, notification bodies).
-
-## Languages
-
-| Language | Catalog | Resolves from | Plural family | Length vs English |
-|---|---|---|---|---|
-| Spanish | `es` | `es_*` | one (n=1) / other | +15–30% |
-| Brazilian Portuguese | `pt_BR` | `pt_BR`, `pt` | one (0, 1) / other | +15–30% |
-| German | `de` | `de_*` | one (n=1) / other | +30–35% |
-| French | `fr` | `fr_*` | one (0, 1) / other | +15–25% |
-| Russian | `ru` | `ru_*` | one / few / many | +20–30% |
-
-Later, only on request or when a contributor offers: Italian (`it`),
-Ukrainian (`uk`), Polish (`pl`), Dutch (`nl`), Turkish (`tr`), Czech (`cs`),
-Swedish (`sv`), Romanian (`ro`). The fonts already cover them.
-
-Plural rules needed in the i18n.md rule table (CLDR, integer counts only):
-
-* **one/other, n = 1**: `es`, `de`. CLDR's `many` for exact millions in
- `es` is ignored, as i18n.md decided.
-* **one/other, n = 0 or 1**: `fr`, `pt_BR`.
-* **East Slavic** (`ru`): one if `n%10 == 1 and n%100 != 11`; few if
- `n%10` is 2–4 and `n%100` is not 12–14; else many.
-
-Later languages reuse these (`it`, `nl`, `sv`, `tr` are n = 1; `uk` is East
-Slavic) or add one function each (Polish: few as East Slavic but 21 is
-"many"; Czech: one/few/other).
-
-Notes per language, for the glossary and review:
-
-* **German.** Long compounds ("Bildschirmsperre", "Tastenkombinationen")
- stress fixed widths more than the `qps` expansion does, because they
- ellipsize as one unit. Formal "Sie" or informal "du" is a decision (D3).
-* **French.** Space before `:;!?` and inside `« »`. Catalogs use U+00A0
- (Manrope has it); `i18n-check` rewrites or rejects U+202F, which would fall
- back to another font. Infinitive for buttons ("Annuler", "Enregistrer").
-* **Spanish, Portuguese.** As in i18n.md: neutral `es` (no voseo), `pt_BR`
- serves `pt` until a `pt_PT` catalog exists.
-* **Russian.** Three plural forms, so every count string must be `trn`
- (i18n.md Phase 3/4 converts the `if (n == 1) "" else "s"` sites). Search
- folds `ё` to `е`.
-* **Turkish** (later). Dotted/dotless i: case folding must map `I`↔`ı` and
- `İ`↔`i` when the UI language is Turkish, and the ASCII mapping otherwise.
-
-## Design
-
-### Search folding: `ui/fold.zig`
-
-A small allocation-free fold for matching, used by the start menu, Control
-Center search, the Files filter and any other substring search:
-
-* Simple Unicode case folding plus diacritic removal for Latin (Latin-1
- Supplement, Extended-A/B), Greek and Cyrillic, writing into a caller
- buffer. Extras that decomposition misses: `ł`→`l`, `ø`→`o`, `ß`→`ss`,
- `ё`→`е`, `æ`→`ae`, `œ`→`oe`. Other scripts pass through unchanged.
-* Tables generated at build time from the Unicode data files by a
- `tools/` program, checked in (a few KiB), so the build needs no network.
-* Turkish rules only when the resolved UI language is `tr`.
-* The query and every candidate go through the same fold, so `camara`,
- `Cámara` and `CÁMARA` all match `Cámara`, and highlighting maps folded
- offsets back to the original text.
-
-Control Center search entries get translated titles and keywords through
-`tr`. The English keywords stay searchable as well, because users copy
-setting names from English guides.
-
-### Sorting names in Files
-
-Names sort by the collation of `[region] formats` (`LC_COLLATE`), with a
-`newlocale(LC_COLLATE_MASK, ...)` owned by the worker, never `setlocale`
-(as `region.zig` already does for numbers). glibc then gets `Äpfel` beside
-`Apfel` in German and `ё` after `е` in Russian. Keep the folders-first rule
-and the existing size and date orders. Measure a 100,000-entry folder
-before and after; if `strcoll_l` is too slow, precompute `strxfrm_l` keys
-once per listing. Natural number order ("file2" before "file10") is a
-separate question and not part of this.
-
-### Dates and calendar
-
-The calendar takes month and weekday names from the `[region] formats`
-locale (`nl_langinfo_l(MON_1…, ABDAY_1…)`) through the same private
-`locale_t` pattern as `taskbar/clock.zig`, and drops the `months` array. The
-long heading pattern (`"%A, %B %-d, %Y"`) becomes a `trc("date", ...)` string,
-so each catalog supplies its word order ("%A, %-d de %B de %Y") while the
-names follow `formats`. Files' modified column already uses a fixed ISO date
-and `prefs.timeFormat()`; leave it.
-
-### One resolver for every locale consumer
-
-The shared resolver from i18n.md replaces the polkit agent's environment
-lookup and the start menu's `Locale.fromEnv`, so the polkit action message,
-desktop-entry `Name[xx]` and RediWM's own text all follow
-`[region] language`. A language change re-registers the polkit agent.
-
-### Language picker
-
-The Region section's Language list:
-
-* Shows each language in its own name ("Deutsch", "Русский", "Español"),
- from a small table compiled with the catalogs, with the glibc name as a
- subtitle.
-* Lists languages RediWM is translated into first, then the other installed
- locales with "RediWM stays in English" next to them.
-* Offers a translated language even when its glibc locale is not generated,
- with a hint on how to enable it (D4). The UI catalog does not need the glibc
- locale, but apps launched with that `LANG` and the calendar names do.
-
-### Our own data files
-
-* `data/*.desktop` (Files, Editor, Images, PDF, Monitor, Theme, Transfers
- and the session entries): `Name[xx]`, `GenericName[xx]`, `Comment[xx]`,
- `Keywords[xx]` generated from the same `.po` files at build time by
- `tools/i18n.zig`, so translators touch one file.
-* `data/org.rediwm.accounts.policy`: `<message xml:lang="xx">` entries
- generated the same way; polkitd picks them using the locale the agent
- registered.
-
-### Translation workflow
-
-* **Glossary.** `po/README.md` holds the contributor guide and, per
- language, about 60 fixed terms (window, workspace, dock, taskbar, tile,
- lock screen, Control Center, Files, …) plus tone (formal or informal
- address, button mood). Product names ("RediWM") are never translated; the
- app names "Files", "Images", "Editor" are translated as ordinary words
- (D5).
-* **Drafting and review** follow D1. A string marked `#, fuzzy` is never
- shown, so an unreviewed draft falls back to English.
-* **Screenshots for reviewers.** `scripts/i18n-screens.py <lang>` starts a
- headless session with `[region] language` set (scratch `XDG_STATE_HOME`),
- walks every panel, Control Center section, dialog and app window, and
- writes IPC screenshots to one folder. Reviewers judge text in place
- without building RediWM, and the same walk asserts
- `text_width <= box.w` (the field i18n.md Phase 1 adds) for every labelled
- widget in that language.
-* **Context for translators.** `trc` contexts and `// i18n:` comments above
- ambiguous strings are extracted into the `.pot` as `#.` notes ("Open" the
- verb vs. "Open" the state).
-
-### When a language ships
-
-A catalog is listed as translated in the picker only when:
-
-1. `zig build i18n-check` passes (no stale entries, placeholders and plural
- counts match).
-2. Every string of the shell, Control Center, lock screen, polkit dialog and
- greeter is translated and not fuzzy. App clients may lag; missing
- strings fall back to English.
-3. The screenshot walk passes the overflow assertion, and every ellipsized
- label has been looked at and either shortened in the catalog or given room
- in the layout.
-4. A native speaker has reviewed the screenshots (D1). The status table
- in `po/README.md` records each language's coverage and review state.
-
-Below that bar a catalog is still compiled in and can be chosen through the
-config key, so contributors can test it, but the picker marks it
-"incomplete".
-
-## Phases
-
-**L0: language correctness, independent of catalogs.** Can start now, in
-parallel with i18n.md Phase 1, and fixes behaviour English users with
-non-English names already hit. `ui/fold.zig` and its use in start menu,
-Control Center and Files search; Files collation; calendar names from
-`formats`; polkit agent and start menu on the shared resolver (or, before
-the resolver exists, on `[region] language` directly). Check Super+letter
-bindings with a `ru`-only keymap in a nested session and fix if needed.
-Unit tests for folding and collation order (`zig build test`); extend
-`tests/calendar_popup.py` with a German `formats`.
-
-**L1: first catalogs, Spanish and Brazilian Portuguese.** Needs i18n.md
-Phases 1–3. Plural families for the five languages in the rule table; `po/README.md`
-with glossary and status table; `scripts/i18n-screens.py`; desktop file and
-polkit policy generation; the language picker. Ship `es` and `pt_BR` through
-the bar above. These two come first because they were already the intended
-first languages and need the fewest new rules.
-
-**L2: German and French.** Latin script, the longest strings. Expect
-layout fixes from German that the `qps` pass missed (single long words);
-add a long-unbroken-word variant to the `qps` generator if it finds real
-problems. French space handling in `i18n-check`.
-
-**L3: Russian.** The three-form plural family gets its first real use: run `i18n-check` and review every `trn` string with the
-reviewer, since a missing `few` form is invisible in English. Cyrillic
-search and sorting were fixed in L0; check them again with the real
-catalog.
-
-**L4: app clients catch up.** As i18n.md Phase 4 converts Files, Images,
-PDF, Editor and the share picker, each catalog gains those strings. A
-language is "complete" when the apps are too.
-
-**L5: more languages on request.** Each one is a `.po`, a glossary section, a
-review and, for Turkish, the folding special case.
-
-## Testing
-
-* `zig build test`: plural rules for every family above with the CLDR
- example numbers (ru: 1, 2, 5, 11, 12, 21, 22, 25, 111;
- fr/pt_BR: 0, 1, 2); fold tables (case, diacritics, the extra
- letters, Turkish); collation of a mixed name list under `de_DE`,
- `ru_RU` and `C`.
-* Integration: the screenshot walk in every shipped language runs the
- overflow assertion; `tests/dead_keys.py` gains a German (`de` nodeadkeys
- vs. deadkeys) and a French layout case; existing English suites stay
- unchanged.
-* Before calling a language done: build Debug and ReleaseSafe, check
- ReleaseSafe binary size against the catalog estimate from i18n.md
- Phase 1, and confirm no test hook leaked (`strings`).
-
-## Risks
-
-* **Translation quality.** A fluent-looking but wrong translation is worse
- than English, especially in the lock screen, polkit and power dialogs,
- where a mistranslated button can mislead the user into the wrong action.
- The review gate and in-place screenshots are the mitigation; security
- dialogs get a second look.
-* **Drift.** Every English change marks strings fuzzy in all five
- catalogs. With five languages, a UI-heavy commit can drop several below
- the "translated" bar. The status table makes that visible; i18n-check does
- not fail the build for fuzzy entries, only for structural errors.
-* **Reviewer availability.** Native reviewers for five languages may not be
- found at once. Shipping order lets the first languages proceed while
- others wait as "incomplete".
-* **Width.** German and Russian strings may need layout changes in places
- the `qps` pass judged fine; L2 budgets time for that.
-* **Distribution of locales.** On Arch-family systems the glibc locale must be
- generated; without it apps launched from RediWM stay in English while
- RediWM itself is translated. D4 decides how much RediWM helps.
-
-## Decisions
-
-1. **D1: who translates.** (a) Only native-speaker contributions by pull
- request, as i18n.md decided; slow, possibly years for five languages.
- (b) Machine-drafted catalogs (Claude), committed as `#, fuzzy` and so
- never shown, then reviewed and un-fuzzied by a native speaker using the
- screenshot walk. **Recommended: (b)**: it keeps i18n.md's
- contribution-by-PR model, and reviewers correct a draft in place
- instead of starting from 1,000 empty strings.
-2. **D2: first languages.** Decided 2026-10-20: Spanish, Brazilian
- Portuguese, German, French and Russian, in the order L1–L3. Others wait
- for a request or a contributor.
-3. **D3: German and other formal/informal address.** Recommended: informal
- "du" for German (confirm with the reviewer), "vous" for
- French, "tú" for Spanish, "você" for Portuguese, "вы" for Russian; recorded in the glossary.
-4. **D4: uninstalled locales.** (a) Show translated languages with a
- distro-neutral hint ("Enable `de_DE.UTF-8` in your system's locale
- settings"). (b) Enable the locale through the accounts helper
- (`/etc/locale.gen` + `locale-gen` on Arch, `locale-gen` package on
- Debian, langpacks on Fedora): distro-specific root code. **Recommended:
- (a)** for now; revisit with the printers-style failure ladder if users
- ask.
-5. **D5: app names.** Recommended: translate "Files", "Images", "Editor",
- "Control Center" as ordinary words (Dateien, Imágenes, Редактор), keep
- "RediWM" as is. Alternative: keep all as brand names, which reads oddly
- next to translated menus.
-6. **D6: search keywords in two languages.** Recommended: translated
- keywords plus the English ones in Control Center search, as above.
- Alternative: translated only, smaller index, but English guides stop
- working as search terms.
-
-## Implementation record (2026-10-20)
-
-L0 uses generated Unicode folding (with original byte ranges for highlights),
-worker-owned collation keys, private calendar locales and the shared language
-resolver. The start-menu cache rescans on language changes. Polkit registration
-changes after outstanding authentication requests finish. Cyrillic-only
-keymaps retain modifier-letter shortcuts without changing client text.
-
-L1–L4 have the catalog/compiler/extraction/check/lint infrastructure, named
-formatting and plural rules, five complete fuzzy drafts, catalog-aware language
-picker, generated desktop/polkit metadata, and the isolated screenshot/review
-walk. Layout changes give navigation and buttons room and wrap Region
-paragraphs, including long words. No catalog is declared native-reviewed.
-The screenshot and manual security-screen review gates still apply; app captures
-need visual review because client apps do not expose shell widget measurements.
-
-Implementation uses D1(b), D3's proposed tones, D4(a), D5 translated app names
-and D6 bilingual search keywords. D2 is unchanged. These are drafting defaults
-for native reviewers, not claims that linguistic review has happened. L5 remains
-future work on request. The source of current message counts is `i18n-check`.
diff --git a/docs/plans/mime-associations.md b/docs/plans/mime-associations.md
deleted file mode 100644
index 5c718a9..0000000
--- a/docs/plans/mime-associations.md
+++ /dev/null
@@ -1,305 +0,0 @@
-# Plan: file-type associations ("which app opens what")
-
-Status: draft, 2026-10-09. Nothing is implemented. Next step is Phase 0, a
-spike that pins down how GIO resolves defaults before any UI is built.
-
-Scope: a place in Settings to see and change which app opens each kind of
-file, and a line in Files' Properties that says which app will open this file
-and why. It edits the standard `mimeapps.list` through GIO, so every other
-program (Brave, `xdg-open`, portals, GTK/Qt apps) agrees with it. It adds no
-store of its own.
-
-## Where we are
-
-Both ends of the system already speak GIO and `~/.config/mimeapps.list`:
-
-* **Files** resolves a double-click with `associations.launchDefault`
- (`g_app_info_get_default_for_type`, the content type itself comes from
- `src/mime_db.zig` since 2026-10-16), shows icons from the same lookup, and
- its Open With dialog (`open_with.zig`) lists `g_app_info_get_all_for_type`
- first, then every other app that takes files or URLs. Ticking "remember"
- calls `g_app_info_set_as_default_for_type`.
-* **Settings** has a Default applications card (`sections/default_apps.zig`,
- on the General page) for exactly two choices, File Manager and Terminal.
- Those are RediWM config (`[compositor] default_*`); the file manager choice
- also writes `inode/directory` and resets `x-scheme-handler/file`.
-
-What is missing: any way to see or edit the other defaults in one place, and
-any explanation of why a file opened with the app it did. The start-menu
-catalog (`AppEntry`) does not parse `MimeType=`, so it cannot answer either.
-
-### Survey (author's machine, 2026-10-09)
-
-* 1,124 types in shared-mime-info; **445** are claimed by at least one
- installed app, **168** by two or more (those are the ones where the winner
- can be an accident), and 27 are URL schemes. `text/plain` alone has 20+
- claimants.
-* `~/.config/mimeapps.list` holds 60 app references. **14 (23%) name apps that
- are not installed** (GNOME Text Editor, Showtime, VLC, Clash Verge, LM
- Studio).
-* **4 lines use an alias spelling** of a type (`video/x-matroska` is an alias
- of `video/matroska`; `application/x-shellscript` of `text/x-shellscript`).
- The file has `video/x-matroska=mpv` and `video/matroska=Celluloid`; GIO
- reports **mpv for both**, so the canonical-keyed Celluloid line loses and
- nothing says so.
-* `video/mp4` has an `[Added Associations]` entry (Showtime, missing) and no
- `[Default Applications]` line. Its winner, Celluloid, is whatever order
- `mimeinfo.cache` happens to give. Install another player and it can change.
-* `Avahi SSH Server Browser` (`bssh.desktop`) has no `MimeType=` and no `%f`/
- `%u` in `Exec`. It is never offered for anything, and Open With already
- filters apps that take neither files nor URLs. Hidden entries do leak in
- through claims: `kitty-open.desktop` (NoDisplay) is a candidate for shell
- scripts.
-
-### Why the wrong app opens
-
-Observed above or visible in the code:
-
-1. **No explicit default.** Winner = install order. Looks like a choice,
- isn't one.
-2. **Alias keys.** Two spellings of one type coexist and one shadows the
- other.
-3. **Dead lines.** A default naming a missing app is skipped silently, so the
- next claimant wins.
-4. **`x-scheme-handler/file`.** GIO checks the scheme before the content type
- (already handled once in `default_apps.zig`'s `setDirectoryDefault`).
-5. **Name-only detection.** `launchDefault` guesses the type from the file
- name and never reads contents (deliberate: the directory worker must not).
- `xdg-open`/`gio open` also sniff, so an extensionless file can resolve
- differently in Files and elsewhere. To verify in Phase 0.
-
-## Goals and non-goals
-
-Goals:
-
-* One mental model: file kinds in about ten groups, each with the app that
- opens it, with the exceptions visible.
-* Show *why*: chosen by you / automatic / from the system / app missing.
-* Never offer an app that cannot open the type (claimants only, same
- file-or-URL filter as Open With).
-* Heal the file when asked: remove dead and shadowed lines.
-* No new wakeups, no GIO enumeration on the compositor's Wayland thread.
-
-Non-goals:
-
-* Editing shared-mime-info (new types, globs, icons).
-* Content sniffing in Files (revisit only if Phase 0 shows it is the common
- complaint).
-* Launch-time overrides, per-file "always use X", or changing what a single
- app declares in its `.desktop` file.
-* Replacing the Open With dialog. It stays the per-file path.
-
-## Design
-
-### Effective answer vs provenance
-
-Two separate questions, answered by two separate things:
-
-* **What will open it** is whatever GIO says
- (`g_app_info_get_default_for_type`), the same call `launchDefault` makes. We
- never recompute it, so the page and the double-click cannot disagree.
-* **Why** comes from reading the user's `mimeapps.list` ourselves (pure Zig, a
- parser plus an atomic rewriter, unit-tested on fixtures; lives in `config/`).
- For a type:
-
- | State | Meaning |
- | --- | --- |
- | Chosen | the user's `[Default Applications]` names an installed app and it is the effective one |
- | Automatic | no valid explicit line; winner is the first of N claimants |
- | System | winner comes from a system or desktop-specific list |
- | Missing app | explicit line names an app that is not installed |
- | Shadowed | an alias-keyed or earlier line overrides this one |
-
- Only the user file is parsed. System lists are detected by "effective app
- differs from every user line and from claimant order".
-
-### File-kind groups
-
-A static table, canonical MIME names plus media-type prefixes, matched on the
-unaliased type so an alias cannot fall between rows:
-
-| Group | Types |
-| --- | --- |
-| Web links | `x-scheme-handler/http`, `https`, `about`, `text/html`, `application/xhtml+xml` |
-| Images | `image/*` |
-| Video | `video/*` (+ a few `application/*` containers) |
-| Audio | `audio/*` |
-| PDF and e-books | `application/pdf`, `epub+zip`, `postscript`, djvu |
-| Office files | OpenDocument and OOXML families, `text/csv` |
-| Text and code | `text/*` minus `text/html` and `text/csv`, JSON, XML, shell scripts |
-| Archives | zip, tar, gzip, 7z, rar, zstd (Files extracts in-app; this is for everyone else) |
-| Mail | `x-scheme-handler/mailto` |
-| Torrents | `x-scheme-handler/magnet`, `application/x-bittorrent` |
-| Folders | `inode/directory` (this is the existing File Manager row) |
-
-Rows with no claimed type on the machine are hidden. Anything outside the
-table lives in the advanced list under "Other".
-
-### Settings: a "Default apps" page
-
-New `Page.apps` in `control_center/panel.zig`; `nav_rows` is already sized from
-`page_names`. The General card is replaced by a link card ("Default apps"
-button, same pattern as the Audio and Display cards), and File Manager and
-Terminal move to the top of the new page unchanged.
-
-**Group rows.** Each row is a `select` (`ui/widgets/select.zig`):
-
-* Options are the apps that claim *any* type in the group, ranked by how many
- of the group's types they handle, labelled "Celluloid, 9 of 12 types". A
- NoDisplay claimant is hidden unless it is the current default.
-* Choosing an app sets the **canonical** key for every type in the group that
- the app claims. Types it does not claim are left alone, so picking Pinta for
- Images does not hand it SVG.
-* If the group's claimed types disagree, the row reads "Mixed" (an
- inert first label, like the existing "Unavailable: id" entry) and a disclosure
- lists the exceptions.
-* Callbacks carry `owner` + `id`; the page rebuilds on a write, as the
- existing section does (`cc.refresh()`).
-
-**Advanced: "All file types".** A disclosure below the groups.
-
-* One group at a time (`segmented`), a search field, and "contested only" on
- by default. At most 40 rows are drawn; the rest are reached by search or
- "show more". Row storage is a fixed array added to the `max(...)` that sizes
- `content_children`, and rows go in through `layout.appendRow` (a raw index
- here once crashed the whole session).
-* A row: type description and `video/matroska`, the current app, a state
- badge from the table above, and a select of claimants.
-* A summary line at the top: "14 lines point to apps that are not installed ·
- 4 use old type names · 9 types have no default", with **Clean up**. It
- removes only missing-app and shadowed lines, after writing
- `mimeapps.list.bak`.
-* Optional, last: **Hide this app for this type** (`[Removed Associations]`,
- `g_app_info_remove_supports_type`), which is the real fix for a text editor
- that claims `text/plain` on every box.
-
-### Files: "Opens with" in Properties
-
-`properties.zig` gets two rows in the info block, under Type:
-
-* The raw MIME type next to the description, dimmed: "Matroska video
- (video/matroska)". Makes a mis-detected file obvious.
-* **Opens with**: app icon + name, then the state in dim text ("you chose
- this", "automatic, first of 4 apps", "no app installed") and a **Change…**
- button.
-
-**Change…** reuses the Open With dialog in a choose-only mode: "Remember" is
-forced on, the button reads "Set default", and nothing launches. Geometry
-changes shift the Permissions block (`fullHeight()` and the hit-test rows move
-together; scroll already handles overflow). Special files (pipes, sockets,
-devices) show neither row.
-
-### Writing
-
-Prefer GIO for the write (`g_app_info_set_as_default_for_type`,
-`g_app_info_reset_type_associations`): correct format, same code path as Open
-With. Phase 0 decides whether GIO can also remove lines keyed by an alias or
-for a missing app. If it cannot, the user-file rewriter does that part: read,
-change only the three association groups, keep every other group and comment,
-write to a temp file in the same directory and `rename`. Other programs write
-this file too, so it is read-modify-write with no lock; the window is small
-and the failure is "your edit lost", never corruption.
-
-Before writing a choice, drop any alias-keyed line for the same type, or it
-will shadow the new one (the mpv/Celluloid case).
-
-### Where it runs
-
-* GIO enumeration (`g_app_info_get_all_for_type`, registered types,
- `mimeinfo.cache` order) is file IO. In the compositor it runs on a worker
- that builds an immutable snapshot and signals an eventfd, as the start-menu
- catalog does. The Wayland thread only reads snapshots.
-* The snapshot is built when the page opens and after our own writes. No new
- watcher and no timers (`AGENTS.md`: idle makes no wakeups). If the catalog
- already exposes a revision, rebuild when it changes; otherwise reopening the
- page is the refresh.
-* Files is its own process and calls GIO directly on its worker, as it does
- now.
-* The two sides share the parser, the group table and the state logic. The
- parser is pure Zig in `config/`; GIO externs stay in thin adapters
- (`files/associations.zig` and a compositor-side one). Whether one adapter
- file can serve both is a `build.zig` question for Phase 0.
-
-## Phases
-
-### Phase 0: spike, no UI (small)
-
-Answer, with a test that pins each answer, using private `XDG_CONFIG_HOME`,
-`XDG_DATA_HOME` and `XDG_DATA_DIRS` (extend `tests/files_associations.py`;
-it already builds private MIME and app databases):
-
-1. How GIO merges a canonical key and an alias key in one list (observed:
- the alias line wins, mpv). Does file order decide?
-2. What `set_as_default_for_type` and `reset_type_associations` do with the
- alias spelling versus the canonical one, and with lines for missing apps.
-3. Whether the lookup walks parent types (`text/x-csrc` to `text/plain`), and
- how to tell which type supplied the winner.
-4. Name-only versus sniffed detection: does `gio open` pick a different app
- from `launchDefault` for an extensionless file?
-5. Which lists exist beside the user's: `$XDG_CURRENT_DESKTOP-mimeapps.list`,
- `/etc/xdg`, `/usr/share/applications/mimeapps.list`. And who ignores them
- (portal OpenURI, Flatpak apps).
-
-Output: a "Findings" section appended here, and the write-path decision.
-
-### Phase 1: Properties "Opens with" (small)
-
-`config/mimeapps.zig` parser + provenance, unit tests on fixtures; the
-Properties rows; choose-only mode in `open_with.zig`.
-
-Done when: for fixture files in private databases the row names exactly the
-app a real double-click launches (the test launches it), each state shows,
-and **Change…** pins a default that survives reopening and is what
-`launchDefault` then launches.
-
-### Phase 2: Default apps page, groups (medium)
-
-Page, snapshot worker, group table, group rows, the General link card, File
-Manager and Terminal moved over.
-
-Done when: choosing in a group changes what Files launches without a restart;
-a Mixed group shows its exceptions; unclaimed types are never written;
-`inode/directory` still has a single writer (`setDirectoryDefault`); opening
-and closing the page leaves no timer and no extra wakeups; the compositor
-thread never blocks on GIO (check with the debug allocator build and a slow
-fixture).
-
-### Phase 3: Advanced list, clean up, hide-app (medium)
-
-Search, group tabs, 40-row cap, state badges, summary + **Clean up** with
-backup, then (optional) **Hide this app for this type**.
-
-Done when: Clean up on a copy of the author's file removes the 14 missing
-and the shadowed lines, leaves the rest byte-identical, and the result
-round-trips through GIO unchanged in effect.
-
-## Tests
-
-* Zig unit tests: parser, state classification, rewriter (comments and unknown
- groups preserved, atomic write), group matching on aliases.
-* `tests/files_associations.py`: GIO behaviour pins (Phase 0) and the
- Properties row against real launches.
-* `tests/control_center.py` already drives the Default applications card
- (`default_file_manager` by widget name, around line 377): extend it for
- group rows, Mixed and Clean up. `desktop_icons.py` only sets the
- `default_file_manager` config key, so moving the card must keep that key.
-* **No test or spike may touch the real `~/.config/mimeapps.list`.** Every
- compositor and Files instance under test gets private XDG dirs (same
- contamination class as `XDG_STATE_HOME`). Settings tests need the scratch
- config home before the page is built.
-* Compare any failing suite against a `git worktree` of HEAD first; several
- already fail there.
-
-## Risks and open questions
-
-* **GIO is the only oracle, and it is opaque.** Phase 0 exists so the UI is
- not built on a guess about alias merging.
-* **Group table drift.** New types appear with new apps. "Other" plus the
- advanced list is the safety net; the table is data, not logic.
-* **Two writers.** GTK apps and `xdg-mime` rewrite the same file; see Writing.
-* **A 40-row cap hides things.** Search and "contested only" must make the
- common case (a handful of conflicts) fit on screen, or raise the cap.
-* To confirm before Phase 2: General keeps a link card rather than the full
- card (recommended); Clean up writes a `.bak` (recommended); Archives stay a
- group even though Files extracts in-app (recommended, for other apps); hide
- app per type is in scope as Phase 3's last item (recommended, droppable).
diff --git a/docs/plans/optional-tiling-qualification.md b/docs/plans/optional-tiling-qualification.md
deleted file mode 100644
index 6ff223b..0000000
--- a/docs/plans/optional-tiling-qualification.md
+++ /dev/null
@@ -1,192 +0,0 @@
-# Optional tiling qualification
-
-Updated 2026-10-08. Canvas remains the shipped default; workspace mode is opt-in.
-This records qualification of the uncommitted stages 1–6 implementation against
-HEAD `a3f4a316bc850169edf55e81325f4b197697e780`. Physical-display qualification
-has started after the user compiled, installed and restarted into the new build.
-Startup inspection is recorded below; interactive checks remain pending.
-
-## Automated results
-
-Debug, ReleaseSafe (`--prefix zig-out/release-safe`) and `zig build test` pass.
-All integration runs use private headless compositors and scratch state.
-The baseline was built in a fresh detached worktree at
-`/tmp/rediwm-tiling-head`. Logs for this run are in
-`/tmp/rediwm-tiling-qualification`; these temporary paths are evidence from this
-run, not repository fixtures.
-
-| Check | Implementation | HEAD comparison |
-| --- | --- | --- |
-| Full `wlr_protocols.py` | Fails at `session_lock`: second client prints EOF instead of `finished`; preceding protocol cases pass | Same assertion in the unmodified HEAD suite |
-| Full `xwayland.py` | Reaches native-scaling managed-window test; expects titlebar 41, receives 35 | Focused `test_native_scaling_managed_window()` reproduces 41 vs 35 on HEAD; the unmodified full HEAD suite stops earlier at its legacy stop-server envelope |
-| Full workspace suite, pixman, two outputs, 1.5×, negative origins, GTK/Xwayland | Pass | Feature absent on HEAD |
-| Full workspace suite, NVIDIA GLES, two outputs, 1.5×, negative origins, GTK/Xwayland | Pass, including scale/origin reload, real input, lock guards, restart, undo and idle | Feature absent on HEAD |
-| Intel GLES workspace controls, persistence and automatic layout, two outputs, 1.5×, negative origins | Pass | Feature absent on HEAD |
-| Full workspace suite, Intel GLES, one output, GTK/Xwayland | Pass, including idle, lock guards, persistence, controls and canvas restoration | Feature absent on HEAD |
-| Intel GLES workspace acceptance, two outputs | Fails idle bound: 70 voluntary main-thread switches in 1.2 s, limit 4 | Matched canvas probe also wakes repeatedly on HEAD; see below |
-| Intel GLES GTK/Xwayland workspace routing and canvas restoration, two outputs, 1.5×, negative origins | Pass | Feature absent on HEAD |
-| Intel GLES `window_corners.py` | Pass at 1, 1.25, 1.5 and 2×, including Settings resize and light/dark edges | No baseline failure to compare |
-| Intel `zig build test-glass` | Pass | Pass |
-| NVIDIA `zig build test-glass` | Fails: incompatible EGLImage/target, FBO creation failure, `effect->valid && !engine->failed` assertion | Same failure |
-
-The workspace GTK routing fixture now honors `REDIWM_TEST_RENDERER`; previously
-that branch silently used pixman even when the rest of the suite used GLES.
-No assertions were relaxed or failures skipped for qualification.
-
-The machine exposes `/dev/dri/renderD128` through i915 and
-`/dev/dri/renderD129` through NVIDIA (driver 615.71.09), on kernel
-7.2.8-zen1-2-zen. Render-node numbers are machine-specific; discover them again
-on another machine. Only `card1-eDP-1` was connected during this run.
-
-The Intel idle comparison used the same three Wayland fixture windows, two
-headless outputs, per-output scale/origin reload sequence and 1.2 s sample:
-
-| Configuration | Main-thread voluntary switches | Other surviving threads |
-| --- | --- | --- |
-| HEAD canvas, GLES | 84 | 0 |
-| Implementation canvas, GLES | 76 | 0 |
-| Implementation workspaces, GLES | 96 | 0 |
-| Implementation workspaces, pixman | 1 | 0 |
-
-This reproduces repeated Intel GLES wakeups without tiling; it does not establish
-their cause or prove equal rendering cost. NVIDIA's full workspace acceptance
-sample recorded 1 main-thread switch and 0 on other surviving threads, with no
-additional client configures. Intel's one-output acceptance also recorded 1/0.
-Intel two-output idle and NVIDIA glass remain open renderer qualifications.
-
-## Reproduction
-
-Build HEAD in an isolated worktree and run the failing protocol cases with its
-own binary and fixtures:
-
-```sh
-git worktree add --detach /tmp/rediwm-tiling-head HEAD
-cd /tmp/rediwm-tiling-head
-zig build
-umask 077
-baseline_state=$(mktemp -d /tmp/rediwm-head-state.XXXXXX)
-export XDG_STATE_HOME="$baseline_state"
-python3 -u tests/wlr_protocols.py
-PYTHONPATH=tests python3 -u -c 'import xwayland; xwayland.test_native_scaling_managed_window()'
-```
-
-Run from the implementation checkout, selecting each available render node:
-
-```sh
-zig build
-zig build -Doptimize=ReleaseSafe --prefix zig-out/release-safe
-zig build test
-umask 077
-REDIWM_TEST_RENDERER=gles2 WLR_RENDER_DRM_DEVICE=/dev/dri/renderD129 \
- REDIWM_TEST_OUTPUTS=2 REDIWM_TEST_SCALE=1.5 REDIWM_TEST_NEGATIVE=1 \
- REDIWM_TEST_XWAYLAND=1 python3 -u tests/workspaces.py
-REDIWM_TEST_RENDERER=gles2 WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128 \
- python3 -u tests/workspaces.py --acceptance-only
-WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128 zig build test-glass
-WLR_RENDER_DRM_DEVICE=/dev/dri/renderD129 zig build test-glass
-REDIWM_TEST_RENDERER=gles2 WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128 \
- python3 -u tests/window_corners.py
-```
-
-Repeat the two-output workspace command with Intel to reproduce the idle
-failure. To exercise its later GTK/canvas cases independently after that failure:
-
-```sh
-REDIWM_TEST_RENDERER=gles2 WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128 \
- REDIWM_TEST_OUTPUTS=2 REDIWM_TEST_SCALE=1.5 REDIWM_TEST_NEGATIVE=1 \
- PYTHONPATH=tests python3 -u -c 'import workspaces; workspaces.xwayland_routing(); workspaces.run(2)'
-```
-
-## Physical-display qualification
-
-After the user's rebuild and restart on 2026-10-08, the running
-`/proc/3159569/exe` hash matches both `/usr/local/bin/rediwm` and the checkout's
-`zig-out/release-safe/bin/rediwm`:
-`98ce6266aebba7d4febd49ff4ec56052123bf5533c09915527a6b5698d3c8b1c`.
-Read-only IPC reports GLES2, `nested = false`, one enabled BOE `0x0A0B` panel
-on `eDP-1`, 2560×1600 pixels / 1706×1066 logical units, scale 1.5 and 60 Hz.
-The active workspace is Canvas. This verifies startup on the intended build
-and physical output; it does not qualify interactive tiling or scanout changes.
-The runtime/output/workspace snapshot is saved at
-`/tmp/rediwm-tiling-qualification/physical-startup.json`.
-
-The user subsequently confirmed that workspace tiling, real clicks, tile
-rearrangement, live split resizing and Escape cancellation work on this display.
-Other physical checks remain pending. Their follow-up request adds a 1 logical
-pixel red active-window outline and an 8 px workspace gap default; those visual
-changes need a rebuild/restart before physical confirmation. Explicit gap
-settings, including zero, remain authoritative; Canvas defaults stay unchanged.
-
-Focus-style validation: Debug and ReleaseSafe builds and all 789 unit tests pass.
-The expanded `window_corners.py` passes on pixman and Intel GLES at 1, 1.25,
-1.5 and 2×, covering focus transfer, straight edges and both corner bands, CSD
-edge clicks, fullscreen, mode transitions and default/explicit-zero gaps.
-The NVIDIA GLES focus check also passes at 1.5×. Complete two-output workspace
-suites pass on pixman and NVIDIA GLES at 1.5× with negative origins and real
-GTK/Xwayland clicks. Snapping, decoration negotiation, workspace tabs and
-focus/zoom integrations pass. Logs are in `/tmp/rediwm-tiling-focus`.
-
-### Checklist
-
-Run the checkout's ReleaseSafe binary in a disposable physical session. The
-installed binary had a different hash during the earlier automated run; the
-new running binary now matches, as recorded above. A nested Wayland window or a headless GLES pass does not verify
-DRM modesetting, scanout, physical input or EDID-derived scale.
-
-Save work and leave the existing graphical session before starting the test from
-a normal user's local VT login. Run without root. Keep the installed binaries
-and normal configuration intact; use scratch configuration and state instead:
-
-```sh
-cd /home/alex/projects/wlroots
-umask 077
-qualification_dir=$(mktemp -d /tmp/rediwm-physical-tiling.XXXXXX)
-mkdir -p "$qualification_dir/config" "$qualification_dir/state" \
- "$qualification_dir/cache" "$qualification_dir/data"
-cat > "$qualification_dir/config.toml" <<'EOF'
-[compositor]
-xwayland = true
-EOF
-sha256sum zig-out/release-safe/bin/rediwm > "$qualification_dir/binary.sha256"
-dbus-run-session -- env -u WAYLAND_DISPLAY -u DISPLAY -u REDIWM_SOCKET \
- REDIWM_CONFIG="$qualification_dir/config.toml" REDIWM_SCALE=auto \
- XDG_CONFIG_HOME="$qualification_dir/config" XDG_STATE_HOME="$qualification_dir/state" \
- XDG_CACHE_HOME="$qualification_dir/cache" XDG_DATA_HOME="$qualification_dir/data" \
- WLR_BACKENDS=drm WLR_RENDERER=gles2 \
- /home/alex/projects/wlroots/zig-out/release-safe/bin/rediwm \
- > "$qualification_dir/compositor.log" 2>&1
-```
-
-Use a terminal launched inside that session for inspection. Record the scratch
-directory, binary hash, driver/kernel versions, connector names, modes, refresh
-rates, effective scales and results below. `rediwm-msg runtime`, `outputs`,
-`workspaces`, `windows` and `window-debug ID` inspect the test compositor;
-verify `nested = false`, GLES and the real connector names before counting a pass.
-Use the checkout's `zig-out/release-safe/bin/rediwm-msg`.
-
-| Exercise | Pass criterion | Result |
-| --- | --- | --- |
-| Default startup | Starts in Canvas; original pan/zoom, manual snapping and canvas bindings work | Canvas startup verified; interactive canvas behavior pending |
-| Opt-in and return | Select Workspaces in Settings; select Canvas again; surviving window positions, size, zoom and canvas shortcuts return | Pending |
-| Physical input | Real keyboard, mouse/touchpad and Super+wheel reach the active workspace; hidden clients receive no clicks/keys | Pending |
-| Tile geometry | Open three native Wayland clients and real GTK/Xwayland clients; gaps, titlebars, footer skirts and borders remain clean and non-overlapping | Pending |
-| Tile controls | Super+V/J, directional focus/swap/resize, automatic/floating workspace toggle, tile insertion and live divider resize work | User confirmed tiling, real clicks, pointer rearrangement and split resizing; remaining controls pending |
-| Cancellation and undo | Escape restores a grab; Super+Z restores both layouts after a transfer; closing a member mid-grab leaves no stale tile | User confirmed Escape cancellation; undo/closure cases pending |
-| Lifecycle | Minimize/restore, maximize/fullscreen, dialogs, Settings, tabs and client closure preserve focus and valid layout | Pending |
-| Scale and scanout | Test scale 1, auto and 1.5 on the physical connector; check sharpness, hover borders, glass and real native/X11 menu click alignment | Pending |
-| Two physical outputs | One visible workspace per connector; focus/transfer across outputs and a negative origin preserve real input and geometry | Pending; needs another display |
-| Physical unplug/reconnect | Unplug an external display during a tile grab; grab ends, hidden/visible membership survives separately, reconnect gets valid ownership | Pending; needs another display |
-| Modes/rotation | Change a supported mode, refresh and rotation in Settings; layout reflows without configure storms or stale imagery | Pending |
-| Idle | After startup and animations settle, compare Canvas/Workspaces per-thread voluntary switches over equal samples with static clients; no tiling-driven repeating wakeups/configures | Pending |
-| Lock/unlock | Lock and unlock this disposable session normally; geometry, focus and real input resume correctly | Pending |
-| Restart | In the scratch config, select Workspaces, save layout and exit; restart the same binary/config/state and reopen matching apps; membership, splits and floating overrides restore | Pending |
-
-For pixels, use compositor IPC screenshots with automation enabled only in this
-disposable session, or the compositor's own screenshot action. Do not use host
-`grim` as evidence about a nested compositor. Capture logs for any failure and
-compare the same operation with HEAD before assigning it to tiling. Restore the
-test output settings before exit; retain scratch evidence until reviewed.
-
-Physical qualification is complete only after results are recorded for the
-available hardware. Mark unavailable multi-display cases pending, not passed.
-Keep tiling opt-in while these checks and renderer limitations remain open.
diff --git a/docs/plans/optional-tiling.md b/docs/plans/optional-tiling.md
deleted file mode 100644
index fbefa66..0000000
--- a/docs/plans/optional-tiling.md
+++ /dev/null
@@ -1,434 +0,0 @@
-# Plan: optional tiling and conventional workspaces
-
-Status: stages 1–5 and automated stage 6 validation implemented for review; workspace mode remains opt-in.
-Updated 2026-10-08.
-
-The first milestone provides opt-in floating workspaces, reversible canvas
-transitions, separate shortcut presets and Settings controls. Workspace IDs
-1–32 are supported (1–10 in the default preset). Dialogs and tab groups move
-together; external activation reveals their workspace. Output removal migrates
-workspace ownership to a surviving output without merging membership.
-
-Per-app floating rules and versioned workspace persistence are implemented.
-Manual split controls, reversible grabs and multi-window layout undo are implemented. Canvas
-autosave is preserved while workspace mode is active. See [README](../../README.md)
-for configuration and shortcuts.
-
-Milestone validation: Debug and ReleaseSafe builds, `zig build test`, and
-snapping, shortcut editing, focus/zoom, tabs, initial window state, layout IPC,
-autosave and output-destruction integrations pass. `tests/workspaces.py`
-covers one/two outputs, 1.5× scale, negative origins, dialogs, Settings mode
-selection, workspace protocol activation, camera/window restoration and held
-keys; its optional GTK check verifies actual Xwayland click routing. Workspace
-shortcut editing/disable and hot-unplug variants also pass.
-
-The full protocol suite stops at its second-lock-client assertion; the full
-Xwayland suite stops at an outdated IPC envelope in its server-stop test. Both
-failures were reproduced on a separate HEAD worktree.
-
-Automatic-layout validation adds pure split/constraint/allocation tests and
-headless checks for stable focus, insertion/closure, live minimum/maximum sizes,
-overflow recovery, output rotation, decoration changes, manual placement and
-minimize/maximize/fullscreen reinsertion. Workspace and tab integrations pass,
-including two outputs with negative origins at 1.5× and real GTK/Xwayland tiled
-click delivery. Automatic-layout geometry also passes with GLES at 1.5×.
-Debug, ReleaseSafe and unit tests pass. The broader output-scale suite's
-`BufferNotAttached` failure and Xwayland shutdown's legacy-envelope assertion
-were reproduced in a fresh worktree of HEAD (`a3f4a31`).
-
-Layout-undo coverage includes keyboard/IPC operations, manual snaps, no-op
-operations, live/released grabs, delayed configure replies, updated client
-constraints, dialogs, tab groups and selected-tab closure, placeholder
-replacement, and reconciliation after closing a focused member. Transfers
-restore both layouts, including tiled/floating moves and windows that remain
-maximized or fullscreen, on two outputs with negative origins at 1.5× scale.
-Canvas undo, snapping, shortcut editing, focus/zoom, initial window state,
-layout IPC/autosave and output-destruction integrations also pass. Debug and
-ReleaseSafe builds and all 785 unit tests pass. GLES was not repeated for this change: this environment has no DRM
-render node.
-
-Stage 5 validation: Debug and ReleaseSafe builds and all 789 unit tests pass.
-Workspace integrations pass on one output and on two outputs with negative
-origins at 1.5× scale, including actual GTK/Xwayland clicks. Restart checks cover
-duplicate app IDs launched in reverse title order, tab groups and selection,
-floating overrides and reinsertion, exact split geometry, empty workspace
-preferences, hidden membership, saved canvas state, named saves and delayed
-startup beyond the first autosave tick. The full Settings suite, snapping,
-shortcut editing, focus/zoom, tabs, initial window state, layout IPC/autosave,
-output destruction and window-rule integrations pass. GLES could not run because
-this environment has no DRM render node.
-
-Stage 6 validation: Debug and ReleaseSafe builds and `zig build test` pass.
-The complete workspace suite passes on one output and on two outputs at 1.5×
-with negative origins, including real GTK/Xwayland clicks. New acceptance checks
-cover live output density/origin changes during tile grabs, unchanged split
-topology, real Wayland click delivery, stable configure counts, per-thread idle
-wakeups, workspace IPC/protocol lock guards, unlock restoration and lock-client
-death. Idle samples recorded 0–2 voluntary context switches per thread in 1.2 s
-and no additional configures.
-The GTK routing fixture now honors the requested output count and converts
-pointer positions to output-local coordinates for negative-origin displays.
-
-Hot-unplug/reconnect checks retain the connector name, preserve separate visible
-and hidden workspace membership on the surviving output, assign an empty
-workspace to the returning output and exercise reversible transfers. Shortcut
-inhibition now runs in both modes, including tiling, Alt+Tab, number/wheel
-navigation, pointer grabs and Super+Escape. The placeholder-undo test now waits
-for the neighboring client's split configure before capturing its geometry.
-
-Snapping, shortcut editing, focus/zoom, tabs, initial window state, layout
-IPC/autosave, output destruction/arrangement/scale, security contexts and X11
-size-hint hardening pass. Workspace variants of shortcut editing and tabs pass.
-The protocol suite's expanded Canvas response expectation and Xwayland's old
-stop-server request envelope are updated. The full protocol suite still fails
-at the second lock client; the full/fractional Xwayland suites stop at a stale
-41-pixel titlebar assertion (the compositor reports 35). These failures were
-reproduced in a fresh HEAD worktree (`a3f4a31`). At that validation run, GLES and
-physical-display qualification were pending because no DRM render node was available.
-
-Follow-up qualification (2026-10-08): render nodes are now available. The lock
-client and 41-vs-35 Xwayland titlebar failures were reproduced again against a
-fresh HEAD build. The complete workspace suite passes with NVIDIA GLES on two
-outputs at 1.5× with negative origins and real GTK input. Intel GLES passes
-the full one-output suite, two-output controls/layout/persistence/routing and border
-checks; its two-output idle limit still fails, with repeated wakeups reproduced
-in HEAD canvas mode. Glass GPU tests pass on Intel and fail identically on HEAD
-and the implementation on NVIDIA. Physical-display checks remain pending by
-user choice. See the [qualification record and hardware checklist](optional-tiling-qualification.md)
-for commands, evidence and open checks. Canvas remains the default.
-
-Physical follow-up: the user rebuilt and restarted the installed ReleaseSafe
-compositor. Its running binary hash matches the checkout; IPC confirms GLES2,
-`nested = false`, a physical 2560×1600 panel at 1.5×/60 Hz and Canvas startup.
-Interactive tiling, physical output changes and multi-display checks remain
-pending in the qualification checklist.
-
-The user then confirmed physical tiling, real clicks, pointer rearrangement,
-split resizing and Escape cancellation. Their requested workspace styling adds
-a 1 logical px red active-window outline (including CSD/floating clients) and
-an 8 px default tile gap. Explicit `window_gap` settings still override that
-default; Canvas retains its styling and zero-gap default. The focus colour is
-the `workspace_active_border` theme token. The visual update needs a new physical
-rebuild/restart for user confirmation.
-
-## Agreed direction
-
-Keep the existing pan-and-zoom canvas as the default. Add an optional
-conventional workspace mode with automatic tiling, floating exceptions, and
-manual window placement. Use a Hyprland-style default shortcut preset in
-workspace mode. Returning to canvas mode restores its existing shortcuts.
-
-Workspace mode is a desktop-wide choice. Within that mode, each workspace can
-use automatic tiling or floating placement. Its shortcut preset stays consistent
-when switching between tiled and floating workspaces or focusing a floating
-window.
-
-## Existing foundations
-
-- [snap.zig](../../src/snap.zig) already implements manual half/quarter tiles,
- edge snapping, previews, and keyboard placement steps.
-- [Toplevel.zig](../../src/Toplevel.zig) owns forced geometry, layout changes,
- floating restore geometry, and backend-specific configure requests.
-- [World.zig](../../src/World.zig) owns the shared canvas and focus stack.
- Its toplevel list changes with focus and must not become the tiling order.
-- Current desktop navigation moves the camera between canvas grid positions;
- it does not switch window membership or visibility. The workspace protocol
- currently advertises one Canvas workspace.
-- Canvas persistence currently restores by app ID and still needs a versioned
- workspace format. Workspace undo now owns snapshots of affected split trees
- and members; canvas undo retains its single-window/camera behavior.
-
-## User-visible behavior
-
-In canvas mode, retain pan, desktop/window zoom, floating placement, and manual
-snapping. In workspace mode, use a fixed camera and normal window scale, with
-one visible workspace per output. New workspaces default to automatic tiling.
-
-Save canvas positions and window zoom before entering workspace mode. Initially
-place existing windows in a workspace on their current output. Returning to
-canvas restores saved state for surviving windows and gives newly opened windows
-sensible floating positions. Clamp restored positions when the output topology
-has changed so windows remain reachable.
-
-Dialogs and transient utilities float by default. Users can toggle any eligible
-window between floating and tiled placement, with per-app rules for exceptions.
-An existing tab group occupies one tile. Explicit manual half/quarter snapping
-removes the window from automatic arrangement; the remaining tiles reflow.
-
-Fullscreen and maximize temporarily override placement and remember the prior
-tile. Minimize removes the window from arrangement while retaining reinsertion
-information. Restore these windows deterministically even if the original
-neighbours have closed.
-
-## Shortcut presets
-
-Use Hyprland's upstream example configuration as the reference for familiar
-bindings, rather than assuming every tiling compositor uses the same defaults.
-The following mappings were checked against the
-[official Hyprland example configuration](https://github.com/hyprwm/Hyprland/blob/main/example/hyprland.lua)
-on 2026-10-08. RediWM should ship a stable preset; upstream changes should not
-silently change existing users' bindings.
-
-| Workspace-mode shortcut | RediWM action |
-| --- | --- |
-| Super+Q | Open the configured terminal |
-| Super+C | Close the focused window |
-| Super+E | Open the configured file manager |
-| Super+R | Open the start menu / launcher |
-| Super+V | Toggle the focused window between tiled and floating |
-| Super+J | Toggle the relevant split direction |
-| Super+arrows | Focus in that direction |
-| Super+1…9, Super+0 | Switch to workspace 1…10 |
-| Super+Shift+1…9, Super+Shift+0 | Move the focused window to workspace 1…10 and follow it |
-| Super+wheel | Cycle existing workspaces |
-| Super+left-drag | Move a floating window or rearrange a tile |
-| Super+right-drag | Resize a floating window or adjust a tiled split |
-
-Use RediWM's configured applications and shell actions for these bindings; no
-Hyprland companion programs are required. Adapt Super+M to RediWM's session/power
-menu instead of its canvas maximize action. Hyprland's example assigns that key
-to its shutdown/exit flow; the shell menu is the proposed RediWM equivalent.
-
-Keep useful RediWM bindings such as Super+F for fullscreen, Super+L for lock,
-Alt+Tab, screenshots, media controls, and Super+Z for undo where they do not
-conflict. Add the following RediWM extensions, clearly labelled as extensions
-rather than Hyprland defaults:
-
-| Additional workspace shortcut | Action |
-| --- | --- |
-| Super+Shift+arrows | Move/swap the focused tile in that direction |
-| Super+Ctrl+arrows | Adjust the relevant split size |
-| Super+Shift+Space | Toggle automatic tiling for the current workspace |
-
-Keep manual snap actions configurable and available through window controls.
-Their canvas shortcuts remain Super+Shift+arrows; workspace mode uses those keys
-for rearrangement. Pseudotiling and special/scratchpad workspaces are deferred,
-so leave Hyprland's corresponding Super+P and Super+S combinations unassigned
-until those features exist.
-
-### Configuration and compatibility
-
-- Select the workspace preset automatically when entering workspace mode, and
- restore the canvas preset when leaving it. Do not persistently rewrite bindings
- during a mode change.
-- Keep existing `[keybinds]` configuration behavior for canvas mode. Add a
- separate workspace override table (proposed spelling: `[keybinds.workspace]`)
- layered over the workspace preset. This avoids importing canvas depth/pan
- bindings into the workspace preset accidentally.
-- Explicit workspace bindings, including `noop`, win over preset defaults.
- Allow users to edit or disable every preset binding through Settings.
-- Show the active mode/preset in shortcut settings and display conflicts there.
- Highlight changed meanings such as Super+Q, Super+M, arrows, and number keys.
-- Keyboard, pointer modifiers, and wheel actions must all switch together.
- Finish or cancel current gestures before switching modes; avoid held-key
- repeats executing an action from the previous mode.
-- Preserve shortcut inhibition, lock handling, keyboard-layout fallback,
- hardware controls, and the existing shortcut-inhibition escape binding.
-
-## Implementation stages
-
-### 1. Real workspace ownership
-
-Add a workspace manager responsible for stable workspace IDs, membership,
-visibility, output assignment, remembered focus, and an independent tiling order.
-Start with conventional floating workspaces.
-
-Update focus traversal, hit testing, taskbar, switcher, activation/reveal paths,
-and workspace protocol reporting. A hidden workspace must not accept input.
-Switching to a workspace already visible on another output should focus that
-output rather than display the workspace twice. Define deterministic migration
-and focus fallback when an output is disconnected.
-
-Checkpoint: switching and moving windows between floating workspaces works on
-one or multiple outputs, including dialogs and compositor-owned Settings windows.
-
-### 2. Reversible mode switching and shortcut presets
-
-Implement Canvas / Workspaces selection, canvas state capture/restore, the fixed
-workspace camera, and the mode-specific shortcut resolver described above.
-Keep window-depth and canvas-pan actions inactive in workspace mode. Add the
-workspace switching/moving actions and Settings support for editing the preset.
-
-Configuration parsing belongs in `src/config/`; applying mode changes belongs
-in `src/config_runtime/`. Audit `Input.zig` pointer modifier handling as well as
-the keyboard action table. Preserve custom canvas configurations and reload
-behavior.
-
-Checkpoint: repeated mode changes preserve windows and focus, activate the right
-keyboard/mouse preset, and restore canvas geometry and bindings without edits to
-the user's existing shortcut table.
-
-### 3. Automatic layout engine — implemented
-
-The pure `auto_layout.zig` split tree supports insertion/removal, swapping,
-rotation and ratio adjustments. `auto_tiling.zig` coalesces compositor changes
-through an event-loop idle callback and admits eligible members in stable
-workspace insertion order. Windows use a separate arbitrary automatic target
-in the existing forced-geometry path. Focus changes do not rearrange the tree.
-The existing `window_gap` applies to output edges and internal splits; client
-limits include decoration extents. Overflow leaves later members floating and
-retries on membership, constraints or usable-area changes. Bounded clients may
-leave unused space inside their tile. Dialogs and fixed-size clients float.
-
-Stage 4 now supplies manipulation shortcuts and drag insertion previews.
-Explicit manual placement/snapping opts a window out; tiled pointer grabs keep
-it in the split tree. Minimize/maximize/fullscreen suspend a leaf, and tabs share
-one leaf. Stage 5 now supplies multi-window undo.
-
-Original stage requirements:
-
-Implement one recursive split layout in a separate module: leaves represent
-windows or tab groups; internal nodes store direction and split ratio. Support
-insertion, removal, swapping, split rotation, and resizing. Focus changes alone
-must not reorder tiles.
-
-Keep geometry calculation independent of scene mutation. Extend the existing
-compositor-owned geometry path to accept arbitrary tile rectangles rather than
-representing automatic placement as a manual half/quarter tile. Keep layout
-state explicit so focus zoom, drag handling, and other floating-only behavior
-recognize automatic tiles.
-
-Account for usable output area, titlebars, borders, gaps, fractional scale, and
-client size constraints. Define a stable fallback when minimum sizes cannot fit:
-leave a newly inserted window floating, and use a deterministic member order for
-overflow after an output shrinks. Never loop between client configure replies
-and relayout indefinitely.
-
-Recompute only for membership, layout, constraints, or usable-area changes;
-coalesce related changes and send only changed geometry. Add no idle polling.
-
-Checkpoint: opening, closing, and resizing windows gives stable, non-overlapping
-tiles with valid sizes and no focus-dependent rearrangement.
-
-### 4. Manual controls and lifecycle integration — implemented
-
-The workspace preset now assigns Super+V/J, Super+Shift+arrows,
-Super+Ctrl+arrows and Super+Shift+Space. The same tiling actions are editable in
-Settings and available through IPC `tiling_action` under its usual lock,
-modal and sandbox checks. Each workspace retains its own automatic/floating
-choice without changing shortcut presets.
-
-Tile moves stage an insertion preview and apply only on release. Split resizes
-are live and own a tree snapshot; Escape restores it and reconciles current
-membership, so closing a window cannot resurrect a stale member. Output removal,
-mode changes and a grabbed window becoming hidden or fullscreen cancel the grab.
-Cross-output insertion and workspace transfers update both layouts. Floating
-toggles and unmap/remap retain reinsertion hints; tab identity changes rename the
-leaf when possible, remapped tabs rejoin surviving groups, and placeholder
-replacement preserves its member identity.
-Normal floating drags/resizes and canvas snapping remain available.
-
-Split operations use the complete layout snapshots supplied in stage 5.
-Per-workspace choices and ratios now persist in the stage 5 workspace snapshot.
-
-Original stage requirements:
-
-
-Wire keyboard rearrangement, split resizing, automatic-layout toggling, and
-floating toggles into the shared actions used by Settings and IPC. Show an
-insertion preview while dragging a tile. Escape restores its previous layout;
-moving across outputs/workspaces updates both source and destination layouts.
-
-Cover minimize/restore, maximize/fullscreen, client unmap/remap, destruction,
-output removal, tab membership changes, and placeholder-to-client replacement.
-Keep dialogs above their owners and avoid counting hidden tabs as extra tiles.
-Preserve backend geometry conventions and actual Xwayland input routing.
-
-Checkpoint: mouse and keyboard manipulation agree, cancellation is reversible,
-and lifecycle events leave no stale members, empty splits, or unreachable windows.
-
-### 5. Settings, rules, persistence, IPC, and undo
-
-Layout undo is implemented in `layout_undo.zig`, backed by owned snapshots in
-`undo.zig`. It captures only affected workspace trees and their member state,
-including both sides of transfers. Shared keyboard/IPC actions, tile insertion,
-split resizing, manual snapping, floating moves/resizes and explicit IPC
-placement use the same undo slot. No-op operations retain the previous entry;
-Escape discards a tiled gesture, while undo during a live grab ends it first.
-Window IDs and stable insertion identities reconcile closures, tab identity
-changes and placeholder replacement. Restoring uses live constraints and output
-ownership, and preserves current minimize/maximize/fullscreen overrides.
-Snapshots are freed on replacement, cancellation, mode changes, lock and shutdown.
-
-Settings now edits workspace placement, gaps and per-app floating defaults.
-Existing window rules accept a live `floating` property; explicit per-window
-placement overrides stay independent. IPC reports output/visibility, gaps,
-split nodes and window placement, with typed setters under the existing lock,
-modal and sandbox guards.
-
-`config/workspace_layout.zig` owns the bounded version 2 JSON format;
-`workspace_persistence.zig` applies it. Workspace autosave uses its own state
-file, and named saves use the same serializer. Unversioned canvas TOML stays
-readable. Snapshots retain output ownership, workspace choices, split topology,
-ratios, occurrence identities, floating geometry, tab grouping/selection and
-saved canvas state. Startup reads once and consumes each app/backend/title/
-instance match once; reverse launch order and missing members are reconciled.
-Restoration runs after initial placement and before map-time focus, then finishes
-group repair after tab reconciliation. Explicit layout operations protect affected
-workspaces from later split rebuilds, and the finite startup restore window frees
-the loaded snapshot after 37 seconds. Periodic saves preserve the original file
-while matches are pending; explicit saves and shutdown capture current state.
-Atomic writes skip unchanged snapshots.
-
-Expose mode, workspace layout, gaps, shortcut overrides, and per-app floating
-rules. Extend IPC with workspace/layout state and actions through its existing
-lock and sandbox checks.
-
-Version the saved layout format and read older saves. Persist workspace
-membership, split structure, ratios, floating restore geometry, and saved canvas
-state. Match multiple windows from one app explicitly, consume each match once,
-and tolerate missing or ambiguous matches. Coordinate autosave restoration with
-initial window placement so the two cannot fight each other.
-
-Extend undo to snapshot all affected layout state for rearrangements, resizes,
-floating toggles, and transfers, including both workspaces when applicable.
-Destroyed windows must not invalidate undo of surviving members.
-
-Checkpoint: restart and undo restore coherent groups rather than isolated window
-coordinates, and config reload respects explicit binding overrides.
-
-### 6. Validation and rollout — automated checks implemented
-
-The automated acceptance and regression coverage above makes the opt-in feature
-reviewable. Keep Canvas as the shipped default. GLES results and open renderer
-limitations are recorded in the [qualification record](optional-tiling-qualification.md).
-Physical-display checks remain pending; reproducing failures on HEAD does not
-count as passing those checks.
-
-Extend existing suites where practical and add focused tests for workspace
-ownership and layout calculations. Follow [TESTING.md](../../TESTING.md) and the
-applicable directory instructions; use isolated headless sessions and scratch
-state directories.
-
-Acceptance coverage:
-
-- Canvas behavior and manual snapping remain unchanged with the feature off.
-- Hidden workspaces cannot receive focus/input; activation reveals the correct
- workspace without bypassing lock or shortcut inhibition.
-- Preset selection, collisions, explicit overrides, `noop`, reloads, held keys,
- pointer modifiers, and return to canvas all behave consistently.
-- Wayland, Xwayland, Settings, dialogs, tabs, placeholders, and remapped windows
- participate correctly.
-- Minimize, fullscreen, maximize, dragging, cancellation, and window closure
- preserve layout invariants.
-- Multiple outputs, unplug/reconnect, negative origins, scale changes, and
- fractional-scale/GLES rendering preserve geometry and real input delivery.
-- Restart, older saves, duplicate app IDs, and multi-window undo are reliable.
-- Idle behavior adds no wakeups and layout changes do not cause configure storms.
-
-For implementation, build Debug and ReleaseSafe, run `zig build test`, and run
-the relevant integrations: snapping, keyboard shortcuts, focus/zoom, tabs,
-initial window state, layout IPC/autosave, output destruction/arrangement,
-workspace protocols, and Xwayland. Compare failures against a HEAD worktree
-before treating them as regressions.
-
-## Delivery boundary
-
-The first reviewable milestone is conventional floating workspaces, reversible
-canvas transitions, and the Hyprland-style shortcut preset. Automatic splits,
-manual controls and multi-window undo now build on that foundation. Workspace
-Settings, per-app floating rules, richer layout IPC and persistence now complete
-that milestone. Keep the feature opt-in throughout development.
-
-Additional layout algorithms, pseudotiling, scratchpads, and full Hyprland
-configuration compatibility are outside this first implementation.
diff --git a/docs/plans/printers-direct-cups.md b/docs/plans/printers-direct-cups.md
deleted file mode 100644
index 60064de..0000000
--- a/docs/plans/printers-direct-cups.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Direct CUPS administration
-
-Add a local libcups administration backend when cups-pk-helper is absent.
-Keep the established helper path when available; backend selection happens
-before a request, never by retrying a failed mutation against another backend.
-The existing canonical-local-server gate remains in force. Remote/TLS inventory
-support is separate work and must not silently redirect to the local scheduler.
-
-Implementation sequence:
-
-1. Add a page-owned native worker with an eventfd completion/challenge channel,
- bounded local connection/I/O, cancellation, and thread-local libcups state.
- Keep the existing validated actions and chained add/PPD cleanup state machine.
-2. Map the helper-independent operations to IPP: discovery, creation, deletion,
- enable/accept, default, description, device, defaults and PPD editing. Rename
- must preserve settings/PPD and reject active jobs/collisions before clone/delete;
- report uncertain or partial changes and refresh instead of automatic rollback.
-3. Add username/password controls backed by locked and wiped storage. Only show
- them in response to a CUPS challenge, bound retries, cancel on page hide, and
- never retain passwords between operations or log server-provided prompts.
-4. Extend isolated tests for helper-absent administration, challenge/retry/cancel,
- denial, discovery filtering, partial operations, and responsive page teardown.
- Existing helper tests remain regression coverage.
-5. Update package/build guidance and subsystem notes. Run Debug and ReleaseSafe
- builds, zig build test, and printer integration tests. Compare failures against
- HEAD in an isolated worktree before attributing regressions.
-
-No production test environment switches, automatic package installation, host
-queue changes, or test print jobs are part of this work. Hardware printing and
-stock CUPS authentication policy still require separate qualification.
-
-Implementation status: the helper-absent backend, secure credentials controls,
-IPP operations, PPD default editing and guarded clone/delete rename are now
-implemented. Helper-present behavior remains covered by the original suite.
-The private libcups suite covers successful operations, collisions, permission
-denial, wrong-password retries and exhaustion, partial rename, active-job refusal,
-and cancellation during both I/O and a password challenge. The Settings test
-checks actual secret widgets, fresh authentication on subsequent operations,
-cancel and hide. No real printer has been exercised.
-
-The direct backend follows the public
-[CUPS authentication and request APIs](https://openprinting.github.io/cups/doc/cupspm.html).
-PPD support intentionally uses CUPS 2.x compatibility APIs, as the existing
-printer page exposes legacy driver controls. Build/install dependencies now
-include libcups headers. A real private cupsd check could not run here because
-the installed cupsd executable is not executable by this user; synthetic tests
-must not be described as stock scheduler/policy qualification.
-
-Direct rename refuses queues in CUPS classes before mutating them; the page
-does not model class membership and must not silently discard it.
-
-Validation completed:
-
-- Debug and ReleaseSafe builds passed.
-- `zig build test` passed on the final source.
-- `zig build test-printers --summary all` and
- `zig build test-printers -Doptimize=ReleaseSafe --summary all` both passed:
- 59/59 build steps, 73/73 printing unit tests, the existing helper integration
- suite, and the new native/Settings integration suite.
-- Native tests include the 20-second I/O deadline, class-member rename refusal,
- PPD preservation, and no timed wakeups in either idle administration thread.
-- `git diff --check`, Python syntax checks and installer shell syntax passed.
-
-These are isolated software checks, not evidence of physical paper output or
-stock CUPS authentication policy on a deployed desktop.
diff --git a/docs/plans/printers-qualification.md b/docs/plans/printers-qualification.md
deleted file mode 100644
index 038699f..0000000
--- a/docs/plans/printers-qualification.md
+++ /dev/null
@@ -1,681 +0,0 @@
-# Printer qualification evidence
-
-Recorded 2026-10-16. These are isolated software compatibility checks for the
-[Printers plan](printers.md), separate from its physical-printer acceptance gates.
-No host CUPS socket, host service, USB device, printer, home directory or project
-checkout was mounted into a container. Packages were installed only in disposable
-rootless Podman containers. The schedulers used private configuration, state,
-spool, cache, log and runtime directories under their container's `/tmp`.
-
-## Distro matrix
-
-The cached release-family images were inspected first with `--network=none`,
-`--read-only` and `--pull=never`. None initially contained CUPS or cups-pk-helper.
-Their packages were then installed from their normal distro repositories inside
-throwaway containers; package versions below are the versions actually observed.
-Arch's base image identified itself as snapshot `20260927.0.600689`, Debian as
-13.7, Ubuntu as 24.04.5, and Fedora as 44.
-
-| Family | CUPS package | cups-pk-helper package | Empty private scheduler | Runtime helper introspection | Raw MIME advertised | `dbus://` subscription |
-| --- | --- | --- | --- | --- | --- | --- |
-| Arch | `2:2.4.20-1` | `0.2.7-2` | Pass | Pass | Pass | Pass |
-| Debian 13 | `2.4.10-3+deb13u2` | `0.2.6-2.1` | Pass | Pass | Pass | Pass |
-| Ubuntu 24.04 | `2.4.7-1.2ubuntu7.14` | `0.2.6-1ubuntu8` | Pass | Pass | Pass | Pass |
-| Fedora 44 | `2.4.19-3.fc44` | `0.2.7-12.fc44` | Pass | Pass | Pass | Pass |
-| openSUSE | Not checked | Not checked | Not checked | Not checked | Not checked | Not checked |
-
-Every checked CUPS package installed `/usr/lib/cups/notifier/dbus`. Each inert
-queue reported `application/vnd.cups-raw`, notification scheme `dbus`, and a
-supported lease range of `0-2147483647`. Creating a printer subscription with
-`notify-recipient-uri=dbus://`, `notify-events=printer-state-changed` and requested
-lease `0` succeeded on all four families. Some creation replies included only the
-subscription ID, so the absence of a lease in that reply is not a refusal.
-
-The Debian packaged `lpadmin(8)` documentation explicitly described the
-`everywhere` model querying the supplied IPP device. Minimal images on the other
-families did not expose that manual through the checked paths. Their actual
-Everywhere queue creation against an IPP device was not exercised. Upstream
-[CUPS lpadmin documentation](https://openprinting.github.io/cups/doc/man-lpadmin.html)
-also describes that model; documentation alone does not qualify discovery or
-creation on real printers.
-
-## Actual helper interface
-
-All four installed helpers were started directly on a private system bus, then
-introspected at destination `org.opensuse.CupsPkHelper.Mechanism`, object path
-`/`, interface `org.opensuse.CupsPkHelper.Mechanism`. The following signatures
-were identical across the two observed helper versions:
-
-| Method | Input signature | Output signature |
-| --- | --- | --- |
-| `DevicesGet` | `iiasas` | `sa{ss}` |
-| `PrinterAdd` | `sssss` | `s` |
-| `PrinterDelete` | `s` | `s` |
-| `PrinterRename` | `ss` | `s` |
-| `PrinterSetDefault` | `s` | `s` |
-| `PrinterSetEnabled` | `sb` | `s` |
-| `PrinterSetAcceptJobs` | `sbs` | `s` |
-| `PrinterAddOptionDefault` | `ssas` | `s` |
-
-This establishes the installed wire interface and executable availability. The
-private bus and scheduler used permissive fixture policies; this does not establish
-a desktop user's stock polkit authorization, service activation, discovery rights
-or successful queue administration through the helper on an installed desktop.
-
-## Subscription lease and byte transport
-
-The follow-up harness queries `Get-Subscription-Attributes` after creation rather
-than assuming that the requested lease was granted. Its raw transport check adds
-one synthetic PPD queue whose only backend copies the job into a private file.
-The PPD declares a deliberately missing PDF filter. One bounded binary payload is
-submitted with `lp -o raw`, then compared byte-for-byte with the captured file.
-This checks CUPS raw bypass through a PPD queue; no hardware backend is installed
-in the fixture's `ServerBin`, and no document is sent to a real printer.
-
-The granted lease was independently queried with `Get-Subscription-Attributes`
-on all four families, and each returned `notify-lease-duration=0`. Explicit
-`Cancel-Subscription` is also exercised before the raw fixture changes its queue.
-Each final comparison passed for the same 35-byte payload, including NUL,
-`0xff`, ESC, LF and CRLF. Debian/Ubuntu used `cmp`; Arch/Fedora minimal images
-lacked `cmp`, so the follow-up compared complete, untruncated `od -An -v -tx1`
-output. The checked backend copies input without invoking filters or opening a
-printer connection.
-
-| Family | Granted lease `0` | Explicit subscription cancellation | Raw bytes through synthetic PPD |
-| --- | --- | --- | --- |
-| Arch / CUPS 2.4.20 | Pass | Pass | Pass, 35 bytes |
-| Debian / CUPS 2.4.10 | Pass | Pass | Pass, 35 bytes |
-| Ubuntu / CUPS 2.4.7 | Pass | Pass | Pass, 35 bytes |
-| Fedora / CUPS 2.4.19 | Pass | Pass | Pass, 35 bytes |
-
-An earlier fixture run replaced `ServerBin` without retaining CUPS's
-`daemon/cups-exec` launcher. Queue changes then triggered a missing-launcher
-notifier retry, and the raw comparison could not run. The final harness retains
-that launcher while keeping hardware and network backends absent, cancels the
-subscription before changing the PPD queue, and bounds the private log size.
-This was a fixture setup failure, not evidence of raw passthrough or a product
-regression. An earlier Debian rename follow-up also encountered a cleanup-only
-race: its raw and lease checks had passed, but removing the private server root
-raced the terminating daemon and exited with status 1. The entire disposable
-container was removed; the documented recipe adds a wait before directory
-removal. Arch/Fedora follow-ups and the corrected final Debian fixture exited 0.
-
-## Rename source review and runtime limit
-
-`PrinterRename(ss) -> s` exists in the installed helper interfaces. The
-[official Debian 0.2.6 source archive](https://deb.debian.org/debian/pool/main/c/cups-pk-helper/cups-pk-helper_0.2.6.orig.tar.xz)
-and [upstream 0.2.7 archive](https://www.freedesktop.org/software/cups-pk-helper/releases/cups-pk-helper-0.2.7.tar.xz)
-were downloaded and `src/cups.c:cph_cups_printer_class_rename` reviewed.
-
-Both implementations check that the destination is absent, reject pending or
-processing jobs, create a replacement queue from the old PPD and selected
-attributes, attempt to move held jobs, then delete the old queue. The procedure
-is not atomic. Several updates/moves/deletion results are ignored; arbitrary
-queue defaults are not comprehensively copied. A concurrent destination creation
-can race the initial check. The 0.2.7 changes in this function only adjust class
-member loop integer types. It must not be described as an atomic or universally
-preserving rename.
-
-Initial private runtime calls in Debian, Arch and Fedora were refused before
-execution: the test bus admitted root but disconnected the packaged polkit
-service after it dropped to its service UID. The fixture policy was corrected
-to admit its container users, and the Debian check was repeated with the same
-private bus also available at the container's conventional system-bus path.
-No host bus or queue was used.
-
-On Debian 13, helper 0.2.6 and CUPS 2.4.10 then demonstrated:
-
-| Check | Actual result |
-| --- | --- |
-| Quiet `RenameSource` to unused `RenameNew` | Empty error string; old name disappeared; `fixture:/source` was preserved under the new name. |
-| `RenameNew` to existing `RenameExisting` | Refused; `RenameNew` retained `fixture:/source` and `RenameExisting` retained `fixture:/existing`. |
-| Rename with a pending job on paused `RenameNew` | Refused; source remained and no destination appeared. The bounded job targeted only the inert fixture backend and was cancelled afterwards. |
-
-Both refusals returned the nonempty error string `successful-ok`. That string
-occupies the helper's error field and is a failure despite its wording; only an
-empty error string denotes success. The final Debian fixture exited 0.
-
-These sequential checks establish the helper's basic rename, collision and
-pending-job behavior in this private root-authorized fixture. They do not
-establish atomicity, preservation of all defaults/history, held-job migration or
-unprivileged desktop authorization. Arch/Fedora rename behavior remains a source
-review plus interface check, rather than a successful runtime rename test.
-
-Source archive SHA-256 values:
-
-* 0.2.6: `959af8f2f5a2761e7e498b61c9caf25ae963335031eae9972d999e9a0d97a228`
-* 0.2.7: `66070ddb448fe9fcee76aa26be2ede5a80f85563e3a4afd59d2bfd79fbe2e831`
-
-## Actual option-setting semantics
-
-A follow-up Debian 13 fixture used CUPS 2.4.10, cups-pk-helper 0.2.6 and a
-synthetic PPD with A4/4x6 media, 203/300 dpi, duplex, color, quality and custom
-Darkness choices. After each helper call, `Get-Printer-Attributes` and the stored
-PPD's `*Default` lines were inspected. No option test submitted a print job.
-
-`PrinterAddOptionDefault` returned an empty error string for canonical media,
-resolution and duplex choices, but CUPS then returned duplicate default
-attributes: the requested 4x6/203 dpi/duplex values followed by the old
-A4/300 dpi/one-sided PPD values. `ipptool` correctly marked those replies as
-invalid due to duplicate attributes. The PPD defaults remained unchanged.
-Using that method with `PageSize`, `Resolution` and `Darkness` similarly stored
-IPP overrides without changing the PPD. A helper success string is therefore
-insufficient evidence that a driver choice was applied consistently.
-
-Those fixture overrides were removed with `PrinterDeleteOptionDefault` before
-checking `PrinterAddOption`, the PPD-aware method. Its observed effects were:
-
-| Method/key/value | Stored PPD after call | Reported IPP default |
-| --- | --- | --- |
-| `PrinterAddOption`, `PageSize=4x6` | `DefaultPageSize: 4x6` | media 4x6 |
-| `PrinterAddOption`, `Resolution=203dpi` | `DefaultResolution: 203dpi` | resolution 203 dpi |
-| `PrinterAddOption`, `Darkness=12` | `DefaultDarkness: 12` | Custom choice verified in PPD |
-| `PrinterAddOption`, `sides=two-sided-long-edge` | `DefaultDuplex: DuplexNoTumble` | two-sided-long-edge |
-| `PrinterAddOption`, `media=iso_a4_210x297mm` | `DefaultPageSize: A4` | A4 |
-| `PrinterAddOption`, `printer-resolution=300dpi` | `DefaultResolution: 300dpi` | resolution 300 dpi |
-| `PrinterAddOption`, `sides=one-sided` | `DefaultDuplex: None` | one-sided |
-| `PrinterAddOption`, `print-color-mode=monochrome` | `DefaultColorModel: Gray` | monochrome |
-| `PrinterAddOption`, `print-quality=4` | `DefaultcupsPrintQuality: Normal`, previously High | normal, also reported before the change |
-
-These PPD-aware replies had one copy of each standard default attribute and
-passed the IPP tool's response checks. Quality needs special care: this fixture reported
-IPP quality `normal` even when its initial PPD quality default was `High`, so
-that IPP field alone did not describe the PPD default. Selecting canonical quality `5` did change the stored PPD back to `High`, but
-IPP quality still reported `normal`.
-
-`PrinterDeleteOptionDefault` was also tested after the PPD setters for
-`PageSize`, `Resolution`, `Darkness`, `media`, `printer-resolution`, `sides`,
-`print-color-mode` and `print-quality`, including a repeated absent `Darkness`
-clear. Every call returned an empty success string. The stored PPD defaults
-survived; nondefault 4x6 media, 203 dpi and duplex remained correct in IPP.
-However, clearing `print-color-mode` reverted the reported IPP default to `color`
-while the PPD remained `Gray`. Clearing before reapplying `monochrome` did not
-repair that IPP field when the PPD was already Gray and the helper consequently
-had no changed PPD to upload. A blanket setter-then-clear sequence is therefore
-not a valid assumption for every canonical field. Default deletion removes an
-IPP override; it does not restore a rewritten PPD's original driver default.
-These checks establish stored PPD changes, not how every application's print
-dialog interprets a conflicting IPP/PPD default.
-
-This behavior matches the helper source's separate default-attribute and
-PPD-editing paths. Upstream
-[`cupsMarkOptions`](https://github.com/OpenPrinting/cups/blob/v2.4.10/cups/ppd-mark.c)
-maps canonical media, resolution, sides, color and quality values to PPD choices.
-The
-[driverless PPD generator](https://github.com/OpenPrinting/cups/blob/v2.4.10/cups/ppd-cache.c)
-also emits standard ColorModel, Duplex and cupsPrintQuality choices, but several
-branches expose resolution through quality presets and a `DefaultResolution`
-line without an editable `Resolution` option. This is source evidence, not a
-runtime driverless-printer qualification; standalone resolution changes can be
-unavailable or ignored on those PPDs. Re-read the actual choice/default before
-reporting a setting as applied.
-
-## Scope still requiring qualification
-
-* The label-printer isolation exercise, an ordinary printer, command-language
- responses, real paper output and ruler measurements remain manual hardware
- gates. A synthetic backend cannot establish physical printing or USB access.
-* The shipped distro policies, unprivileged polkit prompts, helper discovery and
- administration, systemd service start, and end-to-end notifier delivery on
- installed desktops remain separate checks. These fixtures use a private bus
- and fixture policies, and do not run a host service manager.
-* Real driverless discovery/creation, device-ID-to-driver matches, and visibility
- in application/portal print dialogs were not qualified by these containers.
-* No openSUSE image was cached. The release script currently targets Arch,
- Debian, Ubuntu and Fedora; no openSUSE release qualification is claimed.
-
-## Reproduction and recorded commands
-
-Images used (local image IDs, before package installation):
-
-| Image | Local ID |
-| --- | --- |
-| `docker.io/library/archlinux:latest` | `66e676a0a26efc7da658cc3763b65e9bd1927de617c30fd2db7a5b405d5cfc4d` |
-| `docker.io/library/debian:13` | `36c636ddb9c578b068df381216d26a921c64fc2534e20baf7d0c53fb800b3a74` |
-| `docker.io/library/ubuntu:24.04` | `69f919497cada9a8611f3de61df902d9f94bf20f84552ef5bd93125c38608ef9` |
-| `docker.io/library/fedora:latest` | `ccb55df1d2413428166d80b08aa37a4bdcb61a63d09fff6f8abc0d561f311053` |
-
-Read-only inventory command:
-
-```sh
-podman images --format '{{.Repository}}:{{.Tag}} {{.ID}} {{.Size}}'
-podman run --rm --pull=never --network=none --cap-drop=all \
- --security-opt=no-new-privileges --read-only --tmpfs /tmp IMAGE \
- sh -c 'cat /etc/os-release; command -v cupsd || true'
-```
-
-The harness below reproduces the final container-only test recipe from this
-session, with an explicit container guard added. The successful runtime rename
-and option portions were run on Debian; the software matrix above also uses earlier isolated
-Arch/Ubuntu/Fedora runs of the same CUPS checks.
-Save it as a temporary `qualification.sh`, then use each image above and its
-family (`arch`, `debian`, `ubuntu`, `fedora`):
-
-```sh
-podman run --rm --pull=never --security-opt=no-new-privileges \
- -v /absolute/path/to/qualification.sh:/qualification.sh:ro \
- IMAGE sh /qualification.sh FAMILY
-```
-
-Package installation needs repository network access inside the disposable
-container. No host directory other than the read-only harness is mounted, and no
-ports or devices are passed through. Debian/Ubuntu package service-start hooks
-are denied with a container-only `policy-rc.d`. Arch's temporary image runs
-`systemd-sysusers` for its packaged CUPS service account because its base image
-has not booted a service manager. The standalone fixture scheduler is explicitly
-started from the harness. The rootless container's UID 0 is not host root.
-
-```sh
-#!/bin/sh
-set -eu
-# This recipe belongs inside a disposable Podman container only.
-[ -e /run/.containerenv ] || { echo "Run through podman, not on the host" >&2; exit 1; }
-family=$1
-qual_root=$(mktemp -d /tmp/rediwm-printer-qualify.XXXXXX)
-cups_pid=
-bus_pid=
-cleanup() {
- [ -z "$cups_pid" ] || kill "$cups_pid" 2>/dev/null || true
- [ -z "$bus_pid" ] || kill "$bus_pid" 2>/dev/null || true
- [ -z "$cups_pid" ] || wait "$cups_pid" 2>/dev/null || true
- rm -rf "$qual_root"
-}
-trap cleanup EXIT HUP INT TERM
-export SYSTEMD_OFFLINE=1
-case "$family" in
- arch) pacman -Sy --noconfirm cups cups-pk-helper dbus polkit > "$qual_root/packages.log" 2>&1 || { tail -60 "$qual_root/packages.log"; exit 20; }; pacman -Q cups cups-pk-helper dbus ;;
- debian|ubuntu)
- printf '#!/bin/sh\nexit 101\n' > /usr/sbin/policy-rc.d
- chmod 755 /usr/sbin/policy-rc.d
- export DEBIAN_FRONTEND=noninteractive
- apt-get update > "$qual_root/packages.log" 2>&1 && apt-get install -y --no-install-recommends cups-daemon cups-client cups-ipp-utils cups-pk-helper cups-server-common dbus dbus-bin polkitd >> "$qual_root/packages.log" 2>&1 || { tail -60 "$qual_root/packages.log"; exit 20; }
- dpkg-query -W cups-daemon cups-client cups-pk-helper dbus
- ;;
- fedora)
- dnf -y --setopt=install_weak_deps=False install cups cups-client cups-ipptool cups-pk-helper dbus-daemon polkit > "$qual_root/packages.log" 2>&1 || { tail -60 "$qual_root/packages.log"; exit 20; }
- rpm -q cups cups-client cups-ipptool cups-pk-helper dbus-daemon
- ;;
-esac
-printf '\nPACKAGED NOTIFIER\n'
-for path in /usr/lib/cups/notifier/dbus /usr/lib64/cups/notifier/dbus /usr/libexec/cups/notifier/dbus; do
- [ ! -e "$path" ] || ls -l "$path"
-done
-printf '\nHELPER XML\n'
-for path in /usr/share/dbus-1/interfaces/*Cups* /usr/share/cups-pk-helper/* /usr/share/dbus-1/system-services/*Cups* /usr/share/polkit-1/actions/*cups*; do
- [ ! -f "$path" ] || { printf '%s\n' "$path"; case "$path" in *.xml) cat "$path" ;; esac; }
-done
-printf '\nEVERYWHERE DOCUMENTATION\n'
-for path in /usr/share/man/man8/lpadmin.8.gz /usr/share/man/en/man8/lpadmin.8.gz; do
- [ ! -f "$path" ] || zcat "$path" | grep -A6 -B2 everywhere || true
-done
-printf '\nCUPS FILE CONFIG\n'
-cups_user=$(awk '/^User[ \t]/{print $2;exit}' /etc/cups/cups-files.conf)
-cups_group=$(awk '/^Group[ \t]/{print $2;exit}' /etc/cups/cups-files.conf)
-[ -n "$cups_user" ] || cups_user=lp
-[ -n "$cups_group" ] || cups_group=lp
-if [ "$family" = arch ]; then systemd-sysusers /usr/lib/sysusers.d/cups.conf >/dev/null 2>&1 || true; fi
-printf 'SERVICE USER=%s GROUP=%s\n' "$cups_user" "$cups_group"
-mkdir -p "$qual_root/server" "$qual_root/state" "$qual_root/spool" "$qual_root/cache" "$qual_root/tmp" "$qual_root/run" "$qual_root/bin/daemon" "$qual_root/bin/backend" "$qual_root/bin/filter" "$qual_root/bin/notifier"
-# Avoid real USB, DNS-SD and network backends entirely, including discovery.
-for source in /usr/lib/cups/notifier/dbus /usr/lib64/cups/notifier/dbus /usr/libexec/cups/notifier/dbus; do
- if [ -x "$source" ]; then ln -s "$source" "$qual_root/bin/notifier/dbus"; break; fi
-done
-for source in /usr/lib/cups/daemon/cups-exec /usr/lib64/cups/daemon/cups-exec /usr/libexec/cups/daemon/cups-exec; do
- if [ -x "$source" ]; then ln -s "$source" "$qual_root/bin/daemon/cups-exec"; break; fi
-done
-chmod 755 "$qual_root" "$qual_root/server" "$qual_root/state" "$qual_root/spool" "$qual_root/cache" "$qual_root/tmp" "$qual_root/run" "$qual_root/bin" "$qual_root/bin/notifier"
-cat > "$qual_root/cups-files.conf" <<CONF
-User $cups_user
-Group $cups_group
-SystemGroup root
-ServerRoot $qual_root/server
-StateDir $qual_root/state
-RequestRoot $qual_root/spool
-CacheDir $qual_root/cache
-TempDir $qual_root/tmp
-ServerBin $qual_root/bin
-DataDir /usr/share/cups
-DocumentRoot /usr/share/cups/doc-root
-ErrorLog $qual_root/error.log
-AccessLog $qual_root/access.log
-PageLog $qual_root/page.log
-Printcap $qual_root/printcap
-CONF
-cat > "$qual_root/cupsd.conf" <<CONF
-Listen $qual_root/run/cups.sock
-Listen 127.0.0.1:8631
-Browsing Off
-WebInterface No
-DefaultAuthType Basic
-LogLevel debug
-MaxLogSize 1048576
-<Location />
- Order allow,deny
- Allow all
-</Location>
-<Policy default>
- <Limit All>
- Order allow,deny
- Allow all
- </Limit>
-</Policy>
-CONF
-# A private bus is used only by this container's notifier/helper checks.
-cat > "$qual_root/bus.conf" <<CONF
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig><type>system</type><listen>unix:path=$qual_root/run/bus.sock</listen><auth>EXTERNAL</auth><policy context="default"><allow user="*"/><allow own="*"/><allow send_destination="*"/><allow send_type="signal"/><allow receive_sender="*"/></policy></busconfig>
-CONF
-bus_output=$(dbus-daemon --config-file="$qual_root/bus.conf" --fork --print-address=1 --print-pid=1)
-DBUS_SYSTEM_BUS_ADDRESS=$(printf '%s\n' "$bus_output" | head -n1)
-export DBUS_SYSTEM_BUS_ADDRESS
-bus_pid=$(printf '%s\n' "$bus_output" | tail -n1)
-/usr/sbin/cupsd -t -c "$qual_root/cupsd.conf" -s "$qual_root/cups-files.conf"
-/usr/sbin/cupsd -f -c "$qual_root/cupsd.conf" -s "$qual_root/cups-files.conf" > "$qual_root/cupsd.log" 2>&1 &
-cups_pid=$!
-# Single bounded startup wait; no persistent polling.
-sleep 15
-if [ ! -S "$qual_root/run/cups.sock" ]; then cat "$qual_root/cupsd.log" "$qual_root/error.log" 2>/dev/null || true; exit 21; fi
-export CUPS_SERVER="$qual_root/run/cups.sock"
-printf '\nEMPTY SCHEDULER\n'
-lpstat -r
-lpstat -p || true
-cat > "$qual_root/bin/backend/fixture" <<'BACKEND'
-#!/bin/sh
-# An inert, container-only backend: no hardware or network I/O, no jobs sent.
-exit 0
-BACKEND
-chmod 755 "$qual_root/bin/backend/fixture"
-lpadmin -p Qualification -E -v fixture:/never -m raw
-cat > "$qual_root/formats.test" <<'IPP'
-{
- NAME "Private scheduler formats"
- OPERATION Get-Printer-Attributes
- GROUP operation-attributes-tag
- ATTR charset attributes-charset utf-8
- ATTR language attributes-natural-language en
- ATTR uri printer-uri ipp://localhost/printers/Qualification
- ATTR keyword requested-attributes document-format-supported,ipp-versions-supported,notify-schemes-supported,notify-lease-duration-supported
- STATUS successful-ok
- DISPLAY document-format-supported
- DISPLAY ipp-versions-supported
- DISPLAY notify-schemes-supported
- DISPLAY notify-lease-duration-supported
-}
-IPP
-printf '\nRAW FORMAT AND NOTIFY CAPABILITIES\n'
-ipptool -T 3 -tv "ipp://127.0.0.1:8631/printers/Qualification" "$qual_root/formats.test" || true
-printf '\nHELPER RUNTIME INTROSPECTION\n'
-helper=$(sed -n 's/^Exec=//p' /usr/share/dbus-1/system-services/org.opensuse.CupsPkHelper.Mechanism.service)
-for path in /usr/lib/cups-pk-helper-mechanism /usr/libexec/cups-pk-helper-mechanism /usr/lib64/cups-pk-helper-mechanism; do
- [ ! -x "$path" ] || helper=$path
-done
-if [ -n "$helper" ] && command -v dbus-send >/dev/null; then
- "$helper" > "$qual_root/helper.log" 2>&1 &
- helper_pid=$!
- sleep 1
- dbus-send --system --reply-timeout=3000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.freedesktop.DBus.Introspectable.Introspect || true
- kill "$helper_pid" 2>/dev/null || true
- cat "$qual_root/helper.log"
-else
- printf 'helper executable or dbus-send unavailable\n'
-fi
-printf '\nSUBSCRIPTION CAPABILITY\n'
-cat > "$qual_root/subscribe.test" <<'IPP'
-{
- NAME "Private scheduler dbus subscription"
- OPERATION Create-Printer-Subscriptions
- GROUP operation-attributes-tag
- ATTR charset attributes-charset utf-8
- ATTR language attributes-natural-language en
- ATTR uri printer-uri ipp://localhost/
- ATTR name requesting-user-name qualification
- GROUP subscription-attributes-tag
- ATTR uri notify-recipient-uri dbus://
- ATTR keyword notify-events printer-state-changed
- ATTR integer notify-lease-duration 0
- STATUS successful-ok
- DISPLAY notify-subscription-id
- DISPLAY notify-lease-duration
-}
-IPP
-ipptool -T 3 -tv "ipp://127.0.0.1:8631/" "$qual_root/subscribe.test" || true
-printf '\nGRANTED SUBSCRIPTION LEASE\n'
-cat > "$qual_root/subscription-attributes.test" <<'IPP'
-{
- NAME "Private subscription granted lease"
- OPERATION Get-Subscription-Attributes
- GROUP operation-attributes-tag
- ATTR charset attributes-charset utf-8
- ATTR language attributes-natural-language en
- ATTR uri printer-uri ipp://localhost/
- ATTR name requesting-user-name qualification
- ATTR integer notify-subscription-id 1
- STATUS successful-ok
- DISPLAY notify-lease-duration
- DISPLAY notify-recipient-uri
-}
-IPP
-ipptool -T 3 -tv "ipp://127.0.0.1:8631/" "$qual_root/subscription-attributes.test" || true
-cat > "$qual_root/cancel-subscription.test" <<'IPP'
-{
- NAME "Cancel private notification subscription"
- OPERATION Cancel-Subscription
- GROUP operation-attributes-tag
- ATTR charset attributes-charset utf-8
- ATTR language attributes-natural-language en
- ATTR uri printer-uri ipp://localhost/
- ATTR name requesting-user-name qualification
- ATTR integer notify-subscription-id 1
- STATUS successful-ok
-}
-IPP
-ipptool -T 3 -tv "ipp://127.0.0.1:8631/" "$qual_root/cancel-subscription.test"
-printf '\nRAW PASSTHROUGH WITH PPD TO FILE-ONLY FIXTURE BACKEND\n'
-mkdir "$qual_root/received"
-chown "$cups_user:$cups_group" "$qual_root/received" "$qual_root/tmp"
-chmod 700 "$qual_root/received"
-cat > "$qual_root/bin/backend/fixture" <<BACKEND
-#!/bin/sh
-if [ \$# -eq 0 ]; then exit 0; fi
-if [ \$# -ge 6 ]; then
- cat "\$6" > "$qual_root/received/job-\$1.bin"
-else
- cat > "$qual_root/received/job-\$1.bin"
-fi
-BACKEND
-chmod 755 "$qual_root/bin/backend/fixture"
-cat > "$qual_root/fixture.ppd" <<'PPD'
-*PPD-Adobe: "4.3"
-*FormatVersion: "4.3"
-*FileVersion: "1.0"
-*LanguageVersion: English
-*LanguageEncoding: ISOLatin1
-*PCFileName: "QUALIFY.PPD"
-*Manufacturer: "RediWM test fixture"
-*Product: "(Inert fixture)"
-*ModelName: "Inert fixture"
-*NickName: "Inert fixture"
-*PSVersion: "(3010.000) 0"
-*cupsVersion: 1.1
-*cupsManualCopies: True
-*cupsFilter: "application/pdf 0 deliberately-missing-filter"
-*ColorDevice: True
-*DefaultColorSpace: Gray
-*OpenUI *Resolution/Resolution: PickOne
-*DefaultResolution: 300dpi
-*Resolution 203dpi/203 DPI: "<</HWResolution [203 203]>>setpagedevice"
-*Resolution 300dpi/300 DPI: "<</HWResolution [300 300]>>setpagedevice"
-*CloseUI: *Resolution
-*OpenUI *Darkness/Print Darkness: PickOne
-*DefaultDarkness: 8
-*Darkness 8/Light: ""
-*Darkness 12/Dark: ""
-*CloseUI: *Darkness
-*OpenUI *Duplex/Duplex: PickOne
-*DefaultDuplex: None
-
-*Duplex None/Off: "<</Duplex false>>setpagedevice"
-*Duplex DuplexNoTumble/Long edge: "<</Duplex true /Tumble false>>setpagedevice"
-*CloseUI: *Duplex
-*OpenUI *ColorModel/Color Mode: PickOne
-*DefaultColorModel: RGB
-*ColorModel Gray/Monochrome: "<</ProcessColorModel /DeviceGray>>setpagedevice"
-*ColorModel RGB/Color: "<</ProcessColorModel /DeviceRGB>>setpagedevice"
-*CloseUI: *ColorModel
-*OpenUI *cupsPrintQuality/Quality: PickOne
-*DefaultcupsPrintQuality: High
-*cupsPrintQuality Draft/Draft: ""
-*cupsPrintQuality Normal/Normal: ""
-*cupsPrintQuality High/High: ""
-*CloseUI: *cupsPrintQuality
-*OpenUI *PageSize/Media Size: PickOne
-*DefaultPageSize: A4
-*PageSize A4: "<</PageSize [595 842]>>setpagedevice"
-*PageSize 4x6/4 x 6 inch: "<</PageSize [288 432]>>setpagedevice"
-*ImageableArea 4x6: "0 0 288 432"
-*PaperDimension 4x6: "288 432"
-*ImageableArea A4: "0 0 595 842"
-*PaperDimension A4: "595 842"
-*CloseUI: *PageSize
-PPD
-if ! lpadmin -p QualificationPpd -E -v fixture:/never -P "$qual_root/fixture.ppd"; then
- tail -40 "$qual_root/error.log"
- exit 22
-fi
-printf 'RediWM raw passthrough\n\000\377\033%%finite\015\012' > "$qual_root/expected.bin"
-lp -d QualificationPpd -o raw "$qual_root/expected.bin"
-sleep 3
-if [ "$(od -An -v -tx1 "$qual_root/expected.bin")" = "$(od -An -v -tx1 "$qual_root/received/job-1.bin")" ]; then
- printf 'RAW_PPD_BYTE_COMPARISON=PASS\n'
- wc -c "$qual_root/expected.bin"
-else
- printf 'RAW_PPD_BYTE_COMPARISON=FAIL\n'
- lpstat -l -W all -o || true
- tail -35 "$qual_root/error.log"
-fi
-printf '\nPRIVATE HELPER RENAME\n'
-mkdir -p /run/dbus
-ln -s "$qual_root/run/bus.sock" /run/dbus/system_bus_socket
-polkit=
-for path in /usr/lib/polkit-1/polkitd /usr/libexec/polkit-1/polkitd; do
- [ ! -x "$path" ] || polkit=$path
-done
-if [ -n "$polkit" ]; then
- "$polkit" > "$qual_root/polkit.log" 2>&1 &
- polkit_pid=$!
- "$helper" > "$qual_root/rename-helper.log" 2>&1 &
- rename_helper_pid=$!
- sleep 5
- dbus-send --system --reply-timeout=3000 --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames
- lpadmin -p RenameSource -E -v fixture:/source -m raw
- lpadmin -p RenameExisting -E -v fixture:/existing -m raw
- lpadmin -p RenameSource -o printer-info='Retain this description' -o job-sheets-default=none,none
- printf 'BEFORE RENAME\n'
- lpstat -v
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterRename string:RenameSource string:RenameNew || true
- printf 'AFTER NEW NAME\n'
- lpstat -v || true
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterRename string:RenameNew string:RenameExisting || true
- printf 'AFTER COLLISION\n'
- lpstat -v || true
- printf 'PENDING JOB GUARD ON PAUSED QUEUE\n'
- cupsdisable RenameNew || true
- lp -d RenameNew -o raw "$qual_root/expected.bin" || true
- lpstat -l -W not-completed -o || true
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterRename string:RenameNew string:RenamePending || true
- lpstat -v
- cancel -a RenameNew || true
- printf 'PRIVATE OPTION SEMANTICS\n'
- cat > "$qual_root/options.test" <<'IPP'
-{
- NAME "Actual option defaults"
- OPERATION Get-Printer-Attributes
- GROUP operation-attributes-tag
- ATTR charset attributes-charset utf-8
- ATTR language attributes-natural-language en
- ATTR uri printer-uri ipp://localhost/printers/QualificationPpd
- ATTR keyword requested-attributes media-default,printer-resolution-default,sides-default,print-color-mode-default,print-quality-default,Darkness-default,PageSize-default,Resolution-default
- STATUS successful-ok
- DISPLAY media-default
- DISPLAY printer-resolution-default
- DISPLAY sides-default
- DISPLAY print-color-mode-default
- DISPLAY print-quality-default
- DISPLAY Darkness-default
- DISPLAY PageSize-default
- DISPLAY Resolution-default
-}
-IPP
- query_options() {
- printf '\nOPTION SNAPSHOT %s\n' "$1"
- ipptool -T 3 -tv "ipp://127.0.0.1:8631/printers/QualificationPpd" "$qual_root/options.test" || true
- grep '^\*Default' "$qual_root/server/ppd/QualificationPpd.ppd"
- }
- set_option() {
- printf '\nSET OPTION method=%s key=%s value=%s\n' "$1" "$2" "$3"
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / "org.opensuse.CupsPkHelper.Mechanism.$1" string:QualificationPpd "string:$2" "array:string:$3"
- }
- query_options baseline
- set_option PrinterAddOptionDefault media na_index-4x6_4x6in
- set_option PrinterAddOptionDefault printer-resolution 203dpi
- set_option PrinterAddOptionDefault sides two-sided-long-edge
- query_options ipp-default-api
- set_option PrinterAddOptionDefault PageSize 4x6
- set_option PrinterAddOptionDefault Resolution 203dpi
- set_option PrinterAddOptionDefault Darkness 12
- query_options ppd-keys-default-api
- printf 'CLEAR PREVIOUS IPP DEFAULT OVERRIDES\n'
- for key in media printer-resolution sides PageSize Resolution Darkness; do
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterDeleteOptionDefault string:QualificationPpd "string:$key"
- done
- query_options cleared-overrides
- set_option PrinterAddOption PageSize 4x6
- set_option PrinterAddOption Resolution 203dpi
- set_option PrinterAddOption Darkness 12
- query_options ppd-keys-ppd-api
- set_option PrinterAddOption sides two-sided-long-edge
- query_options canonical-duplex-positive
- set_option PrinterAddOption media iso_a4_210x297mm
- set_option PrinterAddOption printer-resolution 300dpi
- set_option PrinterAddOption sides one-sided
- set_option PrinterAddOption print-color-mode monochrome
- set_option PrinterAddOption print-quality 4
- query_options canonical-ppd-api
- printf 'CLEAR ABSENT OVERRIDES AFTER PPD SETTERS\n'
- for key in PageSize Resolution Darkness media printer-resolution sides print-color-mode print-quality; do
- printf 'CLEAR AFTER PPD key=%s\n' "$key"
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterDeleteOptionDefault string:QualificationPpd "string:$key"
- done
- printf 'REPEAT ABSENT CLEAR Darkness\n'
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterDeleteOptionDefault string:QualificationPpd string:Darkness
- query_options absent-clear-after-ppd
- printf 'CANONICAL NONDEFAULTS BEFORE AND AFTER CLEANUP\n'
- set_option PrinterAddOption media na_index-4x6_4x6in
- set_option PrinterAddOption printer-resolution 203dpi
- set_option PrinterAddOption sides two-sided-long-edge
- set_option PrinterAddOption print-color-mode monochrome
- set_option PrinterAddOption print-quality 5
- query_options canonical-nondefaults-before-clear
- for key in media printer-resolution sides print-color-mode print-quality; do
- printf 'CLEAR CANONICAL AFTER key=%s\n' "$key"
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterDeleteOptionDefault string:QualificationPpd "string:$key"
- done
- query_options canonical-nondefaults-after-clear
- printf 'CLEANUP BEFORE EACH CANONICAL SETTER\n'
- for pair in media:na_index-4x6_4x6in printer-resolution:203dpi sides:two-sided-long-edge print-color-mode:monochrome print-quality:5; do
- key=${pair%%:*}
- value=${pair#*:}
- dbus-send --system --reply-timeout=10000 --print-reply --dest=org.opensuse.CupsPkHelper.Mechanism / org.opensuse.CupsPkHelper.Mechanism.PrinterDeleteOptionDefault string:QualificationPpd "string:$key"
- set_option PrinterAddOption "$key" "$value"
- done
- query_options canonical-cleanup-before-set
-
-
- cat "$qual_root/rename-helper.log" "$qual_root/polkit.log"
- kill "$rename_helper_pid" "$polkit_pid" 2>/dev/null || true
-else
- printf 'Private polkit daemon unavailable; rename authorization not exercised\n'
-fi
-printf '\nPRIVATE SCHEDULER LOG TAIL\n'
-tail -12 "$qual_root/error.log" || true
-```
diff --git a/docs/plans/printers.md b/docs/plans/printers.md
deleted file mode 100644
index 488ed74..0000000
--- a/docs/plans/printers.md
+++ /dev/null
@@ -1,627 +0,0 @@
-# Plan: Printers page in Settings (setup, status, and "why didn't it print")
-
-Status: the printer software workflows are implemented, 2026-10-16. Physical
-printer acceptance and stock desktop policy qualification remain open. This
-plan distinguishes implemented behavior, synthetic tests, isolated CUPS checks
-and hardware evidence; a completed CUPS job never establishes paper output.
-
-Implemented scope:
-
-* Settings → Printers lists queues, state/reasons, reported supplies, defaults
- and the current user's recent jobs. Own jobs can be cancelled. Missing or
- private attributes and authorization failures remain visible.
-* A bounded IPP codec and cancellable HTTP worker support configured Unix and
- cleartext TCP CUPS endpoints. System/user `client.conf`, `CUPS_SERVER` and
- encryption preferences are checked without falling back to a different
- server. TLS, authentication and escaped configuration syntax are unsupported.
-* Local-default-server administration uses `cups-pk-helper` when available,
- or a direct libcups worker with CUPS authentication: discovery, queue
- creation, enabling/disabling, accepting/rejecting jobs, descriptions, queue
- rename/removal, connection changes and the system default. Custom Unix and
- remote schedulers remain read-only for these actions. CUPS service start uses
- the existing systemd path and reports unavailability on other service managers.
-* Setup combines CUPS discovery, USB evidence and validated typed network
- addresses. Driverless IPP is preferred when supported evidence is available;
- IEEE 1284 driver matches are conservative, ambiguous matches need a choice,
- and raw queues/third-party driver guidance are explicit. Vendor backends must
- come from the current CUPS discovery result, never arbitrary typed input.
-* Queue-name collisions are checked before administration. Removal and queue
- rename require separate named confirmations. Rename is a
- non-atomic clone/delete operation, with known-job guards, refreshed queue
- checks and migration of personal defaults/private observations after success.
-* Supported IPP values and bounded PPD UI declarations provide media,
- resolution, colour, duplex, quality and exposed label controls. Driver choices
- use the PPD-aware helper API or direct PPD editing and are refreshed for
- verification. CUPS can report conflicting IPP/PPD defaults; an accepted request is not presented as
- a verified setting when the resulting value cannot be established.
-* Per-user defaults preserve existing `~/.cups/lpoptions` options, destinations,
- instances and comments through atomic replacement. `LPDEST`/`PRINTER` overrides
- remain visible; the privileged system default is a separate action.
-* Explicitly confirmed PDF, raw-language and ruler tests use actual media
- dimensions, one copy and no banners. PDFs request no scaling or n-up fitting.
- Language samples run individually, and the user records whether output
- appeared. Two-axis measurements suggest only a supported resolution. No node
- write, test print or privileged mutation happens automatically.
-* USB uevents, local socket-directory events, show/Refresh and user actions
- trigger reloads without polling. Where a verified indefinite `dbus://` lease
- is available, authenticated CUPS notifier signals also reload the page.
- Hiding closes local workers/listeners and attempts subscription cancellation
- without waiting for a reply.
-* Diagnostics retain unknown evidence, mask private identifiers and include
- bounded distro/CUPS version information and user-recorded test outcomes.
- Package guidance covers Arch derivatives, Debian/Ubuntu, Fedora and openSUSE;
- Settings search includes printer terms. Printing adds no root executable,
- package installer, USB rule writer, filter or driver.
-
-[Qualification evidence](printers-qualification.md) records real isolated CUPS
-and helper checks on Arch, Debian 13, Ubuntu 24.04 and Fedora 44, including raw
-bytes through a synthetic PPD queue. These do not qualify USB/backend hardware,
-real media measurements, stock unprivileged polkit behavior, desktop notifier
-delivery, real driverless creation or application/portal visibility. openSUSE
-has guidance but no release build target or executed qualification image.
-The cancellable resolver uses hosts files and ordinary DNS, not NSS/Avahi mDNS;
-direct `ipps://`/DNS-SD reachability remains unavailable. The repository-wide
-i18n module is still planned (`docs/plans/i18n.md`), so strings follow existing
-English call-site conventions rather than a completed extraction pipeline.
-
-Scope: a Printers page in Settings that lists printers and their jobs, adds
-and configures them, and, the part that justifies more than a simple list,
-tells the user *which layer* failed when a printer does not work. It talks to
-CUPS (the only print system on every distro we ship for). It is not tied to
-one distro and it ships no print driver.
-
-## Where this comes from
-
-A field report (`~/Documents/arch-xprinter-tspl-troubleshooting.md`, summarised
-here so the plan stands alone): a cheap USB 4×6 thermal label printer
-(Xprinter/Zijiang family, VID:PID `0416:5011`, advertised 300 dpi, speaks TSPL)
-took hours to get printing. Almost none of that time went to fixing; it went to
-finding out *where* the failure was. In the order it was met:
-
-| # | What went wrong | Layer |
-| - | --- | --- |
-| 1 | Printer appeared and vanished in `lsusb`; its USB string said "Virtual Com Port" although its interface class is 7 (Printer) | USB |
-| 2 | `usblp` node vanished, a `tee` then created a *regular file* at `/dev/usb/lp0` | device node |
-| 3 | Guessed Zebra ZPL / EPL; the self-test (hold FEED while powering on) said TSPL | printer language |
-| 4 | CUPS libusb backend: "USB transaction timeout during read", because the printer claims bidirectional USB and cannot do it | CUPS backend |
-| 5 | A raw TSPL write to the node printed; that one fact split hardware+USB from CUPS+filters | method |
-| 6 | Node name changed after a power cycle (fixed with a udev symlink) | device node |
-| 7 | Advertised 300 dpi; 203 dpi gave the right physical size | queue settings |
-| 8 | Queue deleted by accident, recreated by hand | queue |
-| 9 | Job "ran", label fed, blank. Log: media `4x5.Borderless` not 4×6, `cupsCompression=4294967295`, `rangecheck in .putdeviceprops`, `Sent 0 bytes`, "No pages were found." | filters / PPD |
-
-The report's last state is unresolved (item 9), and several changes were made
-at once (quirk, `usblp` blacklist, udev rule, driver, backend), so which of
-them mattered was never isolated. Phase 0 does that.
-
-What we take from it, and it holds for any printer, not only labels:
-
-1. Printing is a chain, and a good page shows the chain and marks the first
- broken link (the "ladder").
-2. The most useful single test is *send a job that skips the filters*. If that
- prints, the fault is in rendering or the driver, not USB or the printer.
-3. Most "it printed nothing" cases leave evidence the user cannot read (the
- CUPS error log is root-only) but CUPS also reports it over IPP.
-4. Two settings are wrong far more often than anything else: paper size and
- resolution. Show them next to the queue.
-5. A copy-able diagnostic report turns "it doesn't work" into something
- fixable by someone else.
-
-## Goals and non-goals
-
-Goals
-
-* List printers (USB, network, shared) with state, reasons in words
- ("Out of paper", "Cover open", "Toner low") and ink/toner levels where CUPS
- has them.
-* Show and cancel jobs; resume a queue CUPS stopped after an error.
-* Add a printer without a terminal: detected USB devices, network printers
- CUPS discovers, or a typed address. Pick a driver automatically when there is
- a trustworthy match, otherwise say so plainly.
-* Per-printer settings the user can understand: paper size, resolution,
- colour/mono, duplex, quality, and for label printers darkness/speed when the
- driver exposes them. Set as the queue default.
-* The ladder, two test prints (through the driver, and skipping it), a ruler
- test for resolution, and "Copy diagnostic report".
-* Works with no CUPS, a stopped CUPS, a socket-activated CUPS, and with no
- privileges: what cannot be done says why and what to do.
-* Target consistent behavior on the Arch, Debian/Ubuntu and Fedora release
- families, with guidance for openSUSE. Actual policy/hardware qualification is
- tracked separately; the page never runs a package manager.
-
-Non-goals
-
-* No driver of our own: no shipping PPD, raster filter or document-to-TSPL/ZPL
- converter. The bounded diagnostic samples above are the only language output;
- see "Not in this plan".
-* No print dialog: applications print through the Print portal or GTK/Qt
- dialogs and CUPS. This page configures what they see.
-* No print server features: sharing, CUPS web admin, policies, quotas,
- authentication to remote servers, IPP Fax.
-* No scanner/MFP support (that is SANE; separate).
-* No Bluetooth pairing for printers (the Bluetooth page owns pairing; a paired
- Bluetooth printer shows up only if CUPS lists it).
-* No guessing from the network: no port scanning. Discovery is what CUPS
- already reports (DNS-SD/IPP).
-
-## Design
-
-### Talk to CUPS over IPP, unprivileged (D1)
-
-Reads, own-job cancellation and explicit test submissions go straight to the
-configured cupsd over IPP. The default is `/run/cups/cups.sock`; system and user
-`client.conf`, `CUPS_SERVER` and encryption settings determine the actual target.
-Cleartext TCP `host[:port][/version=1.0|1.1]` and supported IPP authorities are
-also accepted. No request silently changes servers. A small IPP client in Zig
-(`src/printing/ipp.zig`: encoder, bounded decoder, HTTP/1.1 transport), in the spirit of `src/dbus`: no new
-library, no libcups ABI to match across four distro families, and no
-glib. It queries printers, attributes, own jobs, PPD metadata and PPD content,
-cancels an individual own job, submits explicit tests, and creates/inspects/
-cancels notification subscriptions. Discovery and administrative changes use
-the privileged APIs below. Any future cancel-all-own action must use
-Cancel-My-Jobs rather than Cancel-Jobs; that bulk action is not exposed here.
-
-Alternative: link libcups. Its transport, authentication, configuration and
-destination APIs avoid reimplementing substantial compatibility behavior.
-The bounded client supports a documented Unix/cleartext TCP subset, not full
-libcups compatibility. TLS, authentication, escaped client configuration and
-NSS/Avahi mDNS resolution are not implemented. DNS, connect, upload and response
-share one three-second request deadline and the page cancellation path. See the
-qualification findings below before extending compatibility claims.
-
-The decoder treats the response as untrusted (cupsd can be remote through
-`CUPS_SERVER`): bounded lengths and counts, no recursion beyond collections,
-text fields length-capped and stripped of control characters before they reach
-a widget.
-
-### Live only while visible, no polling
-
-Same rule as the Services page. The page is live while it is on screen
-(`show` from `printers.build`, `hide` from `selectPage`/`detachSettings`). Hiding
-joins the cancellable worker and releases local sockets, matches and watches;
-subscription cancellation is a best-effort nonblocking send. While live:
-
-* **cupsd changes:** a page-owned system-bus listener validates the notifier
- interface/path/member and authenticates each unique sender through bus
- credentials. CUPS's notifier does not acquire a well-known service name.
- The worker requests an indefinite `dbus://` printer subscription and verifies
- the granted lease, querying it separately when creation omits the duration.
- If unavailable, finite or unauthorized, the page keeps explicit/action-driven
- refresh; no polling or renewal timer runs. Default desktop delivery remains a
- qualification gate. An inotify watch on the local socket's parent also detects
- daemon disappearance/recreation without contacting a host service manager.
-* **USB hotplug:** a kernel uevent listener (netlink `NETLINK_KOBJECT_UEVENT`,
- subsystems `usb` and `usbmisc`) that triggers one sysfs rescan. The scan is
- a pure function from a sysfs root to a list of printer-class devices
- (class 7, VID:PID, manufacturer/product/serial strings, bound driver, the
- matching `/dev/usb/lp*` node and its file type). Debounce: a plug event
- arrives as a burst.
-* Work happens on a worker thread that signals an eventfd; nothing blocks the
- compositor loop. The IPP client has deadlines, because a half-dead cupsd
- must not hang the page.
-
-### The ladder
-
-For the selected printer, one row per layer. Each row is pass / fail / unknown
-(not applicable or cannot tell), with a one-line reason; the first failing row
-is expanded with its fix. Layers by connection kind:
-
-USB printer
-
-1. **Found on USB.** Interface class 7 from sysfs. Fail text names what was
- seen ("a device 0416:5011 is attached but is not a printer class device").
- Never read the product string as truth (finding 1 above).
-2. **Backend access path.** Report the matched `/dev/usb/lp*` node, if any,
- and its file type. A missing `usblp` node is normal for the CUPS libusb
- backend and for `ipp-usb`; it cannot fail this rung. A queue whose backend
- explicitly uses that node can fail if it is missing or a regular file.
- `stat` cannot prove CUPS's access permissions or USB communication; those
- remain unknown without backend evidence. The page never writes to a node.
-3. **CUPS running.** IPP answers. If not, distinguish installation evidence
- from a running/reachable scheduler; offer "Start CUPS" only through the
- existing privileged systemd path (D3). No failed request proves that a unit
- is disabled or that CUPS is absent.
-4. **Queue exists and accepts jobs.** Exists, `printer-state`, `printer-is-
- accepting-jobs`, stopped reasons (`printer-state-reasons`).
-5. **Backend reaches it.** The queue's device URI points at the device that
- rung 1 found (a stale `usb://` serial or a vanished `file`/vendor URI is
- the usual cause of "was working yesterday"); last job's backend message if
- any.
-6. **Settings fit the media.** Queue default page size and resolution against
- what the user says they load (asked once for label printers); mismatch is
- the finding-7/9 case.
-7. **Last job outcome.** From the last job: state, sheets
- completed, `job-state-reasons`, `job-printer-state-message`. A job
- `completed` with 0 sheets and a message like "No pages were found." is
- reported as *finished; no pages reported*, with the filter message shown.
- Missing counters, zero counters alone and `completed` do not prove that
- paper emerged or that it was blank. Omitted/private attributes and absent
- history stay unknown; this page cannot recover every filter log over IPP.
-
-Network printer: a bounded Get-Printer-Attributes on an exact `ipp://` device
-URI replaces rungs 1–2; it never scans hosts or ports. TLS, DNS-SD service URIs
-and mDNS-only names cannot be checked by this transport and retain unavailable
-or unknown evidence. CUPS's own backend can still support those connections;
-a direct reachability result is separate from CUPS backend success.
-
-The ladder only *reports*. Each fix is an explicit button, and none runs
-unasked.
-
-### Two tests, and why there are two (D4)
-
-* **Test page through the driver:** CUPS's own test page, or a small PDF
- sized to the queue's media with a border and a 1-inch square. Exercises
- the whole chain.
-* **Test skipping the filters:** Print-Job with `document-format`
- `application/vnd.cups-raw` (what `lp -o raw` does) carrying a tiny
- command-language test chosen from the known-devices table or the printer's
- `printer-device-id` (`CMD:` field: `TSPL`, `ZPL`, `EPL`, `CPCL`, `PCL`,
- `POSTSCRIPT`, ...). It exercises backend, USB and the printer, and not
- filters or PPD. Isolated CUPS checks passed a bounded binary payload unchanged
- through synthetic PPD queues on all four release families; actual printer
- command execution and backend/USB behavior remain hardware gates.
-
-Implementation refinement: only complete `CMD:`/`COMMAND SET:` tokens count as
-device-ID language evidence. The known-devices table supplies a visible hint,
-never permission to select a language automatically from a shared USB ID. A
-user confirms the language and each individual print. Availability of this
-explicit diagnostic tool does not certify physical output or every installed
-backend/policy. The [isolated raw checks](printers-qualification.md) qualify the
-tested CUPS software path only.
-
-Read together: raw prints and filtered does not → filters/PPD/media; neither
-prints → backend/USB/printer/paper. This is finding 5 as a button pair.
-
-If the printer's language is unknown (no `CMD:` and no table hit), a
-**"Which language does it speak?"** step sends one probe label per language,
-one at a time, asking "did anything print?" after each. The page also says,
-in words, to hold FEED while powering on for the self-test sheet, since that
-page names the language and the real resolution.
-
-### Resolution and size: a ruler, not trust
-
-Product listings lie about dpi (finding 7). For queues the user marks as a
-label printer (or whose driver reports a label media class), "Check scale"
-prints a rectangle of known size (for example 2 × 3 in) and asks what was
-measured, in the user's unit. If it is off, the page suggests the supported
-resolution that corrects it and sets it as the queue default. The ratio is
-computed, not looked up. For other printers, margins and page size are shown
-and editable from the driver's options; no ruler.
-
-### Adding a printer (D2)
-
-Sources, in order shown:
-
-1. Devices returned by the helper's `DevicesGet` CUPS discovery operation
- (USB, DNS-SD, socket and validated installed vendor backends), through the
- privileged path. An authorization failure means
- discovery is unavailable, not that no devices exist.
- Devices CUPS lists whose URI is already used by a queue are hidden.
-2. Detected USB printers that CUPS did not list (the ladder's rungs 1–2 data):
- shown with *why* it is missing ("the kernel driver did not create a
- device", "CUPS cannot open it") instead of silently absent.
-3. A typed address: `ipp://`, `ipps://`, `socket://`, `lpd://`, and hostnames
- when entered as network addresses. Typed schemes are allow-listed. No
- `file:`, credential-bearing `smb:`, scripts or arbitrary typed vendor
- backends are accepted. Discovered vendor URIs must exactly match a current
- helper result and pass the separate discovered-backend validation.
-
-Driver choice, no driver of ours:
-
-1. **Driverless first:** an IPP Everywhere / AirPrint printer, or a USB printer
- exposed over IPP by `ipp-usb` when that is present, is added with the
- `everywhere` model. CUPS 2.4 documents that model name and queries the IPP
- device; it can generate a PPD internally, so "driverless" does not mean
- "no PPD file" on CUPS 2.x. **(verify)** actual add behavior per version.
-2. **Match by device ID:** retrieve PPD metadata and compare the IEEE 1284
- make/model/device ID conservatively. The documented CUPS-Get-PPDs API
- does not promise `ppd-match` rankings or a driver package name. Matching
- and any optional distro package attribution need their own verified
- implementation; ambiguous matches require an explicit choice.
-3. **No match:** say so. Offer a *raw queue* (jobs pass through untouched,
- fine for applications that already emit the printer's language), and show
- the known-devices note ("this model speaks TSPL; ordinary PDF printing needs
- a third-party TSPL driver, not shipped in your distribution's repositories"),
- with the project name and URL, not an install command we cannot vouch for.
- We do not download or install third-party code.
-
-New queues are created enabled and accepting with a unique validated name.
-The UI refreshes names and refuses known collisions before calling the helper;
-"Remove" has a named confirmation and is separate from "Disable". Queue rename
-has its own confirmation and rejects known active/held jobs. The helper itself
-uses a non-atomic clone/delete operation, so concurrent administration remains
-a race; this is not an atomic create-or-rename guarantee. After rename, the page
-checks refreshed queue identities and migrates personal defaults/observations.
-See the [actual helper checks](printers-qualification.md) for collision refusal,
-pending-job refusal and preservation limits.
-
-### Known devices: a small data table
-
-`src/printing/known_devices.zig` stores bounded hardware observations and a
-third-party driver project link. Its initial entry is:
-
-```
-vid:pid=0416:5011 language_hint=TSPL resolution_hint_dpi=203 provisional=true
-note="One unresolved field report; confirm command language and physical scale."
-```
-
-Fields describe observations about the *hardware*, never instructions we run.
-The initial entry is explicitly **provisional**, sourced from the unresolved
-single-device field report above; it is not a universally verified TSPL/203-dpi
-identification for every device sharing `0416:5011`. Its note calls out both
-the advertised 300 dpi and the reported 203 dpi measurement. It supplies a
-language-probe/media hint, not an automatic language or resolution default.
-Future verified entries need isolated hardware evidence and its source in the
-commit message.
-
-### Privileged actions (D3)
-
-Creating, modifying and removing queues, and starting CUPS, need rights an
-unprivileged user and a compositor must not have. In order of preference:
-
-1. **`cups-pk-helper`** (`org.opensuse.CupsPkHelper.Mechanism` on the system
- bus; it is what GNOME Settings and `system-config-printer` use). Polkit
- handles the authorization and our polkit agent already shows the prompt. We
- write no root code. Starting CUPS is a separate service-manager action;
- cups-pk-helper is not a general service controller. Its installed interface
- was checked in four isolated release-family containers; stock desktop
- authorization remains unqualified. It is an optional runtime recommendation
- documented in README, not a generated binary-library dependency. The helper
- targets its canonical local server, so custom Unix and remote endpoints are
- not allowed to administer an unrelated local scheduler.
-2. If it is absent: the page is read-only for those actions and says exactly
- which package is missing, by name for the detected distro (`/etc/os-release`
- `ID`/`ID_LIKE`), without running it.
-3. Only if Phase 0 shows something the user needs that neither covers (for
- example a CUPS USB quirk, if it proves necessary and survives package
- updates), a narrow `rediwm-printers-helper` under `pkexec`, built to the
- rules in `src/accounts_helper/AGENTS.md`: argv arrays only, absolute paths,
- every field validated, a polkit action in `data/`, kept out of greeter mode.
- The root-code list in `AGENTS.md` must be amended in the same change.
-
-Writing a USB quirk is the one thing that needs a decision (D5): the quirk may
-be unnecessary (the working queue in the report used a backend that writes the
-node and so avoids libusb), and a file in `/usr/share/cups/usb/` is owned by
-the package. **(verify)** whether cupsd reads every file in that directory, so
-a separate drop-in would survive upgrades. If a quirk is needed we *tell the
-user*, with the exact line and where to put it; we do not edit package files.
-
-### Diagnostic report
-
-"Copy diagnostic report" puts plain text on the clipboard; it is never sent
-anywhere. It includes allow-listed distro/version information, ladder verdicts,
-USB VID:PID/interface/node evidence, URI scheme/connection class, bounded media
-and resolution data, reported job state/sheets and user-recorded test outcomes.
-Credentials, URI authorities/paths, arbitrary queue/document/user names, USB
-serials and freeform messages are excluded. Known failure messages inform the
-ladder but are not copied verbatim into the report. No job content or privileged
-log read is involved.
-
-### Page layout
-
-A printer selector leads to the selected queue's details and controls. The
-scrollable content includes:
-
-* header: name, model, status sentence, ink/toner bars if reported;
-* ladder (collapsed to one line when everything passes);
-* jobs: list with cancel; "Resume printer" when stopped;
-* settings: paper size, resolution, colour, duplex, quality, driver options
- as the driver's own groups, "Set as default";
-* tools: Test page, Test without driver, Check scale, Copy report;
-* danger zone: Remove printer (confirmation naming it).
-
-Empty states: CUPS not installed (say what and how, by distro), CUPS stopped,
-no printers ("Add a printer" with detected USB first), printer unplugged
-(ladder shows rung 1 failing, settings dimmed).
-
-All controls come from `ui/widgets/`; the ladder uses text as well as state
-styling. English strings follow current repository conventions. The shared
-i18n/extraction system is still a separate planned dependency.
-
-## Decisions applied
-
-* **D1:** a bounded Zig IPP/HTTP client, with explicit compatibility limits.
-* **D2:** CUPS discovery, USB sysfs and typed allow-listed network addresses;
- no scans or guessed driver identity.
-* **D3:** the existing cups-pk-helper and systemd APIs; no new root helper.
-* **D4:** separately confirmed driver/raw/ruler samples and one language probe
- at a time, with user observations distinct from CUPS job state.
-* **D5:** advice only for USB quirks; no package-file or device-node writes.
-* **D6:** preserving per-user defaults, visible environment overrides and a
- separate privileged system-default action. Applications can retain their own
- printer choice; this page does not override their print dialogs.
-
-## Phases
-
-### Phase 0: isolated software evidence captured; hardware gates open
-
-The isolated software checks are recorded below and in the qualification file.
-The manual hardware exercise still requires the author's printer and one
-ordinary printer; it is not part of an automated test or permission to touch
-host queues/services.
-
-* Rebuild a throwaway queue from scratch for the label printer and find the
- *minimal* set of changes (quirk vs `usblp` vs udev symlink vs backend choice)
- and the cause of `cupsCompression=4294967295` (queue PPD vs the installed
- Ghostscript/cups-filters). Decides whether a quirk note exists at all.
-* Verify every **(verify)** item above on Arch plus one of each other family in
- the existing podman setup (never the live session; see the release notes).
-* Confirm what an unprivileged user can read over IPP (jobs of others, device
- list, PPD list, subscriptions) on a default install.
-* Output: facts here, and fixtures for Phase 1 (recorded IPP exchanges).
-
-#### Evidence and remaining gates, 2026-10-16
-
-The host scheduler, its queues/jobs and attached printers were not used for
-qualification. Automated UI exchanges are synthetic. Separate disposable
-containers ran actual CUPS/helper software with private sockets, buses and state;
-their only output backend captured a bounded binary fixture into a private file.
-The [qualification record](printers-qualification.md) contains exact image IDs,
-package versions, commands, outcomes and limits.
-
-Observed software evidence:
-
-* Arch CUPS 2.4.20, Debian 2.4.10, Ubuntu 2.4.7 and Fedora 2.4.19 exposed the
- tested helper ABI and packaged notifier. Indefinite subscription grants,
- explicit cancellation and raw bytes through a synthetic PPD queue passed in
- each container. This does not establish hardware output or stock policy.
-* Debian's real helper renamed an idle throwaway queue, refused an existing
- destination and refused a paused queue's pending job. Source review of helper
- 0.2.6/0.2.7 establishes its non-atomic clone/delete behavior and partial error/
- option-preservation limits; no stronger rename guarantee is claimed.
-* Real helper option checks exposed duplicate IPP defaults from the generic
- default-attribute API. The PPD-aware API updates actual driver choices.
- Colour/quality IPP fields can disagree with the PPD, and deleting an override
- can change reported defaults. The page verifies refreshed driver values and
- keeps unverified outcomes explicit; the qualification record preserves the
- actual before/after results rather than inferring success from an empty error.
-* The unit suite covers bounded/hostile codecs and identity, allocation failures,
- URI validation, driver matching, PPD declarations/dimensions, PDF offsets,
- language samples, calibration, preserving defaults and private observations,
- socket watches, notifier credentials and active DNS cancellation.
-* `tests/printers.py` exercises the real Settings UI with private scheduler,
- helper and service-manager fixtures. It covers confirmed test bytes, setup,
- defaults/options, guarded rename/removal, failures, remote administration
- isolation, privacy and idle/hidden/closed worker lifetime. Current validation
- commands and dependencies are in [TESTING.md](../../TESTING.md).
-
-Useful upstream constraints remain:
-
-* Raw printing/queues and PPD drivers are deprecated. CUPS documents raw jobs
- as bypassing filters; a CUPS completed state still says nothing about paper.
- [Printing guidance](https://openprinting.github.io/cups/),
- [driver migration](https://openprinting.github.io/cups/drivers.html).
-* Default policies place discovery and queue administration behind permissions;
- own-job cancellation, privacy and retained history also depend on policy.
- [CUPS policy template](https://github.com/OpenPrinting/cups/blob/v2.4.20/conf/cupsd.conf.in).
-* PPD metadata does not promise ranked matches or package names. `everywhere`
- queries an IPP device and can generate a PPD on CUPS 2.x.
- [IPP extensions](https://openprinting.github.io/cups/doc/spec-ipp.html),
- [lpadmin](https://openprinting.github.io/cups/doc/man-lpadmin.html).
-* libusb can detach the kernel driver and does not require `/dev/usb/lp*`.
- Source supports separate quirk files, but no isolated hardware evidence shows
- that this printer needs one. No automatic quirk change is implemented.
- [USB backend source](https://github.com/OpenPrinting/cups/blob/master/backend/usb-libusb.c).
-
-Open acceptance work: isolate the original label-printer fault, test one ordinary
-printer, verify real driverless discovery/creation and hardware-specific driver
-matches, measure physical media/ruler output, exercise stock unprivileged polkit
-and notifier delivery on installed release-family desktops, and check newly
-created queues in application/portal print dialogs. An openSUSE image/release
-matrix is absent. Shared-USB-ID hints remain provisional; TLS/authenticated
-remote CUPS, mDNS resolution and the repository-wide i18n pipeline are outside
-the implemented subset. No hardware gate is marked passed by the software tests.
-
-### Phase 1: status, diagnostics and explicit tests — software implemented
-
-`src/printing/` and `control_center/sections/printers.zig`.
-
-* Printer list, state in words, jobs, ink/toner.
-* The ladder, rungs 1–7, from IPP plus sysfs.
-* Cancel own jobs; resume a stopped queue where allowed.
-* Hotplug via uevents; CUPS events or action-driven reload.
-* Empty states; Copy diagnostic report.
-* Separately confirmed driver PDF, raw language sample and ruler tests.
-* Acceptance remains open: the software matrix does not establish physical output.
-* Gate: ladder verdicts match reality on the label printer for each induced
- fault (unplugged, queue stopped, wrong URI, filter fail).
-
-### Phase 2: setup and configuration — software implemented
-
-* Add flow (discovery/typed URI, driverless/PPD match/raw), guarded removal,
- descriptions, confirmed queue rename, connection editing and personal/system
- defaults.
-* Driver options as groups from the PPD or IPP `-supported` attributes; media
- and resolution in plain words.
-* Privileged actions through cups-pk-helper; absence handled.
-* Label printers: media class, "Check scale", language probe, known-devices
- hints.
-* Gate: a printer is added, configured, test-printed and removed with no
- terminal on Arch and one other family.
-
-### Phase 3: integration implemented; distro/hardware qualification remains
-
-* Per-distro guidance strings (missing package names), `os-release` aware.
-* Reload on cupsd restart, graceful loss of CUPS mid-use.
-* `AGENTS.md`, `TESTING.md`, README optional dependencies and Settings search
- keywords are updated. No printing package is added to generated library
- `DEPENDS`; release tooling has no optional `RECOMMENDS` facility.
-* Shared i18n extraction remains blocked on the repository-wide i18n project.
-* The isolated software matrix is recorded; stock desktop and hardware gates
- above remain open.
-
-### Optional: our own helper (only if Phase 0 requires it)
-
-See D3 item 3. Not scheduled.
-
-## Tests
-
-* `zig build test` includes `src/printing/tests.zig`; `zig build test-printers`
- also runs the private Settings integration. Run at scale 1 and 1.5, and check
- the ReleaseSafe build as described in [TESTING.md](../../TESTING.md).
-* Unit fixtures cover bounded IPP/HTTP and collections, response framing and
- version privacy, full validated identities, URI allow-lists, conservative
- driver matching, USB/sysfs/node types, pure ladder verdicts/report masking,
- PPD choices and dimensions, allocation failure, test PDF geometry/xref,
- language samples, two-axis resolution suggestions, preserving preferences,
- socket events, notifier authentication and cancellable DNS.
-* `tests/printers.py` uses private Unix/TCP schedulers and a private D-Bus helper/
- service-manager fixture. A noninstalled `LD_PRELOAD` connect shim redirects
- only the canonical CUPS socket during administration tests, so the production
- local-server safety gate is exercised without contacting host CUPS. Confirmed
- documents terminate in fixture memory; no real print backend is involved.
-* Disposable-container qualification is separate from the normal test target:
- [exact results and reproduction](printers-qualification.md). Its capture-only
- backend establishes tested software passthrough, not physical printing.
-* Never run automated tests against the host scheduler or a real printer. The
- USB layer uses fixture trees; physical USB, paper and desktop policy checks
- remain explicit manual acceptance work.
-* Idle workers block without periodic queries. Integration checks per-thread
- context switches and scheduler requests, and verifies that hiding or closing
- Settings cancels I/O, joins its worker and releases local activity.
-
-## Risks and open questions
-
-* One physical test printer. The generic parts (ladder, test pair, media
- check, report) are testable against a fake and any printer; the quirks and
- device facts are only as good as the hardware we have. The known-devices
- table says so in each entry.
-* CUPS behaviour differs between versions (2.3/2.4, cups-filters 1.x/2.x, the
- new libcups3/`cups-browsed` split, `ipp-usb` presence). Phase 0 checks the
- families we ship; anything newer is reported honestly as "unknown".
-* cups-pk-helper is not installed everywhere. If it is missing on a family,
- D3 item 2 is the user experience there, and it should be acceptable, not an
- error.
-* Remote cupsd (`CUPS_SERVER=host`): cleartext reads and bounded user requests
- are supported; local administrative actions are disabled. TLS/authenticated
- endpoints are unsupported. The resolver uses ordinary DNS and hosts files,
- not NSS/Avahi mDNS; direct `ipps://` and DNS-SD reachability stay unavailable.
-* Indefinite subscriptions avoid renewal wakeups. Cancellation is best effort:
- a failed send or crash can leave a CUPS-owned subscription; local listeners
- and sockets are still closed. Server-side cleanup/delivery remains part of
- desktop policy/lifetime qualification.
-* Rename is a helper clone/delete operation, not atomic. Concurrent changes,
- hidden jobs and arbitrary option/history preservation need care; refresh and
- named confirmation do not turn it into a transactional server operation.
-* Sandboxed callers (`[[sandbox_allow]]`) and the security-context filter are
- untouched; the page runs inside the compositor's own process, like the other
- Settings pages.
-* The Print portal path (rediwm-pdf) is separate and unchanged. A queue this
- page creates must be visible to it; check in Phase 2.
-* Hotplug without a udev library: kernel uevents are enough for "something
- changed, rescan", but their format is a kernel ABI; keep the parser tiny and
- tolerant.
-
-## Not in this plan
-
-* **A print driver of our own** (PPD generation, PDF→raster→TSPL/ZPL, a CUPS
- filter or backend). Decided against: unsupported printers get a clear
- explanation, a raw queue, and a pointer to the third-party driver, not a
- driver from us.
-* Scanning, MFPs, SANE.
-* CUPS server administration, sharing, quotas, authenticated remote servers.
-* Print preview, a print dialog, a print-to-PDF queue.
-* Bluetooth printer pairing and Bluetooth backends.
-* Network or port scanning, unsolicited device probes, and guessed endpoints.
- A bounded request to an exact selected/discovered IPP URI is the only direct
- reachability check.
diff --git a/docs/plans/system-monitor.md b/docs/plans/system-monitor.md
deleted file mode 100644
index bb2414b..0000000
--- a/docs/plans/system-monitor.md
+++ /dev/null
@@ -1,184 +0,0 @@
-# System Monitor plan
-
-Status: implemented, 2026-10-17. Collector, native monitor window, process
-actions, shortcut and desktop integration are present. See the
-[user guide](../system-monitor.md) for behavior, shortcuts and configuration
-migration, and the validation record below.
-
-Add a native **System Monitor** application, `rediwm-monitor`, opened by
-**Ctrl+Alt+Del**. Use [Mission Center](https://missioncenter.io/) as the feature
-reference for a resource overview and process list, with a small first version
-that follows RediWM's existing app styles.
-
-Run it as a separate Wayland application using RediWM's shared UI and theme.
-Process collection runs independently of the compositor.
-
-## First version
-
-Use one resizable window:
-
-| Area | Content |
-| --- | --- |
-| Top | CPU usage and RAM used/total, each with a simple 60-second history graph. |
-| Toolbar | Search, My processes / All processes, and Pause updates. |
-| Main area | Sortable process list: Name, PID, User, CPU %, Memory, State. |
-| Bottom | Process count, swap usage, and actions for the selected process. |
-
-Default to the current user's processes, sorted by CPU usage. Keep selection
-attached to the process as rows move, and preserve scroll position during
-refreshes.
-
-**End process** requests termination. A separate **Force quit** action handles
-processes that ignore it, with confirmation naming the target. Other users'
-processes are viewable where permitted; v1 manages the current user's own
-processes and protects essential RediWM session components.
-
-GPU monitoring, disk/network charts, per-core views and application grouping
-can follow once this foundation is solid.
-
-## Visual design
-
-Use existing window decorations, fonts, spacing, theme colors, selection
-states, fields, buttons, dialogs and scrollbars. Graphs use the theme accent.
-Support live theme changes and fractional scaling from the start.
-
-Use `ui/cairo.zig`, theme text and color tokens, and the shared controls in
-`ui/widgets/`. Load the effective app theme through `files/settings.zig`
-before the first frame. New controls must follow the shared UI ownership,
-callback and lifetime rules.
-
-## Implementation
-
-### 1. Collector and process model
-
-Add `src/system_monitor/` with process enumeration, CPU sampling, memory
-accounting and bounded history. Read Linux's `/proc` data in a worker and
-deliver snapshots to the UI. System memory uses available memory when
-calculating usage; process memory is labeled as resident memory. Follow the
-[Linux proc filesystem documentation](https://docs.kernel.org/filesystems/proc.html).
-
-The existing sampler in
-[`src/ipc/processes.zig`](../../src/ipc/processes.zig) covers only processes
-owning windows. Extract useful parsing logic while preserving that IPC
-command's behavior. The new collector must also include background processes
-and handle processes disappearing during sampling.
-
-Keep collection and process identity logic independent of compositor types.
-Worker snapshots own their data, and workers do not access Wayland or UI
-objects.
-
-### 2. Native window
-
-Follow the existing app-client patterns, using
-[`src/ui/cairo.zig`](../../src/ui/cairo.zig), shared widgets and
-[`src/files/settings.zig`](../../src/files/settings.zig) for theme loading.
-Refresh once per second, paint visible rows, and support keyboard search and
-navigation.
-
-Stop sampling when paused or closed. Include visibility signaling for
-suspension while minimized: the current client protocol setup does not
-provide that automatically. Add and validate that lifecycle support rather
-than treating loss of keyboard focus as proof that the window is hidden.
-
-### 3. Process actions
-
-Identify selections by PID and process start time, revalidate the target, and
-signal through a pidfd so PID reuse cannot redirect an action. Validate the
-pidfd target against the selected identity before sending a signal. Show
-clear outcomes such as "Process already exited" or "Permission denied".
-Follow the [Linux pidfd signal documentation](https://man7.org/linux/man-pages/man2/pidfd_send_signal.2.html).
-
-End process sends SIGTERM. Force quit sends SIGKILL after explicit
-confirmation naming the selected process. Recheck ownership and protected
-session identities when executing the action, including after a confirmation
-has been open while the process list changes.
-
-### 4. Desktop integration
-
-Add an `open_system_monitor` action that launches the app or restores and
-focuses its existing window. Route launching through the existing app-scope
-machinery. Install a desktop entry and icon for the application launcher.
-
-Both presets now bind Ctrl+Alt+Del to `open_system_monitor`; the canvas
-previously used `poweroff`. Explicit bindings are preserved and require the
-[documented configuration change](../system-monitor.md#existing-shortcut-configuration).
-Existing lock, greeter and shortcut-inhibition rules still apply.
-
-Relevant integration points:
-
-| Existing code | Planned integration |
-| --- | --- |
-| [`src/config/keybinds.zig`](../../src/config/keybinds.zig) | Add the named action. |
-| [`src/config/default.zig`](../../src/config/default.zig) | Change the canvas Ctrl+Alt+Del default. |
-| [`src/config/workspace_defaults.zig`](../../src/config/workspace_defaults.zig) | Add the workspace Ctrl+Alt+Del default. |
-| [`src/config_runtime/actions.zig`](../../src/config_runtime/actions.zig) | Dispatch launch or restore/focus through the existing launch path. |
-| [`src/session/app_scope.zig`](../../src/session/app_scope.zig) | Preserve per-application scope placement. |
-| [`src/control_center/sections/shortcuts.zig`](../../src/control_center/sections/shortcuts.zig) | Add the shortcut description and appropriate grouping. |
-| [`build.zig`](../../build.zig) and `data/` | Build and install the executable, desktop entry and icon. |
-
-### 5. Validation
-
-Extend existing tests where practical and add focused coverage for the new
-collector and application:
-
-* CPU calculations and memory accounting from controlled samples.
-* Disappearing processes, PID reuse, unavailable data and permission errors.
-* Sorting, search, stable selection and scroll position during updates.
-* End process and Force quit using disposable fixture processes, including a
- fixture that ignores SIGTERM.
-* Shortcut launch, restore/focus, repeated activation and both desktop modes.
-* Existing lock, greeter and shortcut-inhibition behavior.
-* Live theme changes, fractional scaling, keyboard navigation and resizing.
-* Sampling suspension, cancellation and worker lifetime when paused,
- minimized, restored or closed.
-
-Use isolated headless integration tests as described in
-[`TESTING.md`](../../TESTING.md). Process-action tests must only signal their
-own disposable fixtures.
-
-Before completing implementation, build Debug and ReleaseSafe, run
-`zig build test`, and run the affected integration suites. Compare failures
-against a worktree of HEAD before calling them regressions.
-
-## Delivery order
-
-1. Collector and process model with focused tests.
-2. Usable native monitor window with summaries, history, search and sorting.
-3. Process actions, shortcut integration, launcher packaging and end-to-end
- validation.
-
-## Implementation and validation record
-
-The collector, bounded history and process model live in `src/system_monitor/`.
-IPC reuses its stat reader and retains the existing window-only sampling
-behavior. The standalone app uses persistent shared widgets, released shm
-buffers, filesystem theme notifications, fractional-scale/viewporter, and an
-eventfd worker. xdg-shell v6 suspension is sent by the compositor when a
-window is minimized and cleared on restore. Process actions validate the
-pidfd, start time, ownership and protected executable at execution. Launcher
-files and the session/release installer lists include the new executable.
-
-Validated on 2026-10-17:
-
-* Debug and ReleaseSafe builds; `zig build test` and `zig build test-monitor`.
-* `tests/system_monitor.py`: canvas and workspaces at scale 1 and 1.5,
- disposable TERM/KILL targets, confirmation cancel, a target exiting while
- confirmation is open, protection changing across exec, stable list model,
- pause, focus loss, minimize/restore, hidden close, resizing and live themes.
- The canvas suite also passes against the ReleaseSafe compositor and app
- using `REDIWM_TEST_BINARY=.../zig-out/release-safe/bin/rediwm`.
-* `keyboard_shortcuts.py` and `shortcuts_inhibit.py` in both desktop modes;
- the latter explicitly checks the monitor chord under an inhibitor.
-* `lock_screen.py`, `greeter.py`, `output_scale.py`, `images_viewer.py`,
- `files_controls.py --places-only`, and `editor.py`.
-* ReleaseSafe executable strings contain no monitor preview or production
- `REDIWM_TEST_*` hooks. Installer shell syntax and diff whitespace checks pass.
- UI action tests use a noninstalled seccomp notification guard that permits
- signals only to their own recorded child identities, with a separate guard
- check against an unlisted disposable process.
-
-Two broader suites retain failures reproduced in a detached worktree of
-HEAD (`3170a17`): `wlr_protocols.py` expects `finished` for a second session-lock
-request but receives EOF; `pdf_viewer.py` times out waiting for a double-clicked
-PDF window to close. Workspace inhibition's initial restore-drag assertion
-passed on rerun.