module-eval: cut the header to the new comment budget, drop the verdict note

mara set a 20-line comment maximum and scoped this file for the first pass.
Measured rather than eyeballed: this file had exactly one block over 20 — the
28-line header. Every other block in it is 8 lines or fewer, so the pass is
that header plus one removal.

The header keeps the four things a reader can act on — why this check exists,
assertion versus the absence class, name a case for the property it defends,
and evaluates-rather-than-executes with its stubbing rule — and loses the
connective prose around them.

The verdict-reading paragraph goes back out. It landed by a misclick on a PR
she meant to close, and the judgement is the one she gave its sibling: the
technique works, it just does not earn source space.

The lint still enforces 30. 208 blocks repo-wide exceed 20, so flipping MAX
belongs to the overhaul rather than to this file's pass.
This commit is contained in:
atlas 2026-09-02 00:54:09 +02:00 committed by mara
commit e4a22b4190

View file

@ -1,31 +1,22 @@
# `checks.module-eval` — the flake check that covers **nix**. # `checks.module-eval` — the flake check that covers **nix**.
# #
# Why this exists: every other check in ./checks.nix is a Rust # Every other check in ./checks.nix is a Rust derivation, so a `.nix`-only
# derivation, so a `.nix`-only diff moves no hash, every check is a # diff moves no hash and `nix flake check` goes green **without evaluating
# cache hit, and `nix flake check` reports green **without evaluating # what changed**. This derivation's hash is a function of the results
# what changed**. This one's derivation hash is a function of the # below, so a change that flips a property rebuilds it and fails naming it.
# evaluated *results* below, so a nix change that flips a property
# rebuilds it and the builder fails naming that property.
# #
# ## What belongs here, and what does not # Anything expressible as a module `assertion` **should be one instead** —
#
# Anything expressible as a module `assertion` **should be one instead**:
# an assertion fires at deploy time for a real operator, not only in CI. # an assertion fires at deploy time for a real operator, not only in CI.
# What cannot be an assertion is the **absence class** — "a hive that # What cannot is the **absence class**: "a hive that hasn't opted in
# hasn't opted in renders exactly what it did before", "this unit does # renders what it did before", "this unit does not exist unless X" — claims
# not exist unless X". Those are claims about the *rendered config* # about the rendered config rather than about a config being invalid.
# rather than about a config being invalid, so they need an evaluator.
# #
# ⚠️ **Cases are named by the PROPERTY they defend, never by the ticket # ⚠️ **Name a case for the PROPERTY it defends, never the ticket that
# that prompted them.** A case named after a ticket has the ticket's # prompted it**; a case named after a ticket has the ticket's lifetime.
# lifetime; a case named after a property lives as long as the property.
# #
# ⚠️ **This check evaluates. It does not execute.** Where the artifact is # ⚠️ **This evaluates, it does not execute** — a command line, a request or
# a command line, an HTTP request or a certificate, a value assertion # a certificate needs something that *runs* it. A case needing a rendered
# cannot stand in — those need something that *runs* them. And a case # file must stub what it drags in (`swarm.ui.package = pkgs.emptyDirectory`).
# that needs a **rendered file** must stub the packages that file drags
# in (`swarm.ui.package = pkgs.emptyDirectory`), or it costs a full
# frontend build to answer a question about a listen directive.
{ {
pkgs, pkgs,
lib, lib,
@ -571,13 +562,6 @@ in
# The results are embedded in the builder text on purpose: that is what # The results are embedded in the builder text on purpose: that is what
# makes this derivation's hash depend on them, so a nix-only change that # makes this derivation's hash depend on them, so a nix-only change that
# flips a case cannot be answered from cache. # flips a case cannot be answered from cache.
#
# It also means the verdict can be read without building anything, which is
# what makes mutation-testing a case affordable — mutate, re-read, restore,
# with nothing queued on the shared builder:
#
# nix derivation show .#checks.<system>.module-eval \
# | jq -r '..|.buildCommand? // empty'
pkgs.runCommand "hyperhive-module-eval" { } '' pkgs.runCommand "hyperhive-module-eval" { } ''
${report} ${report}
${ ${