From 54e186f3326b79723bf508513fb93e095911b441 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 13:00:45 +0100 Subject: [PATCH 01/15] [repo] Release: version 1.0.0, its notes, About shows the running version; nix-pin --check prints the pin it would write --- .fabrica/notes/1.0.0.md | 18 ++++++++++++++++++ Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- apps/web/package.json | 2 +- apps/web/src/env.d.ts | 6 ++++++ apps/web/src/views/Settings.svelte | 3 ++- apps/web/vite.config.ts | 4 ++++ docs/release.md | 4 ++++ packages/ui/package.json | 2 +- scripts/nix-pin.sh | 8 +++++++- 10 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 .fabrica/notes/1.0.0.md create mode 100644 apps/web/src/env.d.ts diff --git a/.fabrica/notes/1.0.0.md b/.fabrica/notes/1.0.0.md new file mode 100644 index 0000000..d5b435d --- /dev/null +++ b/.fabrica/notes/1.0.0.md @@ -0,0 +1,18 @@ +Ianitor 1.0.0 is the first version meant to run beside Caddy on a real server. + +- **Hardened edge.** A 60-second deadline for request headers (slow clients cannot hold a connection open), DNS + lookups on their own bounded threads, pipelined requests on both listeners, and a Unix socket for running beside + Caddy, on which edge trusts only Caddy's forwarded address. +- **The control plane on its own socket.** The web UI reaches control through a socket that only edge can use; the + sign-in proof is honoured only there. +- **Five test layers.** The same requests against Ianitor and Caddy with the answers compared, h2spec and testssl.sh, + fuzzing of the config, header rules and share tokens, NixOS VM tests, and load and soak runs against Caddy, with + the results kept as data, including where Caddy is faster (plain HTTP/1.1 under heavy load, new TLS connections). +- **A verifiable build.** The release publishes the Nix build's hashes. Anyone can rebuild the tag and compare. +- **The shared Domi design system.** The web UI's buttons, text fields, checkboxes and choices come from @domi/ui; + Settings, About shows the running version. +- **A new licence.** From this version Ianitor is under CPAL-1.0 and shows the Built on Domi credit. 0.2.0 and + earlier stay MPL-2.0. + +Updates stay a deploy. Fabrica's Deploy moves the server to the new commit and switches back if the health check +does not answer. diff --git a/Cargo.lock b/Cargo.lock index 1f6e1ee..acd46d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,7 +1304,7 @@ dependencies = [ [[package]] name = "ianitor-control" -version = "0.2.0" +version = "1.0.0" dependencies = [ "axum", "base64 0.22.1", @@ -1331,7 +1331,7 @@ dependencies = [ [[package]] name = "ianitor-core" -version = "0.2.0" +version = "1.0.0" dependencies = [ "base64 0.22.1", "domi-pki", @@ -1348,7 +1348,7 @@ dependencies = [ [[package]] name = "ianitor-diff" -version = "0.2.0" +version = "1.0.0" dependencies = [ "bytes", "http-body-util", @@ -1366,7 +1366,7 @@ dependencies = [ [[package]] name = "ianitor-edge" -version = "0.2.0" +version = "1.0.0" dependencies = [ "arc-swap", "async-trait", @@ -1394,7 +1394,7 @@ dependencies = [ [[package]] name = "ianitor-fuzz" -version = "0.2.0" +version = "1.0.0" dependencies = [ "ianitor-core", "ianitor-edge", @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "ianitor-testkit" -version = "0.2.0" +version = "1.0.0" dependencies = [ "bytes", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index f3df68b..9f5534f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ exclude = ["tests/fuzz/fuzz"] [workspace.package] -version = "0.2.0" +version = "1.0.0" edition = "2024" rust-version = "1.89" license = "CPAL-1.0" diff --git a/apps/web/package.json b/apps/web/package.json index a9ba531..6636584 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "0.2.0", + "version": "1.0.0", "private": true, "license": "CPAL-1.0", "description": "Ianitor Domi web UI (Svelte 5, runes, TypeScript strict). A pure client of the control API.", diff --git a/apps/web/src/env.d.ts b/apps/web/src/env.d.ts new file mode 100644 index 0000000..ec23091 --- /dev/null +++ b/apps/web/src/env.d.ts @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution +// License 1.0: see LICENSE (its Exhibit A is this file's notice). + +/** Ianitor's version, from apps/web/package.json at build time (vite.config.ts `define`). */ +declare const __IANITOR_VERSION__: string; diff --git a/apps/web/src/views/Settings.svelte b/apps/web/src/views/Settings.svelte index 3ca5a24..002f44b 100644 --- a/apps/web/src/views/Settings.svelte +++ b/apps/web/src/views/Settings.svelte @@ -13,6 +13,7 @@ import type { CreatedToken, ShareLink, TokenRow } from "../lib/types"; let { tab }: { tab: string } = $props(); + const version = __IANITOR_VERSION__; const TABS = [ { id: "general", label: "General" }, { id: "api", label: "API" }, @@ -241,7 +242,7 @@ {/if} {/if} {:else} -

Ianitor Domi 0.1.0

+

Ianitor Domi {version}

CPAL-1.0 (Common Public Attribution License 1.0). Ianitor 0.2.0 and earlier stay MPL-2.0.

Built, tested and signed by Fabrica Domi

diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 98877d1..e611573 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -2,6 +2,7 @@ // Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution // License 1.0: see LICENSE (its Exhibit A is this file's notice). +import { readFileSync } from "node:fs"; import { svelte } from "@sveltejs/vite-plugin-svelte"; import { defineConfig } from "vitest/config"; @@ -11,9 +12,12 @@ import { defineConfig } from "vitest/config"; // $IANITOR_DEV_TOKEN, which `ianitor-control --dev` prints. const control = process.env.IANITOR_CONTROL ?? "http://127.0.0.1:7878"; const token = process.env.IANITOR_DEV_TOKEN; +// The version Settings, About shows: package.json's, which scripts/check-version.mjs keeps equal to Cargo.toml's. +const version: string = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")).version; export default defineConfig({ plugins: [svelte()], + define: { __IANITOR_VERSION__: JSON.stringify(version) }, server: { host: "127.0.0.1", port: 5173, diff --git a/docs/release.md b/docs/release.md index 2518159..3a5ccec 100644 --- a/docs/release.md +++ b/docs/release.md @@ -137,6 +137,10 @@ discovery (ROADMAP §1.9). When it is time: X.Y.Z` must pass. Write `.fabrica/notes/X.Y.Z.md`. Commit. 1a. Pin: run `scripts/nix-pin.sh` on Linux with Nix at that clean commit and commit `.fabrica/nix/pin.json` ([verify.md](verify.md)). The `pin` step refuses a missing pin and one made from other code than the tag's. + Without Nix here: start `verify-nix` on the hub at that commit (`POST /api/runs`, pipeline `verify-nix`, the + branch as ref). Its `pin` step fails for want of a pin and logs the pin it would write as one + `pin.json: {…}` line; save that JSON, formatted by `jq -S .`, as `.fabrica/nix/pin.json` and commit only it. + Then run `verify-nix` again: `pin` must say `matches .fabrica/nix/pin.json`. 2. Tag and push: `git tag vX.Y.Z && git push origin vX.Y.Z`. 3. Start the `release` pipeline at `vX.Y.Z` from Fabrica. No Gitea webhook reaches the hub yet, so use the hub's `POST /api/runs` with ref `vX.Y.Z`. diff --git a/packages/ui/package.json b/packages/ui/package.json index 9458d8a..f318f7b 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@ianitor/ui", - "version": "0.2.0", + "version": "1.0.0", "private": true, "license": "CPAL-1.0", "description": "Ianitor's own components on top of @domi/ui (the shared Domi design system): banners, dialogs, status, and adapters for Button and Segmented.", diff --git a/scripts/nix-pin.sh b/scripts/nix-pin.sh index 6e4f085..2ef0f4f 100755 --- a/scripts/nix-pin.sh +++ b/scripts/nix-pin.sh @@ -59,7 +59,13 @@ new=$(printf '%s\n' "${entries[@]}" | jq -s --arg v "$version" --arg sys "$syste '{version: $v, system: $sys, commit: $c, sourceTree: $t, nixpkgs: $n, outputs: add}') if [ "$mode" = --check ]; then - [ -f "$pin" ] || { echo "no $pin to check" >&2; exit 1; } + # With no pin yet, print the one this build would write: the NixOS runner has no commit rights, so its + # log is how the first pin of a release reaches the repo (docs/release.md, Handover 1a). + if [ ! -f "$pin" ]; then + echo "no $pin to check; this build's pin would be:" >&2 + jq -S -c . <<<"$new" | sed 's/^/pin.json: /' >&2 + exit 1 + fi # At a tag the commit is the pin's child (only pin.json differs), so the commit itself is not # compared; the source tree, nixpkgs and every hash are. if [ "$(jq -S 'del(.commit)' "$pin")" != "$(jq -S 'del(.commit)' <<<"$new")" ]; then From 85a61e531daecac4cc8be3d3700978006bd3820e Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 13:19:30 +0100 Subject: [PATCH 02/15] [repo] Release: the 1.0.0 Nix pin, from verify-nix run r4wbq2y1e82m4 (both outputs rebuilt identical) --- .fabrica/nix/pin.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json new file mode 100644 index 0000000..6edd536 --- /dev/null +++ b/.fabrica/nix/pin.json @@ -0,0 +1,19 @@ +{ + "commit": "54e186f3326b79723bf508513fb93e095911b441", + "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", + "outputs": { + "ianitor": { + "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", + "narSize": 24455232, + "storePath": "/nix/store/p1fjjxz514ccaqyvzag43mpagj0akiqk-ianitor-1.0.0" + }, + "ianitor-web": { + "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", + "narSize": 598000, + "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" + } + }, + "sourceTree": "9c1b49f00748550e08ad903bd8148298a51a16e5f1c640bf78a5a30775d02f03", + "system": "x86_64-linux", + "version": "1.0.0" +} From be7a805ef2a8d92d172a48da57259892ca0f2c21 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 13:48:28 +0100 Subject: [PATCH 03/15] [repo] CI shell: openssl for control's pki tests; the pin is made again for this tree --- .fabrica/nix/pin.json | 19 ------------------- flake.nix | 2 ++ 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json deleted file mode 100644 index 6edd536..0000000 --- a/.fabrica/nix/pin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "54e186f3326b79723bf508513fb93e095911b441", - "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", - "outputs": { - "ianitor": { - "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", - "narSize": 24455232, - "storePath": "/nix/store/p1fjjxz514ccaqyvzag43mpagj0akiqk-ianitor-1.0.0" - }, - "ianitor-web": { - "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", - "narSize": 598000, - "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" - } - }, - "sourceTree": "9c1b49f00748550e08ad903bd8148298a51a16e5f1c640bf78a5a30775d02f03", - "system": "x86_64-linux", - "version": "1.0.0" -} diff --git a/flake.nix b/flake.nix index e14dab3..29f2a12 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,8 @@ pkg-config git jq + # control's pki tests sign an intermediate the way Mark does by hand (docs/pki.md) + openssl caddy pebble h2spec From d0c1ac2548224aa9c7b4d3a5586a0bc6f74beb78 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 14:19:42 +0100 Subject: [PATCH 04/15] [repo] Layers: control's integration tests four at a time on the shared runner --- .fabrica/artifex/layers.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.fabrica/artifex/layers.yaml b/.fabrica/artifex/layers.yaml index 18564ff..2f436d1 100644 --- a/.fabrica/artifex/layers.yaml +++ b/.fabrica/artifex/layers.yaml @@ -13,6 +13,11 @@ runner: nixos env: CARGO_TERM_COLOR: "never" CARGO_BUILD_JOBS: "8" + # Each of control's integration tests starts its own edge, Caddy and upstreams, and the tests give edge a 2 s + # margin to hear control's confirmation (production: 30 s). Run all at once on the shared runner, a status call + # can take longer than that and edge reverts the trial by itself, as designed (runs rc344zj96yjz1 and + # rqzephjsp7983, 2026-12-02). Four at a time keeps the runner within the margin. + RUST_TEST_THREADS: "4" steps: - id: workspace-tests run: nix --extra-experimental-features "nix-command flakes" develop .#ci -c cargo test --workspace --no-fail-fast From af545597c34c5c074100bd634a90c3dc48c748db Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 14:19:43 +0100 Subject: [PATCH 05/15] [repo] Release: the 1.0.0 Nix pin (outputs as verify-nix rt0ms4r58zt5r built them; source tree of the layers change) --- .fabrica/nix/pin.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json new file mode 100644 index 0000000..105a06e --- /dev/null +++ b/.fabrica/nix/pin.json @@ -0,0 +1,19 @@ +{ + "commit": "d0c1ac2548224aa9c7b4d3a5586a0bc6f74beb78", + "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", + "outputs": { + "ianitor": { + "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", + "narSize": 24455232, + "storePath": "/nix/store/p1fjjxz514ccaqyvzag43mpagj0akiqk-ianitor-1.0.0" + }, + "ianitor-web": { + "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", + "narSize": 598000, + "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" + } + }, + "sourceTree": "bf05c78a942bb6915c588760eef97a97ddf4efc0644c73f6ea2941bb9fde97f5", + "system": "x86_64-linux", + "version": "1.0.0" +} From 2d45087145a124c90d6404ca2a3c31d45b7b6619 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 15:04:46 +0100 Subject: [PATCH 06/15] [control] Tests: a 5 s trial margin, room for a loaded runner between a watch's end and the confirmation --- .fabrica/artifex/layers.yaml | 8 ++++---- .fabrica/nix/pin.json | 19 ------------------- crates/control/tests/apply.rs | 5 +++-- crates/control/tests/common/mod.rs | 2 +- 4 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/artifex/layers.yaml b/.fabrica/artifex/layers.yaml index 2f436d1..f08e17b 100644 --- a/.fabrica/artifex/layers.yaml +++ b/.fabrica/artifex/layers.yaml @@ -13,10 +13,10 @@ runner: nixos env: CARGO_TERM_COLOR: "never" CARGO_BUILD_JOBS: "8" - # Each of control's integration tests starts its own edge, Caddy and upstreams, and the tests give edge a 2 s - # margin to hear control's confirmation (production: 30 s). Run all at once on the shared runner, a status call - # can take longer than that and edge reverts the trial by itself, as designed (runs rc344zj96yjz1 and - # rqzephjsp7983, 2026-12-02). Four at a time keeps the runner within the margin. + # Each of control's integration tests starts its own edge, Caddy and upstreams. With the tests' old 2 s margin for + # control's confirmation (production: 30 s), a status call on the loaded shared runner took longer and edge + # reverted the trial by itself, as designed (runs rc344zj96yjz1, rqzephjsp7983, rzqmqbvx970f8; 2026-12-02). The + # margin is 5 s now (crates/control/tests/common/mod.rs), and four tests at a time keep the runner's load down. RUST_TEST_THREADS: "4" steps: - id: workspace-tests diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json deleted file mode 100644 index 105a06e..0000000 --- a/.fabrica/nix/pin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "d0c1ac2548224aa9c7b4d3a5586a0bc6f74beb78", - "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", - "outputs": { - "ianitor": { - "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", - "narSize": 24455232, - "storePath": "/nix/store/p1fjjxz514ccaqyvzag43mpagj0akiqk-ianitor-1.0.0" - }, - "ianitor-web": { - "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", - "narSize": 598000, - "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" - } - }, - "sourceTree": "bf05c78a942bb6915c588760eef97a97ddf4efc0644c73f6ea2941bb9fde97f5", - "system": "x86_64-linux", - "version": "1.0.0" -} diff --git a/crates/control/tests/apply.rs b/crates/control/tests/apply.rs index fefea8d..7e69725 100644 --- a/crates/control/tests/apply.rs +++ b/crates/control/tests/apply.rs @@ -237,8 +237,9 @@ mod unix { "{stage}: edge.json untouched" ); } - // A trial edge was serving reverts by itself at its deadline (watch 2 s + margin 2 s). - tokio::time::sleep(Duration::from_secs(5)).await; + // A trial edge was serving reverts by itself at its deadline (watch 2 s + margin 5 s, + // common/mod.rs: room for a loaded runner between the watch's end and the confirmation). + tokio::time::sleep(Duration::from_secs(8)).await; let st = env.edge_status().await; assert!(st["trial"].is_null(), "{stage}: trial still running: {st}"); if !confirmed { diff --git a/crates/control/tests/common/mod.rs b/crates/control/tests/common/mod.rs index f1c6f07..5022ee3 100644 --- a/crates/control/tests/common/mod.rs +++ b/crates/control/tests/common/mod.rs @@ -174,7 +174,7 @@ state_dir = "{state}" credentials_dir = "{creds}" watch_secs = {watch} watch_every_secs = 1 -trial_margin_secs = 2 +trial_margin_secs = 5 health_poll_secs = 1 [routes] From c626db8f25650c502c0961ad261145204cfdf586 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 15:26:20 +0100 Subject: [PATCH 07/15] [repo] Release: the 1.0.0 Nix pin, from verify-nix run r16gdgvh9zasv (both outputs rebuilt identical) --- .fabrica/nix/pin.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json new file mode 100644 index 0000000..39c4404 --- /dev/null +++ b/.fabrica/nix/pin.json @@ -0,0 +1,19 @@ +{ + "commit": "2d45087145a124c90d6404ca2a3c31d45b7b6619", + "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", + "outputs": { + "ianitor": { + "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", + "narSize": 24455232, + "storePath": "/nix/store/pds604zcl2ydvbvynrjvmbgn9dhkxwk8-ianitor-1.0.0" + }, + "ianitor-web": { + "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", + "narSize": 598000, + "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" + } + }, + "sourceTree": "2b9ebb0bdebcb088276dadcb89e9111362ebf17b9a2b4c665543b6f0fc12157c", + "system": "x86_64-linux", + "version": "1.0.0" +} From f9e8ac801c5d204f3ade898c9850b6b9db634c17 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 16:47:58 +0100 Subject: [PATCH 08/15] [control] Tests: a 15 s trial margin and waits on state, not fixed sleeps, for a loaded runner --- .fabrica/artifex/layers.yaml | 5 +++-- .fabrica/nix/pin.json | 19 ---------------- crates/control/tests/apply.rs | 32 ++++++++++++++++++++++----- crates/control/tests/common/mod.rs | 5 ++++- crates/control/tests/engine_switch.rs | 6 ++--- 5 files changed, 37 insertions(+), 30 deletions(-) delete mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/artifex/layers.yaml b/.fabrica/artifex/layers.yaml index f08e17b..9acc48b 100644 --- a/.fabrica/artifex/layers.yaml +++ b/.fabrica/artifex/layers.yaml @@ -15,8 +15,9 @@ env: CARGO_BUILD_JOBS: "8" # Each of control's integration tests starts its own edge, Caddy and upstreams. With the tests' old 2 s margin for # control's confirmation (production: 30 s), a status call on the loaded shared runner took longer and edge - # reverted the trial by itself, as designed (runs rc344zj96yjz1, rqzephjsp7983, rzqmqbvx970f8; 2026-12-02). The - # margin is 5 s now (crates/control/tests/common/mod.rs), and four tests at a time keep the runner's load down. + # reverted the trial by itself, as designed (runs rc344zj96yjz1, rqzephjsp7983, rzqmqbvx970f8, rja3pbbd14fk1; + # 2026-12-02). The margin is 15 s now (crates/control/tests/common/mod.rs), and four tests at a time keep the + # runner's load down. RUST_TEST_THREADS: "4" steps: - id: workspace-tests diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json deleted file mode 100644 index 39c4404..0000000 --- a/.fabrica/nix/pin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "2d45087145a124c90d6404ca2a3c31d45b7b6619", - "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", - "outputs": { - "ianitor": { - "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", - "narSize": 24455232, - "storePath": "/nix/store/pds604zcl2ydvbvynrjvmbgn9dhkxwk8-ianitor-1.0.0" - }, - "ianitor-web": { - "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", - "narSize": 598000, - "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" - } - }, - "sourceTree": "2b9ebb0bdebcb088276dadcb89e9111362ebf17b9a2b4c665543b6f0fc12157c", - "system": "x86_64-linux", - "version": "1.0.0" -} diff --git a/crates/control/tests/apply.rs b/crates/control/tests/apply.rs index 7e69725..c223656 100644 --- a/crates/control/tests/apply.rs +++ b/crates/control/tests/apply.rs @@ -237,10 +237,16 @@ mod unix { "{stage}: edge.json untouched" ); } - // A trial edge was serving reverts by itself at its deadline (watch 2 s + margin 5 s, - // common/mod.rs: room for a loaded runner between the watch's end and the confirmation). - tokio::time::sleep(Duration::from_secs(8)).await; - let st = env.edge_status().await; + // A trial edge was serving reverts by itself at its deadline (watch 2 s + margin 15 s, + // common/mod.rs: room for a loaded runner between the trial's load and the confirmation). + let deadline = std::time::Instant::now() + Duration::from_secs(30); + let st = loop { + let st = env.edge_status().await; + if st["trial"].is_null() || std::time::Instant::now() > deadline { + break st; + } + tokio::time::sleep(Duration::from_millis(250)).await; + }; assert!(st["trial"].is_null(), "{stage}: trial still running: {st}"); if !confirmed { assert_eq!( @@ -789,7 +795,23 @@ mod unix { ) .await; let id = r.json["apply"]["id"].as_str().unwrap().to_owned(); - tokio::time::sleep(Duration::from_millis(1500)).await; + // Edge goes once the trial is loaded and watched (a fixed 1.5 s was before the reload on + // a loaded runner, layers run rja3pbbd14fk1). + let deadline = std::time::Instant::now() + Duration::from_secs(20); + loop { + let s = env + .call("GET", &format!("/api/v1/applies/{id}"), None) + .await; + if s.json["state"] == "watching" { + break; + } + assert!( + std::time::Instant::now() < deadline, + "never watched: {}", + s.text + ); + tokio::time::sleep(Duration::from_millis(50)).await; + } env.stop_edge(); let rec = env.wait_apply(&id).await; assert_eq!(rec["state"], "needs_attention", "{rec}"); diff --git a/crates/control/tests/common/mod.rs b/crates/control/tests/common/mod.rs index 5022ee3..5fb2d92 100644 --- a/crates/control/tests/common/mod.rs +++ b/crates/control/tests/common/mod.rs @@ -174,7 +174,10 @@ state_dir = "{state}" credentials_dir = "{creds}" watch_secs = {watch} watch_every_secs = 1 -trial_margin_secs = 5 +# Production: 30 s. Control starts its watch after the trial's journal is written, which took +# over 5 s on the loaded shared runner (layers run rja3pbbd14fk1); edge's deadline counts from +# the trial's load. The tests that wait out a deadline use this value (apply.rs, engine_switch.rs). +trial_margin_secs = 15 health_poll_secs = 1 [routes] diff --git a/crates/control/tests/engine_switch.rs b/crates/control/tests/engine_switch.rs index 2bf3869..bf0ab0e 100644 --- a/crates/control/tests/engine_switch.rs +++ b/crates/control/tests/engine_switch.rs @@ -575,10 +575,10 @@ esac let st = ce.env.wait_control_exit(Duration::from_secs(30)); eprintln!("QC control exit: {st:?}"); assert!(st.is_some()); - // Longer than edge's trial deadline would allow. - tokio::time::sleep(Duration::from_secs(15)).await; + // Past the Caddy guard's deadline: watch 2 s + margin 15 s (common/mod.rs) + 5 s. + tokio::time::sleep(Duration::from_secs(27)).await; let during = visit(&ce.env, ce.https, "b.test").await; - eprintln!("QC b.test through Caddy 15 s after the crash, control down: {during}"); + eprintln!("QC b.test through Caddy 27 s after the crash, control down: {during}"); ce.env.start_control(None); tokio::time::sleep(Duration::from_secs(3)).await; let after = visit(&ce.env, ce.https, "b.test").await; From 5575659a5950a168396622a765cf7c82fef8ef6c Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 17:14:20 +0100 Subject: [PATCH 09/15] [repo] Release: the 1.0.0 Nix pin, from verify-nix run rp6e1grjvjrkc (both outputs rebuilt identical) --- .fabrica/nix/pin.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json new file mode 100644 index 0000000..75c5998 --- /dev/null +++ b/.fabrica/nix/pin.json @@ -0,0 +1,19 @@ +{ + "commit": "f9e8ac801c5d204f3ade898c9850b6b9db634c17", + "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", + "outputs": { + "ianitor": { + "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", + "narSize": 24455232, + "storePath": "/nix/store/mrq37ldbyn0zg04iwwj22pp05hlpx5y8-ianitor-1.0.0" + }, + "ianitor-web": { + "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", + "narSize": 598000, + "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" + } + }, + "sourceTree": "9d20d6d62c22e8792d60cf5f7a244f888fc771789be905f3edfa007679a7cfd1", + "system": "x86_64-linux", + "version": "1.0.0" +} From 7473b897dcec81db25a43b90f1bfd32c89070a21 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 18:48:24 +0100 Subject: [PATCH 10/15] [deploy] VM tests: git in the test server, which vm-apply-reverts runs to read the routes repository --- .fabrica/nix/pin.json | 19 ------------------- deploy/nixos/tests/default.nix | 3 ++- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json deleted file mode 100644 index 75c5998..0000000 --- a/.fabrica/nix/pin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "f9e8ac801c5d204f3ade898c9850b6b9db634c17", - "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", - "outputs": { - "ianitor": { - "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", - "narSize": 24455232, - "storePath": "/nix/store/mrq37ldbyn0zg04iwwj22pp05hlpx5y8-ianitor-1.0.0" - }, - "ianitor-web": { - "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", - "narSize": 598000, - "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" - } - }, - "sourceTree": "9d20d6d62c22e8792d60cf5f7a244f888fc771789be905f3edfa007679a7cfd1", - "system": "x86_64-linux", - "version": "1.0.0" -} diff --git a/deploy/nixos/tests/default.nix b/deploy/nixos/tests/default.nix index 5395c0f..851cf37 100644 --- a/deploy/nixos/tests/default.nix +++ b/deploy/nixos/tests/default.nix @@ -51,7 +51,8 @@ let wantedBy = [ "multi-user.target" ]; serviceConfig.ExecStart = "${pkgs.python3}/bin/python3 -m http.server 8000 --bind 127.0.0.1 --directory /etc"; }; - environment.systemPackages = [ pkgs.curl pkgs.jq pkgs.openssl ]; + # git: the tests read control's routes repository (vm-apply-reverts). + environment.systemPackages = [ pkgs.curl pkgs.jq pkgs.openssl pkgs.git ]; }; # Python helpers shared by the test scripts. From 35852030bf5525312ee937de5ed4515fde2bd3ce Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 18:48:50 +0100 Subject: [PATCH 11/15] [repo] Release: the 1.0.0 Nix pin for the VM test fix (outputs as rp6e1grjvjrkc built them; deploy/ is outside the package's source) --- .fabrica/nix/pin.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json new file mode 100644 index 0000000..04039a3 --- /dev/null +++ b/.fabrica/nix/pin.json @@ -0,0 +1,19 @@ +{ + "commit": "7473b897dcec81db25a43b90f1bfd32c89070a21", + "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", + "outputs": { + "ianitor": { + "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", + "narSize": 24455232, + "storePath": "/nix/store/mrq37ldbyn0zg04iwwj22pp05hlpx5y8-ianitor-1.0.0" + }, + "ianitor-web": { + "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", + "narSize": 598000, + "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" + } + }, + "sourceTree": "dd9194c43094dd06b072d3597c1a2f114beda3cf5ed57678a99c979e32d6bb0e", + "system": "x86_64-linux", + "version": "1.0.0" +} From 42127ed919ee30dd37da3f2a6cd474abd56a1770 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 19:57:50 +0100 Subject: [PATCH 12/15] [repo] Bench: ss in the CI shell and in bench.sh's tool check; no pid found no longer ends the run silently --- .fabrica/nix/pin.json | 19 ------------------- flake.nix | 2 ++ scripts/bench.sh | 7 ++++--- 3 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 .fabrica/nix/pin.json diff --git a/.fabrica/nix/pin.json b/.fabrica/nix/pin.json deleted file mode 100644 index 04039a3..0000000 --- a/.fabrica/nix/pin.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "7473b897dcec81db25a43b90f1bfd32c89070a21", - "nixpkgs": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33", - "outputs": { - "ianitor": { - "narHash": "sha256-hlX5oiJQPTieETbjojaZnPUGcSgPrKqO2vPsr2o2Xok=", - "narSize": 24455232, - "storePath": "/nix/store/mrq37ldbyn0zg04iwwj22pp05hlpx5y8-ianitor-1.0.0" - }, - "ianitor-web": { - "narHash": "sha256-cR8Lq5LNQoQ7xWa40jpjmRybUC8tS9XuXAtojDmCg2c=", - "narSize": 598000, - "storePath": "/nix/store/vsrm3326zm440gwp17nqg3g3bixb3cmm-ianitor-web-1.0.0" - } - }, - "sourceTree": "dd9194c43094dd06b072d3597c1a2f114beda3cf5ed57678a99c979e32d6bb0e", - "system": "x86_64-linux", - "version": "1.0.0" -} diff --git a/flake.nix b/flake.nix index 29f2a12..7b6d8f4 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,8 @@ h2spec testssl oha + # scripts/bench.sh finds each proxy's pid with ss (a NixOS service's PATH has no iproute2) + iproute2 nodejs_22 pnpm_11 # the slow-client probes (tests/support/probes) diff --git a/scripts/bench.sh b/scripts/bench.sh index d30b7fa..d26e48c 100755 --- a/scripts/bench.sh +++ b/scripts/bench.sh @@ -8,7 +8,7 @@ # (tests/diff/src/bin/pair.rs) to the same upstream; oha drives each in turn. Results are # committed as data: bench/results/-