Feature Specification: Test Harness, Checks and Documentation
Created: 2026-09-22
Status: Implemented
Input: Reconstructed from the code at 0bf4ecd36 (core/testers/, core/checks/, core/checks/README.md, core/checks/ci.nix, core/docs/), pull requests #1210, #1790 and #1833, and the design notes of the maintainers.
User Scenarios & Testing (mandatory)
User Story 1 - Test a deployment end to end (Priority: P1)
A developer of core or of a front-end wants to prove that a deployment
works. The shared harness (lib.testers) starts the machines of a deployment
in a NixOS test (VMs or nspawn containers), deploys the applications with a
deployment method, and checks them.
Why this priority: the deployment programs change machines. Only an end to end test shows that they work.
Independent Test: run nix build ./core#checks.x86_64-linux.apps-tf. It
deploys the applications onto NixOS VMs and checks each one.
Acceptance Scenarios:
- Given the default configuration with the applications on, When
apps-tfruns, Then each application answers on its domain. - Given a front-end with its own deployment driver, When it uses
lib.testers, Then it gets the same machines and the same deployment steps ascore.
User Story 2 - Run one check by name, and route every check in CI (Priority: P1)
Each check has a name with a family prefix (apps-*, deployment-*,
integrations-*, contracts-*, test-*, nix-unit-*), a description, and
a CI runner route. A developer runs one check by name.
Independent Test: add a check without a route. The check annotation fails.
Acceptance Scenarios:
- Given a check name, When a developer runs
nix build ./core#checks.<system>.<name>, Then only that check builds. - Given a
nix-unitsuite, When CI runs, Then it builds the group check of the directory. The per-suite check stays available to run one suite.
User Story 3 - Read the documentation of core (Priority: P2)
A reader opens the core-docs site. It shows the concepts, the data model,
the operator configuration, the hosting resources, the attribute names of the
deployment programs, the module options and the reference of
lib/ from its doc comments.
Independent Test: build core-docs. The flake attributes page lists the
families of attributeFamilies.
Edge Cases
- An environment variable is documented next to the code that reads it. The docs take the description from its declaration, so they cannot go out of date.
Requirements (mandatory)
Functional Requirements
- FR-001:
coreMUST publish a test harness (lib.testers) that front-ends can use for their own end to end checks. - FR-002: The harness MUST take the modules and drivers of a front-end as parameters, and MUST NOT import a front-end.
- FR-003: Each check MUST have a family prefix, a description and a CI runner route.
- FR-004:
coreMUST build thecore-docssite from the pages underdocs/md/, the module options and the doc comments oflib/. - FR-005: The docs MUST take the names of the deployment programs from the same grammar that renders them.
- FR-006: The docs MUST include a guide that tells a hosting provider how to find and use the web UIs of a hosting-provider deployment.
- FR-007: The docs MUST tell a maintainer how to check a change without a deploy, how to deploy from CI and from a workstation, and where to find the deploy logs. A template MUST list each repository secret and variable that a CD job reads.
- FR-008: A unit test under
core/MUST importcore/default.nix, not the repository root entrypoint. A Nix file undercore/MUST NOT import the root entrypoint or refer to a path inapiorpanel(principle I). Thenix-unit-testers-leaf-boundarycheck finds a file that does.
Key Entities
- Check: a derivation under
checks, with a name, a description and a runner route. - Tester: the shared harness of the NixOS tests.
- Docs site: the
core-docspackage, published at core.pages.git.fediversity.eu.
Success Criteria (mandatory)
Measurable Outcomes
- SC-001: The
treefmt,core-docsandnix-unit-*checks pass. - SC-002: No check lacks a runner route.
Assumptions
- The heavy checks run on the CI runners, not on the machine of a developer.
Known Deviations
-
The VM tests
core/checks/apps/tf/nixosTest.nix,core/checks/apps/tf-incus/nixosTest.nixandcore/testers/apps-deployment.nixput the rootdefault.nixandflake.nixin theirsourceFileset. This is against FR-008. Thenix-unit-testers-leaf-boundarycheck allows these three files by name. The deployment needs the root entrypoint for these reasons (#2377):- The plan file of
core/effects/common/write-config.niximports the operator root and reads itsboundaryattribute. Only the rootdefault.nixdefinesboundary. core/setups/hosts-common.nixsetsroot-path = ../.., so the deployment refers to the repository root.- Windmill runs
nix develop .#operator-tf-incus-allin a root flake. core/components/hosting-provider/windmill/deploy-env.nixcopies the whole repository.
The three VM tests import their setups from
sourceTree(core/testers/nixosTest.nix), the store copy ofsourceFileset. Thus theroot-pathof the deployment holds only the staged files, and a change outsidesourceFilesetdoes not change the check. - The plan file of