Files
ianitor/docs/ROADMAP.md
T

34 KiB
Raw Blame History

Ianitor Domi — roadmap

Ianitor = the doorkeeper: it decides who comes through the door (routing, TLS) and checks credentials (certificates). Legend: [S] sourced · [J] judgment · [M] decided by Mark.

1. Decisions (do not reopen without Mark)

  1. Scope: internal Domi CA for home-server services and mTLS between Domi apps/devices. Public sites stay on Let's Encrypt. [M]
  2. Root key offline in Custos; intermediate on the server, renewed yearly through a Custos match-code approval. [M]
  3. Own proxy on Pingora (Rust, Apache 2.0; HTTP/1, HTTP/2, gRPC, websockets; a library, not a binary). [M] [S blog.cloudflare.com/pingora-open-source]
  4. Caddy is the fallback: one config model compiled to the Pingora runtime and to Caddy JSON, kept honest by differential tests on every build. [M]
  5. Web UI only, on the server behind Authelia. API tokens are saved by Mark in Custos; control stores only hashes. [M]
  6. Routes live in a git repo (private: ianitor-routes), one TOML file per host, schema-validated. Every change is a commit, applied live without nixos-rebuild. Rebuild only for service-level changes (ports, version). The engine is switched at runtime by control (§3, §4); decided 2026-11-07, replacing "engine" in the rebuild list. [M]
  7. Two processes: ianitor-edge (data plane) and ianitor-control (API + UI). Traffic keeps flowing if control crashes. [M]
  8. Own small CA in crates/core using rcgen. No internal ACME server in v1. [M]
  9. One public MPL-2.0 monorepo on Gitea; read-only GitHub mirror for discovery. Mark's server deployment stays in his NixOS flake. [M]
  10. Branding: "Ianitor Domi", with "Built, tested and signed by Fabrica Domi" on the repo and release page. [M]
  11. Support: free source; "Adopt a red panda" — 80% developer, 20% Red Panda Network, remitted yearly with a published receipt. [M]
  12. Cut-over: only after all five test layers are green and two weeks beside Caddy on low-risk hosts. [M]
  13. Competitor to watch: Pangolin (tunnelled identity-aware reverse proxy). Our edge: Nix-native history, Domi PKI, friend nodes. [S github.com/fosrl/pangolin] [J]

2. Versions and gates

Version Contents Gate question
v1 (phases 1–4) engine, both compilers, control plane, web UI, PKI, NixOS module, five test layers, signed release Does Ianitor serve two low-risk hosts beside Caddy for two weeks with zero incidents and the differential tests green?
v1.1 all hosts on Ianitor; monthly rehearsed switch to Caddy and back Are all hosts on Ianitor, with the Caddy switch rehearsed monthly?
v2 identity gate (passkey/TOTP) replacing Authelia, tunnel via friend node/VPS, one-click Domi templates Can a family member reach a home service from outside with no open port and no Authelia?

3. Architecture

  • Host file fields (v1): hostname, upstreams[], tls = letsencrypt | domi, auth = none | forward-auth, request/response header rules (set/remove; values may reference a named secret), websockets, health check path + interval, share links enabled, access log = off | truncated.
  • Edge: TLS termination with SNI per host, Let's Encrypt via an ACME crate, upstream health checks, websockets, header rules, forward-auth compatible with Authelia (existing protected services must keep working), graceful reload without dropping connections.
  • Secrets referenced by header rules load from $CREDENTIALS_DIRECTORY and never appear in logs or responses.
  • Logging: error log always; access log only per host when enabled, IPv4 truncated to /24, IPv6 to /48, local file only.
  • Apply: validate → compile → write edge config + Caddy JSON → reload edge → watch health checks 60 s → on failure git-revert, reload, report "reverted" with the reason; otherwise "kept". Concurrent applies are serialised. Undo = revert the last kept commit through the same path. Restore = apply an older tree as a new commit. Push to Gitea after a kept apply.
  • Share links: HMAC token bound to host + path prefix + expiry (+ optional password, mixed into the MAC; no hash in the token, so it cannot be guessed offline; edge rate-limits tries), validated statelessly by edge; key from systemd credentials; revocation by key rotation, an epoch ("stop all") or a small deny list kept in a file outside git that control writes and edge re-reads at once, so a Stop never waits for an apply; neither the epoch nor the list ever goes backwards. [M 2026-11-07]
  • API: REST + JSON on loopback, OpenAPI generated from code.
  • CA: root created offline, ~10 years, pathLenConstraint ≥ 1, never on the server. Intermediate ~1 year, key encrypted on the server, password via systemd credentials. Leaf and device mTLS certs issued by control (lifetimes decided and justified in phase 3). Intermediate renewal: control makes a CSR; Custos signs with the root after a match-code approval.
  • Engine switch: the NixOS module defines ianitor-edge and caddy-fallback (reads the generated Caddy JSON); only one runs; an engine-select unit starts the chosen one at boot from /var/lib/ianitor/engine; control may start/stop only these two units through a polkit rule scoped to exactly them.
  • NixOS module: services.ianitor.*; everything on loopback except edge; LoadCredential for secrets, asserted not to be store paths.

