eval-smoke: own-vps-gateway + seed-community drvPath baselines drift (non-deterministic generated cert embedded at eval?) — pre-existing, surfaced by #925 #935

Closed
opened 2026-08-28 08:03:31 +00:00 by matou-build-agent · 1 comment

Symptom

The IDSS_EVAL_SMOKE=1 gates TestSeedCommunity_EvalSmoke (private/VM) and TestOwnVPSGateway_EvalSmoke (self-hosted) FAIL at their assertDrvPathBaseline check:

seam...: baseline: scope "own-vps-gateway" drifted from testdata/drvpath-baseline.txt.
  gateway:
    old /nix/store/…-nixos-system-gateway-26.11.20260612.173d0ad.drv
    new /nix/store/…-nixos-system-gateway-26.11.20260612.173d0ad.drv

The eval itself PASSES (own-VPS gateway eval smoke passed, #414 closure asserts passed) — only the committed drvPath baseline mismatches. TestRentedGateway_EvalSmoke is unaffected (green).

This is pre-existing, not a regression

Found while proving #925 (git+file:// swap). Confirmed on stock main with the #925 changes stashed: TestOwnVPSGateway_EvalSmoke reds with the identical own-vps-gateway drifted baseline failure. #925 does not touch committed-rev evals (flakeRef(dir, rev) is byte-identical before/after), so the drift is independent of it.

Likely cause (unconfirmed — for this ticket to settle)

The two drifting scopes carry a kanidm-tls generator whose public material (the self-signed CA cert) is generated fresh per clan vars generate and embedded at eval into the toplevel derivation. A random keypair per run ⇒ different embedded bytes ⇒ different drvPath every run — which would make these two baselines inherently non-deterministic (note the observed drvs differ run-to-run, e.g. z0m98ph3… vs ikdislmp5… across two runs of the same test). The rented scope not drifting is consistent with a different (non-embedded) shape.

Why a session

Diagnosing needs a real clan run (nix + clan-core, IDSS_EVAL_SMOKE=1): run the eval-smoke twice and diff the two toplevel closures to confirm the varying input, then decide whether to (a) pin the generated cert deterministically for the smoke, (b) drop the embedded-cert scope from the drvPath baseline while keeping the toplevel eval + closure asserts, or (c) re-baseline against a fixed seed. The test explicitly forbids blind IDSS_EVAL_SMOKE_UPDATE=1 re-baselining, so a real fix is owed.

Filed from the #925 session under ADR 0174 as an out-of-scope observation.

## Symptom The `IDSS_EVAL_SMOKE=1` gates `TestSeedCommunity_EvalSmoke` (private/VM) and `TestOwnVPSGateway_EvalSmoke` (self-hosted) FAIL at their `assertDrvPathBaseline` check: ``` seam...: baseline: scope "own-vps-gateway" drifted from testdata/drvpath-baseline.txt. gateway: old /nix/store/…-nixos-system-gateway-26.11.20260612.173d0ad.drv new /nix/store/…-nixos-system-gateway-26.11.20260612.173d0ad.drv ``` The eval itself PASSES (`own-VPS gateway eval smoke passed`, `#414 closure asserts passed`) — only the committed drvPath baseline mismatches. `TestRentedGateway_EvalSmoke` is unaffected (green). ## This is pre-existing, not a regression Found while proving #925 (git+file:// swap). Confirmed on **stock main** with the #925 changes stashed: `TestOwnVPSGateway_EvalSmoke` reds with the identical `own-vps-gateway drifted` baseline failure. #925 does not touch committed-rev evals (`flakeRef(dir, rev)` is byte-identical before/after), so the drift is independent of it. ## Likely cause (unconfirmed — for this ticket to settle) The two drifting scopes carry a kanidm-tls generator whose **public** material (the self-signed CA cert) is generated fresh per `clan vars generate` and embedded at eval into the toplevel derivation. A random keypair per run ⇒ different embedded bytes ⇒ different drvPath every run — which would make these two baselines inherently non-deterministic (note the observed drvs differ run-to-run, e.g. `z0m98ph3…` vs `ikdislmp5…` across two runs of the same test). The rented scope not drifting is consistent with a different (non-embedded) shape. ## Why a session Diagnosing needs a real clan run (nix + clan-core, `IDSS_EVAL_SMOKE=1`): run the eval-smoke twice and diff the two toplevel closures to confirm the varying input, then decide whether to (a) pin the generated cert deterministically for the smoke, (b) drop the embedded-cert scope from the drvPath baseline while keeping the toplevel eval + closure asserts, or (c) re-baseline against a fixed seed. The test explicitly forbids blind `IDSS_EVAL_SMOKE_UPDATE=1` re-baselining, so a real fix is owed. Filed from the #925 session under ADR 0174 as an out-of-scope observation.
Author
Member

Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible test-infra + baseline change, proven by paired eval-smoke runs on this host (nix 2.35.1) and a nix derivation show diff.

What it was — two causes, not the ticket's one

The ticket's hypothesis (a public kanidm CA minted per run and embedded at eval) is wrong: kanidm-tls's ca is declared secret (vmguest.go:541) — a lazy sops path, never readFile'd at eval. The only readFile'd public CA is the private-path front-door-tls (frontdoor.go:611), which the drifting public own-vps-gateway scope never renders, and which the private seed-community scope never generates. So neither drift came from where the ticket looked.

What actually happened, proven empirically:

1. seed-community — deterministic drift (stale baseline). It never runs clan vars generate, so its closure is a pure function of the committed render. Two smoke runs produced identical drvPaths (fleetgw = rymn48… both times; gateway = n26azx…, already matching baseline). The fleetgw closure legitimately evolved across ~25 commits since the #473 baseline (IDIP identity stack #771/#778, files/Nextcloud #788/#790, gate-oidc #628/#644, …) while these IDSS_EVAL_SMOKE tests never run in CI (no Nix sandbox), so nobody re-baselined. → Re-baselined fleetgw under IDSS_EVAL_SMOKE_UPDATE=1 (a deliberate, diagnosed re-baseline, not a blind one — the social rule is satisfied).

2. own-vps-gateway — inherent non-determinism. It does run clan vars generate, minting fresh random secrets every run. Two runs gave j7ssp44… then xnkzcm…. nix derivation show on both toplevels isolated the delta to exactly six sealed-secret store sources — kanidm-tls_{ca,cert,key}, kanidm-admins_{admin,idm_admin}, gate-oidc_secret — which ride the machine's /etc activation manifest into system.build.toplevel. Every generation reseals them with new randomness, so no committed drvPath can ever hold, and the baseline signal (a render silently re-deriving a machine) is permanently drowned by secret churn. → Dropped the own-vps-gateway row + its assertDrvPathBaseline call (ticket option b). The scope keeps a stronger guard for a secret-bearing config anyway: the toplevel eval, the #454 control-plane assertions, and the #414 reachable-closure asserts — all still fire green.

What landed

  • internal/clan/seedcommunity_eval_test.go — removed the own-vps-gateway assertDrvPathBaseline call; comment explains the secret-churn reason.
  • internal/clan/testdata/drvpath-baseline.txt — fleetgw row updated, own-vps-gateway row removed; header now records which scopes are baselineable (only secret-free ones).
  • internal/clan/drvpath_baseline_test.go — baseline header const documents the rule.
  • docs/GOTCHAS.md — #112 (a vars generate scope can never carry a drvPath baseline).
  • STATUS.md — header.

Proof

  • TestSeedCommunity_EvalSmoke — PASS (baseline: scope "seed-community" matches … (2 machines)).
  • TestOwnVPSGateway_EvalSmoke — PASS (eval + #454 guards + #414 closure asserts all green; no baseline assert).
  • Full internal/clan suite (CI, no nix) — green, incl. the baseline unit tests. go build ./... clean.

Commit 1fc2d968 on main.

**Ruled by agent under ADR 0174 — veto anytime.** Two-way door: a revertible test-infra + baseline change, proven by paired eval-smoke runs on this host (nix 2.35.1) and a `nix derivation show` diff. ## What it was — two causes, not the ticket's one The ticket's hypothesis (a **public** kanidm CA minted per run and embedded at eval) is **wrong**: `kanidm-tls`'s `ca` is declared **secret** (`vmguest.go:541`) — a lazy sops path, never `readFile`'d at eval. The only `readFile`'d public CA is the **private-path** `front-door-tls` (`frontdoor.go:611`), which the drifting public `own-vps-gateway` scope never renders, and which the private `seed-community` scope never *generates*. So neither drift came from where the ticket looked. What actually happened, proven empirically: **1. `seed-community` — deterministic drift (stale baseline).** It never runs `clan vars generate`, so its closure is a pure function of the committed render. Two smoke runs produced **identical** drvPaths (`fleetgw` = `rymn48…` both times; `gateway` = `n26azx…`, already matching baseline). The `fleetgw` closure legitimately evolved across ~25 commits since the #473 baseline (IDIP identity stack #771/#778, files/Nextcloud #788/#790, gate-oidc #628/#644, …) while these `IDSS_EVAL_SMOKE` tests never run in CI (no Nix sandbox), so nobody re-baselined. → **Re-baselined `fleetgw`** under `IDSS_EVAL_SMOKE_UPDATE=1` (a deliberate, diagnosed re-baseline, not a blind one — the social rule is satisfied). **2. `own-vps-gateway` — inherent non-determinism.** It **does** run `clan vars generate`, minting fresh random secrets every run. Two runs gave `j7ssp44…` then `xnkzcm…`. `nix derivation show` on both toplevels isolated the delta to **exactly six sealed-secret store sources** — `kanidm-tls_{ca,cert,key}`, `kanidm-admins_{admin,idm_admin}`, `gate-oidc_secret` — which ride the machine's `/etc` activation manifest into `system.build.toplevel`. Every generation reseals them with new randomness, so **no committed drvPath can ever hold**, and the baseline signal (a render silently re-deriving a machine) is permanently drowned by secret churn. → **Dropped the `own-vps-gateway` row + its `assertDrvPathBaseline` call** (ticket option **b**). The scope keeps a stronger guard for a secret-bearing config anyway: the toplevel **eval**, the #454 control-plane assertions, and the #414 reachable-closure asserts — all still fire green. ## What landed - `internal/clan/seedcommunity_eval_test.go` — removed the `own-vps-gateway` `assertDrvPathBaseline` call; comment explains the secret-churn reason. - `internal/clan/testdata/drvpath-baseline.txt` — `fleetgw` row updated, `own-vps-gateway` row removed; header now records which scopes are baselineable (only secret-free ones). - `internal/clan/drvpath_baseline_test.go` — baseline header const documents the rule. - `docs/GOTCHAS.md` — **#112** (a `vars generate` scope can never carry a drvPath baseline). - `STATUS.md` — header. ## Proof - `TestSeedCommunity_EvalSmoke` — **PASS** (`baseline: scope "seed-community" matches … (2 machines)`). - `TestOwnVPSGateway_EvalSmoke` — **PASS** (eval + #454 guards + #414 closure asserts all green; no baseline assert). - Full `internal/clan` suite (CI, no nix) — **green**, incl. the baseline unit tests. `go build ./...` clean. Commit `1fc2d968` on `main`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#935
No description provided.