Files

5.4 KiB

Automated music repair

Go controller + isolated pi1.5.2 + Gemma4-12b-qat through Yveltal's existing GPU broker/Ollama proxy. Deployment is deliberately separate from the model. No GitHub comments, PR submissions, credentials or outside notifications are created by this workflow.

Schedule and decisions

The user timer wakes every minute. Durable state.json schedules actual tests every 5hours while healthy and repair retries 1hour after failures. The selftest cog records a credential-free event for Lavalink track exceptions and stuck YouTube tracks, waking an otherwise healthy controller. The public video ID is retained for replay; unrelated sources do not trigger EJS changes. Incident cooldowns survive error storms and service restarts.

  1. Request an actual YouTube playback canary from the running bot. It uses the existing empty-channel test at volume0 and requires playback progress. A connected player anywhere blocks the check; skip/unavailable is never success.
  2. On failure, read recent EJS issues and PRs using unauthenticated GitHub GETs. pi/Gemma chooses a related PR from this bounded list. Issue79/PR80 seed the initial diagnosis. API failure is an operational error, not evidence of no patch.
  3. Fetch the selected upstream revisions and apply only their solver diff to the pinned cipher/EJS base. Unsupported files or incompatible patches fail closed.
  4. If no related PR is selected, start a persistent absence clock. At 12hours without one, run the separate pi authoring prompt against solvers.ts. Finding a related PR resets that clock. A failing available PR does not authorize self-authoring; the controller retries it hourly.
  5. Build an isolated image without build networking. Run the baseline EJS player fixtures with exact expected n/signature outputs plus the affected05a4ffc0 regression. Expected answers and harness come from controller-owned files, never from a PR or model. Fixture download failure blocks promotion.
  6. Require an idle bot, journal the prior image ID, replace only the cipher image in its Quadlet, restart that service, and repeat real Discord playback. Keep only on pass. Failure, skip, or missing acknowledgement rolls back. An interrupted promotion rolls back on the next timer wake before other work.

The controller never patches Lavalink, bot code, dependency manifests or service definitions supplied by the agent. Currently the writable patch scope is exactly ejs/src/yt/solver/solvers.ts. Other failure classes remain hourly retries for operator review. Research is bounded to12recently updated issues and12PRs; old fixes outside this window may require operator input. No change to account/OAuth/player selection is inferred from an EJS issue alone.

Isolation

pi has read,edit,write,ls only; no shell, MCP, extensions, skills or inherited context. Rootless Podman runs it with no network, no host home, no Podman socket, no credentials, dropped capabilities, a read-only root, and CPU/memory/PID caps. It sees a disposable research/source workspace and a Unix model socket. A local Bun HTTP shim handles SDK compatibility. The host relay permits only model chat requests and pins Gemma; its upstream is the existing GPU broker on11434. GitHub content is explicitly treated as untrusted data. All real service control and credentialed playback stay in the trusted controller/bot.

Build and install

Run on Yveltal, using the repo's mise environment. The build container is AlmaLinux10; no compiler is installed on the hypervisor. Deploy the matching Red image normally before enabling the timer (the cog supplies the playback mailbox).

cd ~/src/dogebot
mise exec -- bash deploy/install-music-repair.sh
~/.local/bin/dogebot-music-repair agent-check
systemctl --user enable --now dogebot-music-repair.timer
systemctl --user start dogebot-music-repair.service

The read-only agent-check exercises research/selection without applying a patch. Pause repairs before manual cipher maintenance or reinstalling the base Quadlets:

systemctl --user stop dogebot-music-repair.timer
systemctl --user stop dogebot-music-repair.service

After a stopped/interrupted promotion, restart the controller once to perform journal recovery. Do not erase its journal first. Base install.sh can overwrite the repaired image reference; preserve the live cipher Quadlet during maintenance.

State and rollback

~/.local/state/dogebot/music-repair/ is0700. State, attempt artifacts, PR diffs, agent output and operational logs are0600. Do not publish private operational logs. state.json reports next check, incident/absence times, last PR, candidate and previous image. The bot mailbox under /data/health/music-{request,result,failure}.json contains nonces, fixed categories/outcomes and public YouTube IDs, no raw exceptions, signed URLs or credentials. The previous image ID is retained for rollback; do not prune it during an incident. Failed image/build contexts are retained for investigation; clean those manually when no promotion is pending. The existing Kuma selftest remains separate.

Controller tests cover schedules, twelve-hour eligibility, patch boundaries, stale acknowledgements, rollback on failed/skipped/unknown playback, restart failure, and crash recovery. Bot tests cover mailbox validation and busy-player deferral. The release gate must additionally pass the real sandbox/model and affected-player tests on Yveltal.