Skip to main content

Module layout

Module layout 

Source
Expand description

On-disk cache-entry layout per CACHE-010, CACHE-012, and CACHE-013.

Pure path-computation helpers. None of these functions touch the filesystem; they translate a workspace-root path and a CacheKey into the canonical paths the cache uses to read and write entry data.

Layout tree under <workspace-root>/.haz/cache/:

.haz/cache/
`-- <shard>/                          (first two hex chars of key)
    `-- <hex-key>/                    (entry directory)
        |-- manifest.json             (CACHE-011)
        |-- stdout                    (CACHE-012)
        |-- stderr                    (CACHE-012)
        `-- outputs/
            `-- <hex-content-hash>    (CACHE-013, one per blob)

Constants§

MANIFEST_FILE_NAME
File name of the manifest within an entry directory (CACHE-011).
OUTPUTS_SUBDIR
Subdirectory holding output blobs within an entry directory (CACHE-013).
STDERR_FILE_NAME
File name of the captured stderr stream within an entry directory (CACHE-012).
STDOUT_FILE_NAME
File name of the captured stdout stream within an entry directory (CACHE-012).

Functions§

cache_root
Compute the cache root directory under workspace_root: <workspace_root>/.haz/cache.
entry_dir
Entry directory of key: <cache_root>/<shard>/<hex-key>.
manifest_path
Path to the manifest file of key’s entry.
output_blob_path
Path to a single output blob, keyed by its content hash (CACHE-013).
outputs_dir
Subdirectory holding output blobs of key’s entry.
restore_staging_dir
Staging directory used by restoration (CACHE-019, CACHE-020): blob bytes are written here first, then renamed onto their workspace-absolute targets so a partial publish is detectable and contained.
shard
The shard component of key per CACHE-010: the first two lowercase hexadecimal characters of the key.
shard_dir
Shard directory under cache_root: <cache_root>/<shard>.
stderr_path
Path to the captured stderr file of key’s entry.
stdout_path
Path to the captured stdout file of key’s entry.
tmp_entry_dir
The name of the two-phase-store tmp directory for key with the caller-supplied random_suffix, per CACHE-017: .tmp-<hex-key>-<random>. The caller chooses the random suffix; the layout helper only joins it into the canonical shape so concurrent stores of the same key on the same shard do not collide.