Ten Months of AitherTunnel: Three Writers, Four Copies, One Plane
We have been writing about this tunnel for ten months. The first cloudflared line in this repository is dated 2025-11-24 — a quick tunnel in front of ComfyUI so a phone could reach a GPU. By March 2026 it was a service: AitherTunnel, with a zero-disk WireGuard VPN beside it, cloud agents reaching the box over MCP, edge nodes deployed with one command, and the piece most people found us through: your website is your homelab, the static apex on GitHub Pages with the live machine behind a Cloudflare Tunnel. In June we onboarded a GPU in another room the same way.
All six posts are still true. tunnel.aitherium.com answers 200 today, from the same 14,000-line service, through the same split. None of them is being walked back.
But when we sat down this week to adopt the thing — make it a product with a page and a price, give the CLI brick real hands, put a queue kind and a CI lane in front of it — the first thing we did was measure the plane it runs on. That measurement is this post, because it is a better lesson than the launch.
What the measurement found
One Cloudflare tunnel. One API endpoint that accepts its whole ingress configuration in a single PUT. And, it turned out, three things writing to it:
- The service inside the fleet, every ten minutes, from the canonical route file — and it is the only writer that also merges the per-workspace routes the platform creates at runtime.
- A PowerShell script, run by a GitHub Actions workflow on every push, from a different file that lived under
config/cloudflare/. - A third Python module nobody remembered, which read yet another file and did a read-modify-write of the live config.
Those files did not agree. The canonical one and the one CI pushed disagreed on nineteen hostnames. So every push to the main branch deleted seven live hostnames plus every runtime route, and the in-fleet service put them back within ten minutes. Nothing failed. Nothing logged. Every health check stayed green, because each individual write was valid. A tenant hitting one of those hostnames in the wrong ten-minute window got a Cloudflare 1033 with no cause anyone could find, and then it worked again.
There was also a fourth copy of the route file, in a directory that should not exist, left behind by a script that once resolved its project root one level short. The drift guard that was supposed to catch route mismatches had been reading that copy — a three-week-old snapshot — and passing.
And the header comment at the top of the canonical file said, in bold, that the CI file "was a LOOKALIKE, removed 2026-07-23". It had not been removed. It was what CI read.
Why documentation could not have fixed this
Every one of those facts had been written down somewhere. The canonical file's header said it was the only source of truth. The CI file's header said it was regenerated from the canonical file. The third module's docstring said what it synced. The drift guard's comment said which file it read. Each document was locally true when written and globally false now, and no document can notice that about itself.
This is the pattern we keep relearning: a routing plane, a deploy manifest, a registry — anything with more than one file describing the same live thing — will drift, and the drift is invisible to every check that reads one file at a time. The two live tunnel gates we already had (does the pushed config match the source? does each origin answer?) were both green the whole time, because each compared one source to the live state, and the live state was flapping between two sources faster than either gate ran.
What we replaced it with
Not a better comment. A set of rules that can fail, in the order the failures cost us.
One writer. Exactly one file in the repository may PUT the tunnel's configuration endpoint from a canonical route file. The CI workflow reports drift and never applies. The PowerShell scripts that used to PUT now POST to the in-fleet writer and ask it to sync — the same writer, the same merge of the runtime overlay. A rule (TRD005) scans every workflow and script for a mutating call to that endpoint that also reads a canonical route file, and it exits non-zero on a second one. Getting its discriminator right mattered: keyed on the endpoint alone it reported thirteen writers, ten of them the correct owners of other tunnels. A rule that floods gets switched off, and we have the per-file-ignores in this repository to prove it.
Generated derivatives. The two files CI and the connector read are now emitted by the writer's own load function — the same code path that builds what is PUT live — with a header naming the command that regenerates them. Rule TRD002 shells the generator and requires byte equality with the committed file, so a hand edit fails CI instead of drifting. We reconciled the files by hand first, declared them identical by hostname set, and the generator's first run showed they still differed: a path carve-out was missing from both, and two hosted-chat carve-outs said http:// where the tunnel is sent https://. A hostname-set comparison cannot see either. The generator can.
One detail worth its own sentence: the generator preserves source order and never sorts. cloudflared is first-match-wins, and the canonical file deliberately places a path carve-out (^/api/v1/chat/hosted on mcp.aitherium.com) above the bare hostname rule. A "deterministic" sort would have deleted the anonymous hosted-chat floor while reporting a tidy green plane.
One home. Rule TRD003 asks git, not the disk: any tracked file with a route-file basename outside config/ is a rival copy, and any tracked route-sync backup is a writer's litter. Rule TRD004 asks every consumer whether the path it names resolves under the canonical directory — a suffix match would have passed a stale copy of the config directory nested under the products tree, which is exactly the path that fooled the drift guard; the self-test caught the suffix version before it shipped. TRD004 then fired on its own author: the first version of the CI validation step used ../../config/tunnel-routes.yaml, and the rule refused it. Good.
The brick validates the file. awtunnel had been 579 lines of ingress-rule validator that could not read YAML and was wired into zero gates. It now reads the route-file grammar with the standard library (checked whole-document against PyYAML on every real file), normalises the connector's shape, and runs on the canonical file in CI (TRD006), asking the two questions the duplicate rule does not: the same host and port reached over both schemes, and a bare-hostname rule placed above its own carve-out. Both fail. The same brick now does what its registry line has promised since day one — awtunnel up --port 8080 prints a public URL, awtunnel down takes it away — and its first live run found a latent bug in the connector we moved into it: the pipe reader ran inside the coroutine and starved the event loop, so the URL was printed and never seen.
The fault the plane was hiding
With the plane agreeing with itself, one hostname still answered 503: dgg-mcp.aitherium.com, a tenant demo node. Two faults, stacked. The container image had been swept from the local store, so the unit crash-looped with "image not known" — and the gate that should have said so had been run from a Windows host where /etc/containers/systemd does not exist, so its verdict "no such unit" was not a measurement. Then the rebuilt image served https against an http route, because the gateway auto-discovers a certificate pair whenever the build context happens to carry one. The served scheme had flipped with every rebuild since August, and each flip was a 503 until someone re-flipped the route. It is pinned in the unit now, at the origin, where the property actually lives.
What "adopt" turned out to mean
The product exists now: a page on the apex, a free tier that is exactly what awtunnel up gives anyone, a paid tier for named hostnames on our zone with the runtime overlay and an audit line per expose and retire, and one meter — endpoint-hours, because what costs us is endpoints held open, not requests. The run queue has a tunnel kind, gated like a spend. The repository has its first composite action, and the first CI lane that validates the route files before anything reads them.
None of that is the interesting part. The interesting part is that a system we had described accurately six times, in public, for ten months, was quietly fighting itself underneath the descriptions — and that no amount of describing it better would have found that. Measuring did. Seven rules that can fail now stand where seven comments stood, and the comments were all, at the time, correct.
If you run anything with two files describing one live thing: count the writers. There is probably one more than you think.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.