build_tools.syllable_walk_web.services.profile_reaches_cache
IPC-backed cache for precomputed walker profile reaches.
This module provides a deterministic, run-directory-local cache for the
profile reach tables computed during /api/walker/load-corpus.
Cache goals: - Avoid recomputing profile reaches when corpus + walker settings are unchanged. - Keep each run directory self-contained as the source of truth. - Use pipeworks-ipc hashes so cache validity is explicit and auditable.
Cache file location:
<run_dir>/ipc/walker_profile_reaches.v1.json
Attributes
Classes
Result of attempting to read and validate a profile-reach cache. |
|
Canonical IPC fields extracted from one run's |
Functions
|
Return canonical cache path for one run directory. |
|
Return cache IPC hashes from disk, if present and valid. |
|
Read and validate cached profile reaches for a run. |
|
Write deterministic profile-reach cache for a run. |
Module Contents
- build_tools.syllable_walk_web.services.profile_reaches_cache.CACHE_SCHEMA_VERSION = 1
- build_tools.syllable_walk_web.services.profile_reaches_cache.CACHE_KIND = 'walker_profile_reaches'
- build_tools.syllable_walk_web.services.profile_reaches_cache.CACHE_FILENAME = 'walker_profile_reaches.v1.json'
- build_tools.syllable_walk_web.services.profile_reaches_cache.CACHE_SCHEMA_ID = 'urn:pipeworks:schema:walker-profile-reaches-cache:v1'
- build_tools.syllable_walk_web.services.profile_reaches_cache.MANIFEST_FILENAME = 'manifest.json'
- build_tools.syllable_walk_web.services.profile_reaches_cache.PROFILE_NAMES = ('clerical', 'dialect', 'goblin', 'ritual')
- class build_tools.syllable_walk_web.services.profile_reaches_cache.CacheReadResult[source]
Result of attempting to read and validate a profile-reach cache.
- status
One of
hit,miss,invalid,error,none.nonemeans cache is ineligible because required manifest IPC metadata is missing.
- profile_reaches
Populated only for
status == "hit".
- message
Optional short diagnostic used for debugging and tests.
- profile_reaches: dict[str, build_tools.syllable_walk.reach.ReachResult] | None = None
- class build_tools.syllable_walk_web.services.profile_reaches_cache.ManifestIPCInfo[source]
Canonical IPC fields extracted from one run’s
manifest.json.
- build_tools.syllable_walk_web.services.profile_reaches_cache.cache_path(run_dir)[source]
Return canonical cache path for one run directory.
- build_tools.syllable_walk_web.services.profile_reaches_cache.read_cached_profile_reach_hashes(run_dir)[source]
Return cache IPC hashes from disk, if present and valid.
This helper is intentionally lightweight and tolerant: malformed or missing cache files simply return
(None, None).
- build_tools.syllable_walk_web.services.profile_reaches_cache.load_cached_profile_reaches(*, run_dir, run_id, walker)[source]
Read and validate cached profile reaches for a run.
Validation gates: - manifest IPC metadata is present (hash authority) - cache file exists and parses - cache input payload/hash matches current run + walker settings - cache output payload/hash is internally consistent