nugitea-daily.sh runs opencode with qwen3-coder over elixir_nugitea's BACKLOG.md, one fresh session per task, and keeps a change only if it stays in elixir_nugitea/, is under 800 lines and passes format, compile and tests; then it commits and pushes agent/daily with its own deploy key. opencode-agent.json denies git history, network, package and service commands. Run by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| nugitea-daily.sh | ||
| opencode-agent.json | ||
| README.md | ||
nugitea daily agent
Run ./nugitea-daily.sh when you like (say, once a day): opencode with the
local Qwen3 Coder works through elixir_nugitea/BACKLOG.md in the nugitea
repo unattended, and pushes what passes to the agent/daily branch on
Forgejo for you to review and merge. It prints as it goes, so you can glance
at it, but it never waits for you.
What a run does (nugitea-daily.sh)
- Checks Ollama is up, resets its own worktree (
~/Code/nugitea-agent, branchagent/daily), merges in the latestelixir-prototype, and requires the checks to pass before it starts. - Takes the first
- [ ]task in BACKLOG.md and gives it to a fresh opencode session (opencode run --standalone --auto, 45 minutes max), withelixir_nugitea/AGENTS.mdas its instructions. - Keeps the result only if it:
- changed only files under
elixir_nugitea/, and none of AGENTS.md, BACKLOG.md, priv/schema.graphql, mix.exs, mix.lock; - is under 800 changed lines;
- passes
mix format --check-formatted,mix compile --warnings-as-errorsandmix test, with no fewer passing tests than before.
- changed only files under
- If not, a second session gets the failure output and tries to fix it. If
that fails too, the changes are thrown away and the task is marked
[!]. - Commits each finished task (checking it off as
[x]) as "nugitea agent", and pushesagent/dailywith its own deploy key. - Up to 3 tasks, or 3 hours, per run.
Output also goes to ~/Library/Logs/nugitea-agent/<date>.log, including
each session's own summary. MAX_TASKS=1 ./nugitea-daily.sh does just one
task.
Guardrails
opencode-agent.json(passed asOPENCODE_CONFIG) denies: files outside the worktree, web access, questions, sub-agents, and shell commands that touch git history, the network, packages or services (git commit/push/reset/...,curl,ssh,brew,npm,launchctl, ...). Everything else in the shell is allowed: it runs as you, so this is a speed bump, not a sandbox.- It pushes with a deploy key (
~/.config/nugitea-agent/deploy_key) that can only write to quine-global-labs/nugitea, and only ever toagent/daily(though the key itself could push any branch there). - Nothing it does reaches
elixir-prototypeormainuntil you merge it.
Setup (once)
git -C ~/Code/nugitea worktree add -b agent/daily ~/Code/nugitea-agent origin/elixir-prototype
mkdir -p ~/.config/nugitea-agent
ssh-keygen -t ed25519 -N "" -f ~/.config/nugitea-agent/deploy_key
# add deploy_key.pub as a write deploy key on quine-global-labs/nugitea
ssh-keyscan -p 2200 forge.quinefoundation.com | grep ed25519 > ~/.config/nugitea-agent/known_hosts
Steering it
Edit elixir_nugitea/BACKLOG.md on elixir-prototype: add tasks at the end,
reorder, or reset a [!] to [ ] after making it smaller. Each task should be
finishable in one sitting and say what test proves it. Review agent/daily,
merge what's good into elixir-prototype; the next run picks up from there.