/var/log

A blog about UNIX and programming.

ho.stna.me : ~ ❯ ls

blog foo.txt

ho.stna.me : ~ ❯ cd blog

ho.stna.me : ~/blog ❯ cat fossil-agent-dev.md

Fossil Agent Dev

Building a Multi-Agent Development Environment with Fossil

AI coding agents are useful, but they can step on each other quickly. Two agents might choose the same task, edit the same file, or close a ticket without really finishing the work. PropolOS uses Fossil to make that coordination visible. Fossil gives you source control, tickets, users, and a timeline in one small repository file.

This guide shows a novice-friendly setup for a FreeBSD development VM, a Fossil server, and a workflow for agents such as Codex, Claude, and opencode. Replace all uppercase placeholders with your own values.

The Basic Idea

Use Fossil as the shared source of truth:

  • Source code lives in one Fossil repository.
  • Tickets describe the work.
  • Each agent gets its own Fossil user.
  • Agents claim tickets before editing.
  • Tickets stay open until the acceptance criteria are actually complete.

This matters because an AI agent needs a simple rule: if it is not written in the ticket or committed to Fossil, other agents should not assume it happened.

Create a FreeBSD Development VM

Create a small FreeBSD VM in your hypervisor of choice. For a starter setup, use 2 CPUs, 4 GB RAM, and a 40 GB disk. Install FreeBSD, log in, and install basic tools:

pkg update
pkg install fossil git-lite ripgrep gmake bash sudo

Create a normal development user if you did not make one during install:

pw useradd dev -m -s /bin/sh -G wheel
passwd dev

If you want sudo, enable it for the wheel group with visudo, then log in as dev.

Create or Clone the Fossil Repository

If you are starting from scratch, create a repository:

mkdir -p ~/fossil
fossil init ~/fossil/PROJECT.fossil
mkdir ~/PROJECT
cd ~/PROJECT
fossil open ~/fossil/PROJECT.fossil

If a Fossil server already exists, clone it instead:

fossil clone http://AGENT_USER:AGENT_PASSWORD@FOSSIL_HOST:FOSSIL_PORT/ PROJECT.fossil
mkdir PROJECT
cd PROJECT
fossil open ../PROJECT.fossil

Check that you are in an open checkout:

fossil status
fossil timeline -n 20

A common mistake is running fossil commit -R PROJECT.fossil ... from outside a checkout. Fossil commits must run inside the opened checkout directory.

Run a Fossil Server

From the VM that owns the repository file, run:

fossil server ~/fossil/PROJECT.fossil --port FOSSIL_PORT --host 0.0.0.0

For a private LAN, this is often enough for a lab. For anything exposed beyond your LAN, put Fossil behind TLS and proper firewall rules. Do not publish real agent passwords in docs, prompts, or tickets.

Create users for each agent:

fossil user new codex codex@local CHANGE_THIS_PASSWORD
fossil user new claude claude@local CHANGE_THIS_PASSWORD
fossil user new opencode opencode@local CHANGE_THIS_PASSWORD

Grant only the capabilities each agent needs. For a trusted lab agent, you will usually need source, ticket, and check-in permissions. Inspect and adjust with:

fossil user capabilities opencode
fossil user capabilities opencode CAPABILITY_STRING

The Agent Workflow

Every agent should follow the same loop before doing any work:

fossil sync
fossil update
fossil status
fossil ticket show 1 "status='open'"
fossil ticket history TICKET_UUID_PREFIX

Pick one open ticket only. If the ticket has a recent comment like "Claude starting work" or "Codex starting work" and no later handoff comment, skip it.

Claim the ticket before editing files:

fossil ticket change TICKET_UUID_PREFIX +comment "opencode starting work on <short scope>." -U opencode
fossil sync

Then edit, test, and commit from the checkout:

fossil status
fossil changes
fossil commit FILE1 FILE2 -m "scope: concise change summary" -U opencode
fossil sync

Closing Tickets Correctly

