balaur

Self-maintenance: how Balaur edits and ships itself

Balaur is now terminal-first. The live surface is the balaur Pi terminal plus this repo as a local Pi package. There is no core balaur-agent gateway service. The self-maintenance loop is:

edit ~/balaur/**  →  bun test  →  git commit  →  git push  →  /reload in the terminal

No container, no .control bridge, no separate headless agent.

The loop

Ask Balaur in the terminal to make a change; it runs the repo side itself:

cd ~/balaur
# 1. edit files
# 2. test (mandatory before push — main is the push target)
bun test
# 3. commit + push
git add -A && git commit -m "…" && git push
# 4. reseed Pi config if AGENTS/SYSTEM/models changed
bash scripts/seed-pi-config.sh

Then run /reload in the balaur terminal when the active Pi session should pick up changed extensions, skills, theme, prompts, or model config.

Dependency changes (pi/package.json deps) need cd pi && bun install before reload.

How it’s wired

Setup once

  1. Fine-grained GitHub PAT scoped to the balaur repo, Contents: Read and write.
  2. Put it in .env: BALAUR_GITHUB_TOKEN=github_pat_xxx.
  3. Run bash scripts/seed-pi-config.sh or just start balaur.

Safety notes

Troubleshooting

Symptom Check / fix
reload did not pick up changes run bash scripts/seed-pi-config.sh, then /reload; check ~/.pi/agent/settings.json includes ~/balaur/pi
git push auth error BALAUR_GITHUB_TOKEN unset/mis-scoped in .env; fix, then rerun scripts/seed-pi-config.sh
tests fail fix before pushing — never deploy red
local model down curl http://127.0.0.1:8082/health; operator can inspect journalctl -u llama-apu

Related: skill-level self-evolution (proposing new skills with review) — see SELF_EVOLUTION.md.