10.16 Manifests, checksums and output contracts
nlmx uses two complementary integrity records. The input manifest identifies bytes that entered the run; checksums.sha256 identifies bytes written through the output set before finalization.
Figure 10.7. Output paths are recorded as they are written, hashed at finish(), and listed in a checksum manifest that does not include itself.
Input manifest
The shared manifest JSON contains:
- engine version;
- run stem and input mode;
- configuration path and SHA-256;
- each discovered artifact's role, path and SHA-256.
This supports exact input comparison even when filenames are reused. Paths still matter operationally, but hashes distinguish content. The manifest proves what the program discovered and recorded, not that the inputs were scientifically appropriate.
Output checksum manifest
OutputSet::finish() iterates the recorded written files, computes each SHA-256 from disk and writes lines with the hash and relative path. It then reports a file count that includes checksums.sha256. The checksum file does not hash itself, avoiding a recursive definition.
Only files written through and recorded by that OutputSet are covered. A file copied into the directory afterward, an untracked writer or an interrupted command can fall outside the list. Verification therefore has two directions:
- every listed file exists and matches its hash;
- every expected run artifact is listed, and unexpected unlisted files are explained.
What SHA-256 establishes
Matching hashes provide strong evidence that bytes are identical. They do not establish who created the file, when it was created, whether it is scientifically correct, or whether an attacker replaced both data and checksum list. Authenticity requires an external trust mechanism such as a signed archive, controlled repository or validated records system.
Output contract
For automation, define required and optional files, schema/version expectations, stable keys, allowed missingness and checksum coverage. A command may conditionally omit plots when plotting is disabled or output no draft when no candidate is selected. “File absent” should be interpreted from that contract, not automatically as a failure.
Common mistakes
- Verifying listed hashes but ignoring unexpected unlisted files.
- Assuming a checksum proves scientific validity or authorship.
- Adding a figure after the run without updating the archive inventory.
- Treating an interrupted directory without
checksums.sha256as complete.
Checklist
- Verify input and output hashes with an independent tool.
- Compare actual files with the command-specific expected inventory.
- Protect the checksum manifest through an external trusted record.
- Record every post-run transformation as a new artifact.
Further reading
See input manifests, output hashes and archiving.