Language

How testing and acceptance are done

Three tiers of commit gates, four acceptance chains that start real processes, and a rule that every criterion must go through mutation validation.

The confidence to ship to production is not "we are careful"; it is that every criterion can be proven to go red. The process has three layers: gates that run automatically before commits, an acceptance chain that actually starts the binary, and the rules for writing criteria themselves.

Commit gates: three tiers, increasing coverage

The fast gate runs before every commit via versioned hooks: code formatting, dependency manifest consistency, build, static checks, script syntax, line-ending conventions, frontend unit tests. It deliberately excludes the frontend build and the full test suite — trading coverage for speed is an explicit trade-off.

The full gate adds on top: the whole-repo Go tests, race detection, dependency vulnerability scanning, frontend build.

The release gate needs Linux, root and systemd, and validates the install-upgrade-rollback chain itself.

Here is a lesson learned the hard way: the CI declaration file in this repo never executes (local git, no remote). Only the three tiers above actually run, so anything "written in CI" is not evidence.

The acceptance chain that starts real processes

The backend browser chain: start the real binary, actually click through the install wizard and login, open each sidebar entry one by one, requiring zero console errors and no unexpected 4xx after login; then walk an operations flow (create draft → confirm publish → edit body → fetch on the frontend), and finally run a text-contrast audit on the whole screen, measured once in each of the light and dark modes.

The translation chain: run the full translation chain against a fake provider that only listens on loopback — deterministic, free, runnable every time, with dozens of assertions. There is also a chain that hits a real endpoint and spends real money; it is not run without explicit authorization.

The upgrade drill: run an old version's store with the current binary — build the tree from an old commit, initialize, seed content, then hand the entire data directory as-is to the new binary, and go through asking whether each backend manifest surface answers, whether content counts and public pages match. Unit tests cannot replace this: every module's migration tests run on stores they created themselves, and such stores are always structurally complete.

The recovery drill: walk through backup → shutdown → restore → restart. Its criterion is "content changed after archiving is swapped back, after recovery, to the old version from the archiving moment", not "the data is still there" — the latter also passes when recovery fails.

Rules for writing criteria

A guard that has never been proven to catch a problem is just decoration. So every new criterion gets a mutation validation before it goes out: deliberately break what it guards, confirm the corresponding test goes red, then restore byte by byte. This rule has caught plenty of "always green but asserting nothing" tests.

Second: the iteration domain is derived from the data source, not copied from a list. The day "there are 12 built-in panels" gets hard-coded in a test, when the registry grows to 19, 7 silently lose coverage while the tests stay all green.

Third: before a new reading lands, ask who reads it. An interface that is served while not one byte appears on the UI is not a feature; it is the next debt.

Fourth: dependency vulnerability scanning is a failure condition in the full gate, not a report. Toolchain patch versions are therefore a security constraint, not a preference — this site's shape is a single process connecting TLS and HTTP/2 directly, and there is no one else to block server-side triggerable standard-library vulnerabilities for us.

One more layer not written into tests

Fuzzing targets cover three key criteria areas — sanitization, scaffolding and the kernel — with a corpus seed of over three hundred entries, fully replayed on every full test run; nobody needs to remember to run it. The timing is also fixed: once after changing any criterion in these three packages, and before each release.

One sentence sums up this process's judgment standard: a test that is red but cannot say why it is red means the criterion is not finished yet.