99 Commits
Author SHA1 Message Date
Ziad Arafat d3b9e0d333 Preflight the rootless podman subuid/subgid ranges in dot boxes
A fedora-toolbox pull dies inside the user namespace ('requested 998:998
for /var/lib/unbound') when the user has no /etc/subuid and /etc/subgid
range, and distrobox only shows podman's unpack error. dot boxes now
checks both files and prints the usermod + podman system migrate fix
before pulling; dot doctor reports the same condition.
tests/boxes-subid.sh covers range summing, small ranges and the hint.
2026-12-02 12:38:40 -07:00
Ziad Arafat 12258063ce remote-browser: make 'cli' a true passthrough and say so
cli used to share the flag parser with the built-in verbs, so a playwright-cli
argument that looked like ours could be swallowed. After 'cli' the args now go
through untouched, '--' is honoured, and the skill documents that the built-ins
are a convenience layer rather than a subset: goto/click/storage/tracing/route/
run-code/pdf/webmcp all work in the attached session with exit codes intact.
2026-12-02 12:29:47 -07:00
Ziad Arafat a21791c630 remote-browser: generalise deck-browser to any device, add a setup workflow
deck-browser assumed one host. remote-browser takes a profile per device
(transport ssh or direct, host, port, ws path, inspect URL) and gains
'profiles', 'setup' and 'check': check walks ssh -> port -> websocket
handshake -> attach -> tabs and prints the first failure instead of a
generic 'could not attach'. The skill ships references/setup.md, a checklist
for onboarding a device with the user, including per-browser toggle URLs, the
Chrome <136 fallback, and a symptom->cause table.
2026-12-02 12:25:45 -07:00
Ziad Arafat 8999c687f9 deck-browser: drive playwright-cli instead of a hand-rolled CDP client
Playwright documents connectOverCDP with a ws:// endpoint, and
playwright-cli attach --cdp=ws://127.0.0.1:9222/devtools/browser works against
the Deck's chrome://inspect toggle. That makes the 270-line stdlib CDP client
redundant: the wrapper is now 130 lines of bash that opens the tunnel, attaches
once and maps tabs/text/html/shot onto playwright-cli (plus a 'cli' passthrough
so agents can reach console, network and the rest without new code).
2026-12-02 12:20:43 -07:00
Ziad Arafat d306474f95 deck-browser: read the Deck's Chrome from arceus over CDP
The user browses on the Steam Deck; agents run on arceus. Chrome's per-instance
remote debugging (chrome://inspect toggle) exposes CDP only as a WebSocket at
/devtools/browser, so playwright attach cannot use it and the HTTP /json paths
return 403. bin/deck-browser speaks CDP directly with the standard library:
tabs, text, html, shot, status, plus an opt-in unsafe-eval. Read-only by design -
no click, type or navigate - because driving authenticated sessions is what gets
accounts restricted. Opens the SSH tunnel itself and reuses an existing one.

Registers the skill for every harness and tells agents it exists.
2026-12-02 12:18:08 -07:00
Ziad Arafat acb8191f13 Explain user-systemd noise instead of only repeating it
Home Manager's reloadSystemd reports the whole user manager before it
reloads anything, so one failed distro unit (xdg-desktop-portal* on a
host with no display, dbus-activated by an agent CLI) makes every
switch look broken. It starts none of those units.

dot doctor now prints the user session state, the failed units with a
reset-failed hint (--fix runs it), restart-looping units, and the units
in ~/.config/systemd/user that no home-manager generation owns. README
gains 'What belongs in dotfiles': the four gated units this repo
declares, the pi-workers file that is tracked but wired by hand, and
why portal and root units must stay out.

tests/doctor-systemd.sh covers the report and the --fix path.
2026-12-02 12:08:29 -07:00
Ziad Arafat 7ca1845213 Add dot sync for dotfiles-only updates
dot update also upgrades Flatpak apps, mise tools, Claude and checks for
missing apps, which is slow for a one-file change. dot sync pulls the
checkout with --ff-only and switches, nothing else; dot update
--switch-only is an alias. Serialise concurrent home-manager runs on
~/.config/dotfiles/switch.lock so two switches cannot fight over the Nix
store, and cover the path with tests/sync.sh.
2026-12-02 11:57:19 -07:00
Ziad Arafat c78b9a751d Package secretctl in every dotfiles profile 2026-12-02 10:56:09 -07:00
Ziad Arafat 769f43ab36 Split secretctl snapshots below the vault note limit 2026-12-02 10:41:54 -07:00
Ziad Arafat 9fdd63a6eb Add Bitwarden backup and restore for secretctl stores 2026-12-02 10:36:38 -07:00
Ziad Arafat 4b6d1a36fc Allow Chrome Flatpak to install web apps during setup 2026-12-02 10:32:04 -07:00
Ziad Arafat 74b24a267b Document required Authentik SSO for personal Vaultwarden 2026-12-02 10:17:46 -07:00
Ziad Arafat c9d7974d16 Document current Vaultwarden CLI setup 2026-12-02 10:10:27 -07:00
Ziad Arafat ea6b7ded17 Configure the Bitwarden server noninteractively 2026-12-02 09:50:06 -07:00
Ziad Arafat 86aed12d40 Select Bitwarden server by dotfiles profile 2026-12-02 09:48:36 -07:00
Ziad Arafat c6199ec824 free-pi mcp: authenticate the wiki server with WIKI3_MCP_TOKEN
The wiki header looked up WIKI_BEARER_TOKEN, which does not exist in
secrets.txt, so free-pi reported 'wiki: failed' and the wiki tools were
missing from every session. Point the header at the secret the wiki-mcp
bridge and the skills already use.
2026-11-30 17:46:19 -07:00
Ziad Arafat e246c1328c Add Kontroll to Moonlander skill 2026-11-30 15:07:11 -07:00
Ziad Arafat 7bc67e42ac Add ZSA Moonlander skill for Riolu 2026-11-30 15:04:19 -07:00
Ziad Arafat b888fa5bc7 Verify Roku HDMI selection through active input status 2026-11-29 00:42:39 -07:00
Ziad Arafat df631c921c Add agent tool and skill for Roku TV HDMI-CEC 2026-11-29 00:37:15 -07:00
Ziad Arafat 49e2321493 handoff skill: point at tests/handoff.sh 2026-11-29 00:36:29 -07:00
Ziad Arafat 653d679dbc doctor: check the handoff pipeline; tests cover it end to end
dot doctor gains four checks (daemon active, weekly probe timer scheduled, every pool
lane usage=developer-api via the new bin/handoff-pool-check, and the pool readable by
free-agent), so a dead daemon or an expired lane stops being invisible.

tests/handoff.sh grows two checks for those and becomes hermetic: its daemon test runs
in a private HANDOFF_TMUX session and points every brief at a path that does not exist,
because a first version started a real worker inside the live session and spent a call.
The doctor assertion captures the output instead of piping into grep -q, which with
pipefail fails on SIGPIPE once the match is found.
2026-11-29 00:36:18 -07:00
Ziad Arafat 767f0f7f8e tests: exercise the handoff pipeline without spending a call
Ten checks in throwaway XDG dirs: the credential and freebuff gates, the task JSON
(backend, role, brief), a running task with no worker reported as orphan, the daemon
actually requeueing one, free-agent reading a custom pool, refusing a lane that is
not a developer API even when forced with --model, exiting 3 when every lane is out
of budget, and pause/resume. Nothing here reaches a provider.
2026-11-29 00:19:07 -07:00
Ziad Arafat c2499969f2 handoff: policy gate for delegated work
Three safeguards, because a queue that can drive any endpoint will eventually drive the
wrong one:

- every pool lane now declares usage=developer-api plus its terms URL; free-agent refuses
  a lane without it, even when forced with --model (Freebuff's client refused an
  agent-initiated brief and counted a strike, which is what this prevents);
- handoff submit refuses a brief containing an API key or private key, since free tiers may
  train on prompts;
- the skill documents the gate: developer APIs only, nothing private in a brief, never
  rephrase past a block.
2026-11-28 23:44:04 -07:00
Ziad Arafat 81b99618b5 handoff: refuse the freebuff backend, and say why
Freebuff's usage policy rejects prompts that read as a job handed to another agent
('Driven by another agent'), does not send them to the model, and counts the attempt
as a strike on the account. The queue must not drive it, so submit refuses the
backend with that explanation and the skill points at interactive use instead.
2026-11-28 23:32:38 -07:00
Ziad Arafat 7669aebd14 freebuff-agent: only the marker ends a run
An idle prompt with no marker is not completion: the TUI sits idle while it waits
for the model, and the 'idle for two polls' shortcut ended a run 20 s in with
nothing done. Wait for HANDOFF-DONE (or the timeout).
2026-11-28 23:22:09 -07:00
ziadarafat bf0170070e tools: version the free-model calibration graders
Both graders, with the reference-implementation note: the first two scoreboards
were grader bugs (a fixture mounting a path that does not exist, and a boundary
case reusing the previous case's fixture), not model failures.
2026-11-28 23:18:01 -07:00
Ziad Arafat 8d73a773b3 handoff: survive restarts, route backends, trust the TUI
- submit stores the backend in the task JSON (--backend freebuff works again).
- start_task reads it; the freebuff path calls freebuff-agent.
- ensure_session starts the tmux server in its own transient scope, so a
  'systemctl --user restart handoff' no longer kills every running worker.
- requeue_orphans puts tasks back in the queue when their window or process is
  gone (daemon crash, killed window, tmux server restart); 'handoff list' shows
  them as orphan instead of running forever.
- freebuff-agent only believes the task is finished when the marker stands alone
  on a line AND the TUI is idle, because the prompt we send contains the marker.
2026-11-28 22:05:28 -07:00
ziadarafat 5accb686d3 free-agent: pool matches reality, plus a ledger generator
Three lanes 404'd (minimax-m3.1-flash, nemotron-3-super, cohere north-mini-code),
one returned 400 on every attempt (qwen3.8-27b), and the two lanes that actually
perform best (nemotron-3-ultra-550b, nemotron-3.5-lightning) were not in the pool
at all. Each surviving lane now carries a note saying what it was measured doing.

free-agent-ledger turns the run history into the table the wiki page quotes, so
the numbers are regenerated rather than remembered.
2026-11-28 22:04:43 -07:00
Ziad Arafat acd1c86393 freebuff: enroll as a handoff backend
- bin/freebuff-agent drives the Freebuff TUI in its own tmux session and keeps the
  same brief -> report contract, so handoff can route to it with
  --backend freebuff (verified: queue -> worker -> diff -> tests pass).
- handoff list shows the backend when a run has no model id.
2026-11-28 21:57:09 -07:00
Ziad Arafat 710b5f59cb probe: weekly timer, and only dead lanes fail the unit
- handoff-probe.service + .timer (Mon 08:00, persistent) run free-agent --probe
  and append to ~/.local/state/free-agent/probe.log.
- probe now separates BUSY (429, quota, empty reply) from DEAD (retired slug,
  dead key, broken template); only DEAD fails the unit, so a weekly red status
  means the pool needs an edit rather than a provider being momentarily full.
2026-11-28 21:52:16 -07:00
ziadarafat 8d719140ba decypharr-phase1: add-latency harness
Runs on the media host so neither the Decypharr token nor the TorBox key leaves
it, and prints only HTTP codes and timings. Uses fresh shuffled hashes per run:
re-adding a hash the sandbox already knows answers in about a millisecond and
halves the measured median.
2026-11-28 21:31:39 -07:00
Ziad Arafat deb83c1a73 free-agent: --probe, OpenRouter free-lane rotation, Groq TPM reality
- OpenRouter free slugs rotate: minimax-m3.1-flash and north-mini-code are gone,
  nemotron-3.5-lightning and nemotron-3-ultra respond, so the pool is updated.
- --probe pings every lane with a tiny prompt and prints alive/dead with the
  provider's own error, which is how the rotation gets noticed.
- Groq free is TPM-bound (~8K/min): one agent turn nearly fills it, so those
  lanes now sit last and are marked small-prompt only.
- qwen3.8-27b on Groq fails its chat template and is dropped.
2026-11-28 21:18:26 -07:00
ziadarafat 499a109fd8 handoff: timezone-aware timestamp in queue entries
datetime.utcnow() is deprecated and printed a DeprecationWarning on every
submit; the queuedAt field is unchanged in format.
2026-11-28 21:11:49 -07:00
Ziad Arafat bbe587377a free-agent: only park a lane on a daily wall, not a per-minute 429 2026-11-28 21:11:37 -07:00
Ziad Arafat 68c85c45af free-agent: retry on provider retryDelay, zai flash maxTokens
- free-agent now sleeps the delay a free tier asks for (Gemini free Flash is
  5 req/min) and retries the same model before spending another lane.
- pool rpm lowered for the Gemini lanes to stay under the published limit.
- models.json: GLM flash ids with explicit maxTokens, otherwise Z.ai rejects
  the request with max_tokens must be in [1,98404].
- handoff skill so every harness knows the brief -> queue -> review loop.
2026-11-28 21:10:14 -07:00
ziadarafat 936f8a323e music-audit: fix-years sets date from the release group's first release
Keep the pressing date in originaldate so libraries still sort and display by
first release. Sweeps a whole library, not just the albums we re-tagged.
2026-11-28 21:07:21 -07:00
ziadarafat ddc7d806b1 models.json: provider keys through secretctl, not literals
Google, Groq, OpenRouter and zai authenticate via secretctl at call time, and
strict mode is off where the provider rejects it.
2026-11-28 21:07:21 -07:00
ziadarafat 8ce4afc9f4 free-agent pool and handoff queue
free-agent runs a task brief through a pool of free models with local rate-limit
accounting and failover; handoff queues briefs and runs each in its own tmux
window under a systemd user service, so workers survive a closed terminal and
come back after a reboot. WORKER.md is the protocol the worker follows.
2026-11-28 21:07:21 -07:00
ziadarafat 0bf6e660ff bin: cdp-key and cdp-read for harvesting keys without transcripts
Reveals a one-time API key in an attached Chrome and pipes it straight into
secretctl add, so the value never lands in a shell history, an argv, or an
agent transcript.
2026-11-28 21:07:21 -07:00
ziadarafat 6a024fe75e windows-vm: promptless install ISO via Microsoft's noprompt boot image
UEFI does not use bootfix.bin (that is BIOS-only); cDBoot prompts on its own and
cannot be dismissed without a keyboard device, which Proxmox reserves for
root@pam via -args. So the prompt is removed from the media instead: the ISO
ships efi/microsoft/boot/efisys_noprompt.bin, byte-for-byte the same size as the
El Torito UEFI image, so it overwrites it in place and the boot catalog stays
valid. build-noprompt-iso.sh does it and verifies the result.

Firmware now starts the CD with no keystroke, but OVMF stalls in Start boot
option and never reaches Setup, so the Packer build still does not complete.
2026-11-28 20:58:19 -07:00
ziadarafat 0a1eaab6e7 windows-vm: Packer schema corrected; the keystroke path is blocked at the API
boot_iso needs an explicit type, otherwise the block is silently ignored and the
VM is built with no installation media at all. The media prompt is still missed:
Proxmox gives Packer's VM only a usb-tablet, and its own remedy for that
(qemu_additional_args) is refused with 500 "only root can set 'args' config".
Documented in place for whoever runs this next.
2026-11-28 20:29:28 -07:00
Ziad Arafat 632ae00711 fix(pi): use non-strict Cohere tools in free profile 2026-11-28 20:12:21 -07:00
ziadarafat c1303d61c7 windows-vm: Packer communicator uses the provisioned account
The build drives the guest over WinRM, so the credentials must be the ones the
answer file creates (doge/doge123!), not the older kraken placeholder.
2026-11-28 19:51:35 -07:00
ziadarafat ef97badfb5 windows-vm: unattended provisioning and automation hooks
A Windows test VM was useless for automation because everything had to be done
through keystroke injection, which cannot reach a boot prompt and mangles
punctuation ('.' is key 'dot', not 'period').

Now an install ends with a machine that can be driven over the network:

  * provision.ps1 installs qemu-guest-agent, WinRM and OpenSSH Server, turns on
    auto-logon and disables sleep and lock, then writes C:\provision-done.txt
  * autounattend.xml is validated before every build - a missing wcm namespace
    makes Setup reject the file and reboot in a loop, which is exactly what cost
    an evening
  * build-answer-iso.sh refuses to build an answer file that would do that
  * win11.pkr.hcl now passes packer validate against proxmox 1.2.4: floppy_files
    and additional_arguments are not supported by the builder, so the answer file
    ships as a second CD and boot options moved into a boot_iso block

README rewritten around the two paths (template + clone, Packer rebuild) with the
four traps and the red herrings recorded.
2026-11-28 19:36:43 -07:00
ziadarafat 79125a841b windows-vm: template-first, Packer for rebuilds
Testing a USB device under Windows meant driving a Windows install by hand, and
that turned out to have one genuinely hostile step. The installation media shows
'Press any key to boot from CD or DVD......' for about five seconds; miss it and
the firmware falls through to the empty disk with 'BdsDxe: No bootable option'.
qm sendkey cannot be relied on for it: it injects PS/2 events while a q35 VM has
only a USB keyboard, and the event must land inside that window. In practice the
keys reached the firmware boot menu but never the media prompt.

Two ways out, in the order they are worth the effort:

  template + clone   install once, sysprep /generalize, qm template; every later
                     VM is a clone that boots in about a minute
  Packer             win11.pkr.hcl builds the template unattended. boot_command
                     sends real keystrokes over VNC and repeats the spacebar
                     across the whole prompt window, which is the fix: one press
                     is a race, ten presses is not

The answer file rides on a floppy so Windows finds it at A:\ instead of guessing
which CD-ROM letter it got, and virtio-win is installed so disks and network are
paravirtualised rather than emulated.
2026-11-28 18:11:22 -07:00
ziadarafat cda5bd83a9 mcp-lapis: never fork the store onto a client host
The wrapper preferred a local LaPis checkout over the ssh bridge. That is fine
on the host that owns the store and wrong everywhere else: a checkout appeared on
the Deck today and, from that moment, the Deck wrote to a brand-new local DB
while the 90 real observations stayed on arceus, invisible to it.

A host now bridges when ~/.pi/memory/REMOTE_STORE names the store host (or when
LAPIS_FORCE_REMOTE=1). Both are host-local state, so the owning host is
unaffected and nothing has to be deleted to become a client again.
2026-11-27 21:14:57 -07:00
ziadarafat 34d4e5afab music-audit: parse numbering, years and bare disc folders
Three folder-naming shapes broke artist/title detection, and each one turned
into a pile of silent 'no candidates':

  '02. 1958- The Songs That Made Him Famous'  the year was stripped but its
      dangling dash stayed, so the string split into artist '02.' — leading
      index prefixes are now dropped and the year takes its dash with it
  'Stockholm 67/Disc 1'                       the folder said only 'Disc 1', so
      the album name is one level up and the artist two: resolve-albums now
      climbs out of bare disc folders
  '03. 1959- The Fabolous Johnny Cash'        spelling as shipped; still no
      candidate, and correctly left alone rather than force-matched

Johnny Cash went from 72/72 no-candidates to finding real releases (Hymns by
Johnny Cash 12/12, Now There Was a Song 12/12, ...).
2026-11-26 14:13:01 -07:00
ziadarafat 9ef4b3c59d music-audit: resolve the albums beets declines
Stage B's quiet import drops every match that is not near-perfect, so a messy
discography yields almost nothing: the whole queue applied 0 albums and skipped
151. Two causes, both confirmed on disk:

  * quiet_fallback: skip turns any 'medium' match into silence. Raising
    strong_rec_thresh to 0.20 does not help, because beets judges the album as a
    whole and a wrong album tag drags the distance past the threshold even when
    the displayed similarity is 86%.
  * albums whose disc folders are separate directories are matched against the
    whole release, so they never line up.

So the declines are resolved outside beets:

  mb-pick.py        search MusicBrainz for a folder and score the candidates
                    against what is actually on disk (a medium of exactly N
                    tracks, the release total, official status, the disc number
                    in the folder name)
  mb-tag.py         write the chosen release with mutagen. Full write when the
                    track count lines up, --album-only when the folder is a
                    partial rip (grouping fixed, lying track numbers avoided),
                    and --gaps names the tracks that are missing
  resolve-albums.py walk a discography, skip anything already carrying a
                    MusicBrainz album id, and log a JSON manifest of outcomes

Pink Floyd's nine declines are now all tagged: Atom Heart Mother, The Wall disc 2
and the Ummagumma studio disc got full tags; Saucerful, Momentary Lapse, Dark
Side and the three Piper 40th discs got album-level tags because the rips are
missing tracks (Us and Them, Sorrow, Set the Controls exist only as live
versions elsewhere in the library). Styx: 11 of 15 albums fully tagged.
2026-11-26 12:27:51 -07:00
ziadarafat e6c4d6a3cf music-audit: sequential Stage B runner
Runs album-level beets imports over a queue of folders, one at a time: beets
writes a single SQLite library, so concurrent imports collide. Waits for any
import already in flight, logs each folder separately, and records completed
folders in /var/lib/beets/stageb-done.txt so a re-run skips them.

Pink Floyd (first folder): 193 of 245 files now carry a musicbrainz_albumid and
27 tracks gained disc numbers > 1, i.e. multi-disc sets are being split properly.
Nine albums were declined and are worth a manual pass: The Wall disc 2, Dark Side
of the Moon, Piper 40th, Echoes disc 2, Zabriskie Point disc 2 and others.
2026-11-26 03:51:23 -07:00
ziadarafat 7a27c78476 music-audit: move duplicates to a reversible trash with a manifest
trash-duplicates.py acts on the AcoustID duplicate report: for each group it
keeps the nominated file and moves the extra copies into a dated folder,
preserving their path relative to the library root so any batch can be restored
in place. Two guards matter: a group is skipped entirely if its keeper no longer
exists (a recording must never lose its last copy), and every move is recorded in
a JSON manifest.

First run: 999 files, 11.91 GiB, 14 groups skipped (sources already gone), 0
failures; keepers verified present afterwards and free space went 13G -> 27G.
2026-11-26 03:39:19 -07:00
ziadarafat 72ac6b0cc6 music-audit: quarantine tool plus fingerprint retry for artwork-broken files
quarantine.py asks an independent decoder whether a file's *audio* plays before
moving anything. The first version wrongly condemned 359 files because ffmpeg
could not decode their embedded cover art; with -vn -map 0:a only one file in the
library is genuinely unplayable (a Leonard Cohen mp3 with no audio stream), and it
is now archived under /mnt/MediaDisk/Music-Quarantine/<stamp>/ with a JSON manifest
and its original relative path.

The other 704 files that fpcalc refused are fine: the official binary bundles
FFmpeg 58, which gives up on that same artwork. The ffmpeg-backed shim now decodes
audio only (-vn -map 0:a, correctly placed after the input), and retry-failed.py
re-fingerprints the failures through it, appending corrected entries to the index.
2026-11-26 02:32:23 -07:00
ziadarafat 1390fd8487 music-audit: fix the completion check that could never fire
pgrep -f music-identify matched the ssh command line carrying that very string,
so the 'still running' branch was always true and the follow-up would wait for
ever. Bracket the pattern (music-[i]dentify) so pgrep cannot match itself.
2026-11-26 02:07:25 -07:00
ziadarafat 39fcf6bc4f music-audit: followup must not treat an unreachable host as a finished run
When the Netbird tunnel dropped, ssh to yveltal timed out and the script wrote
'INCOMPLETE - process is gone' and marked the run done, which would have left the
report wrong and the timer silent. Now an ssh failure logs 'unreachable, will
retry next tick' and exits without touching the state file.
2026-11-26 02:07:04 -07:00
ziadarafat 3fd4ae0109 music-audit: overnight follow-up timer and cohere strict-mode fix
followup.sh + music-followup.timer wake a headless pi session when the AcoustID
identification pass ends: it writes the duplicate report (read-only), records the
identification totals and the Jellyfin grouping, then starts the agent in tmux.
It is idempotent via a state file and Persistent=true so a suspended Deck
catches up on resume.

Two things had to be worked around: pi lives in a mise npm install (a timer has
no shell profile), and Cohere rejects requests whose tool definitions mix strict
and non-strict in pi 1.4.0 headless, so the default model is a local Ollama one.
Also sets compat.supportsStrictMode=false for cohere in the pi model catalog.
2026-11-25 20:58:15 -07:00
ziadarafat 6bc006e90a music-audit: document the beets settings and singleton handling 2026-11-25 20:50:34 -07:00
ziadarafat b8997edc9f music-audit: AcoustID identification pass and duplicate report
identify.py walks the library, fingerprints each file with fpcalc and resolves
it through AcoustID into an append-only JSONL index (/var/lib/beets/
acoustid-index.jsonl). It resumes by path+size+mtime, so an interrupted run
continues where it stopped, and it never touches the audio files.

The first run wedged on file 58 because pyacoustid's urllib call has no
timeout; socket.setdefaulttimeout(60) plus a 180s SIGALRM per-file guard turn
any such stall into a recorded error instead of a dead run.

report-duplicates.py turns that index into two separate lists: 'exact' groups
that resolve to the same MusicBrainz recording id at score >= 0.85 (same audio,
encoded twice) with a nominated keeper (FLAC before lossy, then bitrate, then
size), and 'uncertain' groups that only share a normalised artist+title close in
duration, which need a human. It deletes nothing.
2026-11-25 20:21:52 -07:00
ziadarafat ff82addb46 music-audit: fpcalc fallback shim and notes on getting fingerprints on EL9
AlmaLinux 9 packages libchromaprint but no fpcalc CLI, so beets chroma and
pyacoustid had nothing to call. The shim in this folder produces the same
fingerprint via ffmpeg's chromaprint muxer; on the same file it is byte-identical
to the official 1.5.1 static build, which also installs cleanly from the
acoustid/chromaprint GitHub release.
2026-11-25 20:07:02 -07:00
ziadarafat 40edcf1f29 tools: read-only music library audit + baseline report
Records the analyser used to size up the Jellyfin music library's metadata
problems, plus the 2026-11-25 baseline so the clean-up can be measured against
it. Read-only: mutagen parses tags, nothing is written to the files.
2026-11-25 19:39:06 -07:00
ziadarafat ea52f8f4fc wallpapers: rotate every 15 minutes on the Personal activity too
SlideInterval is in seconds (the slideshow plugin's own schema: 'Interval
between slides in (s)', default 900), so Work was already 15 minutes while
Personal sat at 10 - a ten-second slideshow. Both activities are now 900 s.
Verified through Plasma's scripting API: all four desktop containments report
900, and the live config file agrees after it flushes.
2026-11-25 19:22:20 -07:00
ziadarafat 85fdeaf280 mcp: make the lapis server start on hosts without a local LaPis store
The free-pi lapis entry pointed at /home/ziadarafat/.pi/agent/.../memory-store.js,
an arceus path. On the Deck that file does not exist, so the server never started
and no lapis tools were offered for the whole session - memory had to be reached
by shelling out to arceus by hand.

bin/mcp-lapis is now a single wrapper that picks a strategy per host: run the
local store when the checkout is present (arceus), otherwise bridge stdio over
ssh to the host that has it (the Deck). The free-pi entry runs it through sh so
$HOME resolves on either machine. Verified with an MCP handshake: lapis 1.4.0,
tools/list returns memory-save and friends.
2026-11-25 19:04:09 -07:00
ziadarafat b7d5cc394f codex: homelab config on the Deck with LaPis memory and wiki MCP
config.toml sets gpt-5-codex with approval_policy=never and
sandbox_mode=danger-full-access, and registers two MCP servers: lapis (LaPis
memory, which lives on arceus, bridged over ssh by bin/mcp-lapis-remote) and
wiki (Wiki.js over streamable HTTP, token supplied by WIKI_BEARER_TOKEN in the
launching environment so it never lands on disk).

Skills are already linked from config/skills into ~/.codex/skills. The README
records that ~/.codex is not yet wired into home/agents.nix.
2026-11-25 17:29:24 -07:00
ziadarafat 0502804032 observability: metrics, dashboard and morning check for the debrid pipeline
The rdtc incident was reconstructed from SQLite by hand because nothing was
watching. Now three layers exist:

* rdtc-async-add serves /metrics (adds accepted/deduped/delivered/failed,
  retries, delivery histogram); two tests pin the counters.
* tools/debrid-metrics merges that with rdtc's queue health (pending rows with
  no provider id, torrents stuck at 0%, oldest pending age) and nginx's
  add-request log (latency histogram, 499/504 counts) into one node_exporter
  textfile every 15s. The access log is parsed incrementally with an inode and
  offset state file, so restarts do not double-count or lose lines.
* tools/rtdc-health/check.sh answers 'did it work overnight' from Prometheus,
  the rdtc database and logs, and Radarr's log, and exits non-zero on failure.

Also fixes the reason the incident was invisible: rdtc logged nothing because
General:LogLevel was 4 (Error) and DownloadClient:LogLevel 5 (Fatal). Both are
now Information/Debug, journald is persistent with a 2G cap, and the rdtc API
vhost writes a dedicated access log with $request_time.

Grafana dashboard debrid-pipeline (13 panels) is provisioned on xatu and live.
2026-11-25 17:16:14 -07:00
ziadarafat faa175809d tools: rdtc-async-add, a non-blocking front door for rdtc's add endpoint
rdt-client answers POST /api/v2/torrents/add only once the debrid provider
call has finished. When TorBox is slow, or its slots are held by stalled
torrents, that exceeds *arr's hardcoded ~100s client timeout: *arr reports
"failed to connect to qBittorrent", blocklists the release and grabs the
next one, so one film ends up queued several times. That is what produced
five Passengers releases in seven minutes on 2026-11-25.

The proxy buffers the add, answers 200 "Ok." immediately and delivers it
to rdtc in the background with 3 retrying attempts. Identical bodies inside
a 60s window are suppressed, which covers *arr re-sending the same release.
Everything else is passed through untouched, so *arr still sees qBittorrent.

Nine tests pin the contract, including "add answers in <250ms while the
upstream takes seconds"; a mutation to synchronous delivery makes them fail.
Verified on yveltal: adds now answer in 10ms through nginx (was >100s then
HTTP 499), Radarr logs 0 download-client failures, delivery retries visible
in the journal.
2026-11-25 17:06:54 -07:00
Ziad Arafat 6db09805bc AGENTS.md: state that skills are repo-managed and deployed read-only 2026-11-25 15:35:56 -07:00
Ziad Arafat 2a3efca5a5 skills: store memory-layer as files, not a symlink into LaPis
The symlink was absolute, so the skill dangled on the Deck and would
break on any host where the LaPis checkout moves.
2026-11-25 15:34:32 -07:00
Ziad Arafat 9a55dd678f Make the dotfiles repo the single source of truth for agent skills
The skills were copied between harnesses by hand:

  cp -rn ~/.claude/skills/* ~/.agents/skills/
  cp -rn ~/.agents/skills/* ~/.pi/agent/skills/
  cp -rn ~/.codex/skills/* ~/.pi/agent/skills/

-n never clobbers, so the copies drifted: pi and ~/.agents disagreed on
infra-change, wiki-update and wiki-view, ~/.agents had lapis-memory and pi
did not, Codex had its own memory-layer, and pi's wiki skills pointed at the
wrong host: godemperordoge.org instead of wiki.godemperordoge.org, fixed
separately. pi warned about the collisions on every start, and that warning
was the only signal that a fix existed in a copy it was skipping.

Now config/skills holds one copy per skill, linked into ~/.pi/agent/skills,
~/.free-pi/agent/skills, ~/.codex/skills and ~/.agents/skills. The three
skills that genuinely need two flavours keep both: config/skills/NAME reaches
the wiki through codemode, config/skills/cli/NAME through the mcp bridge, for
harnesses without a sandbox.

Pre-consolidation trees are backed up at
~/skills-pre-consolidation-20261125T223135Z.

Edits now land in git or fail: the deployed paths are symlinks into the
store, so a harness that writes there gets a read-only error and has to
change the repo instead.
2026-11-25 15:31:53 -07:00
Ziad Arafat a0c4c8204a Stop pi from blowing its own context: disclosure by default, guard on reads
Always-on instructions were ~11 KB in every request (two near-duplicate
AGENTS.md files); pi loads both from $HOME and ~/.pi/agent. That is the
monolithic-instruction pattern progressive context disclosure argues
against, and it sat on top of a 33k window.

- config/pi/AGENTS.md: 1.8 KB index of the rules that cannot be delegated
  plus a task -> skill table. ~/AGENTS.md and ~/.pi/agent/AGENTS.md both
  point at it (11 KB -> 3.7 KB of duplicates, one source).
- config/pi/skills/homelab-policies: the merged detail (memory, secrets
  handling, host safety, Proxmox access, forges, codemode sandbox rules,
  docs conventions, stack defaults), loaded only when a task needs it.
- config/pi/skills/context-discipline: locate -> outline -> window ->
  aggregate, with per-call budgets and an anti-pattern table.
- config/pi/extensions/context-guard.ts: pi.on(tool_call). Blocks an
  unbounded read of a file over 300 lines / 16 KB and answers with the
  file outline plus the exact windowed call to make instead; blocks
  cat of such a file; blocks limit > 300. Treats limit 0 and
  offset-without-limit as unbounded, because the model sends those.
  Thresholds are overridable (PI_GUARD_MAX_LINES/_BYTES/_WINDOW) so the
  block path can be tested.

Verified on arceus: guard handler fires on real read calls; with a
deliberately tiny window it refused a 601-line read and the model
reported the constraint and switched to sed/codemode. Skills appear in
the prompt: homelab-policies, context-discipline.
2026-11-25 15:21:39 -07:00
Ziad Arafat 93e8119eb7 Give the local fallback a 128k window instead of 32k
The 26B models baked PARAMETER num_ctx 32768, and models.json mirrored
that as contextWindow, so pi capped every local session at 33k and
compacted there. The weights support 262144.

Measured with per-request num_ctx on yveltal (q4_0 KV, 31 GB RAM):
  12B  32k  -> 8.38 GB            , 413 tok/s prefill, 17-21 tok/s gen
  12B 128k  -> 8.96 GB, 100% VRAM , 337-356 tok/s    , 20 tok/s
  26B  32k  -> 15.12 GB, 80% VRAM , 413 tok/s
  26B 128k  -> 16.16 GB,  0% VRAM , a 14k-token prompt did not finish in 25 min
  26B 256k  -> 17.62 GB            , 1.5 tok/s gen

So widening the 26B pushes it off the GPUs entirely, while the 12B keeps
100% VRAM and full speed at 128k. Widening the window is therefore a
routing change, not a bigger-number change:

- new gemma4-12b-qat-128k (text) and the existing 12B vision model now run at
  131072 and are the long-context local path; it answered a needle test
  placed 14k tokens deep, through pi.
- pi-auto-models fallback moves from the 26B to gemma4-12b-qat-128k.
- the 26B text/vision stay at 32k (quality tier) with -128k variants left
  available in models.json but out of the cycle, since they run on CPU.
2026-11-25 14:55:24 -07:00
Ziad Arafat 76744c9596 Track the KDE Activity browser helper and bun as a mise tool
tools/activity-browser: Go user-session service that sets the default
browser per KDE Activity (Edge for Work, Chrome for Personal) using
busctl CurrentActivityChanged plus a 30 s fallback, verifies each change
and retries at login. No third-party dependencies, tests pass, ships a
systemd user unit and install/rollback notes. Built and tested on
arceus; the live Deck install still needs to verify its desktop IDs.

config/mise: add bun, which the agent MCP wrapper in bin/mcp-wiki-remote
requires.
2026-11-25 13:59:48 -07:00
Ziad Arafat 0ace7605ce free-pi: add the 12B vision model to the tracked model list 2026-11-25 13:55:46 -07:00
Ziad Arafat 3fc103b204 Launch agent MCP wrappers via /bin/sh so GUI-launched agents resolve them without PATH 2026-11-25 13:53:22 -07:00
Ziad Arafat f3649f894f Track pi, free-pi, Cursor and Antigravity agent config
config/pi: curate the model cycle (enabledModels) so Ctrl+P reaches the
primary Cohere models, the local 12B vision model and the 26B text
fallback instead of every installed model. Track models.json and
auto-model.json too; API keys stay behind !secretctl lookups.

config/free-pi: first tracked copy of the free-pi agent directory
(models, wiki MCP, AGENTS.md standing rules incl. this repo as the
source of truth for agent config).

config/cursor + config/antigravity: rules and MCP wiring. The wiki
server is the shared bin/mcp-wiki-remote wrapper so no token is
committed; LaPis gets bin/mcp-lapis.

home/agents.nix: link all of the above for the personal profiles
(full, headless) and keep them out of full-work.
2026-11-25 13:53:06 -07:00
Ziad Arafat 19f9c232e2 Preserve existing Home Manager backups during recovery switches 2026-11-15 12:11:03 -07:00
Ziad Arafat 1c4b0657bf Select an accessible Nix CA bundle inside distrobox 2026-11-15 12:08:45 -07:00
Ziad Arafat 3f71ad2a99 Recover shared-home Nix config links and check the actual flakes gate 2026-11-15 12:07:19 -07:00
Ziad Arafat da2f8bb2e3 Configure profile-aware Git authentication and diagnose Nix setup failures 2026-11-15 11:49:52 -07:00
Ziad Arafat df7ffa82ed Leave Claude configuration unmanaged in full-work profile 2026-11-14 11:47:04 -07:00
Ziad Arafat a217c007c5 Initialize mise for Claude sessions and guide Codex project commands 2026-11-14 11:18:21 -07:00
Ziad Arafat 10b22a6ffc Version reusable Arceus preset and document pokefetch preset library 2026-11-13 15:11:35 -07:00
Ziad Arafat 777d01926d Add custom pokefetch argument hook and day-night Lugia example 2026-11-13 13:47:05 -07:00
Ziad Arafat f13397cf45 Support Selkies bootstrap and native Fedora profile apps 2026-11-13 13:32:24 -07:00
Ziad Arafat 95ca15b2c6 Add full-work desktop subset and personal Codex CLI 2026-11-13 13:20:49 -07:00
Ziad ArafatandClaude Opus 5.5 5adea3ece7 netbird unit: create /run/netbird and /var/lib/netbird; dot system restarts it
The daemon creates neither its socket dir nor its state dir, so the unit
failed with 'listen unix /var/run/netbird/sock: bind: no such file or
directory' and restart-looped (8.6k restarts on the Deck).
RuntimeDirectory= and StateDirectory= create both. dot system now restarts
the service so a changed unit or binary takes effect, and prints the
first-time 'netbird up --management-url' hint for the self-hosted server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:08:59 -07:00
Ziad ArafatandClaude Opus 5.5 68d6fce13e Defguard VPN client: Nix package, root service, dot defguard provisioning
- pkgs/defguard-client.nix repackages the official 2.1.2 .deb (GUI, defguard-service, dg) with
  Nix's WebKitGTK 4.1, so it runs natively on SteamOS; the GUI wrapper adds desktop-file-utils
  and xdg-utils, which the app needs to register its defguard:// handler.
- `dot system` installs the root interface service (config/defguard/defguard-service.service),
  the defguard group and a resolvconf -> resolvectl shim where resolvconf is missing.
- `dot defguard` mints a single-use desktop token with DEFGUARD_API_TOKEN from the Bitwarden-backed
  secrets.env and writes ~/.local/share/net.defguard/provisioning.json, so the app configures the
  home-lab instance on its next start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUebqghNwNssAZuWTxUq1y
2026-11-06 18:34:41 -07:00
Ziad ArafatandClaude Opus 5.5 86876cd7a4 Sounds: Portal 2 voice lines for rare events, ffmpeg PCM conversion + loudness normalisation
Picked by transcribing turret clips (Whisper) and matching the rest against the
game's English captions. Voice lines (turrets, GLaDOS, Wheatley, announcer,
space core) for login/lock/devices/power/network/dialogs; short effects stay on
frequent events. Voice lines are MP3 frames named .wav, so build-sound-theme now
re-encodes everything to PCM via ffmpeg with loudnorm (-14 LUFS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 15:29:51 -06:00
Ziad ArafatandClaude Opus 5.5 195d9d6c6f Sounds actually audible: unmute the event stream, Konsole bell via notifications, chime for every app notification
- The WirePlumber 'Notification' role stream was saved muted, silencing every
  theme sound except Plasma's volume tick; dot sounds build/test/notify now
  unmutes it at 100% (ensure_event_stream).
- Konsole profiles: BellMode=1 (notification) — the default system beep is silent on Wayland.
- notification-sounds: user service watching Notify calls via dbus-monitor; plays
  message-new-instant for notifications without their own sound (skips
  KNotification events, sound hints, and apps with in-app sounds: Telegram, Vesktop).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 15:21:56 -06:00
Ziad ArafatandClaude Opus 5.5 3c0fd6d632 KDE Connect: Portal 2 sounds replace the old Oxygen picks; build-sound-theme reads mapping from the checkout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 15:06:10 -06:00
Ziad ArafatandClaude Opus 5.5 db20e3d8b2 Autohide panel, Rotom menu icon, centred+blurred wallpapers, audio feedback everywhere, secrets status/add/set
- sounds.nix: per-app notifyrc overrides so app notifications, login/logout,
  lock/unlock, network, bluetooth, konsole, spectacle, etc. all play Portal 2 sounds
- dot sounds test|notify to audition the theme and the notification path
- 18 more Portal 2 events (36 total)
- fix-container-desktop-files: wrap PWA launchers written by Edge inside the
  etv distrobox so they start from the host menu
- dot secrets: file list (config/secret-files.txt), status, add, set; WireGuard opt-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 15:01:08 -06:00
Ziad ArafatandClaude Opus 5.5 f5ead556b3 Bitwarden CLI targets vault.etvamerica.com (Vaultwarden)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 14:16:35 -06:00
Ziad ArafatandClaude Opus 5.5 4357dcb2b6 dot secrets render: force 0600 on files holding tokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 14:06:25 -06:00
Ziad ArafatandClaude Opus 5.5 31ba5abca4 dot system: chsh to the distro zsh, never the Nix profile's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 13:20:34 -06:00
Ziad ArafatandClaude Opus 5.5 ccfd442386 README: webtop screenshots (light/dark), panel gotchas
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 13:06:23 -06:00
Ziad ArafatandClaude Opus 5.5 a82ffb2263 Fix panel monitors (regex escaping), qdbus shim for Fedora, per-app flatpak installs, doctor without systemd
Found by the Fedora KDE webtop test: KConfig unescapes backslashes so the CPU
sensor regex broke JSON parsing; plasma-manager calls qdbus which Fedora names
qdbus6; one failing Flatpak (Chrome extra-data in a container) aborted the batch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 13:05:32 -06:00
Ziad ArafatandClaude Opus 5.5 4eadf0ab9a Disable home-manager's non-NixOS GPU shim (needs root unit)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 12:57:16 -06:00
Ziad ArafatandClaude Opus 5.5 6b0cf55103 Sounds: curated Portal 2 mapping from the real VPK contents
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 12:56:30 -06:00
Ziad ArafatandClaude Opus 5.5 c88237e9d2 Fix pokefetch ordering, writable mise config, autostart fallback for daemons, README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 11:00:15 -06:00
Ziad ArafatandClaude Opus 5.5 c76e87e0c7 Add container test harness and Portal 2 sound theme builder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 10:47:17 -06:00
Ziad ArafatandClaude Opus 5.5 3d08572911 Initial dotfiles: nix + home-manager + plasma-manager, dot CLI, bootstrap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UzjWUxheYfqqjWGH7Ktmc
2026-10-30 10:42:45 -06:00