Skip to content

10.oct.2026

Today’s main milestone was getting Herdr’s native FreeBSD CI build and release verification passing, followed by integrating upstream 0.9.3 and its Zig toolchain update. I also worked on Colibri’s mesh and memory design and maintained Pi, my coding-agent harness.

Native FreeBSD CI and release verification

Section titled “Native FreeBSD CI and release verification”

The Phoebe Forgejo runner (phoebe, FreeBSD 15.1 CI runner) finally completed the native FreeBSD 15.1 build and test workflow successfully after a long series of corrective runs. Run #12 (Forgejo run ID 1723) finished with all 3,382 tests passing and no failures: 3,052 binary tests plus 330 integration tests across the API, CLI, client, lifecycle, handoff, machine setup, and server suites.

The work landed through Herdr PR #15. I fixed the FreeBSD-specific process CWD inspection, updater target mapping, plugin platform declarations, generated API schema, platform-gated warnings and imports, prompt timing, and pseudo-terminal retry behavior. The workflow was also made deterministic for Forgejo by using the compatible artifact action, non-interactive test input, and two test threads.

Forgejo published Artifact 19, herdr-freebsd-amd64, at approximately 8.3 MiB. It contains the stripped release binary, SHA-256 checksum, and build-receipt.json. This is the first fully green native FreeBSD CI and release-verification milestone for Herdr, and PR #15 is ready to merge into master.

The 0.9.0 surprise, the elephant in the room, and the Zig 0.16.0 bump

Section titled “The 0.9.0 surprise, the elephant in the room, and the Zig 0.16.0 bump”

Just as I was leaning back with a satisfied grin, watching the agent on Ross (ross) report that Herdr was finally installed system-wide from Forgejo CI Artifact #19, my happy face turned completely upside down.

There it was on the terminal:

Item | Value
Binary | /usr/local/bin/herdr
Version | herdr 0.9.0

Wait. 0.9.0?! Upstream was already on 0.9.3! Where on earth did three entire upstream releases vanish to?

Then came the facepalm moment: the elephant in the room. In the rush of testing FreeBSD builds, I had completely forgotten to merge our prepared sync/upstream-0.9.3 branch into master on code.clawdie.si. PR #15 had branched off the ancient 0.9.0 master, so the Phoebe runner (phoebe) had diligently compiled and verified a pristine, perfectly functioning, and thoroughly obsolete 0.9.0 binary.

Time to fix it properly. Determined not to ship a fossil, I kicked off the sync:

  1. Merging upstream 0.9.3: I pulled PR #16 (sync/upstream-0.9.3) into clawdie/master. That part went cleanly, bringing in over 400 changed files, 50,000 lines of code, the rewritten Kitty graphics layer, and new agent detections.
  2. The merge conflict panic: Next came merging the newly updated master into the FreeBSD PR branch (ci/freebsd-build). Forgejo immediately started throwing warnings:
    • It yelled about unsupported permissions fields across upstream GitHub Action workflows (conventional-commits, check, windows-conpty-package). Fortunately, this was just Forgejo politely grumbling that it uses its own Authorized Integrations rather than GitHub’s YAML tokens.
    • More alarming was the red pull request banner: This pull request has changes conflicting with the target branch: src/pane.rs.
  3. The src/pane.rs face-off: I opened src/pane.rs to see what broke. It turned out to be comical: both branches had independently tried to silence the exact same compiler warning on FreeBSD for TerminalCompressionTask::completed_passes. My FreeBSD branch had used #[cfg_attr(not(any(target_os = "linux", target_os = "macos")), allow(dead_code))], while upstream 0.9.3 had solved it by wrapping the field and helper in #[cfg(all(test, any(target_os = "linux", target_os = "macos")))]. Upstream’s fix was much cleaner. I discarded my workaround, adopted the upstream cfg, and resolved both conflict sites. Zero residual diff.
  4. The Zig 0.16.0 plot twist: I ran cargo check --all-targets locally to be safe, and got hit with another surprise: Building Herdr requires Zig 0.16.0; check zig version. Upstream 0.9.3 had quietly upgraded vendored libghostty-vt to require Zig 0.16.0! My Debian workstation (chandler) was on 0.15.2, and more crucially, the Phoebe FreeBSD runner (phoebe) was also sitting on 0.15.2.
  5. Bootstrapping the toolchain: I grabbed the Zig 0.16.0 binary locally, verified that local check went 100% green, and then taught .forgejo/workflows/freebsd-build.yml how to fend for itself. I added an ensure zig 0.16.0 step that detects if the runner has an older Zig version, downloads the official zig-x86_64-freebsd-0.16.0.tar.xz directly from ziglang.org, unpacks it into ~/.local/zig-0.16.0, and sets up PATH and ZIG environment variables.
  6. Green and rolling: I committed the merge, pushed to ci/freebsd-build, and watched Forgejo flip PR #15 back to mergeable: True. Run #24 launched immediately on Phoebe (phoebe): the new Zig 0.16.0 bootstrap completed in just 7 seconds flat, toolchain verification logged 0.16.0, and release compilation kicked off without a hitch.