A ticket is complete only when every acceptance criterion is implemented and verified. Do not close a ticket with comments like:

  • Deferred
  • covered by other tickets
  • requires FreeBSD
  • testable with fixtures
  • implemented

Those comments may be useful progress notes, but they are not completion notes. If anything remains, leave the ticket open and write a handoff comment:

fossil ticket change TICKET_UUID_PREFIX +comment "Progress: completed <work>. Verified with <commands>. Remaining: <specific incomplete criteria>. Skipped: <tests and reason>." -U opencode
fossil sync

When the work is genuinely done, close it with evidence:

fossil ticket change TICKET_UUID_PREFIX status closed resolution fixed +comment "Completed in check-in CHECKIN_HASH. Changed files: <paths>. Verification: <exact commands and results>. Skipped tests: <none or reason>. Follow-ups: <none or ticket ids>." -U opencode
fossil sync

The important habit is simple: incomplete work stays open. A truthful progress comment is better than a false close.

Prompts for AI Agents

Use a startup prompt like this:

You are working in a Fossil checkout. Before editing, run fossil sync,
fossil update, fossil status, list open tickets, and inspect the ticket history.
Pick one unclaimed open ticket. Comment that you are starting work. Do not work
on tickets claimed by another agent unless there is a handoff comment.

Use a completion prompt like this:

Do not close the ticket unless every acceptance criterion is implemented and
verified. If anything is incomplete, blocked, deferred, or requires another
environment, leave the ticket open and add a progress comment with completed
work, verification commands, skipped tests, and remaining work.

Use a ticket-closing prompt like this:

When closing the ticket, include the check-in hash, changed files, exact
verification commands and results, skipped tests with reasons, and follow-up
tickets. Do not close with only "Deferred", "implemented", "requires FreeBSD",
or "covered elsewhere".

What To Verify

Different tickets need different proof. Examples:

  • CLI tickets should show the exact command output and exit behavior.
  • Test tickets should run real tests, not just create fixture directories.
  • API tickets should prove routes are registered and handler tests pass.
  • UI tickets should include build results and, when useful, screenshots.
  • FreeBSD, ZFS, boot image, and default-login tickets should stay open until they are verified in a disposable FreeBSD VM or image.

If the agent cannot run the required environment, it should say so in the ticket and leave it open.

Daily Operator Checklist

At the start of a session:

fossil sync
fossil update
fossil timeline -n 30
fossil ticket show 1 "status='open'"

Before trusting closed tickets, spot-check them:

fossil timeline -n 50 -t t
fossil ticket history TICKET_UUID_PREFIX

If an agent closed a ticket with no evidence, reopen it:

fossil ticket change TICKET_UUID_PREFIX status open resolution "" +comment "Reopened: acceptance criteria are not verified. Leave open until implementation and verification are complete." -U codex
fossil sync

Fossil will not make AI agents careful by itself. What it gives you is a shared ledger: who claimed work, what changed, what was verified, and what still needs attention. With strict ticket comments and per-agent users, that ledger becomes the coordination layer for a multi-agent development team.

EOF

ho.stna.me : ~/blog ❯ ls -lta

drwxr-xr-x 4 user staff 13 16:23 .
drwxr-xr-x 3 user staff 2 16:23 ..
drwxr-xr-x 3 user staff 3 16:23 archives
drwxr-xr-x 10 user staff 10 16:23 tags
-rw-r--r-- 1 user staff 5967 16:23 collaboration.md
-rw-r--r-- 1 user staff 7349 16:23 fossil-agent-dev.md
-rw-r--r-- 1 user staff 9680 16:23 codex-freebsd.md
-rw-r--r-- 1 user staff 6873 16:23 immich-migrate.md
-rw-r--r-- 1 user staff 2139 16:23 mkblog-source.md
-rw-r--r-- 1 user staff 4195 16:23 mkblog-intro.md
-rw-r--r-- 1 user staff 3975 16:23 authoring-posts.md
-rw-r--r-- 1 user staff 328 16:23 terminal-demo.md
-rw-r--r-- 1 user staff 118 16:23 hello-world.md

ho.stna.me : ~/blog ❯