Skip to content

12.oct.2026

Today we tackled the excessive resource footprint of our native FreeBSD CI pipeline on phoebe (FreeBSD 15.1-RELEASE-p4). While the pipeline had achieved green builds and compiler caching, routine pull requests were still triggering 14-minute runs that pegged all 6 CPU cores at 100%, accumulated redundant artifact storage, and competed for host resources.

Through live telemetry, step-by-step visual profiling, and workflow consolidation, we identified the root architectural causes and transitioned the pipeline to a sane, sustainable release-gated lifecycle.


The 14-minute mystery: dissecting runner CPU saturation

Section titled “The 14-minute mystery: dissecting runner CPU saturation”

Even with sccache delivering an 82.96% cache hit rate (112 hits / 23 misses), CI runs #40 and #41 were taking upwards of 14 minutes. We monitored host phoebe live using btop alongside the Forgejo runner logs to track exactly where every second and CPU cycle went.

Step 1: Early initialization & dependency resolution

Section titled “Step 1: Early initialization & dependency resolution”

The runner begins in an isolated clean workspace. CPU load remains modest as crates are checked and sccache processes cacheable headers:

Phase 1: Early initialization and dependency resolution on Phoebe

Step 2: The first release compilation pass

Section titled “Step 2: The first release compilation pass”

Cargo spends approximately 5 minutes and 40 seconds compiling herdr in release mode:

Phase 2: Forgejo log showing cargo release build at 3m 49s

Step 3: Entering the second compilation pass

Section titled “Step 3: Entering the second compilation pass”

As soon as the initial cargo build completed, the workflow transitioned into cargo test (release). Because Cargo considers each .rs file in tests/ to be a standalone crate target, it had to compile and link 18 separate integration test binaries in parallel with full release optimizations:

Phase 3: rustc spiking load average to 8.28 in btop Phase 3: Forgejo step transitioning into cargo test release pass

Step 4: The 6-core 100% saturation spike (600% CPU)

Section titled “Step 4: The 6-core 100% saturation spike (600% CPU)”

At the height of this pass, rustc spawned 12 threads across all 6 vCPUs, consuming 4.0 to 5.0 GB of RAM and pinning total CPU at 600% (100% on every core):

Phase 4: rustc peaking at 600% CPU and 4 GB RAM on Phoebe Phase 4: Forgejo runner log showing test crates compilation

sccache accelerates object compilation, but it cannot cache the final linking of 18 large binaries against Rust runtime libraries and LLVM code generation.


Each workflow run was packaging and uploading a release tarball, even for routine PRs. While each artifact was only ~9 MB compressed, runs across frequent branches quickly consumed hundreds of megabytes on Forgejo.

In Herdr PR #24 (ci/gate-release-artifact-uploads), we gated artifact packaging and upload behind release tags:

- name: package artifacts
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'

In CI Run #41, artifact upload was cleanly skipped (0 seconds, 0 bytes added to storage), while the release binary version assertion continued to verify target integrity:

Phase 5: Host load dropping to 0.61 in btop as tests complete Phase 5: Forgejo run showing package artifacts and upload skipped

Consolidating the duplicate compilation pass: PR #25

Section titled “Consolidating the duplicate compilation pass: PR #25”

Looking at the timeline, the workflow was executing two separate build commands:

  1. cargo build --release --locked (~5m 40s)
  2. cargo test --release --locked (~5m 03s compile + 3m 22s test execution)

In Cargo, cargo build --release --locked --tests compiles the release binary and all test targets in a single dependency graph traversal. In Herdr PR #25, we merged these into a single step:

Phase 6: Host btop monitoring during single-pass build Phase 6: Single-pass cargo build & test step executing in Forgejo

During Run #42, Cargo compiled everything once, immediately cutting the duplicate 5-minute build pass:

Phase 7: Host load during test target linking in single pass Phase 7: Forgejo log showing test target linking under single pass

Total wall-clock duration dropped from 14m 20s down to 9m 20s.


The architectural decision: release-only CI triggers

Section titled “The architectural decision: release-only CI triggers”

Even at 9 minutes, running full release compilation and linking 18 test harnesses on every single branch PR is an unacceptable CPU drain for a repository where FreeBSD-specific code changes are rare.

We asked: why saturate the runner on every routine commit when the code has not changed?

In PR #25 (commit ffa7a0d), we restructured .forgejo/workflows/freebsd-build.yml to trigger exclusively on release tags and manual dispatch:

name: freebsd-build
on:
push:
tags:
- "v*"
workflow_dispatch:
  1. Zero PR friction: Routine branches and documentation PRs no longer spin up the FreeBSD VM runner, leaving host phoebe at 0% CPU and load ~0.05.
  2. Deterministic release verification: When an upstream release bump occurs (e.g. v0.9.4), pushing the tag automatically executes the single-pass build, validates version parity, runs all 3,670+ tests serially under FreeBSD kernel PTY constraints, and uploads the verified distribution tarball.
  3. On-demand dispatch: Any engineer can manually trigger the pipeline from the Forgejo UI whenever a platform-sensitive subsystem is touched.

Sovereign overlay: self-hosting the Clawdie Mesh on Ross

Section titled “Sovereign overlay: self-hosting the Clawdie Mesh on Ross”

With the CI pipeline stabilized, we turned to the foundational network requirement for the Colibri ecosystem: replacing commercial Tailscale SaaS dependencies with our self-hosted Clawdie Mesh control plane.