A momentary fright, a messy conflict, and a surprise toolchain bump, but we didn’t back down. The real, modern herdr 0.9.3 binary for FreeBSD 15 was in the oven.

The panic hook termination mystery and the live handoff stabilization

Section titled “The panic hook termination mystery and the live handoff stabilization”

Or so I thought. Just when victory seemed minutes away, the test suite on Phoebe exploded:

error: 1 target failed:
`-p herdr --test live_handoff`

Only one single integration test binary failed out of the entire workspace! All unit tests passed, machine_api passed, client_mode passed, but live_handoff would fail intermittently, reporting broken Unix sockets (Connection reset by peer, Broken pipe, or AddrInUse).

I rolled up my sleeves and dove into the logs and code for tests/live_handoff.rs and src/server/handoff.rs. What followed was a wild debugging session that uncovered not one, but five distinct race conditions and architectural quirks:

  1. The CLI session inheritance bug: When Herdr spawns its successor daemon during a live upgrade (spawn_handoff_import), it invokes the binary with --handoff-import. But if the original daemon had been started with --session work, command-line flags aren’t magically copied to the re-exec child. Because HERDR_SESSION wasn’t injected into the child’s environment, the successor defaulted to the default session, tried to bind herdr.sock, collided with whatever was already there, and blew up with AddrInUse. Fixing this was straightforward: explicitly inject command.env(SESSION_ENV_VAR, session_name) if an active session name is present.
  2. The smoking-gun cross-thread termination mystery: The most bewildering failure was completely unrelated test servers dying mid-run. Why were healthy daemons getting terminated? The culprit turned out to be almost comically diabolical:
    • In tests/support/mod.rs, a global panic hook (std::panic::set_hook) was registered to clean up lingering daemon PIDs on test failure (cleanup_registered_herdr_pids()).
    • Meanwhile, inside tests/live_handoff.rs, a helper test called pid_marker_waits_for_complete_line was deliberately testing error handling by triggering an intentional panic and catching it using std::panic::catch_unwind.
    • Here was the trap: Rust’s global panic hook executes before catch_unwind catches the panic! So every time catch_unwind caught an expected panic, the global hook fired first, saw registered daemon PIDs belonging to parallel test threads running completely different tests, and immediately sent them SIGTERM! One test was literally terminating its neighbors.
    • The fix: rewrote marker waiting into a non-panicking try_wait_for_pid_marker returning Result<(), MarkerError>, completely eliminating the panic, and wrapped marker tests with test_lock().
  3. The pre-ready socket handshake race: The integration tests were using wait_for_socket, which merely checked if the .sock file existed on disk. But Unix domain sockets exist on the filesystem as soon as bind() is called, well before Tokio’s accept loop and the JSON-RPC request dispatcher are actually initialized! Sending commands immediately resulted in dropped connections. Replaced wait_for_socket with wait_for_api, which performs an active JSON-RPC ping handshake with retries.
  4. Panic traps in test cleanups: 18 separate cleanup blocks in live_handoff.rs did let _ = request(&api_socket, server.stop). The request() helper had an internal .expect("request succeeds"). When a server was already shutting down or had closed its socket, this cleanup panicked and poisoned subsequent tests. Introduced a safe stop_server helper using non-panicking try_request.
  5. PTY master buffer saturation: On FreeBSD and Linux, spawned interactive test processes write output to pseudo-terminals. If the master PTY isn’t actively read, the kernel PTY buffer fills up and the child process deadlocks on stdout writes. Added a background drain thread (spawn_pty_drain) to SpawnedHerdr to ensure PTY buffers never choke.

With those 5 fixes in place, I ran cargo test --test live_handoff locally. All 29 integration tests passed cleanly in 25.5 seconds without a single dropped socket or terminated PID.

Grounded artifact naming and FreeBSD 15 packaging

Section titled “Grounded artifact naming and FreeBSD 15 packaging”

While the test suite was stabilizing, I also took a hard look at how our release artifacts were being packaged and named.

Previously, the artifact archive was named herdr-freebsd-amd64-${SHORT_SHA}.tar.gz and the Forgejo container was just herdr-freebsd-amd64. Looking at an artifact list, nobody could tell whether they were downloading version 0.9.0 or 0.9.3 without digging through git logs. Even worse, the metadata receipt reported "target": "x86_64-unknown-freebsd"—the raw compiler triple that makes FreeBSD sound like an alien mystery.

We gave the packaging pipeline a proper overhaul:

  • Dynamic version discovery: The workflow now extracts APP_VERSION directly from Cargo.toml via cargo metadata rather than relying on hardcoded strings.
  • Self-identifying archive naming: The release archive is now named herdr-freebsd-amd64-v0.9.3-${SHORT_SHA}.tar.gz (with a matching .sha256 checksum file).
  • Versioned Forgejo container: The Forgejo artifact container is published as herdr-freebsd-15-amd64-v0.9.3.
  • Grounded build metadata: build-receipt.json now explicitly records:
    {
    "platform": "freebsd-15-amd64",
    "version": "0.9.3",
    "arch": "amd64",
    "target_triple": "x86_64-unknown-freebsd"
    }
    Keeping the platform grounded as FreeBSD 15 amd64 while preserving the compiler target triple gives both human operators and automated tools exactly what they need.
  • CI version assertion: Before creating the package, CI executes target/release/herdr --version and asserts that the binary reports the exact version declared in Cargo.toml. Never again will a 0.9.0 binary sneak into a 0.9.3 coat!

