82

Run infrastructure probes as Rust integration tests in the CI suite

Infra line · ADR 82 · 31 AUG 2026 · amended

Detail General notes

Amended by ADR-0104

Infrastructure checks are tests in the suite CI runs, reading the configuration that's actually deployed.

Decision

Write every infrastructure check as a test in the Rust workspace suite that CI already runs. A check that runs only when someone remembers it can stop being run without anything reporting it.

Each test checks one property, is named after it, and starts its own daemon on a free loopback port. It waits until that daemon answers, and it fails if the daemon exits first. A check against a service that never started reports the same green as one that passed, so the readiness wait is mandatory.

Take what a test knows about the deployed configuration from Nix evaluation of the real NixOS configuration, never from a copy. A test that retypes the settings it exercises certifies a configuration nobody deploys, and a grep of the module source finds a value whether or not anything uses it. A value shared by a deployed module and a test is one expression that both read.

Keep inspection out of the suite. A tool that reads the live cluster and prints what it finds has no pass or fail, and turning it into a test would mean inventing a threshold nobody chose.

Why

Security changes to the platform each shipped with a probe script that started the real daemon locally, drove it and checked the change worked. A task-runner recipe was the only thing that ran them, so nothing ran a probe again once its change merged. A later change could undo the property it checked, or the property could fail to hold in production, without any probe reporting it.

Rejected alternatives

  • Probe scripts behind task-runner recipes. They are accurate, and they stop being run without anyone noticing.
  • Folding cluster inspection into the suite. It has no pass condition anyone chose.
  • NixOS VM tests (runNixOSTest). They exercise the whole deployed unit, including systemd ordering, secrets and the firewall, which a single daemon on loopback does not. They need KVM, and neither of our Linux build hosts has it: Hetzner Cloud offers no nested virtualization, and the Linux VM on the Mac already runs under software emulation. Each test would either never be scheduled or run emulated twice over. They become the better tool if the builder moves to a host with KVM.

Consequences

The suite needs the daemons it tests wherever it runs. It builds them from the nixpkgs revision the cluster's flake pins, so the tests exercise the versions the cluster deploys, and a cold machine needs network access to fetch them. Each test adds seconds to every CI build, and tests that evaluate the NixOS configuration add more.

A converted probe is done only when each test has been seen to fail with its property broken. A test that stays green through the break is not checking the property it is named for.