4. UI (count clicks in every smoke test)

Main screen: host list with health dots, engine chip, intermediate-expiry banner, last-apply bar with Undo.

Flow Clicks
Add host: + Host → fill → Apply (auto-kept or auto-reverted) 2
Undo last change 1
Restore: History → pick → Restore 3
Share link: ⋯ → Share → Copy (default expiry 7 d) 3
Switch engine: engine chip → Switch to Caddy 2
Device cert: Certs → + Device → Issue (approve in Custos) 3
Renew intermediate: banner Renew (approve in Custos) 1
API token: ⚙ → API → New token 3

Accepted exceptions [M 2026-11-07]: copying a new API token and installing a device certificate may take a 4th click (deliberate secret-handling steps). A share link on a host with links off takes 4 clicks (⋯ → Share link → Turn on share links → Copy, after the apply is kept; no turn_on API change). Signing the intermediate by hand on the offline machine (openssl) is outside the 1-click Renew budget while Custos lacks the operation (§8.6). Share links are off while Caddy serves (v1); a validator Caddy calls through forward_auth comes before v1.1's monthly switch rehearsal.

5. Test layers (all run in an Artifex pipeline by phase 4)

  1. Differential: the same request corpus against Ianitor and Caddy; status, selected headers and body compared.
  2. Protocol conformance: h2spec, testssl.sh.
  3. Fuzzing: cargo-fuzz on config parsing, header rules, share tokens; any crash fails the pipeline.
  4. NixOS VM tests: failed apply auto-reverts; switch to Caddy and back keeps a host reachable; intermediate renewal with a test root; control unreachable from outside loopback.
  5. Load and soak against Caddy, reproducible from a script; results committed as data, published honestly including where Caddy wins.

6. Phases

Phase 1 — Core and engine

Goal: Pingora proxy serving hosts from the validated model; same model compiled to Caddy JSON; differential harness proving parity. First: .gitignore and a pre-commit hook (rejects binaries, private keys, files > 5 MB). Placeholders only for control/web. Tests first: schema rejects unknown fields, missing/duplicate hostnames, bad upstream URLs, undefined secret references; both compilers deterministic (byte-identical output); an injected secret never appears in a response or log; a forward-auth denial never reaches the upstream; the diff harness (≥ 20 seed requests: plain, headers, websocket upgrade, upstream down, auth denied) catches a deliberately broken compiler once. Done: proxies two local test upstreams with Let's Encrypt staging and with a self-signed test cert; diff suite green.

Phase 2 — Control plane

Goal: ianitor-control edits route files in the git repo, applies with automatic rollback, manages share links and API tokens. Tests first: failed health check reverts the commit and restores the previous edge config; a control crash mid-apply leaves edge on the last good config; share token rejected when expired, wrong path, wrong host, tampered or missing password; requests without a valid token rejected and tokens never logged; concurrent applies serialised. Done: add host, undo, restore and share link work end to end via the API on loopback; curl examples in docs/api.md; diff suite green after every apply. Also includes the UI API contract (docs/ui-api.md: overview, error codes, idempotency, health classes, watch probes, history grouping, restore previews), accepted by Mark 2026-11-07.

Phase 3 — Web UI, PKI, NixOS

Goal: the UI from section 4, the CA flows, the NixOS module with VM tests; Ianitor runs beside Caddy on two low-risk hosts. Tests first: issued chains validate to the root; a leaf cannot sign; expired and wrong-name certs rejected; no root key file in the state dir; a Domi device cert is accepted for mTLS while a self-signed cert with the same subject is rejected; VM tests from section 5 layer 4. If Custos has no CSR-signing operation with match-code approval: stop that part, write the needed operation as a Custos ticket, and document a temporary manual offline signing step. Done: smoke test of every UI flow with clicks counted; VM tests green; Mark has run nixos-rebuild; deploy/test-access.sh passes.

Phase 4 — Hardening and release

Goal: all five test layers in an Artifex pipeline (strict Fabrica YAML); verifiable Nix build; artefacts signed via Custos, published as Gitea release assets, sha256-pinned; GitHub push mirror. Deliverables: README (what, why Pingora, honest benchmarks, the Caddy fallback, the Fabrica badge, support section); docs/support.md (the red panda model); launch post drafts in docs/launch/ only. Release notes live on the Gitea release. Done: pipeline green; signed v1.0.0 on Gitea; mirror visible on GitHub; the two-week run beside Caddy starts.

7. Out of scope for v1

Identity gate, tunnel, Domi templates, ACME server, HTTP/3, migrating public sites away from Caddy before the cut-over gate.

