build_tools.syllable_walk_web.services.session_paths
Path helpers for walker IPC session and patch-output artifacts.
This module centralises filesystem path conventions for upcoming Patch A/B session persistence features. It intentionally contains no IO side effects: callers decide when to create directories or write files.
Attributes
Functions
|
Resolve the directory used for persisted walker session files. |
|
Return the canonical IPC subdirectory for one run directory. |
|
Build the canonical path for one patch-output sidecar artifact. |
|
Build the canonical filename for one saved dual-patch session. |
Module Contents
- build_tools.syllable_walk_web.services.session_paths.PatchKey
- build_tools.syllable_walk_web.services.session_paths.PatchOutputKind
- build_tools.syllable_walk_web.services.session_paths.PATCH_KEYS: tuple[PatchKey, Ellipsis] = ('a', 'b')
- build_tools.syllable_walk_web.services.session_paths.PATCH_OUTPUT_KINDS: tuple[PatchOutputKind, Ellipsis] = ('walks', 'candidates', 'selections', 'package')
- build_tools.syllable_walk_web.services.session_paths.resolve_sessions_base(*, output_base, configured_sessions_base=None)[source]
Resolve the directory used for persisted walker session files.
Resolution policy:
Use
configured_sessions_basewhen provided.Otherwise derive
<output_base>/sessions.
- Parameters:
output_base (pathlib.Path) – Active output root configured for this server instance.
configured_sessions_base (pathlib.Path | None) – Optional explicit sessions directory override.
- Returns:
Normalized absolute path for session file storage.
- Return type:
- build_tools.syllable_walk_web.services.session_paths.run_ipc_dir(run_dir)[source]
Return the canonical IPC subdirectory for one run directory.
- build_tools.syllable_walk_web.services.session_paths.patch_output_sidecar_path(*, run_dir, patch, artifact_kind, schema_version=1)[source]
Build the canonical path for one patch-output sidecar artifact.
- Example::
<run_dir>/ipc/patch_a_walks.v1.json
- build_tools.syllable_walk_web.services.session_paths.session_file_path(*, session_id, output_base, configured_sessions_base=None)[source]
Build the canonical filename for one saved dual-patch session.
- Parameters:
session_id (str) – Opaque session identifier.
output_base (pathlib.Path) – Active output root configured for this server instance.
configured_sessions_base (pathlib.Path | None) – Optional explicit sessions directory override.
- Returns:
Absolute path to
<sessions_base>/<session_id>.json.- Return type: