From ee3d01ecfe77156959554d7acd94f4795d4139b7 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Mon, 26 Oct 2026 23:02:16 +0100 Subject: [PATCH 01/25] add guide on adding Scaleway as an opencode provider --- .../add_scaleway_as_an_opencode_provider.md | 261 ++++++++++++++++++ docs/guides/index.md | 1 + docs/log.md | 4 + 3 files changed, 266 insertions(+) create mode 100644 docs/guides/add_scaleway_as_an_opencode_provider.md diff --git a/docs/guides/add_scaleway_as_an_opencode_provider.md b/docs/guides/add_scaleway_as_an_opencode_provider.md new file mode 100644 index 0000000..65c69b3 --- /dev/null +++ b/docs/guides/add_scaleway_as_an_opencode_provider.md @@ -0,0 +1,261 @@ +--- +type: Guide +title: Add Scaleway as an opencode provider +description: Enabling Scaleway's Generative APIs in opencode with one API key, and pinning every + oh-my-openagent agent and category slot, from a model catalogue verified with real inference + calls. +tags: +- guide +- opencode +- scaleway +- oh-my-openagent +- config-management +status: stable +stale_after: '2027-04-26' +generated: + by: opencode/glm-5.3 + at: '2026-10-26T22:57:02+01:00' +sources: +- id: scw-opencode + resource: https://www.scaleway.com/en/docs/generative-apis/reference-content/integrate-with-opencode/ + title: Integrating Generative APIs with OpenCode - Scaleway Documentation + last_modified: '2026-10-26' +- id: scw-api + resource: https://www.scaleway.com/en/docs/generative-apis/api-cli/using-generative-apis/ + title: Using Generative APIs - Scaleway Documentation + last_modified: '2026-10-26' +- id: scw-pricing + resource: https://www.scaleway.com/en/pricing/model-as-a-service/ + title: Model-as-a-Service pricing - Scaleway + last_modified: '2026-10-26' +- id: scw-models + resource: https://www.scaleway.com/en/docs/generative-apis/reference-content/supported-models/ + title: Generative APIs supported models - Scaleway Documentation + last_modified: '2026-10-26' +- id: omo-repo + resource: https://github.com/code-yeongyu/oh-my-openagent + title: 'code-yeongyu/oh-my-openagent' + last_modified: '2026-10-26' +- id: felix-opencode-config + resource: https://github.com/ftschindler/opencode + title: 'ftschindler/opencode: an opencode configuration with one profile per provider' + last_modified: '2026-10-26' +--- + +Scaleway serves language models over an OpenAI-compatible API at `https://api.scaleway.ai/v1`, and +opencode knows the provider natively: no custom provider definition, no base URL to paste, only an +API key[^scw-opencode]. Enabling it is therefore the short half of this guide. The long half is +what comes with it. oh-my-openagent, the plugin that supplies opencode's agents and its per-task +model routing, has no Scaleway entries in its routing table, so every agent and category it +defines needs an explicit pin to a model Scaleway actually serves. + +The model facts below were measured on 2026-10-26 against opencode 1.18.32 and oh-my-openagent +5.1.48. The catalogue came from the models endpoint, each model's chat behaviour from a real +completion call, tool calling from a function-calling probe, and image handling from having each +model describe a picture. Prices and context windows come from Scaleway's pricing page on the same +day[^scw-pricing]. + +## 1. Get the API key + +In the Scaleway console, generate an API key under IAM. The key's bearer is either a user or an IAM +application, and the console shows the secret exactly once, so it gets copied then. The secret is a +UUID. + +The bearer needs one of the Generative APIs permission sets: `GenerativeApisModelAccess`, the least +that allows listing and calling models; `GenerativeApisFullAccess`; or the broad +`AllProductsFullAccess`[^scw-api]. `InferenceFullAccess` is the legacy name for the same product's +access and may still be attached to older policies. + +## 2. Declare the provider in opencode + +Scaleway documents an interactive sign-in that asks for the same key[^scw-opencode]. The +config-file route below is declarative, and it is the one to keep in version control: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "scaleway": { + "options": { + "apiKey": "{env:SCW_SECRET_KEY}" + } + } + }, + "model": "scaleway/gpt-oss-120b" +} +``` + +The `provider` block with an API key is the whole declaration, because `scaleway` is in opencode's +provider registry[^scw-opencode]. `{env:SCW_SECRET_KEY}` reads the key from the environment. +`{file:.env}` reads it from a file next to the config, resolving relative to the directory the +config lives in, which keeps the credential out of the environment and lets it live beside the +config in version control while being ignored by it. + +Requests go to `https://api.scaleway.ai/v1` and run on the account's default Project. To run them +on a specific Project, for instance to track its billing separately, set the option +`baseURL` to `https://api.scaleway.ai/{env:SCW_PROJECT_ID}/v1`[^scw-opencode]. + +## 3. Verify the credential with a real request + +```bash +opencode run --model scaleway/gpt-oss-120b "Reply with exactly: OK" +``` + +The listing proves nothing. The catalogue and the inference endpoint authenticate separately, so a +rejected key can still list every model and then fail the first real request. A reply proves the +key. A `401` names a rejected key; a `403` names a key whose bearer is missing the permission set +from step 1. + +## 4. Why every oh-my-openagent slot needs a pin + +oh-my-openagent routes each of its agents and task categories through a built-in table that names, +for every slot, an ordered chain of models with the providers that serve them[^omo-repo]. The +table carries no Scaleway entries - confirmed by searching the 5.1.48 build's shipped routing +tables for the provider id - so on a Scaleway session no slot resolves at all. + +An unresolved slot produces no error. It falls through to the session's default model, which is how +a cheap high-volume slot ends up quietly running on the most expensive model in the catalogue. The +failure has a documented shape: when a plugin upgrade renamed a routing category, the pins matching +the old key turned inert and the two new slots silently routed to a provider the configuration +existed to exclude, in +[A plugin upgrade renamed a routing category and silently breached provider isolation](../findings/20261001_a_plugin_upgrade_renamed_a_routing_category_and_breached_provider_isolation.md). + +A complete set of pins is therefore structural for Scaleway, not a preference. + +## 5. The catalogue, as measured + +On 2026-10-26 the models endpoint returned seventeen models for this subscription. Scaleway's +supported-models page describes more than a subscription may serve, so the docs table is not a +promise of what a key can call[^scw-models]. Measure, then pin. + +Thirteen of the seventeen are chat models. Every one of them answered a completion call and emitted +a correct `tool_calls` structure in a function-calling probe. The images column says `described` +where the model described a test image in its own words, `rejected` where the server refused one +outright, and `text-only` where the docs list no image input and no probe was run[^scw-models]. + +| model | € in / € out per 1M tokens | context | reasoning | images | +| --- | --- | --- | --- | --- | +| `gpt-oss-120b` | 0.15 / 0.60 | 128k | yes | text-only | +| `mistral-small-3.2-24b-instruct-2506` | 0.15 / 0.35 | 128k | no | described | +| `gemma-4-26b-a4b-it` | 0.25 / 0.50 | 256k | yes | described | +| `qwen3.6-35b-a3b` | 0.25 / 1.50 | 256k | yes | described | +| `deepseek-v4-flash-0731` | 0.40 / 0.80 | 256k | yes | text-only | +| `deepseek-v4.1-flash` | 0.60 / 1.80 | 256k | yes | described | +| `qwen3.5-397b-a17b` | 0.60 / 3.60 | 250k | yes | described | +| `qwen3.8-27b` | 0.60 / 3.30 | 256k | yes | described | +| `qwen3-235b-a22b-instruct-2507` | 0.75 / 2.25 | 250k | no | text-only | +| `llama-3.3-70b-instruct` | 0.90 / 0.90 | 128k | no | rejected | +| `mistral-medium-3.5-128b` | 1.50 / 7.50 | 256k | yes | described | +| `glm-5.2` | 1.80 / 5.50 | 256k | yes | text-only | +| `glm-5.3` | 1.80 / 5.50 | 256k | yes | text-only | + +Prices, context windows and the reasoning flag are Scaleway's own values from the pricing +page[^scw-pricing]; the reasoning flag marks models that accept reasoning parameters. + +The other four are not chat models and take no turn in an agent session. `bge-multilingual-gemma2` +and `qwen3-embedding-8b` answer the embeddings endpoint, returning 3584 and 4096 dimensions. +`whisper-large-v3` transcribes audio, priced per minute. `lightonocr-3-0.8b` reads text out of +images over its own endpoint; the chat endpoint rejects it. + +## 6. Map the models to the slots + +Slots differ on two axes: how hard the work is, and how often the slot fires. The volume leaders, +`explore` and `librarian` and the `quick` category, run many calls per session, so their price +dominates and reasoning depth is not required. The capability gates are harder: `multimodal-looker` +must genuinely read images or it fails at its job, and the top-reasoning slots want the strongest +model served, whatever it costs, because they fire rarely. + +The mapping below is applied and running in +[Felix's opencode configuration](https://github.com/ftschindler/opencode)[^felix-opencode-config]. +It is one settled answer, not the only one; the wants column is the part that transfers when the +catalogue moves. + +| agent slot | wants | pinned to | +| --- | --- | --- | +| `sisyphus` | plans, delegates, drives to completion | `glm-5.3` | +| `prometheus` | strategic planning, interview-mode questioning | `glm-5.3` | +| `hephaestus` | autonomous deep work, sustained autonomy | `glm-5.3` | +| `oracle` | read-only consultation, pure reasoning | `glm-5.3` | +| `momus` | adversarial critique, pure reasoning | `glm-5.3` | +| `metis` | ambiguity detection, mid reasoning | `glm-5.3` | +| `atlas` | focused execution, no delegation | `qwen3.5-397b-a17b` | +| `sisyphus-junior` | focused execution, no delegation | `qwen3.5-397b-a17b` | +| `explore` | fired many at once; cost and speed dominate | `gpt-oss-120b` | +| `librarian` | fired many at once; cost and speed dominate | `gpt-oss-120b` | +| `multimodal-looker` | images and PDFs; a hard capability gate | `qwen3.8-27b` | + +| category slot | wants | pinned to, in order | +| --- | --- | --- | +| `visual-engineering` | frontend and design; benefits from images | `qwen3.5-397b-a17b`, `qwen3.8-27b`, `mistral-small-3.2-24b-instruct-2506` | +| `deep-low` | autonomous execution, decisions settled from evidence | `qwen3.5-397b-a17b`, `qwen3.6-35b-a3b` | +| `deep-high` | deep work whose decision evidence cannot settle | `glm-5.3`, `qwen3.5-397b-a17b` | +| `quick` | trivial work, high volume | `mistral-small-3.2-24b-instruct-2506`, `gpt-oss-120b` | +| `ultrabrain` | hard logic and architecture | `glm-5.3`, `qwen3.5-397b-a17b` | +| `artistry` | unconventional, creative approaches | `glm-5.3`, `qwen3.5-397b-a17b` | +| `unspecified-low` | moderate work, low effort | `qwen3-235b-a22b-instruct-2507`, `mistral-small-3.2-24b-instruct-2506` | +| `unspecified-high` | broad work, high effort | `glm-5.3`, `qwen3.5-397b-a17b` | +| `writing` | prose quality | `qwen3.5-397b-a17b`, `mistral-medium-3.5-128b` | + +**`glm-5.3` takes the pure-reasoning slots.** It is the strongest reasoner in the catalogue and, +at €1.80 in / €5.50 out, among the most expensive. That combination suits its slots: `oracle`, +`momus`, `metis` and `prometheus` are consulted occasionally rather than fired in parallel, so the +price rarely compounds, and none of them needs images. + +**`qwen3.5-397b-a17b` takes vision with strong reasoning behind it.** It described a test image and +reasons, at €0.60 in, which is a third of glm-5.3's input price. It leads the slots that want both: +`visual-engineering`, `deep-low` and `writing`, plus the two execution agents that may be handed +either text or screenshots. + +**`gpt-oss-120b` takes the highest-volume slots.** Among the models that accept reasoning +parameters it is the cheapest served, at €0.15 in / €0.60 out[^scw-pricing], and every chat model +on the page passed the tool-calling probe, so it can drive the explore and librarian agents that +fire many at once. `mistral-small-3.2-24b-instruct-2506` is cheaper per token still, at €0.15 / +€0.35, but takes no reasoning parameters; it leads `quick` and holds the tail of the low-effort +categories. + +The rest of the chat models stay available but unpinned. `glm-5.2` is the previous generation at +glm-5.3's exact price. The two deepseek flashes are cheap reasoners, and `deepseek-v4.1-flash` +described a test image, making both candidates for the volume slots if a reader weights output +price over reasoning parameters. `gemma-4-26b-a4b-it` is a vision-capable 256k-context model at +€0.25 / €0.50, a reasonable alternative lead for `quick`. `llama-3.3-70b-instruct` is text-only, +takes no reasoning parameters, and is outpriced by everything above it in the table. + +## 7. One model per agent, a list per category + +The two containers differ in what they accept, and the difference is a startup trap. An agent +takes a single `model` string; a `models` array on an agent is rejected by opencode's schema at +startup. A category takes a `models` array, ordered as a fallback chain within the provider. The +plugin reads its model config from `~/.omo/omo.jsonc`, with the opencode harness in a +`"[opencode]"` block[^omo-repo]: + +```jsonc +{ + "[opencode]": { + "agents": { + "explore": { "model": "scaleway/gpt-oss-120b" }, + "multimodal-looker": { "model": "scaleway/qwen3.8-27b" } + }, + "categories": { + "quick": { "models": ["scaleway/mistral-small-3.2-24b-instruct-2506", "scaleway/gpt-oss-120b"] } + } + } +} +``` + +## 8. Keeping it current + +Model pins are literal strings, so a retired model becomes a runtime failure the day some agent +happens to be invoked, and a plugin update can retune the slot roster itself. After either, re-run +the plugin's doctor for conformance, list the models the endpoint serves that day, and repeat the +one-line inference check from step 3 against a pinned model. + +The check that catches a silently unresolved slot is harder: it replays the plugin's routing +table against the live catalogue and reports each slot as pinned, resolved or falling through. +[Felix's configuration](https://github.com/ftschindler/opencode) carries such +scripts[^felix-opencode-config], and its own replay script broke against plugin builds from 5.1.45 +onwards, which is the honest caveat for all of this tooling: a script that reads a routing table +rots with the table. + +What this guide does not cover: dedicated, non-serverless deployments, and custom imported +models. Both exist on Generative APIs, neither follows the serverless catalogue this guide +measured, and both would need their own pass. diff --git a/docs/guides/index.md b/docs/guides/index.md index 94824a6..870063d 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -17,3 +17,4 @@ Conventions: - [Decide whether a Linux freeze is failing hardware](decide_whether_a_linux_freeze_is_failing_hardware.md) - six checks that read a component's own error counters, ordered so the one that usually settles it runs first - [Get started with direnv on Linux](get_started_with_direnv_on_linux.md) - install, hook, first `.envrc`, and why the allow step is the whole trust model - [Authenticate a CLI from the keyring with a PATH shim](authenticate_a_cli_from_the_keyring_with_a_path_shim.md) - feeding a token to a CLI that reads only the environment, and why a shell function reaches the prompt but never an agent +- [Add Scaleway as an opencode provider](add_scaleway_as_an_opencode_provider.md) - one API key and a native provider block, then a pin for every oh-my-openagent slot, mapped from a catalogue measured with real inference calls diff --git a/docs/log.md b/docs/log.md index 700d8bf..c5b9e2e 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-10-26 + +- add guide, "Add Scaleway as an opencode provider", on enabling the provider with one API key and pinning every oh-my-openagent slot from a catalogue measured with real inference calls + ## 2026-10-23 - add guide, "Get started with direnv on Linux", on installing it, hooking the shell, the allow step that gates an .envrc, and the limit that keeps it hygiene rather than a boundary From 4d8821fa081d276d186b9c1d204f0cdbdfe5a873 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:20 +0100 Subject: [PATCH 02/25] add guide on pinning an AUR package with a paru PKGBUILD repo --- docs/guides/index.md | 1 + ...older_version_with_a_paru_pkgbuild_repo.md | 190 ++++++++++++++++++ docs/log.md | 4 + 3 files changed, 195 insertions(+) create mode 100644 docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md diff --git a/docs/guides/index.md b/docs/guides/index.md index 870063d..b447f8f 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -18,3 +18,4 @@ Conventions: - [Get started with direnv on Linux](get_started_with_direnv_on_linux.md) - install, hook, first `.envrc`, and why the allow step is the whole trust model - [Authenticate a CLI from the keyring with a PATH shim](authenticate_a_cli_from_the_keyring_with_a_path_shim.md) - feeding a token to a CLI that reads only the environment, and why a shell function reaches the prompt but never an agent - [Add Scaleway as an opencode provider](add_scaleway_as_an_opencode_provider.md) - one API key and a native provider block, then a pin for every oh-my-openagent slot, mapped from a catalogue measured with real inference calls +- [Pin an AUR package to an older version with a paru PKGBUILD repo](pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md) - masking the AUR with a local checkout when the distribution is too far behind to satisfy an exact dependency, and the Mode setting that makes it a no-op diff --git a/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md b/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md new file mode 100644 index 0000000..8ce0b34 --- /dev/null +++ b/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md @@ -0,0 +1,190 @@ +--- +type: Guide +title: Pin an AUR package to an older version with a paru PKGBUILD repo +description: How to hold an AUR package at the version a lagging distribution can satisfy, by + checking out the matching commit into a local PKGBUILD repository that masks the AUR, and the + Mode setting that silently stops it working. +tags: +- guide +- paru +- aur +- manjaro +- arch +- linux +- package-management +status: stable +stale_after: '2027-04-27' +generated: + by: opencode/claude-opus-5 + at: '2026-10-27T15:10:00+01:00' +sources: +- id: paru-pkgbuild-repo + resource: https://github.com/Morganamilo/paru/discussions/1068 + title: 'Install specific version of an AUR package, paru discussion 1068' + last_modified: '2024-12-27' +--- +An AUR package whose `depends` names an exact version cannot be installed on a distribution whose +repositories are behind Arch. `virtualbox-ext-oracle` is the standing example: its PKGBUILD +carries `depends=("virtualbox=${pkgver}")`, so the 7.2.22 package demands `virtualbox=7.2.22`, +and a Manjaro stable machine holding 7.2.16 cannot satisfy it. The same shape appears wherever a +packager pins a plugin to its host, and the delay is structural rather than a mistake: Manjaro +stable batches Arch's packages behind its own testing branches, so the gap opens again on every +upstream release. + +Editing the PKGBUILD by hand works once and then fights every refresh, because the AUR's copy is +still newer and the helper keeps offering it. A PKGBUILD repository does not, because paru treats +the local copy as authoritative. + +Commands are as of paru 2.1.0 on Manjaro, driving an AUR clone of `virtualbox-ext-oracle`. + +## What a PKGBUILD repo is, and what it is not + +paru reads a `[reponame]` section in its config as a directory of PKGBUILDs, scanned recursively, +and **packages found there take priority over the AUR**. That priority is the whole mechanism: +the masked package's version is whatever the local checkout says, so a checkout of the matching +commit both satisfies the dependency and stops the upgrade being offered, with no ignore list to +maintain. + +This is a different kind of thing from the local repository at `/var/lib/repo/aur`, which paru's +`LocalRepo` fills with **built** packages and pacman serves as `[aur]`. One holds build recipes +and is read before the AUR; the other holds `.pkg.tar.zst` files and is read by pacman. They sit +side by side under `/var/lib/repo` because they are both parts of the same local AUR workflow, +not because they do the same job. + +## 1. Clone the package into the repo + +```bash +mkdir -p /var/lib/repo/aur-pins +git clone https://aur.archlinux.org/virtualbox-ext-oracle.git /var/lib/repo/aur-pins/virtualbox-ext-oracle +``` + +One directory per pinned package, each a full clone. Keeping the git history rather than copying +the files out is what makes the next step and the unpin in step 5 single commands, and it is why +the version to pin gets chosen here rather than in a scratch directory somewhere. + +## 2. Check out the commit that matches + +The AUR serves every package as a git repository, so each released version is a commit. Read the +log of the clone just made: + +```bash +git -C /var/lib/repo/aur-pins/virtualbox-ext-oracle log --oneline -- PKGBUILD +``` + +```text +6672263 commit virtualbox-ext-oracle 7.2.22-1 +f943bc0 commit virtualbox-ext-oracle 7.2.20-1 +e0a291f commit virtualbox-ext-oracle 7.2.18-1 +04af6cd commit virtualbox-ext-oracle 7.2.16-1 +``` + +Restricting the log to `PKGBUILD` is worth the extra argument. Packages accumulate commits that +touch only `.SRCINFO` or the maintainer's tooling, and those produce log lines that look like +releases but are not. + +Match against what is actually installed, not against what the AUR wants: + +```bash +pacman -Q virtualbox +``` + +Then check out the commit whose version that is: + +```bash +git -C /var/lib/repo/aur-pins/virtualbox-ext-oracle checkout 04af6cd +``` + +## 3. Declare it in `paru.conf` + +Append a section to the `paru.conf` paru actually reads, which on a machine with a user config is +`~/.config/paru/paru.conf`; step 4 says how to tell: + +```ini +[aur-pins] +Path = /var/lib/repo/aur-pins +``` + +`Path` takes a plain filesystem path, not a `file://` URL. The distinction matters: `Path` reads +the directory directly, so an edit or a checkout is visible to the next paru invocation and there +is no review step, whilst `Url` treats the target as a git remote to clone and refresh on +`paru -Sya`. For a directory being hand-curated on the same machine, `Path` is the one that +behaves as expected. + +## 4. Allow paru to act on PKGBUILD repos + +**This is the step that is silent when skipped.** A config carrying `AurOnly` restricts paru to +the AUR, and a PKGBUILD repo is not the AUR, so the section declared in step 3 is ignored +entirely. There is no warning; `paru -Si` simply keeps answering with the AUR's version, which +reads exactly like the pin not having been written. + +The setting lives in the same `[options]` section the rest of the general configuration is in, +which paru reads from `$PARU_CONF`, then `$XDG_CONFIG_HOME/paru/paru.conf`, then +`~/.config/paru/paru.conf`, then `/etc/paru.conf`. **Only the first of those that exists is +read**, so a user config masks the system one completely rather than extending it, and `AurOnly` +has to be dealt with wherever it actually sits: + +```bash +grep -rn 'AurOnly\|^Mode' ~/.config/paru/paru.conf /etc/paru.conf +``` + +Edit that file, replacing the `AurOnly` line under `[options]` with the mode list that includes +both: + +```ini +[options] +Mode = aur pkgbuilds +``` + +The `[aur-pins]` section from step 3 goes at the end of the same file, after every `[options]` +key. An ini section runs until the next header, so a `Mode` line written below `[aur-pins]` is +read as a setting of the PKGBUILD repo rather than a general option. + +**The separator is whitespace, not a comma**, though `paru.conf(5)` writes the values as +`aur|repo|pkgbuilds` and invites the comma that every other list-valued setting takes. +`Mode = aur,pkgbuilds` fails with `unknown mode aur,pkgbuilds`, which at least fails loudly. + +Omitting `repo` preserves what `AurOnly` was doing: a `paru` sysupgrade still leaves repository +packages alone, which is the right division on a machine where arch-update owns those. + +## 5. Check it, install, and unpin later + +```bash +paru -Si virtualbox-ext-oracle +``` + +The pin is working when `Repository` reads `aur-pins`, the version is the pinned one, and a +`Path` line appears at the foot of the output pointing into the repo: + +```text +Repository : aur-pins +Name : virtualbox-ext-oracle +Version : 7.2.16-1 +Depends On : virtualbox=7.2.16 +Path : /var/lib/repo/aur-pins/virtualbox-ext-oracle +``` + +`paru -S virtualbox-ext-oracle` then resolves and builds normally. Because paru sees 7.2.16 as +the latest version in existence, the package is also not offered for upgrade, so nothing needs +adding to `IgnorePkg` and arch-update stops reporting it as pending. + +When the distribution catches up, move the checkout forward: + +```bash +git -C /var/lib/repo/aur-pins/virtualbox-ext-oracle checkout master +``` + +Or delete the directory, which hands the package back to the AUR. Leaving a stale pin in place is +the failure mode to watch for, since a pin is invisible once it stops being the thing blocking +an install, and silently holding a package a year behind is not what it was for. + +## What this does not fix + +**The pin applies to one machine and one helper.** pacman knows nothing about it, so a +`pacman -Syu` that wants to upgrade `virtualbox` past the pinned extension pack still reports a +dependency conflict, and the answer there is still to remove the extension pack, upgrade, and +reinstall from the pin. + +**An old version is an old version.** For `virtualbox-ext-oracle` the content is a binary blob +from Oracle and holding it back alongside a matching VirtualBox is exactly what upstream asks +for, so the pin costs nothing. For a package carrying security fixes, the same mechanism quietly +declines them, and the pin is then a decision to be revisited rather than a fix. diff --git a/docs/log.md b/docs/log.md index c5b9e2e..43249c1 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-10-27 + +- add guide, "Pin an AUR package to an older version with a paru PKGBUILD repo", on checking the matching commit into a local repo that masks the AUR, and the Mode setting that makes the pin a no-op + ## 2026-10-26 - add guide, "Add Scaleway as an opencode provider", on enabling the provider with one API key and pinning every oh-my-openagent slot from a catalogue measured with real inference calls From 15b5bd1a71b646176438feba6303679cbe248798 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Wed, 28 Oct 2026 13:51:13 +0100 Subject: [PATCH 03/25] Name keyring service attributes after the tool, not the server --- ...a_cli_from_the_keyring_with_a_path_shim.md | 36 +++++++++++++++++-- docs/log.md | 7 ++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/docs/guides/authenticate_a_cli_from_the_keyring_with_a_path_shim.md b/docs/guides/authenticate_a_cli_from_the_keyring_with_a_path_shim.md index ea809d0..73ffcdb 100644 --- a/docs/guides/authenticate_a_cli_from_the_keyring_with_a_path_shim.md +++ b/docs/guides/authenticate_a_cli_from_the_keyring_with_a_path_shim.md @@ -33,13 +33,45 @@ KWallet. GNOME Keyring answers the same interface. ## 1. Put the secret in the keyring ```bash -secret-tool store --label='Jira API token' service jira account felix.schindler@example.com +secret-tool store --label='jira-cli API token' service jira-cli-ankitpokhrel account felix.schindler@example.com ``` It reads the value from stdin and prints nothing. The attribute pairs after the label are arbitrary, and they are also the lookup key, so whatever is chosen here has to be repeated verbatim in step 2. +### Name the attributes after the tool, not after what it talks to + +`service jira` is the obvious spelling and it is the wrong one. It describes the far end, and +the far end is shared: [jira-cli](https://github.com/ankitpokhrel/jira-cli) and +[fjira](https://github.com/mk-5/fjira) are different programs by different authors against the +same Jira. The second one set up this way either collides with the first entry or quietly +reuses its token, and nothing in the command says which happened. + +A shared token is the part that costs something later. Revoking it takes down a tool nobody was +thinking about, which is the pressure that ends in it not being revoked at all, and Atlassian's +per-token last-used column stops being able to say which program made a call. + +The form that cannot collide is the repository: `-`, for `github.com//`. +So `jira-cli-ankitpokhrel` here, and `fjira-mk-5` for the other one. It is ugly, and it is +unambiguous across every tool that will ever be stored this way, which is the right trade for a +string that is never typed outside a shim. One tool, one entry, one token that can be revoked +on its own. + +Renaming an entry that already exists is two commands, because libsecret has no rename. Store +it again under the new attributes, reading the old value straight out of the keyring, then clear +the old one: + +```bash +secret-tool lookup service jira account felix.schindler@example.com | + secret-tool store --label='jira-cli API token' service jira-cli-ankitpokhrel account felix.schindler@example.com +secret-tool clear service jira account felix.schindler@example.com +``` + +`lookup` prints the secret with no trailing newline, which is what makes the pipe safe; a token +retyped by hand is the version that acquires one. Clear only after the shim has been pointed at +the new attributes and run once, since `clear` deletes without confirming. + ## 2. Write the shim ```bash @@ -48,7 +80,7 @@ cat > ~/.local/bin/jira <<'EOF' #!/bin/bash # jira-cli reads its token only from JIRA_API_TOKEN. Fetch it from the keyring for the # duration of this one process rather than exporting it into every shell. -export JIRA_API_TOKEN="$(secret-tool lookup service jira account felix.schindler@example.com)" +export JIRA_API_TOKEN="$(secret-tool lookup service jira-cli-ankitpokhrel account felix.schindler@example.com)" exec /usr/bin/jira "$@" EOF chmod +x ~/.local/bin/jira diff --git a/docs/log.md b/docs/log.md index 43249c1..d70fd0f 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,12 @@ # Log +## 2026-10-28 + +- added a naming rule to the guide "Authenticate a CLI from the keyring with a PATH shim": the + `service` attribute names the tool as `-` from its repository rather than the + service it talks to, with the two-command form for renaming an entry that already exists. + Updated every example to `jira-cli-ankitpokhrel` + ## 2026-10-27 - add guide, "Pin an AUR package to an older version with a paru PKGBUILD repo", on checking the matching commit into a local repo that masks the AUR, and the Mode setting that makes the pin a no-op From 30f3e10697da68d88b044a0d4fbeafe369c92523 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 29 Oct 2026 11:57:50 +0100 Subject: [PATCH 04/25] add finding on a phantom touch pinning the pointer to the system tray --- ...pointer_to_one_point_in_the_system_tray.md | 139 ++++++++++++++++++ docs/findings/index.md | 1 + docs/log.md | 4 + 3 files changed, 144 insertions(+) create mode 100644 docs/findings/20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md diff --git a/docs/findings/20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md b/docs/findings/20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md new file mode 100644 index 0000000..dfa57de --- /dev/null +++ b/docs/findings/20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md @@ -0,0 +1,139 @@ +--- +type: Finding +title: A phantom touch pins the pointer to one point in the system tray +description: A touchscreen contact that never lifts holds the pointer at a fixed coordinate, and + because the device reports absolute positions, every attempt to move the mouse away is undone + by the next report. +tags: +- finding +- linux +- kde +- plasma +- x11 +- input +- libinput +- touchscreen +status: stable +stale_after: '2027-10-29' +generated: + by: opencode/claude-opus-5 + at: '2026-10-29T10:58:00Z' +--- +The pointer sits in one corner of the screen, jitters by a few pixels, and returns there within +a moment of being moved anywhere else. Nothing is wrong with the mouse. The laptop's touchscreen +is reporting a contact that never lifted, and an absolute device does not nudge the pointer, it +states where the pointer is. + +Observed on a [Dell Precision 5470](../hardware/dell_precision_5470.md) under Plasma 6.7.4 on +X11, with libinput 1.31.3 and xf86-input-libinput 1.5.0. + +## Symptom + +The pointer cannot be kept away from a single point, which on a 2560x1600 panel was the task +area of the system tray at the top right. Moving the mouse works for as long as the hand keeps +moving, and the pointer snaps back as soon as it stops. + +Sampling the position shows the destination is stable and the jitter is small: + +```bash +$ for i in 1 2 3; do xdotool getmouselocation; sleep 0.7; done +x:2054 y:0 screen:0 window:27263026 +x:2056 y:0 screen:0 window:27263026 +x:2048 y:0 screen:0 window:27263026 +``` + +A few pixels of movement with no input is the tell that something is still reporting, rather +than the pointer having been parked somewhere and left. + +## Cause + +The touchscreen is held in proximity with a contact that was never released. `xinput +query-state` on the touch device shows it, and keeps showing it: + +```bash +$ xinput query-state 16 | grep -E 'Proximity|valuator\[0\]|valuator\[1\]' +ValuatorClass Mode=Absolute Proximity=In valuator[0]=52612 valuator[1]=8 +ValuatorClass Mode=Absolute Proximity=In valuator[0]=52639 valuator[1]=8 +ValuatorClass Mode=Absolute Proximity=In valuator[0]=52504 valuator[1]=8 +``` + +`Proximity=In` that never becomes `Out` is the whole finding. X is being told a finger is on the +glass, continuously, and the small variation in the first valuator is sensor noise under that +stuck contact rather than anything moving. + +**Mode=Absolute is why it fights back rather than drifting.** Both touch axes run 0 to 65535 +across the panel, so each report asserts a position outright: + +```bash +$ xinput list 16 + Label: Abs MT Position X Range: 0.000000 - 65535.000000 Current value: 52547.500207 + Label: Abs MT Position Y Range: 0.000000 - 65535.000000 Current value: 8.690492 +``` + +Scaling those against the panel gives `52547/65535 x 2560 = 2052` and `9/65535 x 1600 = 0`, +which is the position the pointer was measured at. A relative device with a stuck button would +leave the pointer wherever it was last pushed; an absolute one restores its own coordinate every +report, so moving the mouse away is a change the next report simply overwrites. + +**The destination means nothing.** Landing on the system tray invites a search through panel +widgets and tray applets, and the coordinate is just wherever the contact happened to be. The +same fault anywhere else on the glass reads as a different bug. + +## Finding the device + +Only one pointer device needs to be wrong, so check each in turn and look for the one in +absolute mode with buttons up: + +```bash +xinput list +xinput query-state +``` + +A mouse and a touchpad in this state report all buttons `up` and no valuator activity, which +clears them in one line each. On this machine the digitiser presents as two devices, a pen and a +finger, and only the finger was at fault; the pen is a separate device and a separate id. + +## Fix + +Disable the device: + +```bash +xinput disable 16 +``` + +The pointer is usable immediately, and the device drops to `floating slave` with `Device +Enabled` at 0. Confirm it with a move that is supposed to stick: + +```bash +$ xdotool mousemove 800 600; sleep 1.2; xdotool getmouselocation +x:800 y:600 screen:0 window:92274728 +``` + +Pen, touchpad and mouse are unaffected. Touch input is gone until the device is enabled again, +which is the entire cost. + +**This does not survive the session, and that is the useful part.** `xinput` changes live in the +running X server, so a logout or a reboot brings the touchscreen back enabled. A latched contact +does not generally survive a reboot either, so the default behaviour is the wanted one: the fix +lasts exactly as long as the fault usually does, and nothing has to be remembered and undone +later. Making it persistent, through a libinput quirk or a udev rule, would turn a transient +fault into a permanently disabled touchscreen. + +`xinput enable 16` is the thing to try first when the call or the task is over. If the ghost +returns at once the contact is still latched in the hardware, and rebinding the hid driver for +the device clears it without a reboot. + +## What it is not + +An undock is a plausible trigger, since lifting the machine off a dock flexes the chassis and +disturbs the i2c-hid digitiser, and the journal dates the dock teardown a few minutes before the +symptom. It is not the mechanism, though, and it is a different fault from +[Chromium maximising to the wrong size after an undock](20260930_chromium_maximises_to_the_wrong_size_after_an_undock.md), +which is about a process carrying a model of a display that no longer exists. Nothing here +involves a display, a window or a toolkit, and no application restart touches it. + +Recently installed software is the other place the search goes, because a cursor behaving oddly +feels like something new taking control of it. An application cannot hold the pointer at a +coordinate this way, and the evidence against it is in the device state rather than in any +process: a stuck `Proximity=In` is a report arriving at the X server, from below everything a +desktop application can reach. diff --git a/docs/findings/index.md b/docs/findings/index.md index 717fde4..25f1e16 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -22,6 +22,7 @@ And the subject lives in the tags rather than in a directory, per ### October +- 2026-10-29: [A phantom touch pins the pointer to one point in the system tray](20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md) - a touchscreen contact that never lifts, and why an absolute device undoes every attempt to move the mouse away - 2026-10-20: [uvx --from silently runs the system binary when the package ships no executable](20261020_uvx_from_silently_runs_the_system_binary_when_the_package_ships_no_executable.md) - a download, an install and a plausible version, none of which came from the package - 2026-10-20: [Bun's auto-install ignores the version pinned in package.json](20261020_bun_auto_install_ignores_the_version_pinned_in_package_json.md) - the clean working directory that costs the pin, and why a skill is better off keeping its node_modules - 2026-10-15: [A tag pushed after its commit is rejected as missing necessary objects](20261015_a_tag_pushed_after_its_commit_is_rejected_as_missing_necessary_objects.md) - a second push carrying the tag alone, and the release that stopped half way with a version number spent diff --git a/docs/log.md b/docs/log.md index d70fd0f..6d232f0 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-10-29 + +- add finding, "A phantom touch pins the pointer to one point in the system tray", on a touchscreen contact that never lifts and the absolute reporting that makes the pointer snap back + ## 2026-10-28 - added a naming rule to the guide "Authenticate a CLI from the keyring with a PATH shim": the From 05d68a765c5bafd9a4525d7f6511b6cfcadcc4f4 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Fri, 30 Oct 2026 09:24:15 +0100 Subject: [PATCH 05/25] Add tool page for wshm --- docs/log.md | 4 ++ docs/tools/index.md | 1 + docs/tools/wshm.md | 140 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 docs/tools/wshm.md diff --git a/docs/log.md b/docs/log.md index 6d232f0..65ae4e9 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-10-30 + +- add tool page, "wshm", on the self-hosted repo agent: what its Apache-2.0 edition triages and scores, which advertised features are paid or unimplemented, and the three shapes it runs in + ## 2026-10-29 - add finding, "A phantom touch pins the pointer to one point in the system tray", on a touchscreen contact that never lifts and the absolute reporting that makes the pointer snap back diff --git a/docs/tools/index.md b/docs/tools/index.md index c542cc8..e5b38c7 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -21,6 +21,7 @@ behind them: they keep their plain name, because `uv` is Astral's and will not b - [project-wiki (giodra96)](project_wiki_giodra96.md) - the LLM wiki pattern aimed at a repository rather than a person, with a closed taxonomy of requirements, decisions and traceability - [uv](uv.md) - the Python manager under everything here, and the manifest-versus-lockfile split several principles turn on - [Dependabot](dependabot.md) - the update bot, and the three different things that share its name +- [wshm](wshm.md) - the self-hosted repo agent whose free edition triages and scores, and whose review, auto-fix and merge are sold separately or not written yet - [opencode](opencode.md) - the terminal agent that writes most of these pages, and the one-directory-per-provider config my own setup is built from - [oh-my-openagent (YeonGyu-Kim)](oh_my_openagent_yeongyu.md) - the plugin that gives opencode its agents and skills, the three editions it grew into, and the opencode 2.x break that stops it loading - [OpenChamber](openchamber.md) - the desktop, web and mobile workspace that drives an opencode server rather than replacing it, and what adopting it would and would not change here diff --git a/docs/tools/wshm.md b/docs/tools/wshm.md new file mode 100644 index 0000000..692989c --- /dev/null +++ b/docs/tools/wshm.md @@ -0,0 +1,140 @@ +--- +type: Tool +title: wshm +description: A self-hosted repository agent in one Rust binary, whose open-source edition triages + issues and scores pull requests whilst the review and auto-fix it advertises are sold separately. +tags: +- tools +- ai-agents +- self-hosted +- ci-cd +- github +status: stable +generated: + by: opencode/claude-opus-5 + at: '2026-10-30T00:00:00Z' +sources: +- id: wshm-repo + resource: https://github.com/wshm-dev/wshm + title: 'wshm-dev/wshm: repository' + last_modified: '2026-10-30' +- id: wshm-readme + resource: https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/README.md + title: 'wshm-dev/wshm: README at e5e7296' + last_modified: '2026-10-21' +- id: wshm-pro-hooks + resource: https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/src/pro_hooks.rs + title: 'wshm-dev/wshm: src/pro_hooks.rs at e5e7296' + last_modified: '2026-10-21' +- id: wshm-merge-queue + resource: https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/src/pipelines/merge_queue.rs + title: 'wshm-dev/wshm: src/pipelines/merge_queue.rs at e5e7296' + last_modified: '2026-10-21' +- id: wshm-config + resource: https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/docs/configuration.md + title: 'wshm-dev/wshm: configuration reference at e5e7296' + last_modified: '2026-10-21' +- id: wshm-daemon + resource: https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/docs/daemon.md + title: 'wshm-dev/wshm: daemon guide at e5e7296' + last_modified: '2026-10-21' +--- +wshm[^wshm-repo] is a repository agent that runs on your own machine: it fetches a forge's +issues and pull requests into a local database, classifies them with a model you point it at, +and can write labels and comments back. It ships as one Rust binary under Apache-2.0, and it +covers GitHub, GitLab, Gitea and Azure DevOps rather than GitHub alone. + +It is open-core. The repository is the free edition, and a paid edition registers extra +behaviour into it at startup. Which half a given feature lives in is the thing to establish +before planning anything around it. + +| | | +| --- | --- | +| Author | `wshm-dev`, with one account carrying almost all commits | +| Licence | Apache-2.0 | +| Language | Rust | +| Version | 0.32.0, released 21 October 2026; first commit 10 April 2026 | +| Distribution | Release binaries, Debian packages, a multi-architecture Docker image | +| Storage | SQLite by default, PostgreSQL as an alternative | +| Source | [github.com/wshm-dev/wshm](https://github.com/wshm-dev/wshm) | + +## What the free edition does + +Four things, and they are all read-then-annotate rather than write-code. + +**Sync** pulls issues and pull requests into a local SQLite file. Everything else reads from +that, so the agent works against a snapshot rather than the live API. + +**Issue triage** classifies an issue by kind, priority and confidence, and can apply labels and +a comment. It declines to close an issue it classified `wontfix`, on the grounds that the +classification is attacker-influenced text, but it does close one it classified as a duplicate +when given a target. + +**Pull request analysis** produces a risk level, a type, a summary and a review checklist, and +can label by them. This is a verdict about the pull request, not a reading of the diff. + +**Merge queue** scores open pull requests and ranks them. + +## What is sold separately + +The split matters because the names overlap with the free features and the marketing does not +always separate them. Line-by-line review of a diff, auto-fix that generates a pull request +from an issue, AI conflict resolution, changelog generation and the chat integrations are all +in the paid edition.[^wshm-readme] + +The mechanism is a hook registry whose own first comment states the position: "In the OSS +build, all hooks are None (no-op)."[^wshm-pro-hooks] The free binary therefore contains the +configuration keys for these features and the call sites that would invoke them, and does +nothing when asked. Setting `auto_fix = true` in a config file is accepted and has no effect. + +One claim is weaker still. The free feature list advertises the merge queue as "scoring, +auto-merge above threshold", and the queue does score. The merge is a `println!` behind +`// TODO: actual merge via GitHub API`, which prints "Warning: Merge not yet implemented. +Coming in M4."[^wshm-merge-queue] Nothing is merged, with `--apply` or without it. + +## How it runs + +Three shapes, and only the third needs anything reachable from outside. + +**One-shot CLI.** `wshm sync`, `wshm triage`, `wshm pr analyze`, or `wshm run` for the whole +cycle. Outbound network only. Mutating actions require `--apply`; without it every command is +a dry run, which makes the first evaluation cheap and safe. + +**Polling daemon.** `wshm daemon --poll --no-server` holds several repositories and polls each +on an interval. Still outbound only, and this is the shape that suits a laptop or a box behind +NAT. + +**Webhook daemon.** A `POST /webhook` receiver that GitHub delivers to, which needs a public +URL or a relay. Deliveries are HMAC-verified and rejected when no secret is set, unless an +override is enabled.[^wshm-daemon] + +Configuration is TOML: `.wshm/config.toml` per repository, `~/.wshm/global.toml` for the daemon +and its repository list.[^wshm-config] Credentials stay out of both, supplied as environment +variables or through an encrypted secret store. GitHub authentication takes either a personal +token or a GitHub App installation, the App preferred where configured. + +Per-repository daemon features default off. `collect_issues` and `collect_prs` are the only +things a fresh daemon does; `triage_issues`, `analyze_prs`, `auto_pr` and `auto_merge` each +have to be turned on by name. A legacy `apply = true` switches on several at once, which is the +one setting worth not reaching for. + +## Models + +Fourteen providers, including Anthropic, OpenAI, Google, Mistral, Groq, DeepSeek and xAI, plus +Ollama for a local model and a `custom` provider that takes any OpenAI-compatible `base_url`. +Azure OpenAI is handled separately. Keys come from the provider's usual environment variable. + +## What to know before adopting it + +The project is six months old, has two listed contributors with one of them at two commits, and +carries no changelog. That is a thin base for something holding a write-capable forge token. + +Two defaults are documented inconsistently with the source. The daemon guide calls polling the +default whilst the config field defaults to false, and the bind address is `127.0.0.1:3000` in +the config but `0.0.0.0:3000` in the CLI flag's own comment. Set `--poll` and `--bind` +explicitly rather than inheriting either. + +The GitHub Action is planned rather than shipped, so the deployment is a daemon or a cron job +you run, not a workflow you add. Where the question is review on a pull request inside CI, the +free edition answers none of it, and [opencode](opencode.md)'s own GitHub action is the thing +that does. From 80f0048b42b092853623d405ff828a6124136d17 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Fri, 30 Oct 2026 09:28:26 +0100 Subject: [PATCH 06/25] Add finding on wshm's open-core split, and link it from the tool page --- ...ngs_its_open_source_build_never_acts_on.md | 80 +++++++++++++++++++ docs/findings/index.md | 1 + docs/log.md | 1 + docs/tools/wshm.md | 4 +- 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 docs/findings/20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md diff --git a/docs/findings/20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md b/docs/findings/20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md new file mode 100644 index 0000000..a86968c --- /dev/null +++ b/docs/findings/20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md @@ -0,0 +1,80 @@ +--- +type: Finding +title: wshm accepts auto_fix and auto-merge settings that its open-source build never acts on +description: The features the landing page leads with are either sold separately or not written yet, + and the free binary takes their configuration keys without complaint and does nothing. +tags: +- finding +- wshm +- ai-agents +- self-hosted +- ci-cd +status: stable +stale_after: '2027-04-30' +generated: + by: opencode/claude-opus-5 + at: '2026-10-30T00:00:00Z' +--- +[wshm](../tools/wshm.md) is advertised as issue triage, PR review, auto-fix, merge queue and +conflict resolution in one self-hosted Apache-2.0 binary. Evaluating it as a repository agent, +the first four words of that list hold and the rest do not. + +`auto_fix = true` in `.wshm/config.toml` is valid configuration. The free binary parses it, +reaches the call site, finds no implementation registered, and carries on. Nothing in the +config layer rejects the key, because the key is real; only the behaviour behind it is absent. + +The mechanism is a hook registry whose own opening comment states it plainly: + +```rust +//! Pro hooks registry — injected at startup by wshm-pro. +//! In the OSS build, all hooks are None (no-op). +``` + +Line-by-line PR review, auto-fix, AI conflict resolution and changelog generation are all +registered through that registry, so all four are inert in the repository you can clone. + +## The merge queue is a third case + +Worth separating, because it is not an edition split. The free feature list advertises the +merge queue as "scoring, auto-merge above threshold", and no paid edition is implied. The +scoring is real. The merge is this: + +```rust +// TODO: actual merge via GitHub API +println!("Warning: Merge not yet implemented. Coming in M4."); +``` + +So the queue ranks pull requests and then declines to act, with `--apply` or without it. A +feature can be missing here for either of two reasons, and the README's edition table only +documents one of them. + +## How to check this quickly on an open-core tool + +**Read the gate, not the feature list.** A project that sells a layer on top of its own +open-source core has to have one file where the split is decided, and that file is both short +and honest in a way the README is not obliged to be. Here it is +[`src/pro_hooks.rs`](https://github.com/wshm-dev/wshm/blob/e5e7296215ee4320529c9b791f865086df77a8b0/src/pro_hooks.rs), +and it answered the question faster than the documentation did. + +The second check is to grep the pipeline for the verb. `merge_queue.rs` contains no call that +merges anything, which takes a moment to establish and does not depend on trusting any prose. + +A configuration key is not evidence that a feature exists. It is evidence that a struct field +exists, and in an open-core project those two things are deliberately decoupled so that one +config file serves both editions. + +## The verdict for these repositories + +Not adopted. The free edition classifies issues and labels them, and +[federated-agent-kits](../tools/federated_agent_kits_schindler.md) has no inbound issues to +classify: every issue on it was filed by its own author. What it does have is a queue of +dependency pull requests nobody merges, which is the one thing the free queue explicitly +cannot do. + +That leaves a daemon holding a write-capable forge token in exchange for labelling your own +issues, against a project six months old with one substantive contributor and no changelog. +The work that wanted an agent here is PR-shaped and already runs in CI, which is +[opencode](../tools/opencode.md)'s GitHub action rather than a service to host. + +Reconsider if the repositories start taking outside traffic, since triage against a backlog +somebody else wrote is the case the free edition is actually built for. diff --git a/docs/findings/index.md b/docs/findings/index.md index 25f1e16..fc74a4a 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -22,6 +22,7 @@ And the subject lives in the tags rather than in a directory, per ### October +- 2026-10-30: [wshm accepts auto_fix and auto-merge settings that its open-source build never acts on](20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md) - the hook registry that decides an open-core split, and the queue that ranks pull requests and then declines to merge one - 2026-10-29: [A phantom touch pins the pointer to one point in the system tray](20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md) - a touchscreen contact that never lifts, and why an absolute device undoes every attempt to move the mouse away - 2026-10-20: [uvx --from silently runs the system binary when the package ships no executable](20261020_uvx_from_silently_runs_the_system_binary_when_the_package_ships_no_executable.md) - a download, an install and a plausible version, none of which came from the package - 2026-10-20: [Bun's auto-install ignores the version pinned in package.json](20261020_bun_auto_install_ignores_the_version_pinned_in_package_json.md) - the clean working directory that costs the pin, and why a skill is better off keeping its node_modules diff --git a/docs/log.md b/docs/log.md index 65ae4e9..e97a3eb 100644 --- a/docs/log.md +++ b/docs/log.md @@ -3,6 +3,7 @@ ## 2026-10-30 - add tool page, "wshm", on the self-hosted repo agent: what its Apache-2.0 edition triages and scores, which advertised features are paid or unimplemented, and the three shapes it runs in +- add finding, "wshm accepts auto_fix and auto-merge settings that its open-source build never acts on", carrying the verdict against adopting it and the way to read an open-core split. Linked from the wshm tool page ## 2026-10-29 diff --git a/docs/tools/wshm.md b/docs/tools/wshm.md index 692989c..7d41c17 100644 --- a/docs/tools/wshm.md +++ b/docs/tools/wshm.md @@ -85,7 +85,9 @@ in the paid edition.[^wshm-readme] The mechanism is a hook registry whose own first comment states the position: "In the OSS build, all hooks are None (no-op)."[^wshm-pro-hooks] The free binary therefore contains the configuration keys for these features and the call sites that would invoke them, and does -nothing when asked. Setting `auto_fix = true` in a config file is accepted and has no effect. +nothing when asked. Setting `auto_fix = true` in a config file is accepted and has no effect, +which is the subject of +[a finding on reading an open-core split](../findings/20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md). One claim is weaker still. The free feature list advertises the merge queue as "scoring, auto-merge above threshold", and the queue does score. The merge is a `println!` behind From abc46e8b3853f74e9f58b6426225e1920af99f1f Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 10 Nov 2026 11:02:07 +0100 Subject: [PATCH 07/25] Add rootless Docker tool page, two findings on disk space and Compose volumes, and a guide to capping the build cache --- ...ainer_leaves_rootless_docker_using_100g.md | 85 +++++++++++++++ ...ompose_database_while_the_stack_is_down.md | 68 ++++++++++++ docs/findings/index.md | 5 + ...e_docker_build_cache_on_rootless_docker.md | 101 ++++++++++++++++++ docs/guides/index.md | 1 + docs/log.md | 7 ++ docs/tools/docker.md | 75 +++++++++++++ docs/tools/index.md | 1 + 8 files changed, 343 insertions(+) create mode 100644 docs/findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md create mode 100644 docs/findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md create mode 100644 docs/guides/cap_the_docker_build_cache_on_rootless_docker.md create mode 100644 docs/tools/docker.md diff --git a/docs/findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md b/docs/findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md new file mode 100644 index 0000000..98b01d3 --- /dev/null +++ b/docs/findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md @@ -0,0 +1,85 @@ +--- +type: Finding +title: Deleting every image and container leaves rootless Docker using 100 GB +description: docker images and docker ps both come back empty whilst ~/.local/share/docker still + holds 100 GB, because the BuildKit build cache and untagged images are counted separately and + neither listing shows them. +tags: +- finding +- docker +- rootless +- linux +- arch +- disk-space +status: stable +stale_after: '2027-05-10' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-10T11:30:00+01:00' +sources: +- id: archwiki-images-location + resource: https://wiki.archlinux.org/title/Docker#Images_location + title: 'ArchWiki: Docker, Images location' + last_modified: '2026-11-10' +- id: archwiki-rootless + resource: https://wiki.archlinux.org/title/Docker#Rootless_Docker_daemon + title: 'ArchWiki: Docker, Rootless Docker daemon' + last_modified: '2026-11-10' +- id: docker-containerd-store + resource: https://docs.docker.com/engine/storage/containerd/ + title: 'Docker docs: containerd image store' + last_modified: '2026-11-10' +--- +**Versions**: [Docker](../tools/docker.md) 29.7.2 in rootless mode on Manjaro, through +`docker-rootless-extras` from the AUR[^archwiki-rootless], using the containerd image store. + +## The symptom + +`~/.local/share/docker` measured 100 GB. Every container had been removed, and `docker images` +listed nothing worth keeping, so there was apparently nothing left to delete. + +## What it was + +`du` placed 92 GB under `containerd/daemon` and 8 GB under `volumes/`. `docker system df -v` +accounted for the rest: + +| What | Size | Shown by `docker images` / `docker ps -a` | +| --- | --- | --- | +| BuildKit build cache | 73.7 GB | no | +| Five untagged `` images, three of about 10 GB each | about 33 GB, sharing layers with the cache | only with `-a`, and easy to read past | +| Volumes, mostly left behind by `act` runs of GitHub workflows | 8.1 GB | no | + +The figures overlap, which is why they add up to more than the directory. Removing images and +containers removes what those two commands list, and nothing else: the build cache belongs to +BuildKit, not to any image, and survives every `docker rmi`. + +The location adds to the confusion. Since Docker 29, a new install uses the containerd image +store[^docker-containerd-store], as the ArchWiki also notes[^archwiki-images-location], so the layers sit under +`containerd/daemon/io.containerd.snapshotter.v1.overlayfs` rather than the `overlay2/` that most +advice about Docker disk usage tells you to look in. `docker info -f '{{ .DriverStatus }}'` +prints `[[driver-type io.containerd.snapshotter.v1]]` when this is the case. + +## How to tell + +```sh +du -xh --max-depth=2 ~/.local/share/docker | sort -rh | head +docker system df -v +``` + +The second command is the one that names each consumer. Its `Build Cache` line is the first +place to look. + +## How to get past it + +```sh +docker builder prune -a # the build cache +docker image prune -a # untagged and unused images +``` + +Leave volumes to a separate, named `docker volume rm`. A blanket prune deletes the database of +every Compose stack that is currently down, as +[docker volume prune -a deletes a Compose database while the stack is down](20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) +explains. + +To keep the cache from growing back, give BuildKit a size limit: +[Cap the Docker build cache on rootless Docker](../guides/cap_the_docker_build_cache_on_rootless_docker.md). diff --git a/docs/findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md b/docs/findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md new file mode 100644 index 0000000..466de16 --- /dev/null +++ b/docs/findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md @@ -0,0 +1,68 @@ +--- +type: Finding +title: docker volume prune -a deletes a Compose database while the stack is down +description: A stopped Compose stack leaves its named volumes attached to no container, so a + blanket volume prune treats the database as unused, and a worktree in another directory gets + volumes of its own rather than sharing the main checkout's. +tags: +- finding +- docker +- docker-compose +- data-loss +- git-worktree +status: stable +stale_after: '2027-05-10' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-10T11:30:00+01:00' +sources: +- id: compose-project-name + resource: https://docs.docker.com/compose/how-tos/project-name/ + title: 'Docker docs: Specify a project name' + last_modified: '2026-11-10' +- id: archwiki-compose + resource: https://wiki.archlinux.org/title/Docker#Docker_Compose + title: 'ArchWiki: Docker, Docker Compose' + last_modified: '2026-11-10' +--- +**Versions**: [Docker](../tools/docker.md) 29.7.2 and Docker Compose 5.5.1, from the Arch +`docker-compose` package[^archwiki-compose]. + +## The symptom + +Clearing out a Docker data directory, `docker system df -v` listed 18 volumes, every one of them +with `LINKS 0`. Among them were two Postgres volumes holding real data, from a project whose +stack simply was not running at the time. + +## What it was + +Compose names a volume `_`, and the project name defaults to the name of the +directory holding the compose file[^compose-project-name]. A compose file in `~/Projects/myapp` +that declares `myapp_db:` creates the volume `myapp_myapp_db`. + +Two consequences follow from that, and neither is announced: + +- **A stack that is down has no container using its volumes.** `docker compose down` removes + the containers and keeps the volumes, so to Docker the database is exactly as unused as a + volume left behind by a throwaway CI run. `docker volume prune -a` removes both. + (Without `-a`, `prune` only removes anonymous volumes, and a Compose volume has a name.) +- **A git worktree gets its own copy of every volume.** Started from a worktree in a directory + called `feature-x`, the same compose file creates `feature-x_myapp_db`: an empty database + instead of the main checkout's data, and one more volume that outlives the worktree once the + directory is deleted. + +Bringing the stack up again in the original directory does find the old volume, by name, and +the data is still there. + +## How to get past it + +- Remove volumes one at a time with `docker volume rm `, after reading the list, rather + than with a prune. +- When a worktree should share the main checkout's data, set the project name explicitly, with + `docker compose -p myapp up` or `name: myapp` at the top of the compose file. Do this + deliberately, though: two checkouts sharing one database is not always what you want. +- When a worktree is removed, run `docker compose down -v` in it first, so its volumes go + with it. + +The disk-space problem that led to this is in +[Deleting every image and container leaves rootless Docker using 100 GB](20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md). diff --git a/docs/findings/index.md b/docs/findings/index.md index fc74a4a..a3424d6 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -20,6 +20,11 @@ And the subject lives in the tags rather than in a directory, per ## 2026 +### November + +- 2026-11-10: [docker volume prune -a deletes a Compose database while the stack is down](20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) - volumes named after the directory, a stopped stack that leaves its database unattached, and the worktree that quietly gets an empty one +- 2026-11-10: [Deleting every image and container leaves rootless Docker using 100 GB](20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md) - a build cache and untagged images that no listing shows, stored where most advice does not look + ### October - 2026-10-30: [wshm accepts auto_fix and auto-merge settings that its open-source build never acts on](20261030_wshm_accepts_auto_fix_and_auto_merge_settings_its_open_source_build_never_acts_on.md) - the hook registry that decides an open-core split, and the queue that ranks pull requests and then declines to merge one diff --git a/docs/guides/cap_the_docker_build_cache_on_rootless_docker.md b/docs/guides/cap_the_docker_build_cache_on_rootless_docker.md new file mode 100644 index 0000000..a1d0593 --- /dev/null +++ b/docs/guides/cap_the_docker_build_cache_on_rootless_docker.md @@ -0,0 +1,101 @@ +--- +type: Guide +title: Cap the Docker build cache on rootless Docker +description: Turning on BuildKit's own garbage collection with a size limit in the rootless + daemon.json, and checking the limit through buildx, since the daemon log never mentions it. +tags: +- guide +- docker +- rootless +- buildkit +- linux +- arch +- disk-space +status: stable +stale_after: '2027-05-10' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-10T11:30:00+01:00' +sources: +- id: docker-build-gc + resource: https://docs.docker.com/build/cache/garbage-collection/ + title: 'Docker docs: Build garbage collection' + last_modified: '2026-11-10' +- id: archwiki-rootless + resource: https://wiki.archlinux.org/title/Docker#Rootless_Docker_daemon + title: 'ArchWiki: Docker, Rootless Docker daemon' + last_modified: '2026-11-10' +- id: archwiki-configuration + resource: https://wiki.archlinux.org/title/Docker#Configuration + title: 'ArchWiki: Docker, Configuration' + last_modified: '2026-11-10' +--- +**Versions**: [Docker](../tools/docker.md) 29.7.2, docker-buildx 0.36.1 and +docker-rootless-extras 29.9.2, on Manjaro, November 2026. + +The BuildKit build cache has no limit worth the name by default, and it is invisible to +`docker images`. On one machine it reached 74 GB before anything noticed, which is the story in +[Deleting every image and container leaves rootless Docker using 100 GB](../findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md). +BuildKit can clean up after itself[^docker-build-gc]; it needs a size to clean up to. + +This is the Docker-native way of doing it. A systemd user timer running +`docker builder prune` would also work, but it is one more unit to maintain to reach what one +setting does. + +## 1. Find the right config file + +The ArchWiki puts the daemon configuration in `/etc/docker/daemon.json`[^archwiki-configuration]. +That is the rootful daemon. **The rootless daemon**, run as a user unit from the AUR package +`docker-rootless-extras`[^archwiki-rootless], reads `~/.config/docker/daemon.json` instead, and +ignores the one in `/etc`. Editing the wrong one does nothing, silently. + +## 2. Set the limit + +`~/.config/docker/daemon.json`: + +```json +{ + "builder": { + "gc": { + "enabled": true, + "defaultKeepStorage": "10GB" + } + } +} +``` + +If the file already exists, merge the `builder` key into it rather than replacing the file. + +## 3. Restart the user daemon + +```sh +systemctl --user restart docker +systemctl --user is-active docker +``` + +This stops every running container, as any daemon restart does. + +## 4. Check the limit was taken + +**This step is silent when skipped.** A daemon that cannot parse `daemon.json` fails to start, +which is loud. But the journal from a successful start says nothing about garbage collection at +all, so it cannot tell a limit that was applied from a file the daemon never read, such as one +written to `/etc`. `journalctl --user -u docker` shows only that nothing went wrong. + +Ask BuildKit instead: + +```sh +docker buildx inspect +``` + +The output should show `GC Policy` rules whose `Reserved Space` is `10GiB`. Without the setting +the size reflects BuildKit's default, a share of the disk rather than the number you chose. + +`docker system df` then shows the current size of the cache on its `Build Cache` line, which is +the number to watch over the next few weeks. + +## What this leaves alone + +Build cache only. Untagged images still need `docker image prune` now and then, and volumes +are deliberately out of reach of anything automatic, for the reason in +[docker volume prune -a deletes a Compose database while the stack is down](../findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md). diff --git a/docs/guides/index.md b/docs/guides/index.md index b447f8f..eb8172c 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -19,3 +19,4 @@ Conventions: - [Authenticate a CLI from the keyring with a PATH shim](authenticate_a_cli_from_the_keyring_with_a_path_shim.md) - feeding a token to a CLI that reads only the environment, and why a shell function reaches the prompt but never an agent - [Add Scaleway as an opencode provider](add_scaleway_as_an_opencode_provider.md) - one API key and a native provider block, then a pin for every oh-my-openagent slot, mapped from a catalogue measured with real inference calls - [Pin an AUR package to an older version with a paru PKGBUILD repo](pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md) - masking the AUR with a local checkout when the distribution is too far behind to satisfy an exact dependency, and the Mode setting that makes it a no-op +- [Cap the Docker build cache on rootless Docker](cap_the_docker_build_cache_on_rootless_docker.md) - one daemon.json setting in the user's config rather than /etc, and the buildx check that proves it was read diff --git a/docs/log.md b/docs/log.md index e97a3eb..3b2c98e 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,12 @@ # Log +## 2026-11-10 + +- add tool page, "Docker", on running it rootless on Arch and where its config, data and logs live when it is +- add finding, "Deleting every image and container leaves rootless Docker using 100 GB", on the build cache and untagged images that survive and where the containerd store keeps them +- add finding, "docker volume prune -a deletes a Compose database while the stack is down", on Compose volume naming, unattached volumes of stopped stacks, and worktrees getting volumes of their own +- add guide, "Cap the Docker build cache on rootless Docker", on BuildKit garbage collection in the user's daemon.json and checking it through buildx + ## 2026-10-30 - add tool page, "wshm", on the self-hosted repo agent: what its Apache-2.0 edition triages and scores, which advertised features are paid or unimplemented, and the three shapes it runs in diff --git a/docs/tools/docker.md b/docs/tools/docker.md new file mode 100644 index 0000000..3f001d5 --- /dev/null +++ b/docs/tools/docker.md @@ -0,0 +1,75 @@ +--- +type: Tool +title: Docker +description: The container engine and CLI, run here as a rootless user daemon on Arch, and where + that puts its configuration and its data. +tags: +- tools +- docker +- rootless +- containers +- linux +- arch +status: draft +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-10T11:30:00+01:00' +sources: +- id: archwiki-docker + resource: https://wiki.archlinux.org/title/Docker + title: 'ArchWiki: Docker' + last_modified: '2026-11-10' +- id: archwiki-rootless + resource: https://wiki.archlinux.org/title/Docker#Rootless_Docker_daemon + title: 'ArchWiki: Docker, Rootless Docker daemon' + last_modified: '2026-11-10' +- id: docker-rootless + resource: https://docs.docker.com/engine/security/rootless/ + title: 'Docker docs: Rootless mode' + last_modified: '2026-11-10' +--- +Docker[^archwiki-docker] builds and runs containers: a daemon, `dockerd`, that does the work, and +the `docker` CLI that asks it to. Here it runs **rootless**[^docker-rootless]: the daemon is an +ordinary process of my own user, so a container breaking out lands as me rather than as root. + +| | | +| --- | --- | +| Author | Docker, Inc., on the open-source Moby project | +| Licence | Apache-2.0 (Engine and CLI) | +| Language | Go | +| Distribution | Arch packages `docker`, `docker-buildx`, `docker-compose`; rootless mode from the AUR package `docker-rootless-extras` | +| Source | [github.com/moby/moby](https://github.com/moby/moby) | +| Version read | 29.7.2 | + +## Rootless, the Arch way + +The ArchWiki covers the setup[^archwiki-rootless]: install `docker-rootless-extras`, give the +user a subordinate UID and GID range in `/etc/subuid` and `/etc/subgid`, and enable `docker` as a +**user** unit rather than a system one. The AUR package ships those units in place of upstream's +`dockerd-rootless-setuptool.sh`. The client then needs a context or `DOCKER_HOST` pointing at +the socket under `$XDG_RUNTIME_DIR`. + +Everything that would live in a system path moves into the home directory, and most advice +written for rootful Docker points at the wrong place as a result: + +| What | Rootful | Rootless | +| --- | --- | --- | +| Daemon config | `/etc/docker/daemon.json` | `~/.config/docker/daemon.json` | +| Data | `/var/lib/docker` | `~/.local/share/docker` | +| Service | `systemctl restart docker` | `systemctl --user restart docker` | +| Logs | `journalctl -u docker` | `journalctl --user -u docker` | + +A new install of Docker 29 or later also uses the containerd image store, so even inside the +data directory the layers are under `containerd/daemon/`, not `overlay2/`. + +## What is known about it here + +- [Deleting every image and container leaves rootless Docker using 100 GB](../findings/20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md) - where the space goes once `docker images` is empty +- [docker volume prune -a deletes a Compose database while the stack is down](../findings/20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) - how Compose names volumes, and why a prune cannot tell a database from debris +- [Cap the Docker build cache on rootless Docker](../guides/cap_the_docker_build_cache_on_rootless_docker.md) - the one setting that stops the cache growing back + +## To fill in + +A draft, written so the page exists and can be linked at. Still missing: how rootless +networking differs in practice (port binding below 1024, and the slirp or pasta layer in +between), and how `act` and the VS Code dev containers behave against a rootless socket. diff --git a/docs/tools/index.md b/docs/tools/index.md index e5b38c7..7ca41b2 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -19,6 +19,7 @@ behind them: they keep their plain name, because `uv` is Astral's and will not b - [federated-knowledge-skills (Felix Schindler)](federated_knowledge_skills_schindler.md) - mine: the `fkb` skill, CLI and hooks that bind privacy-tiered bundles into a federation, and what this bundle is now written through - [federated-agent-kits (Felix Schindler)](federated_agent_kits_schindler.md) - also mine: one manifest line instead of a skill copied by hand into every harness that wants it - [project-wiki (giodra96)](project_wiki_giodra96.md) - the LLM wiki pattern aimed at a repository rather than a person, with a closed taxonomy of requirements, decisions and traceability +- [Docker](docker.md) - the container engine, run rootless as a user unit on Arch, and the table of where config, data and logs move to when it is - [uv](uv.md) - the Python manager under everything here, and the manifest-versus-lockfile split several principles turn on - [Dependabot](dependabot.md) - the update bot, and the three different things that share its name - [wshm](wshm.md) - the self-hosted repo agent whose free edition triages and scores, and whose review, auto-fix and merge are sold separately or not written yet From 98b036dfd38190e8469904c0c0b9d5e603fa8898 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:54:10 +0100 Subject: [PATCH 08/25] add tool page: Inference Manager (Canonical) --- docs/log.md | 4 ++ docs/tools/index.md | 1 + docs/tools/inference_canonical.md | 113 ++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 docs/tools/inference_canonical.md diff --git a/docs/log.md b/docs/log.md index 3b2c98e..fafafe3 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-11-16 + +- add tool page, "Inference Manager (Canonical)", on the inference CLI and proxy over Canonical's inference snaps, written from the documentation + ## 2026-11-10 - add tool page, "Docker", on running it rootless on Arch and where its config, data and logs live when it is diff --git a/docs/tools/index.md b/docs/tools/index.md index 7ca41b2..c4970aa 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -26,6 +26,7 @@ behind them: they keep their plain name, because `uv` is Astral's and will not b - [opencode](opencode.md) - the terminal agent that writes most of these pages, and the one-directory-per-provider config my own setup is built from - [oh-my-openagent (YeonGyu-Kim)](oh_my_openagent_yeongyu.md) - the plugin that gives opencode its agents and skills, the three editions it grew into, and the opencode 2.x break that stops it loading - [OpenChamber](openchamber.md) - the desktop, web and mobile workspace that drives an opencode server rather than replacing it, and what adopting it would and would not change here +- [Inference Manager (Canonical)](inference_canonical.md) - draft, from the docs: one CLI and one local OpenAI endpoint over Canonical's model-per-snap inference snaps - [markitdown](markitdown.md) - Microsoft's PDF-and-Office-to-Markdown converter, as a command and as the MCP server an agent calls - [git-ai](git_ai.md) - the git extension that records which lines an agent wrote, where it puts itself, and what that leaves behind - [linkspector](linkspector.md) - the link checker this bundle commits through, the two passes it resolves every link with, and the schema that refuses to be annotated diff --git a/docs/tools/inference_canonical.md b/docs/tools/inference_canonical.md new file mode 100644 index 0000000..0661ace --- /dev/null +++ b/docs/tools/inference_canonical.md @@ -0,0 +1,113 @@ +--- +type: Tool +title: Inference Manager (Canonical) +description: Canonical's CLI and local proxy over its inference snaps, the one-snap-per-model packages + that pick a hardware-specific engine and serve an OpenAI-compatible API on localhost. +tags: +- tools +- inference +- local-llm +- snap +- ubuntu +- openai-api +status: draft +stale_after: '2027-02-16' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-16T00:00:00Z' +sources: +- id: inference-repo + resource: https://github.com/canonical/inference + title: 'canonical/inference: Inference Manager' + last_modified: '2026-11-16' +- id: inference-snaps-repo + resource: https://github.com/canonical/inference-snaps + title: 'canonical/inference-snaps: install, run, and serve AI models as snaps' + last_modified: '2026-11-16' +- id: snaps-reference + resource: https://documentation.ubuntu.com/inference-snaps/reference/snaps/ + title: 'Inference Snaps documentation: Available snaps' + last_modified: '2026-11-16' +- id: opencode-howto + resource: https://documentation.ubuntu.com/inference-snaps/how-to/integration/opencode/ + title: 'Inference Snaps documentation: Use inference snaps in OpenCode' + last_modified: '2026-11-16' +- id: announcement + resource: https://canonical.com/blog/canonical-releases-inference-snaps + title: 'Canonical: Introducing silicon-optimized inference snaps' + last_modified: '2025-10-23' +- id: cfg-test + resource: https://computingforgeeks.com/ubuntu-inference-snaps/ + title: 'ComputingForGeeks: Ubuntu Inference Snaps Tested: Gemma 4 vs Ollama' + last_modified: '2026-11-11' +--- +The Inference Manager[^inference-repo] is one command and one local endpoint in front of +Canonical's inference snaps. The two are easy to conflate: the **inference snaps** are the +models, one snap each, and the **Inference Manager** is the `inference` snap that finds, +installs and routes to them. This page is written from the documentation; nothing here has +been run on my machines yet. + +| | | +| --- | --- | +| Author | Canonical | +| Licence | GPL-3.0 for the manager; each model snap carries its model's own licence | +| Language | Go | +| Distribution | The Snap Store, as `sudo snap install inference` | +| Source | [github.com/canonical/inference](https://github.com/canonical/inference) | +| Version read | 1.0.1, from the README and the store listing | + +## What it is + +Inference snaps arrived as a public beta in October 2025[^announcement]. A model snap bundles +several weight files and several engines, detects the hardware at install time, and selects +the pair it judges best: a generic CPU build, Intel OpenVINO, CUDA, ROCm, Vulkan, or a vendor +NPU, depending on the model[^snaps-reference]. Each snap then serves an OpenAI-compatible API +on a port of its own and runs offline once installed[^inference-snaps-repo]. The catalogue +holds about twenty models, from Gemma, Qwen, Nemotron and DeepSeek R1 to an embedding model +and two decision models. + +The manager adds the layer above that: + +| | | +| --- | --- | +| `inference find ` | Search the available providers and their capabilities | +| `inference install ` | Install a model snap | +| `inference models` | List the models reachable through the proxy | +| `inference info ` | Show a snap's endpoints, and which engine can run which model size | +| Proxy | One OpenAI-compatible endpoint, `http://127.0.0.1:8400/v1`, routing to whichever snaps are running | + +`inference info` is the useful one for understanding what a snap actually contains. For +`gemma4` it lists the proxy and the snap's own upstream port, then an engine-by-size grid: + +```text +API: http://127.0.0.1:8400/v1 (proxy) + └── http://localhost:8336/v1 (upstream) + +ENGINE gemma4-e2b gemma4-e4b gemma4-12b gemma4-26b-a4b +amd-gpu ✓ ✓ ✓ ✓ +cpu ✓ ✓ ✓ ✓ +intel-cpu ✓ +nvidia-gpu ✓ ✓ ✓ ✓ +``` + +A model's licence does not follow the manager's. Most snaps ship Apache-2.0 or MIT weights, +but not all: OpenJev, one of the decision models, is CC BY-NC 4.0, so check the snap's +store page before using one for work. + +## Why it matters here + +The point is a single stable endpoint for local models, which [opencode](opencode.md) could +take as a provider. Canonical document doing that per snap, as an `openai` provider whose +`baseURL` is the snap's endpoint and whose model name comes from ` status` +[^opencode-howto]. Pointing the provider at the manager's proxy instead would make it one +provider for every local model, and that would fit my one-directory-per-provider layout as +a profile of its own; that is untested. + +## Reported by others + +Not observed here, and kept short on purpose. One CPU-only test on Ubuntu 26.04 in November +2026 reported[^cfg-test]: + +- even the stable channel carried a `2.0.0-beta` model snap +- engine auto-selection did not always pick the fastest engine +- the Nemotron 3 Nano snap installed its 30B model on a 6 GB machine, ignoring a pinned 4B variant From daec8efc07c37befa8ae9004eaf96acc9717022a Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:56:21 +0100 Subject: [PATCH 09/25] Add Arch sudo fix to Inference Manager tool page --- docs/log.md | 1 + docs/tools/inference_canonical.md | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/log.md b/docs/log.md index fafafe3..e74605e 100644 --- a/docs/log.md +++ b/docs/log.md @@ -2,6 +2,7 @@ ## 2026-11-16 +- added a section to the tool page "Inference Manager (Canonical)" on sudo not finding snap commands on Arch, and the sudoers drop-in that fixes it - add tool page, "Inference Manager (Canonical)", on the inference CLI and proxy over Canonical's inference snaps, written from the documentation ## 2026-11-10 diff --git a/docs/tools/inference_canonical.md b/docs/tools/inference_canonical.md index 0661ace..ad7711e 100644 --- a/docs/tools/inference_canonical.md +++ b/docs/tools/inference_canonical.md @@ -40,12 +40,17 @@ sources: resource: https://computingforgeeks.com/ubuntu-inference-snaps/ title: 'ComputingForGeeks: Ubuntu Inference Snaps Tested: Gemma 4 vs Ollama' last_modified: '2026-11-11' +- id: arch-wiki-snap + resource: https://wiki.archlinux.org/title/Snap#Sudo + title: 'ArchWiki: Snap, section Sudo' + last_modified: '2026-11-16' --- The Inference Manager[^inference-repo] is one command and one local endpoint in front of Canonical's inference snaps. The two are easy to conflate: the **inference snaps** are the models, one snap each, and the **Inference Manager** is the `inference` snap that finds, -installs and routes to them. This page is written from the documentation; nothing here has -been run on my machines yet. +installs and routes to them. This page is written from the documentation; apart from +installing the manager on Arch and getting it past sudo, nothing here has been run on my +machines yet. | | | | --- | --- | @@ -103,6 +108,28 @@ take as a provider. Canonical document doing that per snap, as an `openai` provi provider for every local model, and that would fit my one-directory-per-provider layout as a profile of its own; that is untested. +## On Arch, sudo cannot find it + +Installed from the snapd AUR package, `inference` runs as my user but `sudo inference` says +the command is not found. sudo ignores the caller's `PATH` and searches its own +`secure_path`, and on Arch that list lacks `/var/lib/snapd/snap/bin`, where snaps put their +commands. Ubuntu's default sudoers adds `/snap/bin` to it, which is why the problem does not +show there. + +The fix is a sudoers drop-in, as the Arch wiki gives it[^arch-wiki-snap]. Create it with +`sudo visudo -f /etc/sudoers.d/90_snap`, so a syntax error is refused rather than locking +you out of sudo: + +```text +# Add snap binaries installation dir to PATH +Defaults: secure_path="/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin" +``` + +The snippet has to restate the whole list: a later `secure_path` replaces the earlier one, +and there is no way to append to it. `Defaults:` limits the change to one user; plain +`Defaults` applies it to everyone. `sudo env | grep ^PATH` should then end in the snap +directory. + ## Reported by others Not observed here, and kept short on purpose. One CPU-only test on Ubuntu 26.04 in November From a9c545f3bb41bd9acbcbc6185f3ba10cd3d6979b Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:24:39 +0100 Subject: [PATCH 10/25] Add Python type annotation investigation, type-checker-in-CI principle and pyMOR tool page --- docs/investigations/index.md | 1 + ...annotation_options_for_a_python_library.md | 169 ++++++++++++++++++ docs/log.md | 7 + ...config_documents_intent_not_enforcement.md | 6 + docs/principles/index.md | 1 + ..._environment_in_ci_not_an_isolated_hook.md | 104 +++++++++++ docs/tools/index.md | 1 + docs/tools/pymor.md | 45 +++++ 8 files changed, 334 insertions(+) create mode 100644 docs/investigations/type_annotation_options_for_a_python_library.md create mode 100644 docs/principles/run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md create mode 100644 docs/tools/pymor.md diff --git a/docs/investigations/index.md b/docs/investigations/index.md index 0183b40..a72e6a2 100644 --- a/docs/investigations/index.md +++ b/docs/investigations/index.md @@ -21,3 +21,4 @@ date. Where an investigation deliberately stops short of choosing, it says so. - [The deutsche-bahn agent skill: security and telemetry](deutsche_bahn_skill_security_and_telemetry.md) - what one skill from a travel toolkit runs, and what a rail operator learns from it - [Travel management skills: what is portable out of a repo-shaped toolkit](travel_management_skills_portability.md) - counting how much of a 48-skill collection survives leaving the repository it ships in - [What an MCP server can be, and who can reach one](mcp_server_entry_points_and_transports.md) - two transports, five shapes and six callers, and the two variables that decide which are reachable +- [Type annotations for a Python library: the options](type_annotation_options_for_a_python_library.md) - the syntax, checker and strictness choices a typing pull request makes without naming, with one from pyMOR placed among them diff --git a/docs/investigations/type_annotation_options_for_a_python_library.md b/docs/investigations/type_annotation_options_for_a_python_library.md new file mode 100644 index 0000000..be0aea8 --- /dev/null +++ b/docs/investigations/type_annotation_options_for_a_python_library.md @@ -0,0 +1,169 @@ +--- +type: Investigation +title: 'Type annotations for a Python library: the options' +description: The choices behind annotating a Python library - where the types live, which syntax and so + which Python floor, which checker and how strictly - with one pyMOR pull request placed among them. +tags: +- python +- typing +- type-checking +- tooling +- pymor +status: stable +stale_after: '2027-05-17' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T20:00:00+01:00' +sources: +- id: pep-604 + resource: https://peps.python.org/pep-0604/ + title: 'PEP 604: Allow writing union types as X | Y' + last_modified: '2026-11-17' +- id: pep-673 + resource: https://peps.python.org/pep-0673/ + title: 'PEP 673: Self Type' + last_modified: '2026-11-17' +- id: pep-695 + resource: https://peps.python.org/pep-0695/ + title: 'PEP 695: Type Parameter Syntax' + last_modified: '2026-11-17' +- id: pep-696 + resource: https://peps.python.org/pep-0696/ + title: 'PEP 696: Type Defaults for Type Parameters' + last_modified: '2026-11-17' +- id: pep-649 + resource: https://peps.python.org/pep-0649/ + title: 'PEP 649: Deferred Evaluation Of Annotations Using Descriptors' + last_modified: '2026-11-17' +- id: basedpyright + resource: https://github.com/DetachHead/basedpyright + title: 'DetachHead/basedpyright: README' + last_modified: '2026-11-17' +- id: ty + resource: https://github.com/astral-sh/ty + title: 'astral-sh/ty: README' + last_modified: '2026-11-17' +- id: pyrefly + resource: https://github.com/pyrefly-org/pyrefly + title: 'pyrefly-org/pyrefly: README' + last_modified: '2026-11-17' +- id: zuban + resource: https://github.com/zubanls/zuban + title: 'zubanls/zuban: README' + last_modified: '2026-11-17' +- id: pymor-2680 + resource: https://github.com/pymor/pymor/pull/2680 + title: 'pymor#2680: Add type annotations for pymor.vectorarrays' + last_modified: '2026-11-17' +--- +**Context** - an open pull request adds type annotations to [pyMOR](../tools/pymor.md)'s +`vectorarrays` package[^pymor-2680], and the question was how its approach compares with the other +ways a library can be typed. Annotating a library is several independent choices, and a pull +request makes all of them at once without naming any. This page separates them. + +The checker landscape was read from each project's README on 2026-11-17. It moves monthly, so +read that section against the `generated` date. + +## Where the types live + +**In docstrings.** A numpydoc `Parameters` section states types in prose. Readers see them; +no tool checks them. + +**Inline, in the signatures.** The mainstream choice, and the only one a checker reads against +the code it describes. + +**In separate `.pyi` stub files.** Used when the source cannot change, or must keep running on +interpreters older than the annotation syntax. The cost is a second copy of every signature, +which drifts from the first. + +## The syntax sets the Python floor + +Each Python release has added annotation syntax, and using it drops every older interpreter. + +| Python | What it adds | +| --- | --- | +| 3.10 | `X \| Y` unions at runtime[^pep-604] | +| 3.11 | `typing.Self`, for a method returning its own class[^pep-673] | +| 3.12 | `class C[T]: ...` and `type Alias = ...`, replacing `TypeVar` and `TypeAlias`[^pep-695] | +| 3.13 | Defaults for type parameters, so a bare `C` means `C[Default]`[^pep-696] | +| 3.14 | Annotations evaluated lazily, so a forward reference needs no quotes[^pep-649] | + +**The syntax is the only thing a newer floor buys.** `from __future__ import annotations`, +`TypeVar` and `typing_extensions` express the same types on 3.10, and a checker sees no +difference. Raising the floor is therefore a decision about users' interpreters, made for the +sake of shorter source. + +## Which checker + +| Checker | What distinguishes it | +| --- | --- | +| mypy | The reference implementation, with the largest plugin ecosystem; the slowest of these | +| pyright | Microsoft's, behind VS Code's Pylance; fast, and infers more than mypy does | +| basedpyright | A fork of pyright with stricter checks and Pylance's editor features[^basedpyright] | +| ty | Astral's, in Rust; in beta on `0.0.x` versions, with diagnostics that may change between any two releases[^ty] | +| pyrefly | Meta's, in Rust; declares itself stable, releases monthly, and checks NumPy and SciPy among others[^pyrefly] | +| zuban | In Rust, by the author of Jedi; offers a mypy-compatible mode, and is AGPL-3.0 or commercially licensed[^zuban] | + +Checkers disagree at the edges, so a project picks one and treats its verdict as the +definition. pyrefly's use on NumPy and SciPy matters for numerical code, because those are the +stubs such a library leans on hardest. + +Runtime checkers, beartype and typeguard among them, check values as the code runs, typically +under the test suite. Numerical code rarely uses them, because the checks sit on hot paths. + +## How strictly + +Gradual typing checks what is annotated and ignores the rest, and strictness is raised a module +at a time: mypy's `[[tool.mypy.overrides]]`, pyright's `strict` list. Two settings keep the +suppressions honest. mypy's `warn_unused_ignores` reports a `# type: ignore` that no longer +suppresses anything. Ruff's `PGH003` rejects a bare `# type: ignore` in favour of one naming the +error code, which is +[Document a rationale for every disabled lint rule](../principles/document_a_rationale_for_every_disabled_lint_rule.md) +applied to types. + +**Where the checker runs is its own decision**, and +[Run a type checker against the project environment in CI, not in an isolated hook](../principles/run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md) +makes the case for CI. + +## How an interface is typed + +**Nominally**: a class is compatible because it inherits from the interface, an abstract base +class made generic over its parts. **Structurally**: a `typing.Protocol` accepts any class with +the right methods, with no inheritance at all. Structural typing suits an interface that outside +code should satisfy without depending on the library; nominal typing costs nothing extra where +outside code subclasses the interface anyway. + +A method returning "the same kind of object" has three spellings. `Self` returns the caller's +own subclass. An explicit type parameter, `-> A`, ties the return to a parameter of the class. +The base class, `-> VectorArray`, is the loosest: correct, and silent about which subclass comes +back. + +## Arrays + +A bare `np.ndarray` names neither element type nor shape. `numpy.typing.NDArray[np.float64]` +adds the element type, which is what separates a real result from a complex one. Shape typing +exists in third-party libraries such as jaxtyping, and in pyrefly's experimental tensor shape +checks for PyTorch[^pyrefly], but neither is routine for NumPy code. + +## The pyMOR pull request, placed + +Read on 2026-11-17, whilst the pull request was open and its CI failing[^pymor-2680]. + +- **Where**: inline. +- **Syntax**: the newest available. PEP 695 generics, `VectorArray[S, I]` and + `VectorSpace[A]`, and `type Ind = list[int] | slice | None`. That puts the floor at 3.12, + whilst `pyproject.toml` still declares 3.10 and CI still tests it, which is why the 3.10 jobs + cannot pass. +- **Checker**: none in the repository. Neither `pyproject.toml` nor `.pre-commit-config.yaml` + runs one, so the annotations are, for now, what + [A declared-but-inert config documents intent, not enforcement](../principles/a_declared_but_inert_config_documents_intent_not_enforcement.md) + describes. The `# type: ignore` comments suggest a checker run locally. +- **Strictness**: `PGH003` is switched off, so bare `# type: ignore` comments are allowed. +- **Interface**: nominal, which fits, because external solver bindings already subclass + `VectorArrayImpl`. `Self` appears on the `Impl` methods and, deliberately, not on the public + `VectorArray` ones, which return the base class. +- **Arrays**: bare `np.ndarray` throughout. + +One change in it is not an annotation. `numbers.Integral` and `numbers.Number` checks became +`int` and `int | float | complex`, which changes what the code accepts at runtime, not only +what a checker believes. diff --git a/docs/log.md b/docs/log.md index e74605e..175ad55 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,12 @@ # Log +## 2026-11-17 + +- add investigation, "Type annotations for a Python library: the options", on annotation placement, syntax and Python floor, checkers, strictness, interface typing and arrays, with pymor#2680 placed among them +- add principle, "Run a type checker against the project environment in CI, not in an isolated hook" +- add tool page, "pyMOR" +- extended the principle "A declared-but-inert config documents intent, not enforcement" with type annotations that no checker runs on + ## 2026-11-16 - added a section to the tool page "Inference Manager (Canonical)" on sudo not finding snap commands on Arch, and the sudoers drop-in that fixes it diff --git a/docs/principles/a_declared_but_inert_config_documents_intent_not_enforcement.md b/docs/principles/a_declared_but_inert_config_documents_intent_not_enforcement.md index 07e2720..d29b33c 100644 --- a/docs/principles/a_declared_but_inert_config_documents_intent_not_enforcement.md +++ b/docs/principles/a_declared_but_inert_config_documents_intent_not_enforcement.md @@ -25,6 +25,12 @@ rules for languages not yet in the tree, CI matrix entries for platforms not yet targeted. Also when auditing requirements: an inert declaration is not a reason to require the tooling it names. +Type annotations in a repository that runs no type checker are the same case. +They record what the author meant, and nothing rejects code that contradicts +them; enforcement starts only when a checker runs, which is what +[Run a type checker against the project environment in CI, not in an isolated hook](run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md) +is about. + **Why.** Config carries two separable jobs that are easy to conflate. One is *enforcement* - actively rejecting or transforming real inputs. The other is *documentation of intent* - recording a decision so the next contributor inherits diff --git a/docs/principles/index.md b/docs/principles/index.md index 77d0912..6348ea1 100644 --- a/docs/principles/index.md +++ b/docs/principles/index.md @@ -47,6 +47,7 @@ most general. - [Resolve a repo's own dev tools through an ephemeral runner, not a project virtualenv](resolve_a_repos_own_dev_tools_through_an_ephemeral_runner_not_a_project_virtualenv.md) - why a git hook must not depend on a virtualenv being active - [Use PEP 723 inline script metadata for zero-install tooling scripts](use_pep_723_inline_script_metadata_for_zero_install_tooling_scripts.md) - a standalone script that carries its own dependencies - [A declared-but-inert config documents intent, not enforcement](a_declared_but_inert_config_documents_intent_not_enforcement.md) - keeping a rule that fires on nothing, without believing it protects you +- [Run a type checker against the project environment in CI, not in an isolated hook](run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md) - why a checker that cannot see your dependencies passes code it never understood - [Test a config layering assumption with a marker key](test_a_config_layering_assumption_with_a_marker_key.md) - the one-line experiment that says whether layers merge or replace, before you copy a setting into all of them - [Enforce the intersection of all renderers and consumers](enforce_the_intersection_of_all_renderers_and_consumers.md) - writing for the least capable tool that will read it - [Structure docs as the reader's task path - lead with action, defer rationale](structure_docs_as_the_readers_task_path_lead_with_action_defer_rationale.md) - organising a guide around what the reader does next diff --git a/docs/principles/run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md b/docs/principles/run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md new file mode 100644 index 0000000..c0aef0a --- /dev/null +++ b/docs/principles/run_a_type_checker_against_the_project_environment_in_ci_not_an_isolated_hook.md @@ -0,0 +1,104 @@ +--- +type: Principle +title: Run a type checker against the project environment in CI, not in an isolated hook +description: A type checker needs the project's dependencies to say anything true, so it belongs in a CI + job that installs them, with any local hook optional and reading the same configuration. +tags: +- principle +- software +- python +- type-checking +- ci-cd +- pre-commit +status: stable +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T20:00:00+01:00' +sources: +- id: mirrors-mypy + resource: https://github.com/pre-commit/mirrors-mypy + title: 'pre-commit/mirrors-mypy: README' + last_modified: '2026-11-17' +- id: pre-commit-ci-13 + resource: https://github.com/pre-commit-ci/issues/issues/13 + title: 'pre-commit-ci/issues#13: Support for manual dependency management for local repos, system or script entry-points' + last_modified: '2023-02-02' +- id: pre-commit-ci-config + resource: https://pre-commit.ci/ + title: 'pre-commit.ci: configuration' + last_modified: '2026-11-17' +--- +**Claim.** Run a Python type checker as a CI job that installs the project's real +dependencies, not as a pre-commit hook in an environment of its own. A local hook is an +optional convenience on top, and reads the same configuration as the CI job. + +**When to apply.** Any project whose code imports libraries the checker must understand, which +is every project beyond a standalone script. The sharpest case is a numerical library, whose +stack of NumPy, SciPy and compiled extras is large and hard to restate. + +**Why.** A type checker is only as truthful as the imports it can resolve, and a hook cannot +resolve them. + +- **The hook's environment is empty.** pre-commit installs each hook into an isolated + virtualenv, so mypy's own hook runs without the project's dependencies and defaults to + `--ignore-missing-imports`[^mirrors-mypy]. Every unresolved import becomes `Any`, and the + check passes on code it never understood. +- **Restating the dependencies drifts.** The fix the hook offers is `additional_dependencies`, a + second list beside the lockfile that nobody updates with it. That is the drift + [Keep declared toolchain versions in sync, and guard it](keep_declared_toolchain_versions_in_sync_and_guard_it.md) + exists to stop. +- **pre-commit.ci cannot fetch them either.** Its free tier runs hooks with no network access, + and does not support installing anything for a `local`, `system` or `script` + hook[^pre-commit-ci-13]. A hook that relies on the developer's environment has to be listed + under `ci: skip`[^pre-commit-ci-config]. +- **A checker needs the whole program.** pre-commit passes the changed files, whilst a type + error usually surfaces in an unchanged caller. The hook needs `pass_filenames: false` and + checks the whole package on every commit. +- **It cannot fix anything.** A checker only reports, so the slow feedback buys no automatic + fix, which puts it low on the list + [Autofix in the hook, don't just flag](autofix_in_the_hook_dont_just_flag.md) draws up. + +A CI job has none of these problems. It installs the dependencies the tests install, from the +same lockfile, and its red check names the type checker rather than the test suite, as +[Split CI jobs for attributable failure and minimal dependencies](split_ci_jobs_for_attributable_failure_and_minimal_dependencies.md) +wants. + +**Snippet.** + +```yaml +# The authority: a CI job of its own, against the locked environment +type-check: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@ + - uses: astral-sh/setup-uv@ + - name: Type-check the package against the locked dependencies + run: uv run --frozen pyright +``` + +```yaml +# Optional, local only: the same checker, the developer's environment +- repo: local + hooks: + - id: pyright + name: pyright + entry: uv run --frozen pyright + language: system + types: [python] + pass_filenames: false + stages: [manual] +ci: + skip: [pyright] +``` + +**How enforced.** The CI job is the gate. Both it and any hook read one configuration, in +`pyproject.toml`, so that "passed locally" and "passed CI" mean the same thing, which is +[Mirror every local guard in CI](mirror_every_local_guard_in_ci.md) applied to a check that +cannot be mirrored by running the same hook. + +This deliberately cuts against +[Resolve a repo's own dev tools through an ephemeral runner, not a project virtualenv](resolve_a_repos_own_dev_tools_through_an_ephemeral_runner_not_a_project_virtualenv.md). +That principle keeps a hook working without a virtualenv; a type checker without one has +nothing true to say. That is why the local hook stays optional, here on the manual stage, rather +than guarding every commit. diff --git a/docs/tools/index.md b/docs/tools/index.md index c4970aa..50f82fc 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -21,6 +21,7 @@ behind them: they keep their plain name, because `uv` is Astral's and will not b - [project-wiki (giodra96)](project_wiki_giodra96.md) - the LLM wiki pattern aimed at a repository rather than a person, with a closed taxonomy of requirements, decisions and traceability - [Docker](docker.md) - the container engine, run rootless as a user unit on Arch, and the table of where config, data and logs move to when it is - [uv](uv.md) - the Python manager under everything here, and the manifest-versus-lockfile split several principles turn on +- [pyMOR](pymor.md) - the model order reduction library I co-author, built on interfaces an external solver can implement - [Dependabot](dependabot.md) - the update bot, and the three different things that share its name - [wshm](wshm.md) - the self-hosted repo agent whose free edition triages and scores, and whose review, auto-fix and merge are sold separately or not written yet - [opencode](opencode.md) - the terminal agent that writes most of these pages, and the one-directory-per-provider config my own setup is built from diff --git a/docs/tools/pymor.md b/docs/tools/pymor.md new file mode 100644 index 0000000..38b64fc --- /dev/null +++ b/docs/tools/pymor.md @@ -0,0 +1,45 @@ +--- +type: Tool +title: pyMOR +description: A free and open-source Python library of model order reduction algorithms, written against + abstract vector, operator and model interfaces so that external solvers can supply the full-order model. +tags: +- tools +- python +- model-order-reduction +- self-authored +status: stable +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T20:00:00+01:00' +sources: +- id: pymor-pyproject + resource: https://github.com/pymor/pymor/blob/main/pyproject.toml + title: 'pymor/pymor: pyproject.toml' + last_modified: '2026-11-17' +- id: pymor-preprint + resource: https://arxiv.org/abs/2608.00082 + title: 'arXiv:2608.00082 Data-Driven Model Order Reduction with pyMOR' + last_modified: '2026-07-29' +--- +pyMOR is a library of model order reduction algorithms for Python. Its algorithms are written in +terms of three abstract interfaces, `VectorArray`, `Operator` and `Model`, so a full-order model +computed by an external solver can be reduced without being rewritten in Python. Data-driven +methods, which need only simulation or measurement data, sit beside the classical model-based +ones[^pymor-preprint]. [Felix Schindler](../people/felix_schindler.md) is one of its authors. + +| | | +| --- | --- | +| Author | The pyMOR developers; maintained by Stephan Rave | +| Licence | BSD-2-Clause and BSD-3-Clause[^pymor-pyproject] | +| Language | Python, supporting 3.10 to 3.14 as of release 2026.1.1 | +| Distribution | PyPI, as `pymor` | +| Source | [github.com/pymor/pymor](https://github.com/pymor/pymor) | +| Site | [pymor.org](https://pymor.org) | + +## Where it appears here + +pyMOR is the worked example in +[Type annotations for a Python library: the options](../investigations/type_annotation_options_for_a_python_library.md), +which places an open pull request annotating its `vectorarrays` package among the ways a library +can be typed. From 2d50aacdcf783d24eb945d7779fbde23775c44fc Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:04:41 +0100 Subject: [PATCH 11/25] Add feed-reading wish and Miniflux decision --- docs/decisions/index.md | 1 + .../self_hosting_miniflux_as_a_feed_reader.md | 77 +++++++++++++++++++ docs/log.md | 3 + ...e_and_projects_like_the_old_days_of_rss.md | 39 ++++++++++ docs/wishes/index.md | 1 + 5 files changed, 121 insertions(+) create mode 100644 docs/decisions/self_hosting_miniflux_as_a_feed_reader.md create mode 100644 docs/wishes/following_people_and_projects_like_the_old_days_of_rss.md diff --git a/docs/decisions/index.md b/docs/decisions/index.md index d4c97fe..926c6e2 100644 --- a/docs/decisions/index.md +++ b/docs/decisions/index.md @@ -13,3 +13,4 @@ Listed oldest first, so the reasoning reads forward. - [Teaching my agents to write like me](teaching_my_agents_to_write_better.md) - the three prose principles turned into a hook, a skill and an always-on digest, each reaching an audience the others miss - [Adopting caveman at lite, without its init block](adopting_caveman_at_lite_without_its_init_block.md) - keeping the terseness skill and refusing the rule block its installer would have written into a file that already argues the other way - [Adopting ponytail without its always-on ruleset](adopting_ponytail_without_its_always_on_ruleset.md) - taking the half of a skill that adds something, and why the plugin it would have collided with cannot be patched +- [Self-hosting Miniflux as a feed reader](self_hosting_miniflux_as_a_feed_reader.md) - two containers behind the existing Traefik, the server doubling as the sync, and RSSHub held back until a source needs it diff --git a/docs/decisions/self_hosting_miniflux_as_a_feed_reader.md b/docs/decisions/self_hosting_miniflux_as_a_feed_reader.md new file mode 100644 index 0000000..f2b26d6 --- /dev/null +++ b/docs/decisions/self_hosting_miniflux_as_a_feed_reader.md @@ -0,0 +1,77 @@ +--- +type: Decision +title: Self-hosting Miniflux as a feed reader +description: Why Miniflux and its Postgres database, behind the existing Traefik on a rootless Docker server, + meet the feed-reading wishes, and why RSSHub waits. +tags: +- decision +- software +- rss +- self-hosting +- docker +status: draft +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T00:00:00Z' +--- +How Felix chose to follow people and projects: a self-hosted +[Miniflux](https://miniflux.app) on the dedicated server that already runs Traefik on +[rootless Docker](../tools/docker.md). + +## What was wanted + +The [Following people and projects like the old days of RSS](../wishes/following_people_and_projects_like_the_old_days_of_rss.md) +wishes, in short: one inbox, no accounts to tend, read status on every device, FOSS. + +## What it rests on + +- [Prefer FOSS software wherever possible](../values/prefer_foss_software_wherever_possible.md) - + Miniflux is Apache-2.0, and every client considered is FOSS. +- [Prefer plain-text, tool-agnostic formats](../values/prefer_plain_text_tool_agnostic_formats.md) - + subscriptions leave the reader as OPML, a plain XML list any other reader imports. + +## What that led to + +**Miniflux, over FreshRSS.** Both are FOSS, self-hostable and speak the same sync protocols. +Miniflux is one Go binary and a Postgres database, with a deliberately small interface; +FreshRSS is a PHP application with extensions, multi-user setup and a built-in scraper for +pages without feeds. The extra surface is what tipped it: a reader is meant to sit in the +background, and Miniflux has less of it to maintain. + +**The server is the sync.** Read, starred and saved state lives in Miniflux's database, so +every device that talks to the server sees the same state. Nothing else needs running for it. +The browser interface covers any device; native apps (Newsflash on Linux, Read You or Capy +Reader on Android, NetNewsWire on Apple) connect through the Google Reader API, which is a +setting in Miniflux with its own credentials rather than another service. + +**Most sources already publish feeds, so no accounts are needed.** + +| Source | Feed address | +| --- | --- | +| Mastodon and the Fediverse | the profile URL with `.rss` appended | +| Bluesky | `https://bsky.app/profile//rss` | +| GitHub releases, tags, commits | `/releases.atom`, `/tags.atom`, `/commits/.atom` on the repository | +| GitHub user activity | `https://github.com/.atom` | +| YouTube channel | `https://www.youtube.com/feeds/videos.xml?channel_id=`, found by Miniflux from the channel URL | +| Reddit | most pages, with `.rss` appended | + +**The compose service is two containers.** Miniflux joins the Traefik network and an internal +one; Postgres joins only the internal one, with a named volume. Only Traefik publishes ports. + +**Backups cover what only the server knows.** A nightly `pg_dump` holds the read state. A +scheduled OPML export through the API, committed to git, keeps the subscription list as a file +Felix owns independently of the database. + +## What is left out, and would be reconsidered + +**RSSHub is deferred.** It turns pages without a feed, such as X profiles, Telegram channels +or many news sites, into feeds Miniflux can follow, and is the place a throwaway account would +come in, since some of its routes need login cookies. It scrapes, so routes break when sites +change, and its recommended setup adds Redis and a headless browser. It joins the internal +network, without Traefik labels, the first time a wanted source has no feed of its own. + +**Walled gardens stay out.** X and LinkedIn are fragile through any bridge, account or not, +and nothing here is built around them. + +**Nothing is deployed yet.** The compose file, its Traefik labels and the backup timer become +a blueprint once they have run on the server, not before. diff --git a/docs/log.md b/docs/log.md index 175ad55..c71b07a 100644 --- a/docs/log.md +++ b/docs/log.md @@ -2,6 +2,9 @@ ## 2026-11-17 +- add wish, "Following people and projects like the old days of RSS" +- add decision, "Self-hosting Miniflux as a feed reader", as a draft + - add investigation, "Type annotations for a Python library: the options", on annotation placement, syntax and Python floor, checkers, strictness, interface typing and arrays, with pymor#2680 placed among them - add principle, "Run a type checker against the project environment in CI, not in an isolated hook" - add tool page, "pyMOR" diff --git a/docs/wishes/following_people_and_projects_like_the_old_days_of_rss.md b/docs/wishes/following_people_and_projects_like_the_old_days_of_rss.md new file mode 100644 index 0000000..297ee15 --- /dev/null +++ b/docs/wishes/following_people_and_projects_like_the_old_days_of_rss.md @@ -0,0 +1,39 @@ +--- +type: Wish +title: Following people and projects like the old days of RSS +description: One place to follow blogs, projects and people across the internet, with read status shared + between devices and no social media accounts to tend. +tags: +- wish +- software +- rss +- self-hosting +status: stable +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T00:00:00Z' +--- +What Felix wanted from a way of keeping up with projects and people, which the +[Self-hosting Miniflux as a feed reader](../decisions/self_hosting_miniflux_as_a_feed_reader.md) +decision resolves. + +## The wishes + +- **One inbox for updates from anywhere** - blogs, project releases, people - read in one + list rather than on each site that published them. The usability of a feed reader in the + days when every site had a feed. +- **No social media accounts to manage.** An account created once, purely so something can + follow people through it programmatically, is acceptable; one that has to be visited, + curated or kept alive is not. +- **Blogs and plain feeds are enough to start.** Social platforms are a later extension, not + a condition of the first version. +- **Read status shared across devices.** Something read on the phone is read on the laptop. + That means either a self-hosted service, or a local reader with a sync option. +- **FOSS throughout**, the reader and anything it syncs through. + +## What these rest on + +[Prefer FOSS software wherever possible](../values/prefer_foss_software_wherever_possible.md) +rules out the hosted readers whose code is closed, and +[Prefer plain-text, tool-agnostic formats](../values/prefer_plain_text_tool_agnostic_formats.md) +asks that the list of subscriptions outlive whichever reader holds it. diff --git a/docs/wishes/index.md b/docs/wishes/index.md index e92c73c..b43398f 100644 --- a/docs/wishes/index.md +++ b/docs/wishes/index.md @@ -5,3 +5,4 @@ which I want generally. - [Wishes for a personal knowledge base](wishes_for_a_personal_knowledge_base.md) - the full list of requirements the knowledge base had to meet - [Local-first, but not local-required](local_first_but_not_local_required.md) - one wish worth its own page: offline by default, never offline-only +- [Following people and projects like the old days of RSS](following_people_and_projects_like_the_old_days_of_rss.md) - one inbox for blogs, releases and people, synced read status, no accounts to tend From 76e02d0ee9b084599391974b1240cad0bab939d5 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:05:50 +0100 Subject: [PATCH 12/25] Add finding on the Plasma lock screen logging a failed login on every resume --- ...een_logs_a_failed_login_on_every_resume.md | 108 ++++++++++++++++++ docs/findings/index.md | 1 + docs/hardware/dell_precision_5470.md | 1 + docs/log.md | 1 + 4 files changed, 111 insertions(+) create mode 100644 docs/findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md diff --git a/docs/findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md b/docs/findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md new file mode 100644 index 0000000..3d249dc --- /dev/null +++ b/docs/findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md @@ -0,0 +1,108 @@ +--- +type: Finding +title: The Plasma lock screen logs a failed login on every resume, and faillock locks the account +description: Nobody touches the keyboard; the lock screen cancels its own pending password prompt + when the machine sleeps or wakes, pam_unix reports that as a failed password, and three of them + trip pam_faillock. +tags: +- finding +- linux +- kde +- plasma +- kscreenlocker +- pam +- suspend +- arch +status: stable +stale_after: '2027-05-17' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-17T22:30:00+01:00' +sources: +- id: kde-bug-481808 + resource: https://bugs.kde.org/show_bug.cgi?id=481808 + title: 'KDE bug 481808: Sleep mode of Plasma causes a failed login attempt' + last_modified: '2026-11-17' +--- +Opening the lid shows "Unlocking failed" on the lock screen before a key has been pressed, and +after a few suspend cycles the account is locked for several minutes. It looks like phantom +input. There is none: the lock screen fails its own authentication, and the distribution's PAM +stack counts that failure like any other. + +Observed with kscreenlocker 6.7.5 and pam 1.7.3 on Manjaro, on a +[Dell Precision 5470](../hardware/dell_precision_5470.md). + +## Symptom + +The failure lands in the same second as the resume: + +```text +21:59:35 kernel: PM: suspend exit +21:59:35 kscreenlocker_greet: pam_unix(kde:auth): unexpected response from failed conversation function +21:59:35 kscreenlocker_greet: pam_unix(kde:auth): conversation failed +21:59:35 kscreenlocker_greet: pam_unix(kde:auth): auth could not identify password for [] +21:59:36 kscreenlocker_greet: [PAM worker kde] Authentication attempt too soon. This shouldn't happen! +``` + +The same lines appear when the lock screen's own Sleep or Hibernate button starts the +transition, then on the way down rather than the way up. One cycle can log two failures, so +the default limit of three arrives quickly. + +```bash +journalctl --since -14days | grep -E 'PM: suspend (entry|exit)|pam_unix\(kde:auth\)' +``` + +Pairing each `conversation failed` with a `suspend exit` in the same second is the check that +settles it. + +## Cause + +The lock screen calls `pam_authenticate()` as soon as it is shown, and the PAM conversation +then waits for a password. When the machine sleeps or wakes, the greeter cancels that waiting +call, and its conversation function returns `PAM_CONV_ERR`. `pam_unix` turns that into +`PAM_AUTHTOK_ERR`, which the Arch-derived `system-auth` treats as a failed password: + +```text +auth [success=1 default=bad] pam_unix.so try_first_pass nullok +auth [default=die] pam_faillock.so authfail +``` + +`default=bad` lets the stack continue into `pam_faillock ... authfail`, which records the attempt. +With `faillock.conf` left at its defaults, `deny = 3`, three resumes lock the account. A +successful unlock runs `authsucc` and clears the tally, which is why `faillock` usually shows +nothing when checked afterwards. + +**A fingerprint reader is not involved**, though it is the first suspect on a laptop that has +one. `kscreenlocker` runs a separate `kde-fingerprint` PAM service for that, and the failures +above are all in the `kde` service, the password one. + +The bug is upstream's[^kde-bug-481808], open since Plasma 6.2 and fixed in 6.8 by aborting +the authentication flows on sleep rather than letting them fail. + +## How to get past it + +Until 6.8 arrives, stop the tally from locking the account. In `/etc/security/faillock.conf`: + +```text +deny = 0 +``` + +Wrong passwords are still logged, but no longer lock the account. pacman treats the file as +configuration, so an upgrade of `pam` leaves the edit alone and writes a `.pacnew` beside it. +Clear an existing lock with `faillock --user --reset`. + +The narrower alternative, from the bug thread, is an `/etc/pam.d/kde` that inlines the +`system-local-login` chain and gives `pam_unix` the action `authtok_err=die`, so this one +return code skips `authfail`. It keeps the lockout for real failures, at the cost of a private +copy of the distribution's PAM chain that no update will touch again. Neither removes the +"Unlocking failed" message on wake, because the conversation is still started and cancelled. + +Revert `deny = 0` once Plasma 6.8 is installed, if the lockout is wanted back. + +## What it is not + +Not input. The pointer analogue on the same machine, +[a phantom touch pinning the pointer to the system tray](20261029_a_phantom_touch_pins_the_pointer_to_one_point_in_the_system_tray.md), +really was a device reporting contact that never lifted, and it is tempting to read this the +same way. The difference is in where the evidence sits: a stuck contact shows up in +`xinput query-state`, and this shows up as a PAM conversation error timed to the suspend. diff --git a/docs/findings/index.md b/docs/findings/index.md index a3424d6..931ebd9 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -22,6 +22,7 @@ And the subject lives in the tags rather than in a directory, per ### November +- 2026-11-17: [The Plasma lock screen logs a failed login on every resume, and faillock locks the account](20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md) - no keypress at all, just a cancelled password prompt that pam_unix calls a wrong password - 2026-11-10: [docker volume prune -a deletes a Compose database while the stack is down](20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) - volumes named after the directory, a stopped stack that leaves its database unattached, and the worktree that quietly gets an empty one - 2026-11-10: [Deleting every image and container leaves rootless Docker using 100 GB](20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md) - a build cache and untagged images that no listing shows, stored where most advice does not look diff --git a/docs/hardware/dell_precision_5470.md b/docs/hardware/dell_precision_5470.md index a2f576b..ca8b734 100644 --- a/docs/hardware/dell_precision_5470.md +++ b/docs/hardware/dell_precision_5470.md @@ -116,3 +116,4 @@ something else, and on this machine it is noise. - [A Bluetooth headset reconnects in A2DP instead of the saved profile](../findings/20260928_a_bluetooth_headset_reconnects_in_a2dp_instead_of_the_saved_profile.md), met with [the OpenMove](openmove_by_shokz.md) - [ahci probe fails with error -12 on an Intel VMD machine](../findings/20261014_ahci_probe_fails_with_error_12_on_an_intel_vmd_machine.md), a line this machine has logged at every boot since it was installed, and which reads as a storage fault - [A hard freeze leaves no journal, and the last entry is not where it hung](../findings/20261014_a_hard_freeze_leaves_no_journal_and_the_last_entry_is_not_where_it_hung.md), met after three failed boots here, and general to any machine running journald +- [The Plasma lock screen logs a failed login on every resume](../findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md), which looks like phantom input and is the lock screen cancelling its own password prompt diff --git a/docs/log.md b/docs/log.md index c71b07a..64e0a7b 100644 --- a/docs/log.md +++ b/docs/log.md @@ -2,6 +2,7 @@ ## 2026-11-17 +- add finding, "The Plasma lock screen logs a failed login on every resume, and faillock locks the account" - add wish, "Following people and projects like the old days of RSS" - add decision, "Self-hosting Miniflux as a feed reader", as a draft From 0250a54f9af14287efad304ca15fb50a67fbcfb2 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Wed, 18 Nov 2026 14:58:18 +0100 Subject: [PATCH 13/25] add tool page Math*DB MCP (MaRDI4NFDI) and finding on missing MCP tool annotations --- ...tions_looks_destructive_to_every_client.md | 82 +++++++++++++++++++ docs/findings/index.md | 1 + docs/log.md | 5 ++ docs/tools/index.md | 1 + docs/tools/mathstardb_mcp_mardi4nfdi.md | 58 +++++++++++++ 5 files changed, 147 insertions(+) create mode 100644 docs/findings/20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md create mode 100644 docs/tools/mathstardb_mcp_mardi4nfdi.md diff --git a/docs/findings/20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md b/docs/findings/20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md new file mode 100644 index 0000000..623c4e8 --- /dev/null +++ b/docs/findings/20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md @@ -0,0 +1,82 @@ +--- +type: Finding +title: An MCP server without tool annotations looks destructive to every client +description: Tool annotations are optional and their absence defaults to the worst case, so a + server that leaves them out presents every query tool as one that may overwrite or delete. +tags: +- finding +- mcp +- agent-tooling +status: draft +stale_after: '2027-05-18' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-18T14:30:00+01:00' +sources: +- id: mcp-schema + resource: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.ts + title: 'Model Context Protocol schema, 2025-06-18: ToolAnnotations' + last_modified: '2026-11-18' +--- +A server's `tools/list` came back with tools that had a name, a description and an input +schema, and nothing else. Every one of them only queried a database, but nothing in the +response said so. + +This is a reading of the specification rather than a client caught misbehaving: no client was +watched treating the tools differently. + +## How to check + +`tools/list` over HTTP, printing each tool's hints: + +```sh +curl -sS -X POST "$MCP_URL" \ + -H 'Content-Type: application/json' \ + -H 'Accept: application/json, text/event-stream' \ + -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | +python -c 'import json,sys +for t in json.load(sys.stdin)["result"]["tools"]: + print(t["name"], t.get("annotations"))' +``` + +`None` on every line is the symptom. + +## What it means + +Since the 2025-03-26 revision a tool may carry four hints, all optional, and the schema gives +each a default for when it is absent[^mcp-schema]: + +| Hint | Says | Default when absent | +| --- | --- | --- | +| `readOnlyHint` | the tool does not modify its environment | `false` | +| `destructiveHint` | if it modifies, it may overwrite or delete | `true` | +| `idempotentHint` | calling it twice has no further effect | `false` | +| `openWorldHint` | it reaches entities outside the server | `true` | + +Every default is the cautious one. A tool with no annotations therefore claims to be a +non-idempotent, destructive write that reaches the outside world. A client that auto-approves +read-only tools has to ask about every query, and a client that warns about destructive ones +has to warn about all of them, so the one tool that does have a side effect looks no different +from the rest. + +## How to get past it + +On the server, declare the hints. In FastMCP that is one argument per tool: + +```python +from mcp.types import ToolAnnotations + +READ_ONLY = ToolAnnotations(readOnlyHint=True, openWorldHint=False) + +@app.tool(name="SPARQL_Query", annotations=READ_ONLY) +def sparql_query(query: str) -> str: ... +``` + +`openWorldHint` stays `true` for a tool that leaves the server even when it only reads, such as +one that resolves a DOI. A tool that sends mail or files a ticket is `readOnlyHint=False`, and +`destructiveHint=False` if it only adds. + +On the client the hints change nothing about trust. The schema calls them hints and says a +client should not rely on them from a server it does not trust, so a client's own allow and +deny list stays the control; the hints only make a trustworthy server describe itself +accurately. diff --git a/docs/findings/index.md b/docs/findings/index.md index 931ebd9..2ff1d7a 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -22,6 +22,7 @@ And the subject lives in the tags rather than in a directory, per ### November +- 2026-11-18: [An MCP server without tool annotations looks destructive to every client](20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md) - every hint defaults to the cautious value, so a query tool and a mail-sending one look the same until the server says otherwise - 2026-11-17: [The Plasma lock screen logs a failed login on every resume, and faillock locks the account](20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md) - no keypress at all, just a cancelled password prompt that pam_unix calls a wrong password - 2026-11-10: [docker volume prune -a deletes a Compose database while the stack is down](20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) - volumes named after the directory, a stopped stack that leaves its database unattached, and the worktree that quietly gets an empty one - 2026-11-10: [Deleting every image and container leaves rootless Docker using 100 GB](20261110_deleting_every_image_and_container_leaves_rootless_docker_using_100g.md) - a build cache and untagged images that no listing shows, stored where most advice does not look diff --git a/docs/log.md b/docs/log.md index 64e0a7b..44368a4 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,10 @@ # Log +## 2026-11-18 + +- add tool page, "Math*DB MCP (MaRDI4NFDI)", as a draft +- add finding, "An MCP server without tool annotations looks destructive to every client", as a draft + ## 2026-11-17 - add finding, "The Plasma lock screen logs a failed login on every resume, and faillock locks the account" diff --git a/docs/tools/index.md b/docs/tools/index.md index 50f82fc..70c0ddf 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -40,3 +40,4 @@ behind them: they keep their plain name, because `uv` is Astral's and will not b - [peon-ping](peon_ping.md) - Warcraft III voice lines on agent hooks, the twelve lifecycle events and plaintext prompt log that come with them, and the three paths its own uninstaller misses - [Voxtype (Peter Jackson)](voxtype_jackson.md) - stub: push-to-talk dictation as a single Rust binary, with eight local engines behind one config line - [Vocalinux (VocaHQ)](vocalinux_vocahq.md) - stub: the AGPL Python alternative, dictating from a tray icon on X11 and Wayland alike +- [Math*DB MCP (MaRDI4NFDI)](mathstardb_mcp_mardi4nfdi.md) - draft: one public MCP server over MaRDI's model and algorithm graphs, and the tools that walk from a model to the software that solves it diff --git a/docs/tools/mathstardb_mcp_mardi4nfdi.md b/docs/tools/mathstardb_mcp_mardi4nfdi.md new file mode 100644 index 0000000..4d191f9 --- /dev/null +++ b/docs/tools/mathstardb_mcp_mardi4nfdi.md @@ -0,0 +1,58 @@ +--- +type: Tool +title: Math*DB MCP (MaRDI4NFDI) +description: A public MCP server over MaRDI's two mathematical knowledge graphs, MathModDB for + models and their equations and MathAlgoDB for algorithms, problems and software, with tools + that cross from one to the other. +tags: +- tools +- mcp +- mardi +- mathematics +- sparql +status: draft +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-18T14:30:00+01:00' +sources: +- id: mathstardb-repo + resource: https://github.com/MaRDI4NFDI/MathModDB-MCP + title: 'MaRDI4NFDI/MathModDB-MCP: Repo for the MCP development for MathModDB' + last_modified: '2026-11-03' +--- +Math*DB[^mathstardb-repo] is an MCP server that lets an agent query two knowledge graphs +from the [MaRDI](https://www.mardi4nfdi.de/) project, the German national research data +infrastructure for mathematics. One graph describes mathematical models, the other the +algorithms and software that solve the problems those models lead to, and the server can +walk from one to the other. + +| | | +| --- | --- | +| Author | MaRDI4NFDI | +| Licence | GPL-3.0 | +| Language | Python, on FastMCP | +| Distribution | A hosted endpoint, `https://mathstardb.mardi4nfdi.de/mcp`, over streamable HTTP with no authentication | +| Source | [github.com/MaRDI4NFDI/MathModDB-MCP](https://github.com/MaRDI4NFDI/MathModDB-MCP) | +| Version read | 0.2.0 live, from its `initialize` and `tools/list` responses; 0.1.0 in the repository | + +## What it is + +**MathModDB** holds mathematical models: their formulations as LaTeX formulas, the quantity +every symbol stands for, the assumptions they make, and how models relate to one another, as +specialisations, approximations, linearisations and discretisations. It lives in the MaRDI +portal's Wikibase and is queried with SPARQL. The server asks for one discovery call, +`Explore_Ontology`, before any query, so the agent learns the item and property ids first. +`model_formulation` and `model_relations` answer the common questions without writing SPARQL. + +**MathAlgoDB** holds algorithms, problems, software, benchmarks and publications, linked by +relations such as *solves*, *implemented by* and *specialises*. Most questions have a +dedicated tool rather than a query: `algorithms_for_problem`, `software_for_algorithm`, +`benchmarks_for_problem`, `hierarchy` for the taxonomy around an entry, and `literature` for +the papers that introduced, surveyed or analysed it. `sparql_query` remains for anything else. + +**The bridge is what makes it one server rather than two.** `algorithms_for_model` starts from +a model in MathModDB and returns the algorithms and software in MathAlgoDB that apply to it, +and `models_for_problem` goes the other way. Twenty-two tools in all. + +The public repository is behind the deployment. It holds version 0.1.0, with the three +MathModDB tools only, whilst the endpoint reports 0.2.0 with all twenty-two. From 6ff9b5bf8cd7ae3c096774054f62806205a9ebd3 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Sun, 15 Nov 2026 22:16:44 +0100 Subject: [PATCH 14/25] add Lenovo ThinkPad X390 Yoga hardware page --- docs/hardware/index.md | 1 + docs/hardware/lenovo_thinkpad_x390_yoga.md | 101 +++++++++++++++++++++ docs/log.md | 3 + 3 files changed, 105 insertions(+) create mode 100644 docs/hardware/lenovo_thinkpad_x390_yoga.md diff --git a/docs/hardware/index.md b/docs/hardware/index.md index dca595d..8d3b0dc 100644 --- a/docs/hardware/index.md +++ b/docs/hardware/index.md @@ -25,5 +25,6 @@ Conventions: ## Devices +- [Lenovo ThinkPad X390 Yoga](lenovo_thinkpad_x390_yoga.md) - a 13-inch Whiskey Lake convertible with a Wacom pen and touch digitizer - [Dell Precision 5470](dell_precision_5470.md) - my work machine from 2022 until now: a 14-inch Alder Lake workstation - [OpenMove by Shokz](openmove_by_shokz.md) - my open-ear bone-conduction headset diff --git a/docs/hardware/lenovo_thinkpad_x390_yoga.md b/docs/hardware/lenovo_thinkpad_x390_yoga.md new file mode 100644 index 0000000..7db9635 --- /dev/null +++ b/docs/hardware/lenovo_thinkpad_x390_yoga.md @@ -0,0 +1,101 @@ +--- +type: Device +title: Lenovo ThinkPad X390 Yoga +description: A 13-inch Whiskey Lake convertible with a Wacom pen and touch digitizer, a classic + Realtek HDA codec rather than SoundWire, and no discrete GPU. +tags: +- hardware +- lenovo +- thinkpad +- convertible +- linux +- audio +- bluetooth +status: stable +generated: + by: opencode/glm-5.2 + at: '2026-11-15T12:00:00+01:00' +--- +The ThinkPad X390 Yoga is Lenovo's 13-inch convertible on Intel's Whiskey Lake-U platform, +with a 360-degree hinge and a Wacom pen and touch digitizer. + +| | | +| --- | --- | +| Vendor | Lenovo | +| Form factor | Notebook, 13-inch, convertible, DMI chassis type 31 | +| Processor | Intel Core i5-8365U, Whiskey Lake-U, 4-core | +| Memory | 16 GB, two 8 GiB DDR4 SODIMMs at 2400 MT/s (2667 MT/s rated) | +| Storage | A 2 TB Samsung SSD 860 EVO M.2 over SATA, carrying LUKS and LVM | +| Graphics | Intel UHD Graphics 620, WhiskeyLake-U GT2, at `00:02.0` | +| Display | eDP-1, 1920x1080, 294 x 165 mm | +| Audio | Cannon Point-LP HD Audio controller at `00:1f.3`, driving a Realtek ALC257 codec | +| Wireless | Intel Cannon Point-LP CNVi, Wireless-AC 9560, `iwlwifi` for Wi-Fi | +| Bluetooth | Intel Bluetooth 9460/9560 (JfP) on the USB bus as `8087:0aaa`, `btusb` | +| Ethernet | Intel Ethernet Connection (6) I219-LM at `00:1f.6` | +| Thunderbolt | JHL6240 Alpine Ridge LP 2016, at `07:00.0` | +| Pen and touch | Wacom Pen and multitouch sensor on USB as `056a:51af`, finger and pen inputs | +| Touchpad | Synaptics TM3469-010 over RMI4 | +| TrackPoint | TPPS/2 Elan TrackPoint | +| Camera | Syntek Integrated Camera, `174f:2435` | +| Fingerprint | Synaptics Prometheus MIS Touch Fingerprint Reader, `06cb:00bd` | +| SD card | Genesys Logic GL9750 SD Host Controller at `02:00.0` | +| Firmware | BIOS N2LET71W (1.71), 2019-12-05; ThinkPad EC firmware N2LHT33W | +| Read through | Manjaro Linux, kernel 6.12.112-1-MANJARO | + +Everything above was read off the running machine rather than from a specification sheet, per +[the convention for this genre](index.md). + +## The processor has no hyperthreading + +The i5-8365U is a 4-core, 4-thread part: there is no hyperthreading to toggle, and +`/sys/devices/system/cpu/smt/control` reads `notsupported` because the hardware does not +provide it rather than because it is disabled. Anything that sizes a thread pool from +`nproc` on this machine gets 4. This is the same end result as +[the Dell Precision 5470](dell_precision_5470.md) on a different part and for a different +reason: the Precision's i7-12800H has performance cores that would normally contribute a +second thread each, and the firmware does not expose them, whilst the i5-8365U simply does +not have SMT. + +## Audio is classic HDA, not SoundWire + +The audio controller enumerates as Intel HD Audio and the codec behind it is a Realtek +ALC257 reached directly over the HD Audio link, not over SoundWire. ALSA therefore presents +the card as `HDA Intel PCH` with the node names that classic setup implies: + +```text +alsa_output.pci-0000_00_1f.3.analog-stereo +``` + +A configuration snippet written against a `sof-soundwire` node name, as +[the Dell Precision 5470](dell_precision_5470.md) requires, will not match anything here. +There is a second ALSA card, `ThinkPadEC` at card 29, which is the ThinkPad's console audio +control rather than a codec: it exposes volume and mute knobs through the embedded +controller, and carries no playback or capture streams of its own. + +## Bluetooth and Wi-Fi are one part + +The Wireless-AC 9560 is a CNVi design, the same architecture as the AX211 in +[the Dell Precision 5470](dell_precision_5470.md) one generation back: the Wi-Fi side +attaches through the chipset at `00:14.3` whilst the Bluetooth side appears on the USB bus +as `8087:0aaa` and is driven by `btusb`. `rfkill` on this machine lists two entries rather +than four, because a ThinkPad does not carry the platform radio switches a Dell does: only +the two radios themselves, `phy0` and `hci0`, with no `dell-wifi` or `dell-bluetooth` +intermediate. A radio can still be blocked, but only at the one level. + +## The pen and touch digitizer + +The Wacom digitizer is a USB device at `056a:51af`, presenting two input devices: a finger +input for multitouch and a separate pen input for the stylus. The hinge rotates 360 degrees +to tablet mode, and the ThinkPad ACPI layer reports tablet mode through +`/sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode`, which a desktop environment can +read to disable the keyboard and touchpad when folded. The digitizer itself needs no +configuration beyond the `wacom` kernel module, which is built into Manjaro's default +initramfs. + +## There is no discrete GPU + +This configuration carries only the integrated UHD Graphics 620. There is no NVIDIA or AMD +part on the PCI bus, no modprobe blacklist to maintain, and no mode-switching tool such as +EnvyControl needed. The x16 bridge at `00:01.0` is present but empty, which is the normal +state for a ThinkPad that was not ordered with a dGPU and not the sign of a device removed at +boot. diff --git a/docs/log.md b/docs/log.md index 44368a4..97ac442 100644 --- a/docs/log.md +++ b/docs/log.md @@ -20,6 +20,9 @@ - added a section to the tool page "Inference Manager (Canonical)" on sudo not finding snap commands on Arch, and the sudoers drop-in that fixes it - add tool page, "Inference Manager (Canonical)", on the inference CLI and proxy over Canonical's inference snaps, written from the documentation +## 2026-11-15 + +- add hardware page, "Lenovo ThinkPad X390 Yoga", a 13-inch Whiskey Lake convertible with Wacom pen and touch, classic Realtek HDA audio, and no discrete GPU ## 2026-11-10 From 870f28e188e02a850ef4f4ef15eedcf19472f84d Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 24 Nov 2026 19:31:12 +0100 Subject: [PATCH 15/25] Add investigation: agentic AI + Home Assistant integration (skills + MCP servers) --- .../agentic_ai_homeassistant_integration.md | 209 ++++++++++++++++++ docs/investigations/index.md | 3 + 2 files changed, 212 insertions(+) create mode 100644 docs/investigations/agentic_ai_homeassistant_integration.md diff --git a/docs/investigations/agentic_ai_homeassistant_integration.md b/docs/investigations/agentic_ai_homeassistant_integration.md new file mode 100644 index 0000000..0e78c7a --- /dev/null +++ b/docs/investigations/agentic_ai_homeassistant_integration.md @@ -0,0 +1,209 @@ +--- +type: investigation +title: Agentic AI and Home Assistant Integration +description: Survey of skills and MCP servers for connecting AI agents to Home Assistant, with security and architecture findings +status: complete +generated: + by: opencode/qwen3.5-397b-a17b + at: 2026-11-24 +verified: + at: null + by: null +tags: +- home-automation +- mcp +- agent-integration +- smart-home +- websocket-api +references: +- https://github.com/homeassistant-ai/skills +- https://github.com/tevonsb/homeassistant-mcp +- https://github.com/voska/hass-mcp +- https://skills.sh/ +--- + +# Agentic AI and Home Assistant Integration + +## Overview + +This investigation surveyed the landscape of skills and MCP servers for connecting AI agent harnesses (opencode, Claude Code, Cursor) to Home Assistant instances. The goal: full remote agent access to near all aspects of HA — reading states, controlling devices, editing automations, monitoring events in real-time. + +## Methods Searched + +1. **skills.sh leaderboard** — `npx skills find home assistant`, `npx skills find homeassistant`, `npx skills find smart home` +2. **GitHub MCP server search** — `homeassistant mcp server`, filtered by stars and recency +3. **akit subscription** — attempted `akit add homeassistant-ai/skills`, succeeded despite no `.akit.yaml` in source + +## Findings + +### Skills (skills.sh ecosystem) + +| Skill | Installs | Stars | Source | Capabilities | +|-------|----------|-------|--------|--------------| +| **`homeassistant-ai/skills@home-assistant-best-practices`** | **9.6K** | **1k** | homeassistant-ai/skills | Native HA patterns, safe refactoring, dashboard design, AppDaemon, blueprints, backups | +| `claude-office-skills@Home Assistant Automation` | 5.2K | - | claude-office-skills | Automation creation | +| `balloob/llm-skills@home-assistant` | 267 | 4 | balloob (HA co-founder) | Connection setup, API reference (Python/Node.js) | +| `anotb/homeassistant-skill@homeassistant-skill` | 153 | 7 | anotb | REST/WS workflows, works alongside MCP | +| `bradsjm/hassio-addons@*` (7 skills) | 500-800 each | - | bradsjm | Addon-specific guides | + +**Key finding:** `homeassistant-ai/skills` is the only security-audited skill (Gen Agent Trust Hub, Socket, Snyk all pass). It teaches native HA constructs over templates — e.g., `condition: numeric_state` instead of `condition: template` — which HA validates at load time rather than failing silently at runtime. + +### MCP Servers (GitHub) + +| Server | Stars | Lang | Transports | Notable Capabilities | +|--------|-------|------|------------|---------------------| +| **`tevonsb/homeassistant-mcp`** | **574** | TypeScript | SSE | Add-on/HACS management, automation editing, real-time SSE updates | +| **`voska/hass-mcp`** | **353** | Python | stdio, HTTP | **Lovelace editing** (live updates + backups), history/stats, guided conversations | +| `robbrad/homeassistant-mcp` | 106 | Python | stdio | Basic control | +| `jango-blockchained/advanced-homeassistant-mcp` | 58 | TypeScript (Bun) | stdio, HTTP+WS | **50+ tools**, speech-to-text, Code Mode sandbox | +| `c1pher-cn/ha-mcp-for-xiaozhi` | 287 | Python | - | 小智 AI integration (niche) | +| `hekmon8/Homeassistant-server-mcp` | 48 | JavaScript | stdio | Basic | + +**Key finding:** All MCP servers use WebSocket under the hood (`ws://HA:8123/api/websocket`) with long-lived tokens. They expose tools to the LLM while keeping credentials secure in the MCP server process. + +### Architecture Patterns + +**Three integration methods emerged:** + +1. **WebSocket API (primary)** — Persistent connection, real-time `subscribe_events`, `call_service`, `get_states`. Used by all MCP servers. +2. **REST API (fallback)** — Stateless polling, `GET /api/states`, `POST /api/services/...`. Used by skills without MCP. +3. **MCP Server (abstraction layer)** — Agent→MCP→HA, credentials stored once, can add rate limiting/logging. + +**Security architectures:** + +| Pattern | Token Location | Agent Access | Exposure | +|---------|---------------|--------------|----------| +| Local LAN | MCP server env | Via MCP only | None (firewalled) | +| HA Cloud | MCP server env | Via MCP + TLS tunnel | Nabu Casa encrypted | +| VPN (Tailscale) | MCP server env | Via MCP + VPN | Zero-trust network | +| Direct skill | Skill config | Direct REST/WS | Token in skill config | + +## Security Considerations + +### MCP Server Advantages + +- **Credential isolation** — HA token stored once in MCP env, never exposed to agent +- **Rate limiting** — Can enforce call budgets per session +- **Audit logging** — All agent actions logged at MCP layer +- **Permission scoping** — Can restrict which services/tools are exposed + +### Risks Identified + +1. **Long-lived tokens** — 10-year validity, full user permissions. Must be stored securely. +2. **No built-in rate limiting** — HA API doesn't throttle; MCP must enforce. +3. **Webhook security** — Webhook URLs are the only secret; if leaked, anyone can trigger. +4. **Direct exposure** — Skills that connect directly put token in agent context. + +### Recommended Security Posture + +- **MCP server on same LAN** as HA, agent connects to MCP (not HA directly) +- **Home Assistant Cloud** for remote access (encrypted tunnel, no port forwarding) +- **Non-admin user** for agent token, with explicit permissions only +- **Automatic backups** before any write operation (voska does this for Lovelace) + +## Capability Comparison + +| Capability | REST API | WebSocket | MCP Server | +|------------|----------|-----------|------------| +| Read entity states | ✅ | ✅ | ✅ | +| Control devices | ✅ | ✅ | ✅ | +| Real-time events | ❌ | ✅ | ✅ | +| Edit automations | ⚠️ Manual | ✅ | ✅ (tevonsb) | +| Lovelace editing | ❌ | ✅ | ✅ (voska) | +| History queries | ✅ | ⚠️ Limited | ✅ (voska) | +| Add-on management | ❌ | ✅ | ✅ (tevonsb) | +| Speech/voice | ❌ | ❌ | ✅ (jango) | + +## Installation Findings + +### akit Subscription + +The `homeassistant-ai/skills` repo has no `.akit.yaml` manifest, but akit successfully subscribed anyway: + +```bash +uvx --from federated-agent-kits akit add --global homeassistant-ai/skills home-assistant-best-practices +``` + +Result: 16 files rendered to `/home/felix/.agents/skills/home-assistant-best-practices/`, pinned to commit `166defa`. + +**Gap:** akit expects `.akit.yaml` for discovery; skills.sh repos use `SKILL.md` instead. akit falls back to cloning and scanning, but this should be documented. + +### MCP Server Setup + +Both recommended MCP servers support Docker deployment: + +**voska/hass-mcp:** +```bash +docker pull voska/hass-mcp:latest +# Add to opencode.jsonc mcpServers config +``` + +**tevonsb/homeassistant-mcp:** +```bash +docker compose up -d # from repo +# Requires .env with HASS_HOST, HASS_TOKEN, HASS_SOCKET_URL +``` + +## Recommendations + +### For Full Remote Agent Access + +**Install both:** + +1. **MCP Server: `voska/hass-mcp`** + - Lovelace dashboard editing with live updates + - Automatic backups before writes + - History/statistics queries with date ranges + - HTTP transport for remote access + +2. **Skill: `homeassistant-ai/skills@home-assistant-best-practices`** + - 9.6K installs, security audited + - Teaches native HA patterns (no templates where helpers exist) + - Safe refactoring workflow + - Works alongside MCP — skill guides *what*, MCP executes *how* + +### Architecture + +``` +┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐ +│ opencode │────►│ voska/hass-mcp │────►│ Home Assistant │ +│ (agent) │ MCP │ (Docker, LAN) │ WS │ (local network) │ +└─────────────────┘ └─────────────────┘ └──────────────────┘ + │ │ │ + │ HA_TOKEN in env Long-lived token + │ (never exposed) (admin for editing) + └─────────────────────────────────────────────────────┘ + Skill: home-assistant-best-practices (read-only knowledge) +``` + +### Why This Combination + +| Need | Solution | +|------|----------| +| Real-time control | WebSocket via MCP | +| Dashboard editing | voska Lovelace tools | +| Best practices | homeassistant-ai skill | +| History/stats | voska `get_statistics` | +| Security | MCP holds token, skill is read-only | + +## Gaps Identified + +1. **No akit-native HA kit** — homeassistant-ai/skills uses skills.sh format, not `.akit.yaml` +2. **No unified MCP standard** — 6+ incompatible MCP servers, no interoperability +3. **Permission scoping** — HA tokens are all-or-nothing; no fine-grained agent permissions +4. **Audit trail** — HA logs actions but doesn't attribute them to "agent" vs "user" + +## References + +- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) — 1k stars, 9.6K installs +- [voska/hass-mcp](https://github.com/voska/hass-mcp) — 353 stars, Lovelace editing +- [tevonsb/homeassistant-mcp](https://github.com/tevonsb/homeassistant-mcp) — 574 stars, add-on mgmt +- [HA WebSocket API](https://developers.home-assistant.io/docs/api/websocket/) +- [HA REST API](https://developers.home-assistant.io/docs/api/rest/) +- [skills.sh leaderboard](https://skills.sh/) + +## Related + +- [What an MCP server can be, and who can reach one](mcp_server_entry_points_and_transports.md) +- [skills.sh: repository layout and telemetry](skills_sh_repository_layout_and_telemetry.md) +- [Agent-integration layer and multi-vault interaction](agent_integration_layer_and_multi_vault_interaction_for_an_okf_conformant_pkb.md) diff --git a/docs/investigations/index.md b/docs/investigations/index.md index a72e6a2..e1c2369 100644 --- a/docs/investigations/index.md +++ b/docs/investigations/index.md @@ -10,6 +10,8 @@ decision it fed rather than on its own. A survey is a claim about what existed when it was written, so read one against its `generated` date. Where an investigation deliberately stops short of choosing, it says so. +**Latest:** [Agentic AI and Home Assistant Integration](agentic_ai_homeassistant_integration.md) — 9.6K-install skill + MCP server architecture for full remote agent access. + - [Open Knowledge Format (OKF): findings](open_knowledge_format_okf_findings.md) - what the format these pages are written in actually specifies - [Substrate options for an OKF-based agent-first LLM wiki: investigation](substrate_options_for_an_okf_based_agent_first_llm_wiki_investigation.md) - the survey of tools that could hold such a knowledge base, deliberately stopping short of choosing - [Agent-integration layer and multi-vault interaction for an OKF-conformant PKB](agent_integration_layer_and_multi_vault_interaction_for_an_okf_conformant_pkb.md) - how an agent reaches these pages, and how several bundles at different privacy tiers meet @@ -22,3 +24,4 @@ date. Where an investigation deliberately stops short of choosing, it says so. - [Travel management skills: what is portable out of a repo-shaped toolkit](travel_management_skills_portability.md) - counting how much of a 48-skill collection survives leaving the repository it ships in - [What an MCP server can be, and who can reach one](mcp_server_entry_points_and_transports.md) - two transports, five shapes and six callers, and the two variables that decide which are reachable - [Type annotations for a Python library: the options](type_annotation_options_for_a_python_library.md) - the syntax, checker and strictness choices a typing pull request makes without naming, with one from pyMOR placed among them +- [Agentic AI and Home Assistant Integration](agentic_ai_homeassistant_integration.md) - survey of skills and MCP servers for connecting AI agents to Home Assistant, with security and architecture findings From 71d0a318e917994764bd5d6dbde1bf7f61e4bc15 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:15:13 +0100 Subject: [PATCH 16/25] Add blueprint: Home Assistant agent integration via MCP (voska/hass-mcp + akit skill) --- ...ome_assistant_agent_integration_via_mcp.md | 316 ++++++++++++++++++ docs/blueprints/index.md | 1 + 2 files changed, 317 insertions(+) create mode 100644 docs/blueprints/home_assistant_agent_integration_via_mcp.md diff --git a/docs/blueprints/home_assistant_agent_integration_via_mcp.md b/docs/blueprints/home_assistant_agent_integration_via_mcp.md new file mode 100644 index 0000000..c7cbe84 --- /dev/null +++ b/docs/blueprints/home_assistant_agent_integration_via_mcp.md @@ -0,0 +1,316 @@ +--- +type: blueprint +title: Home Assistant Agent Integration via MCP +description: Full remote agent access to Home Assistant through MCP server and best-practices skill, without oh-my-openagent +status: implemented +generated: + by: opencode/qwen3.5-397b-a17b + at: 2026-11-24 +verified: + at: null + by: null +tags: +- home-automation +- mcp +- agent-integration +- smart-home +- blueprint +references: +- ../investigations/agentic_ai_homeassistant_integration.md +- https://github.com/voska/hass-mcp +- https://github.com/homeassistant-ai/skills +--- + +# Home Assistant Agent Integration via MCP + +## Overview + +This blueprint delivers **full remote agent access** to a Home Assistant instance through two components: + +1. **MCP Server** (`voska/hass-mcp`) — Real-time WebSocket connection for device control, Lovelace editing, history queries +2. **Best-Practices Skill** (`homeassistant-ai/skills`) — Read-only knowledge that prevents anti-patterns (native HA constructs over templates) + +**What the agent can do:** +- Read all entity states in real-time +- Control lights, locks, climate, media, covers, fans, switches +- Edit Lovelace dashboards with live preview + automatic backups +- Query historical data and statistics +- List and trigger automations +- All via secure MCP layer (token never exposed to agent) + +**What this blueprint does NOT require:** +- oh-my-openagent plugin (not used here) +- Docker (runs via `uvx` directly) +- Root access (fully rootless) +- Public internet exposure (local LAN only) + +## Prerequisites + +| Requirement | Why | How to verify | +|-------------|-----|---------------| +| Home Assistant instance (2024.x+) | MCP server connects via WebSocket API | `https://your-ha.local:8123` reachable | +| Long-lived access token | Authentication for MCP→HA connection | Profile → Security → Create token | +| opencode with MCP support | Loads MCP servers from config | `opencode --version` ≥ 2.x | +| `uv` package manager | Runs `hass-mcp` without Docker | `uv --version` | +| Local network access | HA must be reachable from opencode machine | `curl http://ha.local:8123/api/` | + +### Create Long-Lived Access Token + +1. Open Home Assistant UI +2. Click your user profile (bottom left) +3. Go to **Security** tab +4. Click **Create Long-Lived Access Token** +5. Name it `opencode-agent` (or similar) +6. Copy the token (starts with `eyJ...`) +7. Store securely — valid for 10 years, full user permissions + +## Installation + +### Step 1: Install the Skill (already done) + +The best-practices skill is already installed via akit: + +```bash +# Already executed: +# uvx --from federated-agent-kits akit add --global homeassistant-ai/skills home-assistant-best-practices +``` + +**Location:** `/home/felix/.agents/skills/home-assistant-best-practices/` (16 files) + +**What it does:** Teaches native HA patterns — e.g., use `condition: numeric_state` instead of `condition: template`, which HA validates at load time rather than failing silently at runtime. + +### Step 2: Configure MCP Server + +**Config file:** `~/.config/opencode/opencode.jsonc` + +The MCP entry has been added: + +```jsonc +"hass-mcp": { + "type": "local", + "command": ["uvx", "hass-mcp@latest"], + "env": { + "HA_URL": "{file:.env.hass_mcp_voska}", + "HA_TOKEN": "{file:.env.hass_mcp_voska}" + }, + "enabled": true +} +``` + +**Env file:** `~/.config/opencode/.env.hass_mcp_voska` + +```bash +HA_URL=http://homeassistant.local:8123 +HA_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...your_token_here +``` + +**Action required:** Fill in your actual `HA_URL` and `HA_TOKEN` in the env file. + +### Step 3: Restart opencode + +```bash +# Quit opencode if running +# Then restart: +opencode +``` + +The MCP server starts automatically on first agent request that needs HA access. + +## Configuration Details + +### Network Considerations + +**Local LAN (this blueprint):** +- `HA_URL` = `http://homeassistant.local:8123` or `http://192.168.x.x:8123` +- opencode machine must be on same network as HA +- No firewall changes needed +- Token transmitted unencrypted (LAN only) + +**Remote via Home Assistant Cloud:** +- `HA_URL` = `https://your-url.nabu.casa` +- Requires HA Cloud subscription (~$5/month) +- Encrypted tunnel, no port forwarding +- Same config, just different URL + +**Remote via VPN (Tailscale/ZeroTier):** +- `HA_URL` = `http://100.x.y.z:8123` (Tailscale IP) +- VPN must be active on opencode machine +- Encrypted, no public exposure + +### Security Model + +| Layer | Protection | +|-------|------------| +| **Token storage** | `.env.hass_mcp_voska` (mode 600, gitignored) | +| **Token exposure** | Never sent to agent — MCP holds it | +| **Network** | Local LAN only (unless HA Cloud/VPN) | +| **Rate limiting** | None built-in — agent self-limits | +| **Permissions** | Full user permissions — use non-admin user if concerned | +| **Audit trail** | HA logs all actions, attributed to token owner | + +### File Permissions + +```bash +chmod 600 ~/.config/opencode/.env.hass_mcp_voska +``` + +The env file is already set to mode 600 (owner read/write only). + +## Capabilities + +### What the Agent Can Do + +| Capability | Tool | Example | +|------------|------|---------| +| **Read entity state** | `get_entity` | "What's the temperature in the living room?" | +| **List entities** | `list_entities` | "Show me all lights in the bedroom" | +| **Control devices** | `entity_action` | "Turn off all kitchen lights" | +| **Call any service** | `call_service_tool` | "Activate the 'Movie Night' scene" | +| **Edit Lovelace** | `add_card`, `update_card`, etc. | "Add a temperature card to the dashboard" | +| **Query history** | `get_history`, `get_statistics` | "Show me energy usage last week" | +| **List automations** | `list_automations` | "What automations run at sunset?" | +| **Trigger automation** | `call_service_tool` | "Run the 'Good Morning' automation" | + +### Lovelace Dashboard Editing + +The voska MCP server supports **live Lovelace editing**: + +- `list_dashboards` — List all dashboards (storage mode only) +- `get_dashboard_config` — Get full dashboard config +- `add_card` / `update_card` / `remove_card` / `move_card` — Edit cards +- `list_view_sections` — List sections in a "sections"-type view +- `add_view` / `remove_view` / `update_view` — Edit views + +**Automatic backups:** Before every write, the current config is saved to `~/.hass-mcp/dashboard-backups/`. Can restore via `restore_dashboard`. + +**Important:** Only works with **storage-mode** dashboards (UI-managed). YAML-mode dashboards must be edited directly. + +## Testing + +### First Commands to Verify Connection + +After filling in the env file and restarting opencode, try these: + +1. **Basic connectivity:** + ``` + What's the current state of the sun entity? + ``` + Expected: Returns `above_horizon` or `below_horizon` + +2. **List entities:** + ``` + List all lights in my home + ``` + Expected: List of `light.*` entities with states + +3. **Read a sensor:** + ``` + What's the temperature in the living room? + ``` + Expected: Current temperature from your sensor + +4. **Control a device:** + ``` + Turn on the hallway light at 50% brightness + ``` + Expected: Light turns on, agent confirms + +5. **Query history:** + ``` + Show me the living room temperature over the last 24 hours + ``` + Expected: Historical data points + +### Troubleshooting Connection + +**"Connection refused" or "Cannot connect to HA":** +- Verify `HA_URL` is correct and reachable: `curl http://your-ha:8123/api/` +- Check HA is running: `systemctl status home-assistant@homeassistant` (if systemd) +- Ensure opencode machine is on same network + +**"Invalid token" or "Unauthorized":** +- Re-create the long-lived token in HA +- Ensure no trailing whitespace in `.env.hass_mcp_voska` +- Token must be for an existing HA user + +**"No Lovelace dashboards found":** +- Only **storage-mode** dashboards are editable +- YAML-mode dashboards must be edited directly +- Check: HA → Settings → Dashboards → see which are "Storage" vs "YAML" + +**MCP server not starting:** +- Check opencode logs for MCP startup errors +- Verify `uv` is installed: `uv --version` +- Test manually: `uvx hass-mcp --help` + +## Architecture + +``` +┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐ +│ opencode │────►│ voska/hass-mcp │────►│ Home Assistant │ +│ (agent) │ MCP │ (uvx process) │ WS │ (local network) │ +└─────────────────┘ └─────────────────┘ └──────────────────┘ + │ │ │ + │ HA_TOKEN in .env Long-lived token + │ (mode 600, never (full user perms) + │ exposed to agent) + │ + └─ home-assistant-best-practices skill (read-only knowledge) + /home/felix/.agents/skills/home-assistant-best-practices/ +``` + +**Key properties:** +- MCP server runs as local process (no Docker) +- Token stored in env file, read by MCP only +- Agent never sees token — calls MCP tools +- Skill guides *what* to write, MCP executes *how* + +## Maintenance + +### Updating the MCP Server + +```bash +# MCP server updates automatically via @latest in config +# To force update, clear uv cache: +uv cache clean +``` + +### Updating the Skill + +```bash +# Skill is pinned by akit to commit 166defa +# To update: +uvx --from federated-agent-kits akit update --global home-assistant-best-practices +``` + +### Rotating the Token + +If the token is compromised: + +1. Revoke old token: HA → Profile → Security → Revoke +2. Create new token +3. Update `.env.hass_mcp_voska` +4. Restart opencode + +### Backups + +**Lovelace backups:** Automatic, stored in `~/.hass-mcp/dashboard-backups/` + +**HA instance backups:** Use HA's built-in backup system (Settings → System → Backups) + +**Config backups:** The `.env.hass_mcp_voska` file is your responsibility — back it up securely. + +## Related + +- [Investigation: Agentic AI and Home Assistant Integration](../investigations/agentic_ai_homeassistant_integration.md) — full survey of skills and MCP servers +- [What an MCP server can be, and who can reach one](../investigations/mcp_server_entry_points_and_transports.md) — MCP architecture patterns +- [voska/hass-mcp documentation](https://github.com/voska/hass-mcp) — upstream MCP server docs +- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) — best-practices skill source + +## Changelog + +- **2026-11-24** — Initial blueprint, based on investigation findings + - Skill installed via akit (16 files rendered) + - MCP config added to `opencode.jsonc` + - Env file template created (`.env.hass_mcp_voska`) + - Awaiting user to fill in actual HA_URL and HA_TOKEN diff --git a/docs/blueprints/index.md b/docs/blueprints/index.md index ba3909e..02541e7 100644 --- a/docs/blueprints/index.md +++ b/docs/blueprints/index.md @@ -2,5 +2,6 @@ The concrete, copyable artefact a decision produced. +- [Home Assistant Agent Integration via MCP](home_assistant_agent_integration_via_mcp.md) — full remote agent access to HA through MCP server and best-practices skill, without oh-my-openagent - [MkDocs Material PKB publishing stack](mkdocs_material_pkb_publishing_stack.md) - the stack this site runs on, component by component, with the reasons attached - [Sharing one knowledge bundle on two branches](sharing_one_knowledge_bundle_on_two_branches.md) - what a bundle looks like once several people file into it, and the published branch takes no direct pushes From 97f54a328a3cb53fc02cc8a02e56ded58d516417 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:01:58 +0100 Subject: [PATCH 17/25] Add finding: Autologon set up with Autologon.exe is gone after the next boot --- ...tologon_exe_is_gone_after_the_next_boot.md | 71 +++++++++++++++++++ docs/findings/index.md | 1 + docs/log.md | 5 ++ 3 files changed, 77 insertions(+) create mode 100644 docs/findings/20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md diff --git a/docs/findings/20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md b/docs/findings/20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md new file mode 100644 index 0000000..2e238f1 --- /dev/null +++ b/docs/findings/20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md @@ -0,0 +1,71 @@ +--- +type: Finding +title: Autologon set up with Autologon.exe is gone after the next boot +description: The unattend file behind the install leaves an AutoLogonCount that Autologon.exe does + not reset, and once earlier logons have spent it, the next boot logs nobody on and deletes the new + settings with the old. +tags: +- finding +- windows +- autologon +- sysinternals +- vagrant +status: stable +stale_after: '2027-05-30' +generated: + by: opencode/claude-opus-5.5 + at: '2026-11-30T10:00:00+01:00' +sources: +- id: box-autounattend + resource: https://github.com/gusztavvargadr/packer/blob/master/src/windows/vagrant/Autounattend.xml + title: 'gusztavvargadr/packer: the Autounattend.xml behind its Vagrant boxes' + last_modified: '2026-11-30' +--- +Sysinternals `Autologon.exe` checks the password, writes the autologon settings and exits without +complaint. The next boot still stops at the sign-in screen. Afterwards the Winlogon key, +`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`, holds no `AutoAdminLogon`, +`DefaultUserName` or `DefaultDomainName` at all. The values are not wrong; they are gone. + +Observed on Windows 11 Enterprise Evaluation 25H2, build 26200, in a VM that +[windows-vm](https://github.com/ftschindler/windows-vm) provisions from the Vagrant box +`gusztavvargadr/windows-11` 2601.0.0. + +## Cause + +The box was installed from an unattend file that turns on autologon for `vagrant` with a +`LogonCount` of 2[^box-autounattend]. Windows Setup writes that as `AutoLogonCount` in the +Winlogon key, and every automatic logon counts it down. Provisioning reboots the VM at least twice +before its last step, so `vagrant` has spent both logons by the time that step sets up a different +account. + +`Autologon.exe` writes the account, the domain and the password, and leaves `AutoLogonCount` at 0. +The next boot finds the count spent, logs nobody on and removes the autologon settings, the new +ones included. + +Nothing records this as a failure. The Security log shows two automatic logons as `vagrant`, then +a successful logon as the new account from `Autologon.exe` itself, which is how it checks the +password. The boot after that logs no attempt for any user account, failed or otherwise. + +## How to get past it + +Delete `AutoLogonCount` when setting up autologon on a machine that an unattend file installed. +Without the value, autologon has no limit: + +```powershell +$winlogon = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" +if (Get-ItemProperty -Path $winlogon -Name "AutoLogonCount" -ErrorAction SilentlyContinue) { + Remove-ItemProperty -Path $winlogon -Name "AutoLogonCount" +} +``` + +Where the settings have already gone, run `Autologon.exe` again afterwards. With both done, the VM +logged the account on 11 seconds after a cold boot, and the settings were still in place after +that logon. + +## What it is not + +Not the password: the check `Autologon.exe` makes is a real logon, and it succeeded. Not Windows +11's passwordless setting either: `DevicePasswordLessBuildVersion` was 2 throughout, and autologon +works with it once the counter is gone. Not the 32-bit `Autologon.exe` writing to the +`WOW6432Node` view of the registry, since the same binary, run again, set up the autologon that +worked. And not the domain: `.` works for a local account. diff --git a/docs/findings/index.md b/docs/findings/index.md index 2ff1d7a..ac0192e 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -22,6 +22,7 @@ And the subject lives in the tags rather than in a directory, per ### November +- 2026-11-30: [Autologon set up with Autologon.exe is gone after the next boot](20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md) - a logon counter the unattended install left behind, spent before the new account is set up, and a boot that clears the lot without logging a failure - 2026-11-18: [An MCP server without tool annotations looks destructive to every client](20261118_an_mcp_server_without_tool_annotations_looks_destructive_to_every_client.md) - every hint defaults to the cautious value, so a query tool and a mail-sending one look the same until the server says otherwise - 2026-11-17: [The Plasma lock screen logs a failed login on every resume, and faillock locks the account](20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md) - no keypress at all, just a cancelled password prompt that pam_unix calls a wrong password - 2026-11-10: [docker volume prune -a deletes a Compose database while the stack is down](20261110_docker_volume_prune_a_deletes_a_compose_database_while_the_stack_is_down.md) - volumes named after the directory, a stopped stack that leaves its database unattached, and the worktree that quietly gets an empty one diff --git a/docs/log.md b/docs/log.md index 97ac442..3d3a359 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,9 @@ # Log +## 2026-11-30 + +- add finding, "Autologon set up with Autologon.exe is gone after the next boot" + ## 2026-11-18 - add tool page, "Math*DB MCP (MaRDI4NFDI)", as a draft @@ -20,6 +24,7 @@ - added a section to the tool page "Inference Manager (Canonical)" on sudo not finding snap commands on Arch, and the sudoers drop-in that fixes it - add tool page, "Inference Manager (Canonical)", on the inference CLI and proxy over Canonical's inference snaps, written from the documentation + ## 2026-11-15 - add hardware page, "Lenovo ThinkPad X390 Yoga", a 13-inch Whiskey Lake convertible with Wacom pen and touch, classic Realtek HDA audio, and no discrete GPU From c3b9bcc5248a0490541a862a289311875ba7845c Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:01:34 +0100 Subject: [PATCH 18/25] Add finding on the Wayland freeze after an i915 GPU hang, and a draft guide for moving to xe --- ...n_i915_gpu_hang_whilst_audio_carries_on.md | 90 ++++++++++++++ docs/findings/index.md | 4 + docs/guides/index.md | 1 + .../move_an_alder_lake_gpu_from_i915_to_xe.md | 116 ++++++++++++++++++ docs/hardware/dell_precision_5470.md | 1 + docs/log.md | 6 + 6 files changed, 218 insertions(+) create mode 100644 docs/findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md create mode 100644 docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md diff --git a/docs/findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md b/docs/findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md new file mode 100644 index 0000000..0380bab --- /dev/null +++ b/docs/findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md @@ -0,0 +1,90 @@ +--- +type: Finding +title: Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on +description: A desktop that stops drawing and accepts no keys, not even a switch to a TTY, whilst + the kernel, audio and network run on for minutes, because the compositor did not survive a GPU + context reset. +tags: +- finding +- linux +- kde +- plasma +- wayland +- kwin +- i915 +- debugging +status: stable +stale_after: '2027-06-03' +generated: + by: opencode/claude-opus-5.5 + at: '2026-12-03T11:05:00+01:00' +--- +The screen froze mid-call and took the keyboard with it: no pointer, no Ctrl+Alt+F3, nothing. +The Teams call in Chromium carried on for another quarter of an hour, both ways, until the power +key ended it. The machine was not frozen. Only the desktop was, and the journal says exactly when +it stopped. + +Observed on a [Dell Precision 5470](../hardware/dell_precision_5470.md) (Alder Lake-P, Iris Xe, +PCI ID `8086:46a6`, i915 driver), kernel 6.18.63, Plasma and KWin 6.8.2, Mesa 26.2.7, a few days +after switching from X11 to Wayland. + +## Symptom + +The picture stops, input stops, and switching to a text console does nothing. Audio and +networking keep working, so a call stays up and the other side hears you. + +## What the journal shows + +Unlike [a hard freeze](20261014_a_hard_freeze_leaves_no_journal_and_the_last_entry_is_not_where_it_hung.md), +this boot's journal runs on to the reboot. Chromium, earlyoom, clamd and the update checker all +logged for the next 14 minutes, and the last line is logind seeing the power key. Everything +before that worth reading is in one second: + +```text +10:30:29.491 kernel: i915 0000:00:02.0: [drm] GPU HANG: ecode 12:1:85dffffb, in QSGRenderThread [7240] +10:30:29.491 kernel: i915 0000:00:02.0: [drm] GPU error state saved to /sys/class/drm/card1/error +10:30:29.491 kernel: i915 0000:00:02.0: [drm] QSGRenderThread[7240] context reset due to GPU hang +10:30:29.520 plasmashell[3100]: QRhiGles2: Context is lost. +10:30:29.520 plasmashell[3100]: Graphics device lost, cleaning up scenegraph and releasing RHI +``` + +**That second is the freeze**, confirmed against when the screen actually stopped. Neither +`plasmashell` nor `kwin_wayland` logged anything afterwards. Firefox had started nine seconds +earlier, which is a candidate trigger and no more than that on one occurrence. + +The previous day had warnings from the same direction: three `Failed to allocate a graphics +buffer for a swapchain` from `kwin_wayland`, and one `The main thread was hanging temporarily!` +straight after the lid closed. + +## Why there is no TTY + +On Wayland the compositor owns the keyboard. Ctrl+Alt+F3 reaches KWin, which asks logind to +switch virtual terminals. With KWin stuck, the request is never made, so a healthy kernel looks +like a dead one. Under X11 the X server did this, which is why the failure only appeared after +the switch. + +## What to do when it happens + +These are the things that settle what hung, and they have to happen before the reboot: + +- **Get in from another device.** Over SSH, `ps -o pid,stat,wchan:30,cmd -C kwin_wayland,plasmashell` + shows whether either is stuck in the driver (`D`) or in itself. +- **Keep the GPU error state.** `sudo cat /sys/class/drm/card1/error > ~/i915-error.txt`. It is + cleared by the reboot, which is how this one was lost. +- **Try `pkill -9 plasmashell`, then `kwin_wayland`.** Either may bring the session back, or at + least drop to the login screen. +- **Otherwise reboot with SysRq, not the power key.** Manjaro ships `kernel.sysrq = 16`, which + allows sync and nothing else. Setting it to `1` in `/etc/sysctl.d/99-sysrq.conf` enables the + rest; on a laptop SysRq is the Print Screen key, so Alt+PrtScr and then R, E, I, S, U, B, a + second apart. R alone takes the keyboard back from the compositor and may already make + Ctrl+Alt+F3 work. S writes the journal out, which the power key does not. + +## What it is not + +One driver-recovered GPU hang is not failing hardware; +[the hardware checks](../guides/decide_whether_a_linux_freeze_is_failing_hardware.md) exist for +the case where it might be. KWin is meant to survive a context reset, so this is a bug somewhere +between Plasma, Mesa and i915. Going back to X11 to tell those apart is not available, since +Plasma 6.8 no longer ships an X11 session. Running the GPU on the newer `xe` driver instead is the +remaining way to take i915 out of the picture: +[Move an Alder Lake GPU from i915 to xe](../guides/move_an_alder_lake_gpu_from_i915_to_xe.md). diff --git a/docs/findings/index.md b/docs/findings/index.md index ac0192e..c162539 100644 --- a/docs/findings/index.md +++ b/docs/findings/index.md @@ -20,6 +20,10 @@ And the subject lives in the tags rather than in a directory, per ## 2026 +### December + +- 2026-12-03: [Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on](20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md) - a desktop that never recovers from a GPU reset, no TTY because the compositor owns the keyboard, and what to catch before rebooting + ### November - 2026-11-30: [Autologon set up with Autologon.exe is gone after the next boot](20261130_autologon_set_up_with_autologon_exe_is_gone_after_the_next_boot.md) - a logon counter the unattended install left behind, spent before the new account is set up, and a boot that clears the lot without logging a failure diff --git a/docs/guides/index.md b/docs/guides/index.md index eb8172c..69fd3bc 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -20,3 +20,4 @@ Conventions: - [Add Scaleway as an opencode provider](add_scaleway_as_an_opencode_provider.md) - one API key and a native provider block, then a pin for every oh-my-openagent slot, mapped from a catalogue measured with real inference calls - [Pin an AUR package to an older version with a paru PKGBUILD repo](pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md) - masking the AUR with a local checkout when the distribution is too far behind to satisfy an exact dependency, and the Mode setting that makes it a no-op - [Cap the Docker build cache on rootless Docker](cap_the_docker_build_cache_on_rootless_docker.md) - one daemon.json setting in the user's config rather than /etc, and the buildx check that proves it was read +- [Move an Alder Lake GPU from i915 to xe](move_an_alder_lake_gpu_from_i915_to_xe.md) - a GRUB entry booted once, so a failed attempt falls back to i915 by itself; not yet carried out diff --git a/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md b/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md new file mode 100644 index 0000000..a013a69 --- /dev/null +++ b/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md @@ -0,0 +1,116 @@ +--- +type: Guide +title: Move an Alder Lake GPU from i915 to xe +description: Boot an Alder Lake laptop on the experimental xe driver through a GRUB entry used + once and then forgotten, so a failed attempt costs one reboot and the way back needs no menu. +tags: +- guide +- linux +- i915 +- xe +- grub +- hardware +status: draft +stale_after: '2027-06-03' +generated: + by: opencode/claude-opus-5.5 + at: '2026-12-03T11:05:00+01:00' +--- +Intel's `xe` driver can run Alder Lake graphics, but only when forced, and only as experimental +support. The reason to try it is to take i915 out of a fault such as +[Plasma freezing after an i915 GPU hang](../findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md). +The cost is new bugs of its own, in suspend, docking or video decoding. + +This is written for a [Dell Precision 5470](../hardware/dell_precision_5470.md) on Manjaro: GRUB +with `GRUB_DEFAULT=saved` and `GRUB_SAVEDEFAULT=true`, an encrypted root, kernel 6.18 with +`xe.ko` already present, and the GPU at PCI ID `8086:46a6`. Check yours with +`lspci -nn -s 00:02.0` and substitute it throughout. Not yet carried out, hence the draft. + +## 1. Know the way back before you start + +**The existing entry is the backup, and nothing below touches it.** The test entry is booted +once with `grub-reboot`, which does not change the default, and it carries no `savedefault`, so +the boot after it is i915 again whatever happens. If the xe boot freezes or stays black, +Alt+PrtScr+R, E, I, S, U, B reboots into the old setup without anyone touching a menu. That needs +`kernel.sysrq = 1`; Manjaro ships 16. + +The menu is hidden (`GRUB_TIMEOUT_STYLE=hidden`). Holding Esc as the machine starts shows it, +and the older 6.12 kernel in it is a second fallback. + +## 2. Add the xe entry + +Copy the existing Manjaro entry out of the generated config, under a new name: + +```bash +sudo awk '/^menuentry .Manjaro Linux. /,/^}/' /boot/grub/grub.cfg +``` + +Paste it at the end of `/etc/grub.d/40_custom`, below the `exec tail` line, then edit three +things: + +- rename it `menuentry 'Manjaro (xe)'`, and drop the `--id` and `$menuentry_id_option` parts; +- **delete the `savedefault` line**, which is what makes the test one-shot; +- append `i915.force_probe=!46a6 xe.force_probe=46a6` to the `linux` line. The first stops i915 + claiming the device; without it i915 wins and nothing changes. + +The entry names `/boot/vmlinuz-6.18-x86_64`, which every 6.18 update replaces in place, so it +survives kernel updates within that series and not a move to the next one. Regenerate: + +```bash +sudo grub-mkconfig -o /boot/grub/grub.cfg +grep -A3 "Manjaro (xe)" /boot/grub/grub.cfg # must show the force_probe parameters +``` + +## 3. Boot it once + +```bash +sudo grub-reboot "Manjaro (xe)" +sudo grub-editenv list # next_entry=Manjaro (xe) +``` + +Then reboot. + +## 4. Confirm it is really xe + +```bash +lspci -k -s 00:02.0 # Kernel driver in use: xe +journalctl -b -k | grep -iE 'xe |guc|huc|dmc' | head -30 +vainfo 2>&1 | grep -iE 'driver|H264' +``` + +Firmware loads from `/usr/lib/firmware/i915/adlp_*`, which is the same set i915 uses, so a +missing-firmware line means something else is wrong. `vainfo` matters because video calls +decode and encode through it; if it errors, calls fall back to the CPU. + +Then use the machine normally for a day: a call, an undock, a suspend and resume. + +## 5. Make it the default, or don't + +If it held up: + +```bash +sudo grub-set-default "Manjaro (xe)" +``` + +From here the way back is no longer automatic. `sudo grub-set-default "Manjaro Linux"` +restores i915; so does picking the normal entry from the menu with Esc, because that entry +still saves itself as the default. + +## 6. If it does not come back at all + +Only possible after step 5, since before it every boot after a failed one is i915. In order: + +1. Hold Esc at power-on, choose **Manjaro Linux**. It boots i915 and becomes the default again. +2. If the menu shows but the entry also fails, press `e` on it, delete the two `force_probe` + parameters from the `linux` line and press Ctrl+X. This edit is not saved. +3. From a Manjaro live USB, unlock and mount the root, then reset the default: + + ```bash + sudo cryptsetup open /dev/disk/by-uuid/5af18995-b106-4b9e-8e73-c43593bd45ec linux-crypt + sudo vgchange -ay + sudo mount /dev/linux-crypt-vg/root /mnt + sudo grub-editenv /mnt/boot/grub/grubenv unset saved_entry + ``` + + If `/boot` is a separate partition, mount it at `/mnt/boot` first. The UUID is the + `cryptdevice=` value from `/proc/cmdline`. diff --git a/docs/hardware/dell_precision_5470.md b/docs/hardware/dell_precision_5470.md index ca8b734..4b8d750 100644 --- a/docs/hardware/dell_precision_5470.md +++ b/docs/hardware/dell_precision_5470.md @@ -117,3 +117,4 @@ something else, and on this machine it is noise. - [ahci probe fails with error -12 on an Intel VMD machine](../findings/20261014_ahci_probe_fails_with_error_12_on_an_intel_vmd_machine.md), a line this machine has logged at every boot since it was installed, and which reads as a storage fault - [A hard freeze leaves no journal, and the last entry is not where it hung](../findings/20261014_a_hard_freeze_leaves_no_journal_and_the_last_entry_is_not_where_it_hung.md), met after three failed boots here, and general to any machine running journald - [The Plasma lock screen logs a failed login on every resume](../findings/20261117_the_plasma_lock_screen_logs_a_failed_login_on_every_resume.md), which looks like phantom input and is the lock screen cancelling its own password prompt +- [Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on](../findings/20261203_plasma_on_wayland_freezes_after_an_i915_gpu_hang_whilst_audio_carries_on.md), the first fault seen here after moving to Wayland diff --git a/docs/log.md b/docs/log.md index 3d3a359..152d1db 100644 --- a/docs/log.md +++ b/docs/log.md @@ -1,5 +1,11 @@ # Log +## 2026-12-03 + +- add finding, "Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on" +- add guide, "Move an Alder Lake GPU from i915 to xe", as a draft +- link the new finding from "Dell Precision 5470" + ## 2026-11-30 - add finding, "Autologon set up with Autologon.exe is gone after the next boot" From 2c6ce49fa33794906355fe70b9269555ab0591ba Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:10:17 +0100 Subject: [PATCH 19/25] Revise the xe guide after carrying it out: VA-API driver, xe as default, i915 fallback entry --- docs/guides/index.md | 2 +- .../move_an_alder_lake_gpu_from_i915_to_xe.md | 78 +++++++++++++------ docs/log.md | 1 + 3 files changed, 56 insertions(+), 25 deletions(-) diff --git a/docs/guides/index.md b/docs/guides/index.md index 69fd3bc..e14ec03 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -20,4 +20,4 @@ Conventions: - [Add Scaleway as an opencode provider](add_scaleway_as_an_opencode_provider.md) - one API key and a native provider block, then a pin for every oh-my-openagent slot, mapped from a catalogue measured with real inference calls - [Pin an AUR package to an older version with a paru PKGBUILD repo](pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md) - masking the AUR with a local checkout when the distribution is too far behind to satisfy an exact dependency, and the Mode setting that makes it a no-op - [Cap the Docker build cache on rootless Docker](cap_the_docker_build_cache_on_rootless_docker.md) - one daemon.json setting in the user's config rather than /etc, and the buildx check that proves it was read -- [Move an Alder Lake GPU from i915 to xe](move_an_alder_lake_gpu_from_i915_to_xe.md) - a GRUB entry booted once, so a failed attempt falls back to i915 by itself; not yet carried out +- [Move an Alder Lake GPU from i915 to xe](move_an_alder_lake_gpu_from_i915_to_xe.md) - a GRUB entry booted once to test it, then xe for every entry and a hand-written one kept for i915 diff --git a/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md b/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md index a013a69..2e12b5e 100644 --- a/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md +++ b/docs/guides/move_an_alder_lake_gpu_from_i915_to_xe.md @@ -2,7 +2,8 @@ type: Guide title: Move an Alder Lake GPU from i915 to xe description: Boot an Alder Lake laptop on the experimental xe driver through a GRUB entry used - once and then forgotten, so a failed attempt costs one reboot and the way back needs no menu. + once and then forgotten, then make it the default with a hand-written i915 entry kept as the way + back. tags: - guide - linux @@ -10,11 +11,11 @@ tags: - xe - grub - hardware -status: draft +status: stable stale_after: '2027-06-03' generated: by: opencode/claude-opus-5.5 - at: '2026-12-03T11:05:00+01:00' + at: '2026-12-03T11:30:00+01:00' --- Intel's `xe` driver can run Alder Lake graphics, but only when forced, and only as experimental support. The reason to try it is to take i915 out of a fault such as @@ -24,7 +25,8 @@ The cost is new bugs of its own, in suspend, docking or video decoding. This is written for a [Dell Precision 5470](../hardware/dell_precision_5470.md) on Manjaro: GRUB with `GRUB_DEFAULT=saved` and `GRUB_SAVEDEFAULT=true`, an encrypted root, kernel 6.18 with `xe.ko` already present, and the GPU at PCI ID `8086:46a6`. Check yours with -`lspci -nn -s 00:02.0` and substitute it throughout. Not yet carried out, hence the draft. +`lspci -nn -s 00:02.0` and substitute it throughout. Carried out on 2026-12-03 with +`intel-media-driver` 26.3.5. ## 1. Know the way back before you start @@ -78,39 +80,67 @@ journalctl -b -k | grep -iE 'xe |guc|huc|dmc' | head -30 vainfo 2>&1 | grep -iE 'driver|H264' ``` -Firmware loads from `/usr/lib/firmware/i915/adlp_*`, which is the same set i915 uses, so a -missing-firmware line means something else is wrong. `vainfo` matters because video calls -decode and encode through it; if it errors, calls fall back to the CPU. +Firmware loads from `/usr/lib/firmware/i915/`, the same files i915 uses: DMC from +`adlp_dmc.bin`, GuC from `adlp_guc_70.bin` and HuC from `tgl_huc.bin`. A missing-firmware line +means something other than the driver is wrong. + +`vainfo` matters because video calls decode and encode through it; if it errors, calls fall +back to the CPU. **An error here is usually not xe.** `vaInitialize failed with error code -1` +means no VA-API driver for this GPU is installed: Manjaro's `libva-intel-driver` is the old +i965 driver, which stops before Iris Xe, so the GPU had no video acceleration under i915 +either. Install Intel's current one, which works with both drivers: + +```bash +sudo pacman -S intel-media-driver +vainfo | grep -E 'Driver version|H264Main' # iHD, with VLD and EncSlice entry points +``` + +A video call in Chromium logging `[OpenH264]` warnings is the visible sign of the missing +driver: that is the software encoder. Then use the machine normally for a day: a call, an undock, a suspend and resume. -## 5. Make it the default, or don't +## 5. Make it the default, keeping i915 by hand -If it held up: +Making the test entry the default would leave every generated entry on i915 and the custom one +on a kernel path frozen at 6.18. The other way round is sturdier: put the parameters into +`/etc/default/grub`, so every generated entry uses xe through kernel updates and series +changes, and make the custom entry the i915 one. -```bash -sudo grub-set-default "Manjaro (xe)" -``` +1. Append the two parameters to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`, keeping + a copy of the file first. +2. In `/etc/grub.d/40_custom`, rename the entry `'Manjaro (i915)'` and **remove** the two + `force_probe` parameters from its `linux` line. It still carries no `savedefault`, so + choosing it once does not make it the default. +3. Regenerate and check that only the fallback lacks them: + + ```bash + sudo grub-mkconfig -o /boot/grub/grub.cfg + sudo grep -E '^\s*(menuentry|submenu)|force_probe' /boot/grub/grub.cfg + ``` -From here the way back is no longer automatic. `sudo grub-set-default "Manjaro Linux"` -restores i915; so does picking the normal entry from the menu with Esc, because that entry -still saves itself as the default. +`saved_entry` stays on the normal entry, which now means xe. Note that the older kernel's entry +gets the parameters too, so the fallback is a different driver on the same kernel, not an older +kernel. -## 6. If it does not come back at all +## 6. Getting back to i915 -Only possible after step 5, since before it every boot after a failed one is i915. In order: +In order of effort: -1. Hold Esc at power-on, choose **Manjaro Linux**. It boots i915 and becomes the default again. -2. If the menu shows but the entry also fails, press `e` on it, delete the two `force_probe` - parameters from the `linux` line and press Ctrl+X. This edit is not saved. -3. From a Manjaro live USB, unlock and mount the root, then reset the default: +1. **For one boot:** hold Esc at power-on and choose **Manjaro (i915)**. Nothing is saved, so + the next boot is xe again. +2. **If that entry fails too:** press `e` on **Manjaro Linux**, delete the two `force_probe` + parameters from the `linux` line and press Ctrl+X. This edit is not saved either. +3. **For good:** remove the two parameters from `/etc/default/grub` and regenerate. The copy + made in step 5 is the file as it was. +4. **If nothing boots to a desktop:** the parameters are not what is wrong, since the fallback + lacks them. A text console or a live USB is the next step, with the root unlocked as below + and `/boot` (a separate partition here) mounted at `/mnt/boot`: ```bash sudo cryptsetup open /dev/disk/by-uuid/5af18995-b106-4b9e-8e73-c43593bd45ec linux-crypt sudo vgchange -ay sudo mount /dev/linux-crypt-vg/root /mnt - sudo grub-editenv /mnt/boot/grub/grubenv unset saved_entry ``` - If `/boot` is a separate partition, mount it at `/mnt/boot` first. The UUID is the - `cryptdevice=` value from `/proc/cmdline`. + The UUID is the `cryptdevice=` value from `/proc/cmdline`. diff --git a/docs/log.md b/docs/log.md index 152d1db..ceba93c 100644 --- a/docs/log.md +++ b/docs/log.md @@ -5,6 +5,7 @@ - add finding, "Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on" - add guide, "Move an Alder Lake GPU from i915 to xe", as a draft - link the new finding from "Dell Precision 5470" +- revise "Move an Alder Lake GPU from i915 to xe" after carrying it out, and take it out of draft ## 2026-11-30 From a7880b164991867e5c310d4a1e921509c3e58a6c Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 22:13:36 +0100 Subject: [PATCH 20/25] Add investigation: LeOn Audio-Aufnahme Sicherheitsanalyse --- docs/investigations/index.md | 3 +- .../leon_audio_security_analysis.md | 279 ++++++++++++++++++ docs/log.md | 1 + 3 files changed, 281 insertions(+), 2 deletions(-) create mode 100644 docs/investigations/leon_audio_security_analysis.md diff --git a/docs/investigations/index.md b/docs/investigations/index.md index e1c2369..86e4e9a 100644 --- a/docs/investigations/index.md +++ b/docs/investigations/index.md @@ -10,8 +10,6 @@ decision it fed rather than on its own. A survey is a claim about what existed when it was written, so read one against its `generated` date. Where an investigation deliberately stops short of choosing, it says so. -**Latest:** [Agentic AI and Home Assistant Integration](agentic_ai_homeassistant_integration.md) — 9.6K-install skill + MCP server architecture for full remote agent access. - - [Open Knowledge Format (OKF): findings](open_knowledge_format_okf_findings.md) - what the format these pages are written in actually specifies - [Substrate options for an OKF-based agent-first LLM wiki: investigation](substrate_options_for_an_okf_based_agent_first_llm_wiki_investigation.md) - the survey of tools that could hold such a knowledge base, deliberately stopping short of choosing - [Agent-integration layer and multi-vault interaction for an OKF-conformant PKB](agent_integration_layer_and_multi_vault_interaction_for_an_okf_conformant_pkb.md) - how an agent reaches these pages, and how several bundles at different privacy tiers meet @@ -25,3 +23,4 @@ date. Where an investigation deliberately stops short of choosing, it says so. - [What an MCP server can be, and who can reach one](mcp_server_entry_points_and_transports.md) - two transports, five shapes and six callers, and the two variables that decide which are reachable - [Type annotations for a Python library: the options](type_annotation_options_for_a_python_library.md) - the syntax, checker and strictness choices a typing pull request makes without naming, with one from pyMOR placed among them - [Agentic AI and Home Assistant Integration](agentic_ai_homeassistant_integration.md) - survey of skills and MCP servers for connecting AI agents to Home Assistant, with security and architecture findings +- [LeOn Audio-Aufnahme: Sicherheitsanalyse](leon_audio_security_analysis.md) - Technische Analyse der LeOn-App Audio-Aufzeichnungen mit Fokus auf TLS-Sicherheit, ML-Training und Voice-Cloning-Risiken nach dem NSA-Advisory vom 2. Dezember 2026 \ No newline at end of file diff --git a/docs/investigations/leon_audio_security_analysis.md b/docs/investigations/leon_audio_security_analysis.md new file mode 100644 index 0000000..ba4380c --- /dev/null +++ b/docs/investigations/leon_audio_security_analysis.md @@ -0,0 +1,279 @@ +--- +type: Investigation +title: 'LeOn Audio-Aufnahme: Sicherheitsanalyse' +description: Technische Analyse der LeOn-App Audio-Aufzeichnungen mit Fokus auf TLS-Sicherheit, ML-Training und Voice-Cloning-Risiken nach dem NSA-Advisory vom 2. Dezember 2026 +status: stable +generated: + by: opencode/qwen3.5-397b-a17b + at: 2026-12-03 +tags: +- security +- privacy +- machine-learning +- tls +- voice-cloning +- school-software +references: +- https://www.leon-nrw.de +- https://words.filippo.io/nsa-advisory/ +- https://www.outermedia.de/referenzen/leon +--- + +## LeOn Audio-Aufnahme: Sicherheitsanalyse + +### Was ist LeOn? + +LeOn (Leseraum Online) ist eine webbasierte Anwendung zur Leseförderung für Schülerinnen und Schüler der zweiten bis sechsten Klasse. Entwickelt wurde sie vom Lehrstuhl für Fachdidaktik Deutsch der Technischen Universität Chemnitz (Prof. Dr. Michael Krelle) und der OUTERMEDIA GmbH in Berlin. Gefördert wird das Projekt vom Ministerium für Schule und Bildung des Landes Nordrhein-Westfalen. + +Seit dem Schuljahr 2023/24 steht LeOn allen allgemeinbildenden Schulen in NRW kostenfrei zur Verfügung. Rund 120.000 Nutzerinnen und Nutzer an mehr als 3.400 Schulen verwenden die Anwendung (Stand: Februar 2025). Im Februar 2025 erhielt LeOn den Deutschen Lesepreis 2025 in der Kategorie "Herausragende Leseförderung mit digitalen Medien". + +### Die Einwilligungsfrage + +Für die Nutzung von LeOn benötigen Erziehungsberechtigte zwei separate Einwilligungen: + +1. **Allgemeine Nutzung:** Kenntnisnahme der Datenschutzerklärung und Nutzungsbedingungen +2. **Audio-Aufzeichnungen:** Separate, freiwillige Einwilligung für die Aufnahme von Leseübungen (Karaoke-Raum und Hörspielwerkstatt) + +Die Audio-Funktion ermöglicht es Kindern, das Vorlesen von Lesetexten aufzunehmen und für die Lehrkraft freizuschalten. Diese kann damit den Leselernprozess individueller fördern und persönliches Feedback geben. + +### Fazit vorweg: Von der Audio-Aufnahme ist abzuraten + +**Vor dem Hintergrund der aktuellen Sicherheitslage im Internet sollten Erziehungsberechtigte der Audio-Aufzeichnung in LeOn nicht zustimmen.** + +Die Risiken überwiegen den pädagogischen Nutzen. Die technischen Schutzmassnahmen sind nach aktuellen Erkenntnissen nicht ausreichend, um die Stimme Ihres Kindes vor unbefugtem Zugriff zu schützen. Einmal erfasste Audiodaten können nicht zuverlässig gelöscht werden und bleiben potentiell dauerhaft verfügbar. + +### Das gravierendste Problem: Mithören genügt + +#### TLS-Verschlüsselung bietet keinen zuverlässigen Schutz mehr + +LeOn verwendet zur Datenübertragung TLS 1.3 mit der Verschlüsselung `TLS_AES_256_GCM_SHA384`. Das Zertifikat wird von DigiCert ausgestellt und ist bis Januar 2027 gültig. Diese Angaben stammen aus den HTTP-Headern der LeOn-Server (Stand: Dezember 2026). + +**Das Problem:** TLS 1.3 verwendet für den Schlüsselaustausch standardmäßig elliptische Kurven wie X25519 oder P-256. Am 2. Dezember 2026 veröffentlichte die NSA einen Advisory, der vor diesen Verfahren warnt. Der Kryptograph Filippo Valsorda analysierte den Advisory auf words.filippo.io und kam zu dem Schluss: + +> "256-bit elliptic curves (P-256 and Curve25519/X25519/Ed25519) are likely broken or significantly weaker than we thought" + +Es handelt sich nicht um einen Quantenangriff, sondern um einen klassischen Angriff, der von KI-Firmen ("Frontier SI companies") entdeckt wurde. Die NSA empfiehlt einen sofortigen Übergang zu Post-Quantum-Kryptographie (ML-KEM, ML-DSA). + +**Konsequenz:** Wenn LeOn X25519 oder P-256 für den Schlüsselaustausch verwendet (was bei TLS 1.3 der Standard ist), dann können aufgezeichnete TLS-Sitzungen retroaktiv entschlüsselt werden. + +#### Harvest-now-decrypt-later ist Realität + +Der NSA-Advisory warnt explizit: + +> "Adversaries are already collecting encrypted information to decrypt once the capabilities become available" + +Geheimdienste sammeln seit Jahren verschlüsselten Internetverkehr. Die Snowden-Enthüllungen zeigten, dass Massenüberwachungsprogramme wie TEMPORA (GCHQ) und PRISM (NSA) Internetverkehr mitschneiden. Mit den neuen Angriffsmethoden kann dieser gesammelte Traffic jetzt entschlüsselt werden. + +**Wer heute schon mithören kann:** + +| Akteur | Fähigkeit | Quelle | +| -------- | ----------- | -------- | +| **NSA / Five Eyes** | Sammelt TLS-Traffic seit Jahren | Snowden-Dokumente | +| **BND** | Betreibt eigene Überwachungsinfrastruktur | Öffentliche Berichte | +| **Andere Geheimdienste** | China, Russland, Israel verfügen über ähnliche Programme | Öffentliche Berichte | +| **Große Tech-Firmen** | "Frontier SI companies" haben die Angriffswerkzeuge | NSA-Advisory | +| **Internet-Provider** | Können Traffic mitschneiden | Netzwerkarchitektur | + +**Ihr Kind ist betroffen, wenn:** + +- Der Audio-Upload über TLS mit X25519 oder P-256 erfolgte (wahrscheinlich, aber von LeOn nicht bestätigt) +- Ein Geheimdienst oder Provider den Traffic mitgeschnitten hat +- Die neuen Entschlüsselungswerkzeuge verfügbar sind (laut NSA der Fall) + +Es braucht keinen Server-Einbruch mehr. Passives Mithören genügt. + +### Ungeschützte Speicherung auf Servern + +#### Audio-Daten liegen im Klartext vor + +Laut der Vereinbarung zur Auftragsverarbeitung (AVV) werden Audio-Aufnahmen auf Servern folgender Anbieter gespeichert: + +- **IONOS SE**, Elgendorfer Str. 57, 56410 Montabaur, Deutschland +- **OVH GmbH**, Christophstraße 19, 50670 Köln, Deutschland + +Diese Information stammt aus der Liste der Unterauftragsverarbeiter (Version 1.0, 15.06.2023), verfügbar unter leon-nrw.de. + +**Die Daten werden während der Verarbeitung im Klartext gespeichert.** Das ist für die ML-Verarbeitung notwendig, bedeutet aber: Wer Zugang zu den Servern hat, hat Zugang zu allen Audio-Aufnahmen. + +#### Wer hat Server-Zugang? + +Laut den technisch-organisatorischen Massnahmen (TOM, Version 40, 12.01.2024) gelten folgende Zugriffsregeln: + +- Minimale Anzahl an Administratoren +- Zugriff nur für Mitarbeiter mit spezieller Schulung +- Verschlüsselung von Datenträgern +- Zertifikatsbasierter SSH-Zugang + +**Aber:** Die OUTERMEDIA GmbH als Auftragsverarbeiter hat vollen Zugriff. Auch die Storage-Provider (IONOS, OVH) können im Notfall auf die Daten zugreifen. + +#### Einbruch-Szenario + +Bei einem erfolgreichen Cyberangriff auf die Server wären folgende Daten verfügbar: + +- Alle Audio-Aufnahmen im Klartext +- Metadaten (User-ID, Timestamp, Klassen-Zuordnung) +- Transkripte der Sprachaufnahmen + +Es gibt keine Ende-zu-Ende-Verschlüsselung zwischen dem Browser Ihres Kindes und der Verarbeitung. Die Audio-Dateien werden auf den Servern entschlüsselt gespeichert. + +### Was Angreifer mit den Audio-Daten machen können + +#### Voice Cloning und Deepfake-Audio + +Mit 30 Sekunden bis 3 Minuten Referenzmaterial können moderne KI-Tools eine Stimme klonen. LeOn-Aufnahmen umfassen typischerweise 30 bis 120 Sekunden Lesetext - ausreichend für einen Klon. + +**Verfügbare Tools (Stand 2026):** + +- ElevenLabs +- Resemble AI +- MyVocal.ai + +**Was damit möglich ist:** + +1. **Identitätsdiebstahl:** Anrufe bei Familie oder Freunden mit geklonter Stimme des Kindes +2. **Erpressung:** Gefälschte Audio-Nachrichten, die das Kind kompromittieren +3. **Soziales Engineering:** Vortäuschen falscher Tatsachen gegenüber Dritten +4. **Dauerhafte Verfügbarkeit:** Einmal im Umlauf, sind die Dateien nicht mehr löschbar + +#### Biometrische Identifikation + +Stimmen sind biometrische Merkmale, vergleichbar mit Fingerabdrücken. Datenbanken zur Stimmerkennung können Ihr Kind identifizieren - heute und in Zukunft. + +**Langzeit-Risiko:** Auch wenn Sie die Einwilligung widerrufen, bleiben geklonte Stimmen oder biometrische Profile in Datenbanken Dritter erhalten. + +### Ungeklärte Fragen zur Audio-Verarbeitung + +#### Welches Speech-to-Text-Modell wird verwendet? + +Laut FAQ auf leon-nrw.de: + +> "Im Rahmen von LeOn soll in den nächsten Monaten maschinelles Lernen eingesetzt werden, um die Leseflüssigkeit der Leseproben der Schülerinnen und Schüler einzuschätzen. Konkret bedeutet dies, dass die Leseprobe zu Text umgewandelt wird." + +**Nicht dokumentiert ist:** + +- Welches ASR-Modell (Automatic Speech Recognition) zum Einsatz kommt +- Ob es sich um eine Eigenentwicklung der TU Chemnitz handelt +- Ob Open-Source-Modelle (Whisper, Wav2Vec2) verwendet werden +- Ob kommerzielle APIs (Google Speech, Azure Speech, AWS Transcribe) genutzt werden + +#### Wo findet die Transkription statt? + +Die Datenschutzerklärung besagt, dass Audio-Daten auf Servern in Deutschland gespeichert werden. **Unklar bleibt, ob:** + +- Die Speech-to-Text-Umwandlung auf denselben Servern erfolgt +- Die Daten für die Verarbeitung an Dritte weitergegeben werden +- Bei Nutzung einer Cloud-API Daten Deutschland verlassen + +Die AVV erwähnt Atlassian Pty Ltd (Sydney, Australien) als Unterauftragsverarbeiter für den Service Desk. Das zeigt: Drittland-Übermittlungen sind im System vorgesehen. + +#### Wer hat Zugriff auf das trainierte Modell? + +Laut FAQ: + +> "Ein Teil der Daten wird genutzt werden, um ein lokales Modell zu trainieren. Das Modell wird dann nur für genau diesen Zweck und zwar im Rahmen von Schul-Software eingesetzt." + +**Der Begriff "lokales Modell" ist nicht definiert.** Es könnte bedeuten: + +- Lokal auf Servern von Outermedia +- Lokal bei der TU Chemnitz +- Lokal in Deutschland (aber bei welchem Provider?) + +Eine wissenschaftliche Publikation oder ein technischer Report zur ML-Architektur von LeOn ist öffentlich nicht auffindbar. Für ein Forschungsprojekt der TU Chemnitz ist das ungewöhnlich. + +### Das Löschungs-Problem: Einmal trainiert, immer gelernt + +#### DSGVO-Recht auf Löschung läuft ins Leere + +Die Datenschutzerklärung verspricht: + +> "Aufnahmen können jederzeit von den Nutzern selbst gelöscht werden. Ansonsten werden die Aufnahmen in jedem Fall spätestens 24 Monate nach dem letzten Login automatisiert gelöscht." + +**Das gilt aber nur für die Rohdaten.** Wenn Audio-Aufnahmen zum Training eines Machine-Learning-Modells verwendet wurden, greift die Löschung nicht. + +#### Deep-Learning-Modelle "vergessen" nicht + +Bei neuronalen Netzen (Deep Learning) werden die Trainingsdaten in den Modellgewichten kodiert. Einzelne Beispiele können nach dem Training nicht mehr entfernt werden. Das Modell behält das Gelernte - auch wenn die Originaldaten gelöscht wurden. + +**Technischer Stand (2026):** + +- "Machine Unlearning" ist ein aktives Forschungsfeld +- Praktisch anwendbare Methoden existieren noch nicht +- Bei grossen Modellen ist selektives Vergessen einzelner Beispiele nicht möglich + +#### Was bedeutet das konkret? + +Wenn die Audio-Aufnahmen Ihres Kindes zum Training verwendet wurden: + +1. **Die Stimmeigenschaften sind im Modell enkodiert** +2. **Eine Löschung der Rohdatei ändert daran nichts** +3. **Das Modell kann diese Eigenschaften bei zukünftigen Vorhersagen nutzen** +4. **Ihr Kind ist auch nach Widerruf der Einwilligung identifizierbar** + +Die Einwilligungserklärung erwähnt diese Problematik nicht. Sie besagt lediglich: + +> "Für die Rückmeldung durch Lehrkraft werden Lösungen des maschinellen Lernens eingesetzt, um aus dem Audio eine visuelle Darstellung für die Lehrkraft zu erzeugen. Für eine optimale Unterstützung wird ein Teil der Aufnahmen verwendet, um diesen Prozess mittels maschinellen Lernens stetig zu verbessern." + +Von "Training", "Modell" oder "nicht widerrufbarer Verarbeitung" steht nichts darin. + +### Fehlende Transparenz bei kritischen Punkten + +#### Diese Fragen beantwortet LeOn nicht + +Trotz mehrfacher Durchsicht aller verfügbaren Dokumente bleiben folgende Fragen offen: + +1. **Welcher TLS-Key-Exchange-Algorithmus wird verwendet?** (X25519? P-256? P-384?) +2. **Plant LeOn die Umstellung auf Post-Quantum-Kryptographie?** (ML-KEM, ML-DSA) +3. **Welches Speech-to-Text-Modell kommt zum Einsatz?** +4. **Wo findet die Transkription statt?** (Nur deutsche Server?) +5. **Handelt es sich um Deep Learning?** (Und damit: irreversible Verarbeitung?) +6. **Ist das ML-Modell adaptiv?** (Lernt es kontinuierlich nach?) +7. **Gibt es eine wissenschaftliche Publikation zur ML-Architektur?** + +Auf Anfrage an sollten Erziehungsberechtigte diese Informationen einfordern. + +### Zusammenfassung: Die Risiko-Nutzen-Rechnung + +#### Der pädagogische Nutzen + +- Lehrkraft erhält detaillierteres Feedback zum Lesefortschritt +- Kind kann die eigene Stimme hören und verbessern +- Automatisierte Auswertung spart Zeit bei der Korrektur + +#### Die Risiken + +| Risiko | Eintrittswahrscheinlichkeit | Schadensausmass | +| -------- | --------------------------- | ----------------- | +| **Retroaktive Entschlüsselung** | Hoch (laut NSA) | Stimme klonbar | +| **Server-Einbruch** | Mittel | Alle Daten im Klartext | +| **Drittland-Transfer** | Unklar | Daten ausserhalb EU | +| **Irreversibles ML-Training** | Unklar, aber möglich | Dauerhafte Speicherung | +| **Voice-Cloning-Missbrauch** | Mittel (Werkzeuge verfügbar) | Identitätsdiebstahl | + +#### Die Empfehlung + +**Der pädagogische Mehrwert der Audio-Funktion steht in keinem Verhältnis zu den Risiken.** + +LeOn ist auch ohne Audio-Aufnahme voll nutzbar. Alle Räume ausser Karaoke und Hörspielwerkstatt stehen Kindern zur Verfügung, deren Erziehungsberechtigte der Aufnahme nicht zustimmen. + +**Empfehlung:** + +- **Allgemeine Nutzung:** Ja (wenn Schule LeOn verwendet) +- **Audio-Aufnahme:** Nein + +Sollte sich die Sicherheitslage ändern (Post-Quantum-Umstellung, transparente ML-Dokumentation), kann die Entscheidung jederzeit überdacht werden. Die Einwilligung ist freiwillig und widerrufbar. + +### Quellen + +1. **LeOn Website:** +2. **Datenschutzerklärung:** +3. **Nutzungsbedingungen:** +4. **AVV (Auftragsverarbeitung):** +5. **Unterauftragsverarbeiter:** +6. **TOM (Technisch-organisatorische Massnahmen):** +7. **FAQ:** +8. **Karaoke-Auswertung:** +9. **NSA Advisory Analyse:** (2. Dezember 2026) +10. **Pressemitteilung Deutscher Lesepreis:** +11. **OUTERMEDIA Referenz:** + +*Kontakt für Rückfragen an LeOn: * diff --git a/docs/log.md b/docs/log.md index ceba93c..8095c0c 100644 --- a/docs/log.md +++ b/docs/log.md @@ -2,6 +2,7 @@ ## 2026-12-03 +- add investigation, "LeOn Audio-Aufnahme: Sicherheitsanalyse", on TLS-X25519 breakage, irreversible ML training and voice-cloning risks after the NSA Advisory of 2 December 2026 - add finding, "Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on" - add guide, "Move an Alder Lake GPU from i915 to xe", as a draft - link the new finding from "Dell Precision 5470" From 4b3762ed63b2a69c309b74fdae5a8649876dfe65 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 22:29:23 +0100 Subject: [PATCH 21/25] Fix OKF type field and markdownlint issues in agentic_ai_homeassistant_integration - Change type from 'investigation' to 'Investigation' (case-sensitive genre match) - Demote top-level H1 to H2 (MD025: single top-level heading) - Add language specifier to code block (MD040) - Replace em dashes with hyphens (house style) --- .../agentic_ai_homeassistant_integration.md | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/docs/investigations/agentic_ai_homeassistant_integration.md b/docs/investigations/agentic_ai_homeassistant_integration.md index 0e78c7a..7d59b00 100644 --- a/docs/investigations/agentic_ai_homeassistant_integration.md +++ b/docs/investigations/agentic_ai_homeassistant_integration.md @@ -1,5 +1,5 @@ --- -type: investigation +type: Investigation title: Agentic AI and Home Assistant Integration description: Survey of skills and MCP servers for connecting AI agents to Home Assistant, with security and architecture findings status: complete @@ -22,36 +22,36 @@ references: - https://skills.sh/ --- -# Agentic AI and Home Assistant Integration +## Agentic AI and Home Assistant Integration -## Overview +### Overview -This investigation surveyed the landscape of skills and MCP servers for connecting AI agent harnesses (opencode, Claude Code, Cursor) to Home Assistant instances. The goal: full remote agent access to near all aspects of HA — reading states, controlling devices, editing automations, monitoring events in real-time. +This investigation surveyed the landscape of skills and MCP servers for connecting AI agent harnesses (opencode, Claude Code, Cursor) to Home Assistant instances. The goal: full remote agent access to near all aspects of HA - reading states, controlling devices, editing automations, monitoring events in real-time. ## Methods Searched -1. **skills.sh leaderboard** — `npx skills find home assistant`, `npx skills find homeassistant`, `npx skills find smart home` -2. **GitHub MCP server search** — `homeassistant mcp server`, filtered by stars and recency -3. **akit subscription** — attempted `akit add homeassistant-ai/skills`, succeeded despite no `.akit.yaml` in source +1. **skills.sh leaderboard** - `npx skills find home assistant`, `npx skills find homeassistant`, `npx skills find smart home` +2. **GitHub MCP server search** - `homeassistant mcp server`, filtered by stars and recency +3. **akit subscription** - attempted `akit add homeassistant-ai/skills`, succeeded despite no `.akit.yaml` in source ## Findings ### Skills (skills.sh ecosystem) | Skill | Installs | Stars | Source | Capabilities | -|-------|----------|-------|--------|--------------| +| ------- | ---------- | ------- | -------- | -------------- | | **`homeassistant-ai/skills@home-assistant-best-practices`** | **9.6K** | **1k** | homeassistant-ai/skills | Native HA patterns, safe refactoring, dashboard design, AppDaemon, blueprints, backups | | `claude-office-skills@Home Assistant Automation` | 5.2K | - | claude-office-skills | Automation creation | | `balloob/llm-skills@home-assistant` | 267 | 4 | balloob (HA co-founder) | Connection setup, API reference (Python/Node.js) | | `anotb/homeassistant-skill@homeassistant-skill` | 153 | 7 | anotb | REST/WS workflows, works alongside MCP | | `bradsjm/hassio-addons@*` (7 skills) | 500-800 each | - | bradsjm | Addon-specific guides | -**Key finding:** `homeassistant-ai/skills` is the only security-audited skill (Gen Agent Trust Hub, Socket, Snyk all pass). It teaches native HA constructs over templates — e.g., `condition: numeric_state` instead of `condition: template` — which HA validates at load time rather than failing silently at runtime. +**Key finding:** `homeassistant-ai/skills` is the only security-audited skill (Gen Agent Trust Hub, Socket, Snyk all pass). It teaches native HA constructs over templates - e.g., `condition: numeric_state` instead of `condition: template` - which HA validates at load time rather than failing silently at runtime. ### MCP Servers (GitHub) | Server | Stars | Lang | Transports | Notable Capabilities | -|--------|-------|------|------------|---------------------| +| -------- | ------- | ------ | ------------ | --------------------- | | **`tevonsb/homeassistant-mcp`** | **574** | TypeScript | SSE | Add-on/HACS management, automation editing, real-time SSE updates | | **`voska/hass-mcp`** | **353** | Python | stdio, HTTP | **Lovelace editing** (live updates + backups), history/stats, guided conversations | | `robbrad/homeassistant-mcp` | 106 | Python | stdio | Basic control | @@ -65,14 +65,14 @@ This investigation surveyed the landscape of skills and MCP servers for connecti **Three integration methods emerged:** -1. **WebSocket API (primary)** — Persistent connection, real-time `subscribe_events`, `call_service`, `get_states`. Used by all MCP servers. -2. **REST API (fallback)** — Stateless polling, `GET /api/states`, `POST /api/services/...`. Used by skills without MCP. -3. **MCP Server (abstraction layer)** — Agent→MCP→HA, credentials stored once, can add rate limiting/logging. +1. **WebSocket API (primary)** - Persistent connection, real-time `subscribe_events`, `call_service`, `get_states`. Used by all MCP servers. +2. **REST API (fallback)** - Stateless polling, `GET /api/states`, `POST /api/services/...`. Used by skills without MCP. +3. **MCP Server (abstraction layer)** - Agent→MCP→HA, credentials stored once, can add rate limiting/logging. **Security architectures:** | Pattern | Token Location | Agent Access | Exposure | -|---------|---------------|--------------|----------| +| --------- | --------------- | -------------- | ---------- | | Local LAN | MCP server env | Via MCP only | None (firewalled) | | HA Cloud | MCP server env | Via MCP + TLS tunnel | Nabu Casa encrypted | | VPN (Tailscale) | MCP server env | Via MCP + VPN | Zero-trust network | @@ -82,17 +82,17 @@ This investigation surveyed the landscape of skills and MCP servers for connecti ### MCP Server Advantages -- **Credential isolation** — HA token stored once in MCP env, never exposed to agent -- **Rate limiting** — Can enforce call budgets per session -- **Audit logging** — All agent actions logged at MCP layer -- **Permission scoping** — Can restrict which services/tools are exposed +- **Credential isolation** - HA token stored once in MCP env, never exposed to agent +- **Rate limiting** - Can enforce call budgets per session +- **Audit logging** - All agent actions logged at MCP layer +- **Permission scoping** - Can restrict which services/tools are exposed ### Risks Identified -1. **Long-lived tokens** — 10-year validity, full user permissions. Must be stored securely. -2. **No built-in rate limiting** — HA API doesn't throttle; MCP must enforce. -3. **Webhook security** — Webhook URLs are the only secret; if leaked, anyone can trigger. -4. **Direct exposure** — Skills that connect directly put token in agent context. +1. **Long-lived tokens** - 10-year validity, full user permissions. Must be stored securely. +2. **No built-in rate limiting** - HA API doesn't throttle; MCP must enforce. +3. **Webhook security** - Webhook URLs are the only secret; if leaked, anyone can trigger. +4. **Direct exposure** - Skills that connect directly put token in agent context. ### Recommended Security Posture @@ -104,7 +104,7 @@ This investigation surveyed the landscape of skills and MCP servers for connecti ## Capability Comparison | Capability | REST API | WebSocket | MCP Server | -|------------|----------|-----------|------------| +| ------------ | ---------- | ----------- | ------------ | | Read entity states | ✅ | ✅ | ✅ | | Control devices | ✅ | ✅ | ✅ | | Real-time events | ❌ | ✅ | ✅ | @@ -133,12 +133,14 @@ Result: 16 files rendered to `/home/felix/.agents/skills/home-assistant-best-pra Both recommended MCP servers support Docker deployment: **voska/hass-mcp:** + ```bash docker pull voska/hass-mcp:latest # Add to opencode.jsonc mcpServers config ``` **tevonsb/homeassistant-mcp:** + ```bash docker compose up -d # from repo # Requires .env with HASS_HOST, HASS_TOKEN, HASS_SOCKET_URL @@ -160,11 +162,11 @@ docker compose up -d # from repo - 9.6K installs, security audited - Teaches native HA patterns (no templates where helpers exist) - Safe refactoring workflow - - Works alongside MCP — skill guides *what*, MCP executes *how* + - Works alongside MCP - skill guides *what*, MCP executes *how* ### Architecture -``` +```text ┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐ │ opencode │────►│ voska/hass-mcp │────►│ Home Assistant │ │ (agent) │ MCP │ (Docker, LAN) │ WS │ (local network) │ @@ -179,7 +181,7 @@ docker compose up -d # from repo ### Why This Combination | Need | Solution | -|------|----------| +| ------ | ---------- | | Real-time control | WebSocket via MCP | | Dashboard editing | voska Lovelace tools | | Best practices | homeassistant-ai skill | @@ -188,16 +190,16 @@ docker compose up -d # from repo ## Gaps Identified -1. **No akit-native HA kit** — homeassistant-ai/skills uses skills.sh format, not `.akit.yaml` -2. **No unified MCP standard** — 6+ incompatible MCP servers, no interoperability -3. **Permission scoping** — HA tokens are all-or-nothing; no fine-grained agent permissions -4. **Audit trail** — HA logs actions but doesn't attribute them to "agent" vs "user" +1. **No akit-native HA kit** - homeassistant-ai/skills uses skills.sh format, not `.akit.yaml` +2. **No unified MCP standard** - 6+ incompatible MCP servers, no interoperability +3. **Permission scoping** - HA tokens are all-or-nothing; no fine-grained agent permissions +4. **Audit trail** - HA logs actions but doesn't attribute them to "agent" vs "user" ## References -- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) — 1k stars, 9.6K installs -- [voska/hass-mcp](https://github.com/voska/hass-mcp) — 353 stars, Lovelace editing -- [tevonsb/homeassistant-mcp](https://github.com/tevonsb/homeassistant-mcp) — 574 stars, add-on mgmt +- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) - 1k stars, 9.6K installs +- [voska/hass-mcp](https://github.com/voska/hass-mcp) - 353 stars, Lovelace editing +- [tevonsb/homeassistant-mcp](https://github.com/tevonsb/homeassistant-mcp) - 574 stars, add-on mgmt - [HA WebSocket API](https://developers.home-assistant.io/docs/api/websocket/) - [HA REST API](https://developers.home-assistant.io/docs/api/rest/) - [skills.sh leaderboard](https://skills.sh/) From f85caa1a6271eb1bb9eaad7b0d4cb938124935f7 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 22:29:27 +0100 Subject: [PATCH 22/25] Fix OKF type field and markdownlint issues in home_assistant_agent_integration_via_mcp - Change type from 'blueprint' to 'Blueprint' (case-sensitive genre match) - Demote top-level H1 to H2 (MD025: single top-level heading) - Add language specifiers to code blocks (MD040) - Replace em dashes with hyphens (house style) - Fix em dash in blueprints/index.md --- ...ome_assistant_agent_integration_via_mcp.md | 82 ++++++++++++------- docs/blueprints/index.md | 2 +- 2 files changed, 52 insertions(+), 32 deletions(-) diff --git a/docs/blueprints/home_assistant_agent_integration_via_mcp.md b/docs/blueprints/home_assistant_agent_integration_via_mcp.md index c7cbe84..a4af054 100644 --- a/docs/blueprints/home_assistant_agent_integration_via_mcp.md +++ b/docs/blueprints/home_assistant_agent_integration_via_mcp.md @@ -1,5 +1,5 @@ --- -type: blueprint +type: Blueprint title: Home Assistant Agent Integration via MCP description: Full remote agent access to Home Assistant through MCP server and best-practices skill, without oh-my-openagent status: implemented @@ -21,16 +21,17 @@ references: - https://github.com/homeassistant-ai/skills --- -# Home Assistant Agent Integration via MCP +## Home Assistant Agent Integration via MCP -## Overview +### Overview This blueprint delivers **full remote agent access** to a Home Assistant instance through two components: -1. **MCP Server** (`voska/hass-mcp`) — Real-time WebSocket connection for device control, Lovelace editing, history queries -2. **Best-Practices Skill** (`homeassistant-ai/skills`) — Read-only knowledge that prevents anti-patterns (native HA constructs over templates) +1. **MCP Server** (`voska/hass-mcp`) - Real-time WebSocket connection for device control, Lovelace editing, history queries +2. **Best-Practices Skill** (`homeassistant-ai/skills`) - Read-only knowledge that prevents anti-patterns (native HA constructs over templates) **What the agent can do:** + - Read all entity states in real-time - Control lights, locks, climate, media, covers, fans, switches - Edit Lovelace dashboards with live preview + automatic backups @@ -39,6 +40,7 @@ This blueprint delivers **full remote agent access** to a Home Assistant instanc - All via secure MCP layer (token never exposed to agent) **What this blueprint does NOT require:** + - oh-my-openagent plugin (not used here) - Docker (runs via `uvx` directly) - Root access (fully rootless) @@ -47,7 +49,7 @@ This blueprint delivers **full remote agent access** to a Home Assistant instanc ## Prerequisites | Requirement | Why | How to verify | -|-------------|-----|---------------| +| ------------- | ----- | --------------- | | Home Assistant instance (2024.x+) | MCP server connects via WebSocket API | `https://your-ha.local:8123` reachable | | Long-lived access token | Authentication for MCP→HA connection | Profile → Security → Create token | | opencode with MCP support | Loads MCP servers from config | `opencode --version` ≥ 2.x | @@ -62,7 +64,7 @@ This blueprint delivers **full remote agent access** to a Home Assistant instanc 4. Click **Create Long-Lived Access Token** 5. Name it `opencode-agent` (or similar) 6. Copy the token (starts with `eyJ...`) -7. Store securely — valid for 10 years, full user permissions +7. Store securely - valid for 10 years, full user permissions ## Installation @@ -77,7 +79,7 @@ The best-practices skill is already installed via akit: **Location:** `/home/felix/.agents/skills/home-assistant-best-practices/` (16 files) -**What it does:** Teaches native HA patterns — e.g., use `condition: numeric_state` instead of `condition: template`, which HA validates at load time rather than failing silently at runtime. +**What it does:** Teaches native HA patterns - e.g., use `condition: numeric_state` instead of `condition: template`, which HA validates at load time rather than failing silently at runtime. ### Step 2: Configure MCP Server @@ -121,18 +123,21 @@ The MCP server starts automatically on first agent request that needs HA access. ### Network Considerations **Local LAN (this blueprint):** + - `HA_URL` = `http://homeassistant.local:8123` or `http://192.168.x.x:8123` - opencode machine must be on same network as HA - No firewall changes needed - Token transmitted unencrypted (LAN only) **Remote via Home Assistant Cloud:** + - `HA_URL` = `https://your-url.nabu.casa` - Requires HA Cloud subscription (~$5/month) - Encrypted tunnel, no port forwarding - Same config, just different URL **Remote via VPN (Tailscale/ZeroTier):** + - `HA_URL` = `http://100.x.y.z:8123` (Tailscale IP) - VPN must be active on opencode machine - Encrypted, no public exposure @@ -140,12 +145,12 @@ The MCP server starts automatically on first agent request that needs HA access. ### Security Model | Layer | Protection | -|-------|------------| +| ------- | ------------ | | **Token storage** | `.env.hass_mcp_voska` (mode 600, gitignored) | -| **Token exposure** | Never sent to agent — MCP holds it | +| **Token exposure** | Never sent to agent - MCP holds it | | **Network** | Local LAN only (unless HA Cloud/VPN) | -| **Rate limiting** | None built-in — agent self-limits | -| **Permissions** | Full user permissions — use non-admin user if concerned | +| **Rate limiting** | None built-in - agent self-limits | +| **Permissions** | Full user permissions - use non-admin user if concerned | | **Audit trail** | HA logs all actions, attributed to token owner | ### File Permissions @@ -161,7 +166,7 @@ The env file is already set to mode 600 (owner read/write only). ### What the Agent Can Do | Capability | Tool | Example | -|------------|------|---------| +| ------------ | ------ | --------- | | **Read entity state** | `get_entity` | "What's the temperature in the living room?" | | **List entities** | `list_entities` | "Show me all lights in the bedroom" | | **Control devices** | `entity_action` | "Turn off all kitchen lights" | @@ -175,11 +180,11 @@ The env file is already set to mode 600 (owner read/write only). The voska MCP server supports **live Lovelace editing**: -- `list_dashboards` — List all dashboards (storage mode only) -- `get_dashboard_config` — Get full dashboard config -- `add_card` / `update_card` / `remove_card` / `move_card` — Edit cards -- `list_view_sections` — List sections in a "sections"-type view -- `add_view` / `remove_view` / `update_view` — Edit views +- `list_dashboards` - List all dashboards (storage mode only) +- `get_dashboard_config` - Get full dashboard config +- `add_card` / `update_card` / `remove_card` / `move_card` - Edit cards +- `list_view_sections` - List sections in a "sections"-type view +- `add_view` / `remove_view` / `update_view` - Edit views **Automatic backups:** Before every write, the current config is saved to `~/.hass-mcp/dashboard-backups/`. Can restore via `restore_dashboard`. @@ -192,60 +197,74 @@ The voska MCP server supports **live Lovelace editing**: After filling in the env file and restarting opencode, try these: 1. **Basic connectivity:** - ``` + + ```text What's the current state of the sun entity? ``` + Expected: Returns `above_horizon` or `below_horizon` 2. **List entities:** - ``` + + ```text List all lights in my home ``` + Expected: List of `light.*` entities with states 3. **Read a sensor:** - ``` + + ```text What's the temperature in the living room? ``` + Expected: Current temperature from your sensor 4. **Control a device:** - ``` + + ```text Turn on the hallway light at 50% brightness ``` + Expected: Light turns on, agent confirms 5. **Query history:** - ``` + + ```text Show me the living room temperature over the last 24 hours ``` + Expected: Historical data points ### Troubleshooting Connection **"Connection refused" or "Cannot connect to HA":** + - Verify `HA_URL` is correct and reachable: `curl http://your-ha:8123/api/` - Check HA is running: `systemctl status home-assistant@homeassistant` (if systemd) - Ensure opencode machine is on same network **"Invalid token" or "Unauthorized":** + - Re-create the long-lived token in HA - Ensure no trailing whitespace in `.env.hass_mcp_voska` - Token must be for an existing HA user **"No Lovelace dashboards found":** + - Only **storage-mode** dashboards are editable - YAML-mode dashboards must be edited directly - Check: HA → Settings → Dashboards → see which are "Storage" vs "YAML" **MCP server not starting:** + - Check opencode logs for MCP startup errors - Verify `uv` is installed: `uv --version` - Test manually: `uvx hass-mcp --help` ## Architecture -``` +```text ┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐ │ opencode │────►│ voska/hass-mcp │────►│ Home Assistant │ │ (agent) │ MCP │ (uvx process) │ WS │ (local network) │ @@ -260,9 +279,10 @@ After filling in the env file and restarting opencode, try these: ``` **Key properties:** + - MCP server runs as local process (no Docker) - Token stored in env file, read by MCP only -- Agent never sees token — calls MCP tools +- Agent never sees token - calls MCP tools - Skill guides *what* to write, MCP executes *how* ## Maintenance @@ -298,18 +318,18 @@ If the token is compromised: **HA instance backups:** Use HA's built-in backup system (Settings → System → Backups) -**Config backups:** The `.env.hass_mcp_voska` file is your responsibility — back it up securely. +**Config backups:** The `.env.hass_mcp_voska` file is your responsibility - back it up securely. ## Related -- [Investigation: Agentic AI and Home Assistant Integration](../investigations/agentic_ai_homeassistant_integration.md) — full survey of skills and MCP servers -- [What an MCP server can be, and who can reach one](../investigations/mcp_server_entry_points_and_transports.md) — MCP architecture patterns -- [voska/hass-mcp documentation](https://github.com/voska/hass-mcp) — upstream MCP server docs -- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) — best-practices skill source +- [Investigation: Agentic AI and Home Assistant Integration](../investigations/agentic_ai_homeassistant_integration.md) - full survey of skills and MCP servers +- [What an MCP server can be, and who can reach one](../investigations/mcp_server_entry_points_and_transports.md) - MCP architecture patterns +- [voska/hass-mcp documentation](https://github.com/voska/hass-mcp) - upstream MCP server docs +- [homeassistant-ai/skills](https://github.com/homeassistant-ai/skills) - best-practices skill source ## Changelog -- **2026-11-24** — Initial blueprint, based on investigation findings +- **2026-11-24** - Initial blueprint, based on investigation findings - Skill installed via akit (16 files rendered) - MCP config added to `opencode.jsonc` - Env file template created (`.env.hass_mcp_voska`) diff --git a/docs/blueprints/index.md b/docs/blueprints/index.md index 02541e7..d3668d9 100644 --- a/docs/blueprints/index.md +++ b/docs/blueprints/index.md @@ -2,6 +2,6 @@ The concrete, copyable artefact a decision produced. -- [Home Assistant Agent Integration via MCP](home_assistant_agent_integration_via_mcp.md) — full remote agent access to HA through MCP server and best-practices skill, without oh-my-openagent +- [Home Assistant Agent Integration via MCP](home_assistant_agent_integration_via_mcp.md) - full remote agent access to HA through MCP server and best-practices skill, without oh-my-openagent - [MkDocs Material PKB publishing stack](mkdocs_material_pkb_publishing_stack.md) - the stack this site runs on, component by component, with the reasons attached - [Sharing one knowledge bundle on two branches](sharing_one_knowledge_bundle_on_two_branches.md) - what a bundle looks like once several people file into it, and the published branch takes no direct pushes From fa2846a6ea5e969c44e7e0fa200c23cd12d4cb49 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 22:29:50 +0100 Subject: [PATCH 23/25] Add trailing newline to investigations/index.md (end-of-file-fixer) --- docs/investigations/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/investigations/index.md b/docs/investigations/index.md index 86e4e9a..49e2cdf 100644 --- a/docs/investigations/index.md +++ b/docs/investigations/index.md @@ -23,4 +23,4 @@ date. Where an investigation deliberately stops short of choosing, it says so. - [What an MCP server can be, and who can reach one](mcp_server_entry_points_and_transports.md) - two transports, five shapes and six callers, and the two variables that decide which are reachable - [Type annotations for a Python library: the options](type_annotation_options_for_a_python_library.md) - the syntax, checker and strictness choices a typing pull request makes without naming, with one from pyMOR placed among them - [Agentic AI and Home Assistant Integration](agentic_ai_homeassistant_integration.md) - survey of skills and MCP servers for connecting AI agents to Home Assistant, with security and architecture findings -- [LeOn Audio-Aufnahme: Sicherheitsanalyse](leon_audio_security_analysis.md) - Technische Analyse der LeOn-App Audio-Aufzeichnungen mit Fokus auf TLS-Sicherheit, ML-Training und Voice-Cloning-Risiken nach dem NSA-Advisory vom 2. Dezember 2026 \ No newline at end of file +- [LeOn Audio-Aufnahme: Sicherheitsanalyse](leon_audio_security_analysis.md) - Technische Analyse der LeOn-App Audio-Aufzeichnungen mit Fokus auf TLS-Sicherheit, ML-Training und Voice-Cloning-Risiken nach dem NSA-Advisory vom 2. Dezember 2026 From 698d58006c7e8caa38a661db12e88e7235868237 Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 22:53:56 +0100 Subject: [PATCH 24/25] Cite declared source in pin_an_aur_package guide The page declared paru-pkgbuild-repo in sources but never cited it. Added citation where the PKGBUILD repo mechanism is introduced. --- ...ur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md b/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md index 8ce0b34..7cf7108 100644 --- a/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md +++ b/docs/guides/pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md @@ -35,7 +35,8 @@ Editing the PKGBUILD by hand works once and then fights every refresh, because t still newer and the helper keeps offering it. A PKGBUILD repository does not, because paru treats the local copy as authoritative. -Commands are as of paru 2.1.0 on Manjaro, driving an AUR clone of `virtualbox-ext-oracle`. +Commands are as of paru 2.1.0 on Manjaro, driving an AUR clone of `virtualbox-ext-oracle`. The +PKGBUILD repo mechanism that makes this possible is documented upstream.[^paru-pkgbuild-repo] ## What a PKGBUILD repo is, and what it is not From 09fe0675bbeb9bd7fdfbf5e62f92877c3c88c0fa Mon Sep 17 00:00:00 2001 From: Felix Schindler <107669806+ftschindler@users.noreply.github.com> Date: Thu, 3 Dec 2026 23:06:25 +0100 Subject: [PATCH 25/25] Add guide: Harden SSH after the NSA post-quantum advisory --- ...ssh_after_the_nsa_post_quantum_advisory.md | 313 ++++++++++++++++++ docs/guides/index.md | 1 + docs/log.md | 1 + 3 files changed, 315 insertions(+) create mode 100644 docs/guides/harden_ssh_after_the_nsa_post_quantum_advisory.md diff --git a/docs/guides/harden_ssh_after_the_nsa_post_quantum_advisory.md b/docs/guides/harden_ssh_after_the_nsa_post_quantum_advisory.md new file mode 100644 index 0000000..d8430e6 --- /dev/null +++ b/docs/guides/harden_ssh_after_the_nsa_post_quantum_advisory.md @@ -0,0 +1,313 @@ +--- +type: Guide +title: Harden SSH after the NSA post-quantum advisory +description: Moving SSH logins and an SSH server off 256-bit elliptic curves after the NSA's December + 2026 advisory, with ML-DSA keys where the server accepts them, RSA where it does not, one key pair + per service, and an sshd drop-in that refuses the rest. +tags: +- guide +- ssh +- openssh +- post-quantum +- security +- linux +status: stable +stale_after: '2027-03-03' +generated: + by: opencode/claude-opus-5.5 + at: '2026-12-03T17:30:00+01:00' +sources: +- id: filippo + resource: https://words.filippo.io/nsa-advisory/ + title: What to Make of the NSA Advisory - Filippo Valsorda + last_modified: '2026-12-02' +- id: nsa-press + resource: https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4662430/nsa-advises-immediate-transition-to-post-quantum-cryptography-to-protect-nation/ + title: NSA advises immediate transition to post-quantum cryptography to protect nation + last_modified: '2026-12-01' +- id: openssh-notes + resource: https://www.openssh.com/releasenotes.html + title: OpenSSH release notes + last_modified: '2026-12-03' +- id: arch-ssh-keys + resource: https://wiki.archlinux.org/title/SSH_keys + title: SSH keys - ArchWiki + last_modified: '2026-12-03' +- id: arch-openssh + resource: https://wiki.archlinux.org/title/OpenSSH + title: OpenSSH - ArchWiki + last_modified: '2026-12-03' +- id: sshd-config + resource: https://man.archlinux.org/man/sshd_config.5 + title: sshd_config(5) + last_modified: '2026-12-03' +- id: ssh-config + resource: https://man.archlinux.org/man/ssh_config.5 + title: ssh_config(5) + last_modified: '2026-12-03' +- id: github-keygen + resource: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent + title: Generating a new SSH key and adding it to the ssh-agent - GitHub Docs + last_modified: '2026-12-03' +--- + +On 1 December 2026 the NSA advised an immediate move to post-quantum cryptography, prompted by +discoveries that AI companies had disclosed to the US government[^nsa-press]. Filippo Valsorda's +reading of the advisory is that 256-bit elliptic curves are likely broken or much weaker than +assumed: P-256, X25519 and Ed25519 included[^filippo]. RSA and P-384 are named as stopgaps, and +ML-KEM and ML-DSA as the destination. + +For SSH that splits into two problems of different urgency. Key exchange decides whether recorded +traffic can be decrypted later. Signatures decide whether somebody can log in as you, or pose as +your server. This guide covers both, on the client and on the server. + +Commands are as of OpenSSH 10.6p2 on Arch Linux, measured on 3 December 2026. Other distributions +differ in package names and in where host keys are generated, and the steps carry over otherwise. + +## 1. Pick the algorithms + +**Key exchange: `mlkem768x25519-sha256`.** OpenSSH 10.6 offers it first by default, and it is the +hybrid the NSA now explicitly permits[^filippo]. Nothing needs choosing here beyond running a +current OpenSSH on both ends. + +**Login and host keys: ML-DSA where the other side accepts it, RSA where it does not.** The order +of preference: + +1. **`mldsa44-ed25519`**, the composite post-quantum signature. OpenSSH 10.4 added it as an + experiment and 10.6 enabled it by default[^openssh-notes]. Dropbear and libssh do not support + it[^arch-ssh-keys]. +2. **RSA, 4096 bits.** It works against every server, and the advisory names RSA 3072 as the + acceptable floor[^filippo]. `ssh-keygen` defaults to 3072[^arch-ssh-keys]; 4096 costs a slower + login and buys margin whilst attacks improve. +3. **Not Ed25519, ECDSA P-256 or any FIDO `-sk` key on those curves.** They are what the advisory + excludes[^filippo]. + +The composite key still contains Ed25519, and that is the point of it. Breaking the login needs +both halves broken, so a weakened Ed25519 leaves ML-DSA-44 standing. + +## 2. Take stock + +```bash +ssh -V +for f in ~/.ssh/*.pub; do ssh-keygen -lf "$f"; done +awk '{print $1, $3}' ~/.ssh/authorized_keys 2>/dev/null +ssh-add -l +``` + +`ssh -V` has to report 10.6 or later for any of the ML-DSA steps. The `ssh-keygen -lf` lines end +in the key type, so every `(ED25519)` and `(ECDSA)` is a key to replace. `authorized_keys` is the +other direction: keys this machine accepts from elsewhere. + +Back up `~/.ssh` before changing anything. A rotation done in the wrong order can leave no key +that any server accepts, and the backup is what undoes that: + +```bash +cp -a ~/.ssh ~/.ssh.bak-$(date +%F) +``` + +## 3. One key pair per service + +A separate key per service means a rotation touches one service. It also means a key can be the +type that service accepts, when a single shared key would have to be the type the weakest of +them accepts. That second reason is new: during this migration, services diverge. + +Each service gets a `Host` block naming its key, with `IdentitiesOnly yes`: + +```text +Host github.com + User git + IdentityFile ~/.ssh/github + IdentitiesOnly yes + +Host build-box + HostName build-box.example.org + IdentityFile ~/.ssh/build_box + IdentitiesOnly yes +``` + +**`IdentitiesOnly yes` is what makes the block mean anything.** Without it, ssh also offers every +key the agent holds[^ssh-config], and the server logs you in with whichever it recognises first. +That is how a login silently lands on the wrong account. The pattern is ArchWiki's for managing +several identities[^arch-ssh-keys]. + +A second account on the same host, such as a work account on GitHub, gets its own alias: + +```text +Host github-work + HostName github.com + User git + IdentityFile ~/.ssh/github_work + IdentitiesOnly yes +``` + +Repositories for that account then use `git@github-work:org/repo.git` as their remote. + +### Ask each server what it accepts + +A server lists the login key types it accepts during the handshake, before any key is sent. It +costs nothing to read: + +```bash +ssh -v -o BatchMode=yes -i /dev/null -o IdentitiesOnly=yes -T git@github.com 2>&1 | + grep -E 'kex: algorithm|server-sig-algs' +``` + +The `kex:` line names the key exchange the connection used. `server-sig-algs` lists the login +key types. If `ssh-mldsa44-ed25519` is in it, use ML-DSA for that service; if not, RSA. + +On 3 December 2026 GitHub negotiated `mlkem768x25519-sha256` but did not list +`ssh-mldsa44-ed25519`. Its web form then rejects an ML-DSA public key with "Key is invalid. You +must supply a key in OpenSSH public key format", which reads like a paste error and is not one. +GitHub's own documentation names `rsa -b 4096` as its non-Ed25519 option[^github-keygen]. + +## 4. Rotate one key + +Generate the new key beside the old one, prove it works on its own, then swap the filenames. The +config never changes, and every step can be undone until the old key is removed from the server. + +```bash +# ML-DSA, where the server accepts it +ssh-keygen -t mldsa44-ed25519 -f ~/.ssh/github.new -C "$(whoami)@$(hostname)-$(date +%F)" +# or RSA, where it does not +ssh-keygen -t rsa -b 4096 -f ~/.ssh/github.new -C "$(whoami)@$(hostname)-$(date +%F)" +``` + +Give it a passphrase. Then install the public half at the service, keeping the old key there for +now. For a GitHub account that is the SSH keys page in its settings; for a server, `ssh-copy-id`. + +**Test the new key with the config switched off.** `-F /dev/null` stops the `Host` block adding +the old key, so a success can only come from the new one: + +```bash +ssh -F /dev/null -i ~/.ssh/github.new -o IdentitiesOnly=yes -T git@github.com +``` + +GitHub greets the account by name. **Check that it is the right account**, which matters when +there are two: a key pasted into the wrong browser session belongs to the wrong account, and +GitHub refuses the same key on a second account. Every account's public keys are listed at +`https://github.com/.keys`, so this needs no passphrase: + +```bash +grep -qF "$(awk '{print $2}' ~/.ssh/github.new.pub)" <(curl -s https://github.com/.keys) && echo listed +``` + +Then swap the files and drop the old key from the agent: + +```bash +cd ~/.ssh +mv -n github github.old && mv -n github.pub github.old.pub +mv -n github.new github && mv -n github.new.pub github.pub +ssh-add -d github.old.pub +ssh -T git@github.com +``` + +Last, remove the old key at the service, check it is gone from `.keys`, and delete +`github.old*`. The backup from step 2 still holds a copy. + +> A test from a script or an agent, run with `-o BatchMode=yes`, reports `Permission denied` for a +> key with a passphrase even when the server accepted it. `ssh -v` tells the two apart: "Server +> accepts key" followed by a denial means the key is right and only the passphrase was missing. + +## 5. Harden the machine's own sshd + +This part refuses Ed25519 and ECDSA logins, so it comes after every client that logs in here has +a new key in `authorized_keys`. Done the other way round, it locks those clients out. + +### Read the current settings + +```bash +sudo sshd -T | grep -iE '^(kexalgorithms|hostkeyalgorithms|pubkeyacceptedalgorithms|hostkey|requiredrsasize|passwordauthentication|port) ' +for f in /etc/ssh/ssh_host_*_key.pub; do ssh-keygen -lf "$f"; done +awk '{print $1, $3}' ~/.ssh/authorized_keys +``` + +The defaults accept every key type, including `ssh-ed25519` and `ecdsa-sha2-nistp256`, and an RSA +key as small as 1024 bits[^sshd-config]. Arch generates four host key pairs: Ed25519, +ML-DSA-44/Ed25519, ECDSA and RSA[^arch-openssh]. + +### Write a drop-in + +```text +# /etc/ssh/sshd_config.d/50-post-quantum.conf +KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512 +HostKey /etc/ssh/ssh_host_mldsa44_ed25519_key +HostKey /etc/ssh/ssh_host_rsa_key +HostKeyAlgorithms ssh-mldsa44-ed25519,rsa-sha2-512,rsa-sha2-256 +PubkeyAcceptedAlgorithms ssh-mldsa44-ed25519,rsa-sha2-512,rsa-sha2-256 +RequiredRSASize 3072 +PasswordAuthentication no +AuthenticationMethods publickey +``` + +What each line does: + +- **`KexAlgorithms`** keeps only the two post-quantum hybrids. A client without them can no longer + connect, which is the intent. The server's list sets what is allowed; the client picks the + order[^sshd-config]. +- **`HostKey`** loads only the two host keys worth presenting, and **`HostKeyAlgorithms`** offers + only their signatures. +- **`PubkeyAcceptedAlgorithms`** refuses Ed25519 and ECDSA logins. OpenSSH checks this list + before it parses the key a client sends, so a refused type never reaches the parser[^openssh-notes]. +- **`RequiredRSASize 3072`** refuses RSA keys below the advisory's floor. The option can only be + raised from its default of 1024[^sshd-config]. +- **`PasswordAuthentication no`** and **`AuthenticationMethods publickey`** are ArchWiki's lines for + forcing key authentication[^arch-openssh]. The advisory does not cover passwords; they are here + because a refused key should not fall back to one. + +**The filename number matters.** sshd keeps the first value it reads for each keyword[^sshd-config], +and drop-ins are read in lexical order. `50-` comes before Arch's `99-archlinux.conf`. + +**Keep the RSA lines only if the RSA host key has at least 3072 bits.** The `ssh-keygen -lf` +loop above prints its size first. If it is smaller, drop both `rsa-sha2-*` entries and its +`HostKey` line rather than presenting a key below the floor. + +### Apply it with a way back in + +Keep one SSH session to the machine open until the end of this section, or work at its console. +A mistake in this file then costs a revert rather than a trip to the machine. + +```bash +sudo sshd -t && sudo systemctl reload sshd +``` + +`sshd -t` prints nothing for a valid configuration[^arch-openssh]. Then, from a client, open a +new connection with verbose output: + +```bash +ssh -v -p @ true 2>&1 | grep -E 'kex: algorithm|host key algorithm|Authenticated' +``` + +The two lines to see are `kex: algorithm: mlkem768x25519-sha256` and `kex: host key algorithm: +ssh-mldsa44-ed25519`. A client that knew the old Ed25519 host key now warns that the host key +changed. That is expected here: remove the old entry with `ssh-keygen -R '[]:'`, +compare the new fingerprint with `ssh-keygen -lf /etc/ssh/ssh_host_mldsa44_ed25519_key.pub` run on +the server, and accept it only if they match. + +Last, confirm the refusals. An old Ed25519 key from the backup and a password login should both +fail: + +```bash +ssh -F /dev/null -o IdentitiesOnly=yes -i ~/.ssh.bak-/id_ed25519 -p @ true +ssh -F /dev/null -o PubkeyAuthentication=no -p @ true +``` + +### Leave the unused host key files where they are + +On Arch, `sshdgenkeys.service` regenerates any missing host key at the next boot, whatever +`HostKeyAlgorithms` allows[^arch-openssh]. Deleting `ssh_host_ed25519_key` therefore achieves +nothing for long. The drop-in's `HostKey` lines are what stop sshd presenting it. + +`ssh-audit`, packaged in Arch, analyses a server's or a client's configuration +automatically[^arch-openssh], and is worth running once the drop-in is in place. + +## What this does not cover + +TLS, VPNs and GnuPG keys are subject to the same advisory and are not SSH. For TLS, the check is +whether a connection negotiates `X25519MLKEM768`; `openssl s_client -connect :443 -brief` +prints the negotiated group. A VPN's key exchange is set by its server, so a client can only ask. + +SSH certificates signed by a CA need the CA key rotated as well. OpenSSH accepts +`ssh-mldsa44-ed25519` as a CA signature from 10.6p2[^openssh-notes]. + +The one thing this guide cannot settle is when each service adds ML-DSA. Re-running the +`server-sig-algs` check from step 3 is how an RSA key gets replaced once it does. diff --git a/docs/guides/index.md b/docs/guides/index.md index e14ec03..dcd40dd 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -21,3 +21,4 @@ Conventions: - [Pin an AUR package to an older version with a paru PKGBUILD repo](pin_an_aur_package_to_an_older_version_with_a_paru_pkgbuild_repo.md) - masking the AUR with a local checkout when the distribution is too far behind to satisfy an exact dependency, and the Mode setting that makes it a no-op - [Cap the Docker build cache on rootless Docker](cap_the_docker_build_cache_on_rootless_docker.md) - one daemon.json setting in the user's config rather than /etc, and the buildx check that proves it was read - [Move an Alder Lake GPU from i915 to xe](move_an_alder_lake_gpu_from_i915_to_xe.md) - a GRUB entry booted once to test it, then xe for every entry and a hand-written one kept for i915 +- [Harden SSH after the NSA post-quantum advisory](harden_ssh_after_the_nsa_post_quantum_advisory.md) - ML-DSA keys where a server takes them and RSA 4096 where it does not, one key per service, and an sshd drop-in applied in an order that cannot lock you out diff --git a/docs/log.md b/docs/log.md index 8095c0c..a74294e 100644 --- a/docs/log.md +++ b/docs/log.md @@ -2,6 +2,7 @@ ## 2026-12-03 +- add guide, "Harden SSH after the NSA post-quantum advisory" - add investigation, "LeOn Audio-Aufnahme: Sicherheitsanalyse", on TLS-X25519 breakage, irreversible ML training and voice-cloning risks after the NSA Advisory of 2 December 2026 - add finding, "Plasma on Wayland freezes after an i915 GPU hang, whilst a call carries on" - add guide, "Move an Alder Lake GPU from i915 to xe", as a draft