8. Open points (resolve at the start of the phase that needs them; record the answer here)

  1. Pingora TLS backend: rustls vs BoringSSL/OpenSSL — maturity and NixOS packaging. (phase 1) Answer: rustls (ring), pingora 0.9.1 feature rustls. Pure Rust, so no system TLS library, Perl, Go or clang in the Nix build. TlsSettings::set_cert_resolver gives SNI selection and lets ACME renewals swap certificates live; tested in crates/edge. Risk: the Pingora README labels it "rustls(experimental)", and the cert callback API is not available on rustls. Mitigation: the diff suite now, then testssl.sh/h2spec in phase 4. Fallback: the openssl feature, a change local to crates/edge/src/lib.rs and tls.rs. [S github.com/cloudflare/pingora README; pingora-core 0.9.1 src/listeners/tls/rustls] [J]

  2. Rust ACME crate for Let's Encrypt — maintenance status; pick and justify. (phase 1) Answer: instant-acme 0.8.5 (djc/instant-acme; release 2026-02-24, ~1.5 M recent downloads). It is a plain RFC 8555 client with rustls/ring and rcgen, and edge keeps control of HTTP-01, storage and renewal. rustls-acme and tokio-rustls-acme (also maintained) own the TLS acceptor, which conflicts with Pingora's listener. acme2 (last release 2022) and acme-lib (2024) are stale. Verified end to end against Pebble 2.6 only, not against LE staging. [S crates.io API 2026-11-07] [J]

  3. Does Pingora build on Windows? If not, develop in WSL2 and note it in CLAUDE.md. (phase 1) Answer: it compiles and the unit tests run on Windows (MSVC, Rust 1.99), but the README calls Windows support "preliminary by community's best effort only". Unix-only parts include graceful upgrade, the in-process runner and the integration tests. Caddy and Pebble are not on this Windows box. So the edge integration tests, the diff suite and the ACME test run in WSL2 Debian, as noted in CLAUDE.md. One gotcha: libz-ng-sys's CMake build fails under a very deep CARGO_TARGET_DIR (MSBuild path length). [S github.com/cloudflare/pingora README; local builds 2026-11-07]

  4. Pingora graceful reload behaviour under load. (phase 2) Answer: no Pingora graceful upgrade for config changes; edge swaps its config in process. A reload builds a complete new runtime from the config file (secrets, certificates, share-link key) and installs it with one atomic pointer swap (arc-swap); listeners, TLS sessions and keep-alive connections are untouched, each request keeps the runtime it started with, and the next request on the same connection uses the new one. A config that fails to build is refused and the old one keeps serving; listen addresses change only with a restart. Control triggers it through edge's admin Unix socket (mode 0660, never a TCP port) as a trial that edge reverts by itself unless control confirms it in time, so a control crash mid-apply cannot strand edge on an unverified config. Pingora's graceful upgrade (new process takes the listening sockets, old one drains for the grace period) stays for binary upgrades only: it needs a second process and fd passing, and idle keep-alive connections on the old process are closed after the drain, which clients see as a reset on their next request; it was not measured. [J] Measured (crates/edge/tests/reload.rs, debug build, WSL2 Debian, 16 cores, one local upstream; alternating two configs that differ in a response header, POST /v1/reload every 100 ms, each client one TLS keep-alive connection sending requests back to back):

    Clients Duration Reloads Requests Errors Connection resets Connections that saw both configs p50 / p99 / max latency
    32 10 s 98 30,198 0 0 32/32 10.5 / 17.2 / 132 ms
    64 30 s 294 95,229 0 0 64/64 20.0 / 31.9 / 190 ms
    128 30 s 292 87,796 0 0 128/128 43.1 / 69.1 / 215 ms

    Reproduce: IANITOR_RELOAD_CLIENTS=64 IANITOR_RELOAD_SECS=30 cargo test -p ianitor-edge --test reload -- --exact unix::reload_under_load_drops_nothing --nocapture. Not measured: a release build, HTTP/2 clients, long-lived websockets across reloads (they keep the runtime they started with until they close), and Pingora graceful upgrade for comparison. [S local runs 2026-11-07]

  5. Authelia forward-auth endpoint and headers to mirror exactly. (phase 1) Answer: GET /api/authz/forward-auth (ForwardAuth implementation; legacy /api/verify not used). Edge sends X-Forwarded-Method, -Proto, -Host, -URI (required) and X-Forwarded-For, and always sets them itself. It also forwards the client's headers (Cookie, Authorization) without hop-by-hop headers or body. A 2xx answer copies Remote-User, Remote-Groups, Remote-Email and Remote-Name onto the request (client copies removed). Any other answer (302 portal, 401 + WWW-Authenticate, 403) goes back to the client verbatim. An unreachable, silent (10 s deadline), oversized (>1 MiB), broken or 101 auth answer fails closed with 502; 1xx heads are skipped. Client-sent Remote-* headers are always stripped on forward-auth hosts, whatever copy_headers says. This mirrors caddy adapt output for Authelia's documented forward_auth snippet; tested against a mock, not a real Authelia. [S authelia.com/reference/guides/proxy-authorization, authelia.com/integration/proxies/caddy]

  6. Custos CSR-signing operation with match-code approval. (phase 3) Answer: Custos has none (desktop 0.8.0, CustosPublic v0.13.0). Its sign op signs only minisign, SHA256SUMS manifests, Authenticode digests and deploy approvals, refuses any request against domi-root (the RSA-3072 Authenticode root), and no path takes a CSR. Its server reach is the factor-service sign mailbox (POST /api/sign/requests, Bearer sign token, answers sealed to a one-time X25519 key, 5-minute match-code card on the PC with a push to the phone). So, per §6: the operation is written as a ticket, custos-ticket.md (a new key domi-pki-root, ECDSA P-256; a sign kind x509_csr through the same mailbox that builds the intermediate from a fixed profile and takes only the CSR's key and CN; the match code computed from the CSR on both screens), not filed. Until then the intermediate is signed by hand on the offline machine with openssl (pki.md; Mark accepted it as a §4 exception, 2026-11-07) and device certificates are approved on the server with sudo -u ianitor-control ianitor-control pki approve <code> (Q5). API tokens: Custos stores them as "Local app credential" items with a domi-ref; the intended import is Provisio's offer (the server seals the value to the PC's key and Mark accepts a match-code card), or copy and paste in the item editor. [S Custos docs/09_signing.md, 07_domi_identity.md, 10_provisio.md, apps/desktop/src-tauri/src/signing.rs] Configuration_Server findings (domains, Caddy, sops-nix secrets, the two trial hosts): deploy/beside-caddy.md. Mark, 2026-11-08: production runs Authelia, configured outside Configuration_Server, so forward-auth stays (the admin UI host must be behind it; control refuses the ui-proof header on any other host); the trial hosts flowers.stage and esp32.stage on the hyperv-infra mirror are confirmed; and changes keep working while Caddy serves (applies, Undo and Restore are loaded into Caddy through its admin socket, watched through Caddy and reverted by reloading the previous caddy.json; only share links are off).

  7. Red Panda Network donation route for a non-US individual and the receipt they issue. (phase 4, Mark) Proposed answer, pending Mark's confirmation (2026-11-10): once a year, a one-time gift in USD through RPN's online donation form, by card, as an individual; RPN's online gifts come with a receipt "for your records" by e-mail, naming RPN as a US 501(c)(3) (EIN 26-1103671). For a larger sum, RPN's 2024 sponsorship sheet also names bank transfer and check; the transfer details are not on the website and come from the US office (info@redpandanetwork.org, +1 503 662 8130; mail: 5 Centerpointe Drive, Suite 400, PMB16970706, Lake Oswego, OR 97035; an older address in Eugene, OR still appears on the planned-giving page). Nothing on the site addresses donors outside the US: no other currency, no non-US receipt. The receipt is a US tax document; for a Czech donor a gift to a charity seated outside the EU/EEA is, as far as found, not deductible under §15 of the Czech income tax act (not confirmed by a source that says so directly; ask the tax office if it matters). RPN's crypto route via Every.org could not be checked (Every.org answered 429), and one third-party listing says Every.org does not take gifts for RPN now. Publishing: the e-mailed receipt, personal data blacked out, under docs/support/receipts/ with a line in docs/support.md. Also found: RPN runs its own "Adopt a red panda" programme (from USD 60, certificate by e-mail, receipt issued); docs/support.md says the project's model is not that programme. Before the first remittance, Mark should e-mail info@redpandanetwork.org to confirm that a receipt is issued to a non-US individual and ask for transfer details. [S redpandanetwork.org/donate, /adopt, /contact-us, /sample-language-for-your-will-or-trust; RPN_Partnership-Sponsorship_Features_and_Benefits_2024 (redpandanetwork.org/files/galleries, as quoted by search; the PDF's text could not be extracted here); gofundme.com/charity/red-panda-network (501(c)(3), EIN); a 2017 RPN e-mail receipt via Classy (receipt number, amount, date, tax line); finance.cz and vskp.vse.cz on Czech gift deductions] [J]

9. Status

Phase State Notes
1 Core and engine Done Merged to main 2026-11-07. Tests run in WSL2; ACME checked only against Pebble. The Let's Encrypt staging check moved to phase 3 (Mark, 2026-11-07).
2 Control plane Done Merged to main 2026-11-07 (PR 3): routes repo, journaled apply with trial/watch/revert, undo, restore, share links, API tokens, REST API + OpenAPI, --dev. Four QC rounds; every finding fixed or listed in Handover. Real Gitea, systemd credentials and Authelia not exercised.
3 Web UI, PKI, NixOS Built and merged; Done criteria pending Mark Merged to main 2026-11-08 (PR 5): web UI (murex palette), Domi CA and device mTLS, UI sign-in behind Authelia, runtime engine switch with changes under Caddy, NixOS flake, module and VM tests. Click smoke test green. Not yet done: VM tests run on a KVM host, Mark's nixos-rebuild on the staging mirror, deploy/test-access.sh there, the LE staging check.
4 Hardening and release Started: the release kit A v* tag's Gitea release carries the notes and screenshots of the web UI under a signed SHA256SUMS (docs/release.md, 2026-11-09). The rest of phase 4 is not started; known gaps carried here: see Handover.

10. Handover

(Rewritten at the end of every session: what changed, what was not verified, which build is deployed, the next step.)

2026-11-17: The Domi CA moved to the shared crate domi-pki (Fabrica docs/32_coherence.md, T3a).

  • Changed: crates/core/src/pki.rs is now Ianitor's view of domi-pki v1.0.0 (git tag in Cargo.toml): the same public API, the same error messages and the same encrypted-key format (which stays here: it is Ianitor's storage). Fabrica issues Legatus agent certificates from the same crate under a second intermediate. deploy/nixos/package.nix gets cargoLock.outputHashes."domi-pki-1.0.0" (the NAR hash of the tag's tree, computed with a script checked against a known flake.lock narHash). core no longer depends on rcgen, x509-parser and time directly.
  • Verified: Rust on Windows only (WSL2 Debian has no disk: E:\WSL\Debian\ext4.vhdx is missing): core 103 (pki 15, unchanged tests), control 21, edge 31 and diff 2 (the Linux-only targets are skip stubs there), testkit 1: the same counts as before the move.
  • Not verified: nix build .#ianitor, nix flake check, the Linux-only Rust suites.
  • Deployed: nothing.
  • Next step: T4 (its own session) runs the Linux suites and the Nix build first.

2026-11-09: Release notes and screenshots for Fabrica.

  • Changed: .fabrica/artifex/release.yaml (on a v* tag, Windows runner: version check, web check and tests, fabrica notes, the screenshots, Custos approval, publish to the tag's Gitea release with sums: domi-release); apps/web/scripts/shots.mjs (the built UI against the demo control plane apps/web/tests/demo.ts, invented data, headless Edge over DevTools: aula-hosts, -host, -engine, -history, -certificates.png and aula.json); apps/web/tests/demo.test.ts (each shot drawn from the demo alone, and nothing in it outside .test and the documentation address ranges); mockApi.ts exports its builders and routes for the demo; scripts/check-version.mjs; .fabrica/notes/0.1.0.md (the first release's highlights). docs/release.md says how. app.yaml is unchanged (no aula: true, so no landing page; no desktop part: Ianitor has no installer).
  • Verified: fabrica artifex check 0 problems; fabrica notes (whole history; PR 3 to 5 come out as bare "PR #n", hence the highlights); the shots script 9 runs (one browser start timed out, before the retry was added), each PNG looked at; vitest 21 (smoke 15, demo 6), svelte-check clean. Rust on Windows only (WSL2 Debian would not start: HCS_E_CONNECTION_TIMEOUT): core 103, control 21, edge 31 and diff 2 (the Linux-only targets are skip stubs there), testkit 1; no Rust file changed.
  • Deployed: nothing; no tag, no run.
  • Next step: Mark tags v0.1.0, starts release at it, then Deploy as before.

2026-11-08: Ianitor declared to Fabrica.

  • Changed: .fabrica/app.yaml (a server part, flake input ianitor) and .fabrica/artifex/deploy.yaml (approve, then deploy: ianitor), so Fabrica's Apps screen shows an Ianitor card with Deploy. fabrica artifex check: 0 problems.
  • Deployed: nothing; no deploy was started.
  • For Mark, before the card's Deploy can work: the server flake needs the ianitor input (the patch in docs/deploy/configuration-server.patch; with rev= pinned, nix flake update ianitor cannot move it, so drop the rev= once the first lock is reviewed), and ianitor in services.fabrica-artifex.deploy.inputs (Fabrica docs/04_deploy.md) with its health URL.

2026-11-08: Phase 3, web UI, PKI, NixOS.

  • Changed:
    • apps/web and packages/ui: Svelte 5 UI from the designer's hand-off (docs/ui-handoff.md, decisions in docs/ui-decisions.md), murex palette, self-hosted fonts, no outside requests (CSP). vitest click smoke test for every §4 flow, with the accepted 4th clicks.
    • Domi CA in core and control (docs/pki.md): ECDSA P-256; root made offline by ianitor-control ca init; intermediate key encrypted at rest; server certificates 90 days, device certificates 1 year and never past the intermediate; control refuses to start with a private key it does not expect in its state dir. Device mTLS in edge and Caddy (device_certs hosts, allow list, 421 on SNI/Host mismatch).
    • §8.6 answered: Custos has no CSR signing; ticket written (docs/custos-ticket.md, not filed); interim manual openssl signing and pki approve on the server.
    • UI sign-in (G14): a per-boot ui-proof secret that only the admin host behind Authelia sends; control trusts Remote-User only with it.
    • Engine switch at runtime through polkit (start/stop of exactly two units). Changes keep working under Caddy: trials loaded through its admin socket, watched by probing upstreams with edge's rules, reverted by control, a deadline guard unit, or ExecStopPost after a crash. Share links are off under Caddy.
    • Test hooks moved behind the default test-hooks feature; the Nix release build is checked to contain none.
    • flake.nix (.#ianitor, .#ianitor-web, nixosModules.ianitor), deploy/nixos with four VM tests, deploy/test-access.sh; docs/deploy/configuration-server.patch and beside-caddy.md (flowers.stage and esp32.stage on the staging mirror, the LE staging check).
    • Tests: core 103, edge 57, control 75, diff 4, testkit 1 (240); vitest 15; svelte-check clean; hook self-test 55. Four QC rounds and two design reviews; every finding fixed or listed below.
  • Deployed: nothing. The server is unchanged. The prepared change is docs/deploy/configuration-server.patch; Mark runs it (beside-caddy.md).
  • Not verified:
    • The four NixOS VM tests: written and their drivers build, but never run (no /dev/kvm in WSL2).
    • Real systemd, polkit, LoadCredential, Authelia, Gitea push and Caddy under systemd; the module against hyperv-infra's nixpkgs 24.11.
    • The caddy guard retrying a failed load (code reading only).
    • PKCS#12 (AES-256) install on older iOS and macOS; a screen reader; a real clipboard copy in Chrome, Firefox and iOS Safari.
    • https upstreams: Caddy-path probes use the system CA bundle; not compared with Pingora's roots.
  • Known gaps for later phases:
    • Edge beside Caddy listens on loopback TCP, so any local process could forge X-Forwarded-For; trustedProxies stays off there. A Unix-socket listener is the fix. (phase 4)
    • Control on a Unix socket only edge can reach (G14 option b). (phase 4)
    • Share links under Caddy need a validator Caddy calls via forward_auth. (before v1.1)
    • "All hosts answered" after a switch is not claimed: control does not check every host.
    • A revocation during an engine switch reaches the engine at the end of the switch (or by the 2 s retry), not at once.
    • The open apply_sequence flake from phase 2 has not recurred, but its cause is still unknown.
  • Decided by Mark (2026-11-07/08): the share link on a host with links off keeps 4 clicks; UI sign-in by a secret header from edge; the switch to Caddy is allowed with differences shown; share links off under Caddy for v1; device approval falls back to pki approve; manual intermediate signing is a §4 exception; device certificates last 1 year; confirmations on Stop all and Revoke; hidden tabs stop polling after 15 minutes; token lifetime choice; "Open to anyone" chip; production runs Authelia outside Configuration_Server; trial hosts flowers.stage and esp32.stage; changes keep working under Caddy.
  • Still open:
    • Mark: add hyperv-infra/ianitor/domi-root.crt (made offline), apply the patch with the merged commit hash, deploy to the staging mirror, run deploy/test-access.sh, then the LE staging check (it needs a new public name on production).
    • Run the VM tests on a machine with KVM (nix flake check).
    • (e) Delete F:\pwt and the merged remote branches.
  • Next step: Mark's staging deploy and the VM tests close Phase 3; then Phase 4.

2026-11-07: Phase 2, control plane (kept for its open items).

  • Changed:
    • Phase 2 on branch control/phase-2: crates/control (routes repo through the git binary, journaled apply with edge trial reloads, 60 s watch and revert, undo/redo, restore, push with retry, share links, API tokens, REST API with OpenAPI, --dev), edge in-process reload over an admin Unix socket, share-link checks and visitor pages in edge, share tokens and the exact hosts/<hostname>.toml loader in core.
    • docs/api.md (curl examples, run end to end against --dev) and docs/ui-api.md (the designer's contract for phase 3, with the deviations listed at its end).
    • §8.4 answered with load numbers. Tests: core 86, edge 43, control 42, diff 3 (diff after each of six applies: 0 new differences), testkit 1; hook self-test 55.
    • Four QC rounds. Fixed along the way: password-throttle flush, CLI revoke lost to a server write, a pause lost on a full disk (three variants), revocation epoch rollback, Unicode and encoded .. escapes in share paths, credentials echoed in errors, a port race in the test harness.
  • Deployed: nothing. The server is unchanged and no nixos-rebuild is needed.
  • Not verified:
    • Push to the real Gitea over HTTPS (askpass) — a local bare repo stood in.
    • systemd LoadCredential (a credentials-dir override stood in); a real Authelia (mock only).
    • A release build, HTTP/2 clients and websockets across reloads; Pingora graceful upgrade (kept for binary upgrades only, not measured).
    • A lost confirm answer from edge is tested only indirectly (edge stopped during the watch, not a late answer).
    • Everything from the phase 1 list below that is still open.
  • Known gaps for later phases:
    • Share links work only on Pingora; under the Caddy fallback a visitor gets the normal sign-in (G7, phase 3).
    • The "site not reachable" visitor page is not built: it needs a matching Caddy handle_errors to keep the diff suite equal.
    • The crash and write-failure test hooks (IANITOR_TEST_CRASH_AT, IANITOR_TEST_FAIL_WRITE) are in the release binary, gated only by environment; move them behind a default feature that the Nix release build turns off. (phase 3)
    • Control trusts only API tokens; forwarded Remote-User headers get 401 until the UI sign-in is designed (G14, phase 3).
    • Edge config is version 2; a phase-1 edge refuses it.
    • Workspace rust-version is now 1.89 (File::lock).
    • One open flake: in one full run apply_sequence timed out waiting for Caddy on the chunked-body case (Ianitor answered 200). The diff suite alone passed 5/5 afterwards; cause not found.
  • Decided by Mark (2026-11-07):
    • (a) Let's Encrypt staging moves to phase 3, run on the first low-risk host beside Caddy.
    • (b) The engine is switched at runtime by control (§3, §4); §1.6 corrected.
    • (c) The 4th click for copying an API token and for installing a device certificate is accepted (§4).
    • (d) The murex palette is approved; CLAUDE.md now says "dark Domi theme, murex palette".
    • (f) The share-link deny list stays a separate file outside git (§3 updated).
    • (g) §3 now describes the password as mixed into the MAC, with no hash in the token.
    • (h) Phase 2's growth to the UI API contract is accepted (§6 Phase 2 note).
  • Still open:
    • The phase 1 click note also listed "share link on a host with links off" as needing a 4th click; not yet decided.
    • (e) Delete the stray build folder F:\pwt, and the merged remote branches docs/bootstrap, core/phase-1 and control/phase-2.
  • Next step: Phase 3, starting with §8.6 (Custos CSR signing) and the Let's Encrypt staging check.

2026-11-07: Phase 1, design draft (kept for its open items).

  • Changed:
    • Phase 1 on branch core/phase-1: workspace, .githooks/pre-commit, crates/core (schema and both compilers), crates/edge (Pingora with rustls), tests/diff (60 cases against Caddy 2.11.7), tests/support.
    • Reviewed by a separate QC pass, two rounds; every finding fixed or listed below.
    • §8 answers 1, 2, 3 and 5 recorded.
  • Deployed: nothing. The server is unchanged and no nixos-rebuild is needed.
  • Not verified:
    • Let's Encrypt staging; ACME renewal; Caddy's ACME config.
    • A real Authelia (mock only).
    • HTTPS upstreams against the system roots.
    • HTTP/2 client paths; a DNS change while edge runs.
    • The hook on bash 3.2 (it refuses to run there).
  • Known gaps for later phases:
    • Slowloris: the header read has no overall deadline; Caddy closes the connection at 60 s, edge keeps it past 90 s. (phase 4)
    • Timed-out DNS lookups keep a blocking-pool thread busy until glibc gives up. (phase 4)
    • Divergences KD-4 to KD-10 compare status only.
    • The plain-HTTP listener answers only the first of pipelined requests.
    • The <hostname>.toml check looks at the base name only. (phase 2 loader)
    • On Windows the Linux-only test targets show "1 passed" (a skip test).
    • CLAUDE.md lists packages/ui, tests/fuzz, deploy/nixos, the flake and deploy/test-access.sh, which do not exist yet. (phase 3/4)
  • Needs Mark:
    • (a) Let's Encrypt staging: defer or give a domain.
    • (b) §1.6 says an engine change needs a rebuild, but §3 and §4 let control switch engines at runtime. Which one holds?
    • (c) §4 click counts: share link with links off, device-cert install and saving an API token each need a 4th click.
    • (d) Approve the "murex" palette, and whether CLAUDE.md's "dark Domi theme" wording should change.
    • (e) Delete the stray build folder F:\pwt.
  • Next step: Phase 2, control plane. Resolve §8.4 (graceful reload under load) first.