Distributed agent coordination, shared memory hydration, and remote runner workflows across heterogeneous hosts (chandler, monica, phoebe, joey) require an encrypted overlay network that is strictly sovereign, fail-closed, and independent of external SaaS accounts or API tokens.

The control plane runs on Ross (FreeBSD 15.1-RELEASE-p4), a dedicated host separate from both the CI build plane and application servers:

  • Headscale v0.29.3: Installed natively via the FreeBSD port (security/headscale), listening on loopback 127.0.0.1:8080 with metrics on 127.0.0.1:9090. All SQLite databases and Noise cryptographic keys persist under /var/db/headscale/.
  • Caddy v2.11.4: Handles public TLS termination for https://mesh.clawdie.si via automatic Let’s Encrypt certificates, reverse-proxying into Headscale with trusted_proxies: [127.0.0.1/32].
  • Private MagicDNS: Configured using the .internal private namespace (mesh.internal), ensuring mesh hostnames never shadow public DNS records.

Jev triage: evaluating the ACL security boundary

Section titled “Jev triage: evaluating the ACL security boundary”

During policy design, Pi on Ross proposed starting with an open bootstrap rule (autogroup:member to autogroup:member on ip: *) to simplify host enrollment, with an intention to tighten it later.

Before adopting this, we ran a Bayesian triage evaluation through Jev System One (/home/samob/ai/agent-skills/jev-triage/jev_eval), archived in the Jev evidence packet in Colibri:

  • Decision Metric: safe_to_edit: 0.33 (failing the $\ge 0.69$ safety threshold)
  • Recommended Action: next_action: investigate (probability 0.75 vs 0.06 implement)
  • Human Review: 0.79 (operator intervention required)

Jev identified a fundamental violation of the project invariant “Membership is not trust”:

phoebe is a remote FreeBSD compilation host executing third-party crates, test suites, and untrusted CI jobs. Granting an unconstrained ip: * wildcard across all member nodes would give any compromised build container instant lateral network reach into:

  • ross (the control plane)
  • monica (the Oxigraph semantic database and dev host)
  • joey (Forgejo Git server)
  • chandler (the operator workstation)

Temporary allow-all rules during bootstrap introduce unacceptable exposure. Jev recommended enforcing role-based tags and least-privilege grants from day one.

We replaced the wildcard with an explicit, deny-by-default HuJSON policy (packaging/headscale/policy.hujson.example in Colibri PR docs/headscale-policy-and-roles):

{
"tagOwners": {
"tag:operator": ["clawdie@"],
"tag:ci-runner": ["clawdie@"],
"tag:ci-coordinator": ["clawdie@"],
"tag:server": ["clawdie@"],
},
"grants": [
// 1. Operator full fleet management via SSH
{ "src": ["tag:operator"], "dst": ["*"], "ip": ["22"] },
// 2. Colibri Bridge between coordinator/operator and backend servers
{
"src": ["tag:operator", "tag:ci-coordinator"],
"dst": ["tag:server"],
"ip": ["9190"],
},
// 3. Strict CI Confinement: Runner can only access Forgejo on the coordinator
{
"src": ["tag:ci-runner"],
"dst": ["tag:ci-coordinator"],
"ip": ["2222", "3000", "443"],
},
],
}

We enrolled all infrastructure nodes sequentially into the mesh using single-use tagged pre-auth keys. Every node was assigned a static, sequential CGNAT address (obfuscated below as 100.x.y.1–5 to preserve network scrubbing discipline):

Node IDHostnameMagicDNS FQDNMesh IPPlatformRole TagFunction
1monicamonica.mesh.internal100.x.y.1FreeBSD 15.1tag:serverOxigraph store & dev host
2phoebephoebe.mesh.internal100.x.y.2FreeBSD 15.1tag:ci-runnerHigh-spec CI build runner
3chandlerchandler.mesh.internal100.x.y.3Debian 13tag:operatorDeveloper workstation
4joeyjoey.mesh.internal100.x.y.4Debian 13tag:ci-coordinatorForgejo Git & webhook coordinator
5rachelrachel.mesh.internal100.x.y.5Androidtag:operatorSecure mobile operator node

Because every node is registered as a tagged service device, node credentials hold Expiration: N/A, ensuring keys never expire unexpectedly during long operations.

Live reachability and packet filter probes across all hosts verified both connectivity and cryptographic enforcement:

  1. Operator Reachability (tag:operator $\to$ All Nodes on :22):
    • Verified clean SSH execution from chandler to monica, phoebe, and joey over *.mesh.internal.
  2. CI Runner Confinement (tag:ci-runner on phoebe):
    • Connections to joey:2222 (Git SSH) and joey:443 (Web HTTPS) succeeded cleanly.
    • Connections to monica:22 and chandler:22 timed out and were dropped by WireGuard (Exit code: 1).
    • MagicDNS automatically omitted inaccessible peer hostnames (ping: cannot resolve monica).
  3. Direct Peer-to-Peer NAT Traversal:
    • tailscale ping confirmed direct WireGuard UDP sessions between all nodes (28 ms to phoebe, 105 ms to monica) with zero DERP relay hops.
  4. FreeBSD Privacy Hardening:
    • Both FreeBSD nodes (phoebe and monica) had telemetry streaming permanently disabled via rc.d (tailscaled_telemetry_enable=NO), keeping connection metadata strictly off third-party servers.

With the 5-node matrix active, the Clawdie Mesh establishes a fully sovereign, fail-closed transport foundation for all upcoming Colibri multi-agent workflows.