I also tried to build the Rust terminal on Ross (ross) while Pi was running. The host had only about 2.0 GiB of usable RAM and no swap. The kernel killed rustc, cargo, and Pi’s Node process with failed to reclaim memory. Lowering Rust optimisation and increasing codegen units did not solve the underlying problem: the build needed memory headroom, and the agent was competing for the same small pool.

Pi build killed by the FreeBSD OOM condition on Ross

This changed the build design question. Small hosts should not compile this workload concurrently with an agent. Phoebe (phoebe) has about 11.7 GiB of usable RAM and a 1 GiB swap device, so it is a more suitable build and validation host. The remaining design discussion is whether to build directly on Phoebe, publish verified artifacts through Forgejo, or use a dedicated build queue with Phoebe as the builder and the other hosts as consumers.

I also finalized the network design in the Colibri documentation. Ross (ross.clawdie.si) remains the physical FreeBSD control server, while mesh.clawdie.si is the stable Headscale service name. It is deliberately independent of the host: if the control plane moves to another provider, I only need to repoint the DNS A record and migrate the Headscale SQLite state, private keys, and configuration. Clients keep using https://mesh.clawdie.si and do not need to re-enroll.

The accepted deployment shape is a small Ross (ross) instance with 1 vCPU and approximately 2 GB RAM, Headscale backed by SQLite, and Caddy providing automatic TLS in front of Headscale on 127.0.0.1:8080. HTTPS on port 443 is required; UDP 3478 is optional and only needed when the embedded DERP relay is enabled. The design keeps gRPC on loopback and separates mesh enrollment, ACL authorization, and payload attestation as three different security layers.

The decision-of-record documentation was pushed on Colibri branch docs/clawdie-mesh-asgard at bb037cc, superseding the earlier “Headscale on Monica” design and folding in the enrollment documentation. Its docs-only verification passed: 831 strict wiki checks, frontmatter and formatting checks, and all evidence/whitespace gates passed. Enrollment remains proposed pending explicit acceptance; DERP timing, Headplane, API-key location, the Colibri adapter, and the MagicDNS base domain remain open decisions.

Colibri memory: a learning cycle and clearer language

Section titled “Colibri memory: a learning cycle and clearer language”

I clarified what I want Colibri to become: an upstream-maintained agent harness connected to persistent memory and a glasspane where I can observe and review its work. The architecture is still evolving. I revised the BAML assessment around one small experiment: extract a correction from a session, review it, and supply it to a later session. BAML may simplify structured model requests; it does not supply the whole memory system. The report includes an isolated FreeBSD probe protocol, but native compatibility remains untested.

I also tested the Jev evaluation and triage tools live from Codex, then checked their terminology suggestions against source material. The wiki glossary now explains BAML plainly, spells out schema-aligned parsing instead of the confusing SAP abbreviation, and corrects IQ, NR, and SAS. IQ here describes model compression formats, not an intelligence score. Documentation checks passed, and the changes are pushed on docs/baml-eval; BAML adoption remains undecided.

I no longer have an Ollama subscription, so the @ollama/pi-web-search extension and its web_search and web_fetch tools had stopped working. I removed the package with pi remove npm:@ollama/pi-web-search, which dropped the declaration from ~/.pi/agent/settings.json and uninstalled the module from Pi’s npm directory. Pi now loads three extensions: herdr-agent-state.ts, openviking, and pi-subagents.

Pi scans skills from several locations: the agent directory (~/.pi/agent/skills), the shared ~/.agents/skills, and project-level .pi/skills and .agents/skills directories discovered from the working directory up to the repository root. Any directory that contains a SKILL.md file counts as a skill.

Startup diagnostics reported collisions for astro-starlight-deploy and image-redaction. The cause was a leftover ~/ai/.agents/skills directory holding stale copies of both skills, plus an astro-starlight-deploy.bak-20261003-201538/ backup that registered as a third copy of the same name. The canonical skills live in the agent-skills repository and are linked into ~/.agents/skills; those symlinks resolve to the same real path, so they never collide.

Because project skills win over user skills, the stale September copies were silently shadowing the newer canonical versions, so the collision was a behavior bug rather than a harmless warning. I archived the directory to ~/.local/state/agent-skills/backups/stale-project-skills/ and removed ~/ai/.agents.

I loaded Pi’s own resource loader in the ~/ai working directory and checked the result: 42 skills, zero diagnostics, zero duplicate names. astro-starlight-deploy and image-redaction now resolve to the canonical ~/.agents/skills/... paths.

The lesson for backups: never leave a backup inside a directory that Pi scans for skills. The installer already writes its backups to $XDG_STATE_HOME/agent-skills/backups for exactly this reason.