The result cache on disk (design notes §7.3): one compact JSON file per mutated source file, under a directory named for the cache's globals.
cache/results/g-<16 hex of the globals' sha>/<16 hex of the file's sha>.jsonA shard holds the entries of the mutants of one source file, with what entries share written once and referred to by index:
sources-[file, content sha, [[function key, hash], ...]]: each footprint file at one content, with the functions any entry recorded in it. An entry'sfootprintis[[source index, [function index, ...]], ...];test_files-[file, hash]: an entry'stestsis[index, ...];tests-[id, module, name, file, line]: a result'stests(andkilled_by) is[[index, duration_ms, outcome], ...].
Reading a shard gives back exactly the entries written (encode/3, read/2). The
single-file cache this replaces held each entry's footprint hashes, file shas and
test references in full, once per entry, and was rewritten whole on every run
(157 MB on a large Phoenix app); a shard is rewritten only when its file's entries
change.
Summary
Functions
The directory of the shards written under globals, inside the cache path.
The JSON of the shard of source file's entries (by mutant key) under globals.
The shard of source file in dir.
The shard paths in dir of files, or every shard there with :all.
Removes, from the cache path, every shard directory but keep, and the format 1
file (path with .json): what other globals wrote can never be read again.
The entries of the shard at path (by mutant key), or none when it is missing,
unreadable, of another format or written under other globals.
Functions
The directory of the shards written under globals, inside the cache path.
The JSON of the shard of source file's entries (by mutant key) under globals.
The shard of source file in dir.
The shard paths in dir of files, or every shard there with :all.
Removes, from the cache path, every shard directory but keep, and the format 1
file (path with .json): what other globals wrote can never be read again.
The entries of the shard at path (by mutant key), or none when it is missing,
unreadable, of another format or written under other globals.