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:
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:
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:
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):
sccache accelerates object compilation, but it cannot cache the final linking of 18 large binaries against Rust runtime libraries and LLVM code generation.
Stopping artifact bloat: PR #24
Section titled “Stopping artifact bloat: PR #24”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:
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:
cargo build --release --locked(~5m 40s)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:
During Run #42, Cargo compiled everything once, immediately cutting the duplicate 5-minute build 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:The resulting contract:
Section titled “The resulting contract:”- Zero PR friction: Routine branches and documentation PRs no longer spin up the FreeBSD VM runner, leaving host
phoebeat 0% CPU and load ~0.05. - 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. - 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.
Control plane deployment on Ross
Section titled “Control plane deployment on Ross”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 loopback127.0.0.1:8080with metrics on127.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.sivia automatic Let’s Encrypt certificates, reverse-proxying into Headscale withtrusted_proxies: [127.0.0.1/32]. - Private MagicDNS: Configured using the
.internalprivate 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)
The “Phoebe Blast Radius” finding
Section titled “The “Phoebe Blast Radius” finding”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.
The 4-role least-privilege policy
Section titled “The 4-role least-privilege policy”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"], }, ],}The 5-node fleet enrollment
Section titled “The 5-node fleet enrollment”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 ID | Hostname | MagicDNS FQDN | Mesh IP | Platform | Role Tag | Function |
|---|---|---|---|---|---|---|
| 1 | monica | monica.mesh.internal | 100.x.y.1 | FreeBSD 15.1 | tag:server | Oxigraph store & dev host |
| 2 | phoebe | phoebe.mesh.internal | 100.x.y.2 | FreeBSD 15.1 | tag:ci-runner | High-spec CI build runner |
| 3 | chandler | chandler.mesh.internal | 100.x.y.3 | Debian 13 | tag:operator | Developer workstation |
| 4 | joey | joey.mesh.internal | 100.x.y.4 | Debian 13 | tag:ci-coordinator | Forgejo Git & webhook coordinator |
| 5 | rachel | rachel.mesh.internal | 100.x.y.5 | Android | tag:operator | Secure 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.
End-to-end verification
Section titled “End-to-end verification”Live reachability and packet filter probes across all hosts verified both connectivity and cryptographic enforcement:
- Operator Reachability (
tag:operator$\to$ All Nodes on:22):- Verified clean SSH execution from
chandlertomonica,phoebe, andjoeyover*.mesh.internal.
- Verified clean SSH execution from
- CI Runner Confinement (
tag:ci-runneronphoebe):- Connections to
joey:2222(Git SSH) andjoey:443(Web HTTPS) succeeded cleanly. - Connections to
monica:22andchandler:22timed out and were dropped by WireGuard (Exit code: 1). - MagicDNS automatically omitted inaccessible peer hostnames (
ping: cannot resolve monica).
- Connections to
- Direct Peer-to-Peer NAT Traversal:
tailscale pingconfirmed direct WireGuard UDP sessions between all nodes (28 ms tophoebe, 105 ms tomonica) with zero DERP relay hops.
- FreeBSD Privacy Hardening:
- Both FreeBSD nodes (
phoebeandmonica) had telemetry streaming permanently disabled via rc.d (tailscaled_telemetry_enable=NO), keeping connection metadata strictly off third-party servers.
- Both FreeBSD nodes (
With the 5-node matrix active, the Clawdie Mesh establishes a fully sovereign, fail-closed transport foundation for all upcoming Colibri multi-agent workflows.