Sht 1LINE 1, PLANT MAINL-2 BackendADR 6: Return GraphQL error codes in extensions and localize them on iOSADR 9: Organise the backend into domain modules that query Postgres through sqlx directlyADR 31: Write component-specific GraphQL queries instead of reusable onesADR 33: Event-source trips as an append-only log of effectsADR 34: Test external API calls against recorded reqwest-vcr cassettesADR 38: Generate neighbourhood guides with Exa's answer endpoint and keep the output display-onlyADR 41: Publish trip-id signals over GraphQL subscriptions and filter each device's own echo on the serverADR 45: Wrap every domain identifier in its own UUID newtypeADR 46: Model trip versions as named refs into a modification treeADR 48: Diff versions on the server as fork point, branch history and end stateADR 49: Replace upsert effects with create, update and remove, and embed bookings in createsADR 51: Order a trip's modifications under a FOR UPDATE lock on the trip rowADR 56: Accept every booking and derive discrepancies from the rebuilt tripADR 62: Serve the planning engine as deterministic MCP tools from the GraphQL binaryADR 65: Route every modification write through one apply-and-rebuild service methodADR 67: Serve MCP over stateless Streamable HTTP with JSON responsesADR 73: Replay the effect log on-device through a shared Rust coreADR 74: Address destinations by id and batch-local handles in the effect vocabularyADR 75: Converge concurrent edits by id-addressed replay and escalate non-commuting pairsADR 76: Serve the API as GraphQL with async-graphql on AxumADR 77: Generate each domain's error types with a declarative macroADR 79: Bound GraphQL request cost at input size instead of per-field query complexityADR 80: Check the GraphQL schema against a committed compatibility floorADR 87: Derive every fact about a trip in the shared Rust core and keep only presentation in the clientsADR 96: Constrain effect generation with a JSON Schema derived from the Rust typesADR 97: Encode effects as JSON between the app and the serverADR 100: Let the in-app agent propose one modification per turn for the user to applyADR 109: Send every model call that can change a trip to one LLM provider, with a server-chosen model per taskADR 110: Extract bookings from uploaded documents with a tool-less model call over OpenAI file inputsADR 111: Serve GraphQL subscriptions only over HTTP multipart responsesL-3 SecurityADR 22: Serialize PASETO key rotation across nodes with pg_try_advisory_xact_lockADR 28: Use device-bound PASETO tokens as the only session stateADR 58: Make discoverable WebAuthn passkeys the primary sign-inADR 63: Hand-roll a minimal OAuth 2.1 authorization server for MCPADR 86: Throttle credential attempts in the application, per client address and per accountADR 89: Give every non-production environment one shared passkey RP IDL-4 iOSADR 3: Serve SwiftUI views from @Observable environment services over Apollo's normalized cacheADR 4: Test and preview iOS services over a mocked Apollo network transportADR 15: Persist Apollo's normalized cache in SQLite and clear it on sign-outADR 36: Geocode destinations on-device with MapKit and record the result as an effectADR 37: Reference accommodations by Apple Maps Place ID with a name and coordinate snapshotADR 44: Use generated types directly in the iOS app instead of a hand-written mirror modelADR 69: Replace the pre-merge click-through with Maestro flows run locally on maestro-runnerADR 70: Build native macOS from the iOS SwiftUI target with an adaptive NavigationSplitView rootADR 85: Express the iOS design system in SwiftUI's own vocabulary instead of portable design tokensADR 88: Look at another version only inside the Versions sheetADR 90: Set display text in New York, the system serif, over an SF bodyADR 91: Draw a trip's three sections as text tabs in the page, not a split view or the system tab barL-5 InfraADR 39: Back up Postgres with pgBackRest in weekly fulls and daily differentialsADR 40: Detect intrusions from Traefik and sshd logs with CrowdSecADR 53: Trace from the app through to the backend via a per-node Grafana Alloy collector that holds every credentialADR 55: Deploy each ready pull request as its own Nomad job and Postgres databaseADR 68: Deploy NixOS nodes with Colmena, building closures on an ephemeral x86 Hetzner builderADR 78: Grant tailnet membership reachability only, and make every service authenticateADR 82: Run infrastructure probes as Rust integration tests in the CI suiteADR 92: Patch every dependency daily, ahead of advisories, with an agent reviewing the upstream diffsADR 93: Apply every merge to production with a leader-last rolling deployADR 94: Detect faults with alerts routed to an agent, not with scheduled diagnosticsADR 95: Keep CI secrets in a master-only environment so the patch agent can edit workflowsADR 98: Follow the Sentinel election instead of declaring Redis mastersADR 99: Encrypt node-to-node traffic with a static WireGuard meshADR 101: Run Postgres under Patroni with Consul as its consensus storeADR 102: Run the app on Nomad and Consul and keep stateful services on NixOSADR 103: Keep Redis as one Sentinel-managed store for signals, counters and OAuth stateADR 104: Run NixOS VM tests under emulation on pull requests that ask for themADR 105: Run CI on a self-hosted runner that hands builds to ephemeral Hetzner builders backed by an R2 Nix cacheADR 106: Deliver node secrets as sops files encrypted to each host's SSH keyMatch line · continued on sheet 3.1
Sht 1LINE 1, PLANT MAINL-2 BackendADR 6: Return GraphQL error codes in extensions and localize them on iOSADR 9: Organise the backend into domain modules that query Postgres through sqlx directlyADR 31: Write component-specific GraphQL queries instead of reusable onesADR 33: Event-source trips as an append-only log of effectsADR 34: Test external API calls against recorded reqwest-vcr cassettesADR 38: Generate neighbourhood guides with Exa's answer endpoint and keep the output display-onlyADR 41: Publish trip-id signals over GraphQL subscriptions and filter each device's own echo on the serverADR 45: Wrap every domain identifier in its own UUID newtypeADR 46: Model trip versions as named refs into a modification treeADR 48: Diff versions on the server as fork point, branch history and end stateADR 49: Replace upsert effects with create, update and remove, and embed bookings in createsADR 51: Order a trip's modifications under a FOR UPDATE lock on the trip rowADR 56: Accept every booking and derive discrepancies from the rebuilt tripADR 62: Serve the planning engine as deterministic MCP tools from the GraphQL binaryADR 65: Route every modification write through one apply-and-rebuild service methodADR 67: Serve MCP over stateless Streamable HTTP with JSON responsesADR 73: Replay the effect log on-device through a shared Rust coreADR 74: Address destinations by id and batch-local handles in the effect vocabularyADR 75: Converge concurrent edits by id-addressed replay and escalate non-commuting pairsADR 76: Serve the API as GraphQL with async-graphql on AxumADR 77: Generate each domain's error types with a declarative macroADR 79: Bound GraphQL request cost at input size instead of per-field query complexityADR 80: Check the GraphQL schema against a committed compatibility floorADR 87: Derive every fact about a trip in the shared Rust core and keep only presentation in the clientsADR 96: Constrain effect generation with a JSON Schema derived from the Rust typesADR 97: Encode effects as JSON between the app and the serverADR 100: Let the in-app agent propose one modification per turn for the user to applyADR 109: Send every model call that can change a trip to one LLM provider, with a server-chosen model per taskADR 110: Extract bookings from uploaded documents with a tool-less model call over OpenAI file inputsADR 111: Serve GraphQL subscriptions only over HTTP multipart responsesL-3 SecurityADR 22: Serialize PASETO key rotation across nodes with pg_try_advisory_xact_lockADR 28: Use device-bound PASETO tokens as the only session stateADR 58: Make discoverable WebAuthn passkeys the primary sign-inADR 63: Hand-roll a minimal OAuth 2.1 authorization server for MCPADR 86: Throttle credential attempts in the application, per client address and per accountADR 89: Give every non-production environment one shared passkey RP IDL-4 iOSADR 3: Serve SwiftUI views from @Observable environment services over Apollo's normalized cacheADR 4: Test and preview iOS services over a mocked Apollo network transportADR 15: Persist Apollo's normalized cache in SQLite and clear it on sign-outADR 36: Geocode destinations on-device with MapKit and record the result as an effectADR 37: Reference accommodations by Apple Maps Place ID with a name and coordinate snapshotADR 44: Use generated types directly in the iOS app instead of a hand-written mirror modelADR 69: Replace the pre-merge click-through with Maestro flows run locally on maestro-runnerADR 70: Build native macOS from the iOS SwiftUI target with an adaptive NavigationSplitView rootADR 85: Express the iOS design system in SwiftUI's own vocabulary instead of portable design tokensADR 88: Look at another version only inside the Versions sheetADR 90: Set display text in New York, the system serif, over an SF bodyADR 91: Draw a trip's three sections as text tabs in the page, not a split view or the system tab barL-5 InfraADR 39: Back up Postgres with pgBackRest in weekly fulls and daily differentialsADR 40: Detect intrusions from Traefik and sshd logs with CrowdSecADR 53: Trace from the app through to the backend via a per-node Grafana Alloy collector that holds every credentialADR 55: Deploy each ready pull request as its own Nomad job and Postgres databaseADR 68: Deploy NixOS nodes with Colmena, building closures on an ephemeral x86 Hetzner builderADR 78: Grant tailnet membership reachability only, and make every service authenticateADR 82: Run infrastructure probes as Rust integration tests in the CI suiteADR 92: Patch every dependency daily, ahead of advisories, with an agent reviewing the upstream diffsADR 93: Apply every merge to production with a leader-last rolling deployADR 94: Detect faults with alerts routed to an agent, not with scheduled diagnosticsADR 95: Keep CI secrets in a master-only environment so the patch agent can edit workflowsADR 98: Follow the Sentinel election instead of declaring Redis mastersADR 99: Encrypt node-to-node traffic with a static WireGuard meshADR 101: Run Postgres under Patroni with Consul as its consensus storeADR 102: Run the app on Nomad and Consul and keep stateful services on NixOSADR 103: Keep Redis as one Sentinel-managed store for signals, counters and OAuth stateADR 104: Run NixOS VM tests under emulation on pull requests that ask for themADR 105: Run CI on a self-hosted runner that hands builds to ephemeral Hetzner builders backed by an R2 Nix cacheADR 106: Deliver node secrets as sops files encrypted to each host's SSH keyADR 107: Register Nomad job services under the Nomad agent's Consul token instead of workload identitiesADR 108: Log CI in to Nomad with GitHub OIDC, and run previews in their own Nomad namespace

Revisions

  1. CJ Balloon 104 added, Infra line 17 NOV 2026 P.H.
  2. CH Balloon 103 added, Infra line 17 NOV 2026 P.H.
  3. CG Balloon 109 added, Backend line 16 NOV 2026 P.H.