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

PatchKey

PatchOutputKind

PATCH_KEYS

PATCH_OUTPUT_KINDS

Functions

resolve_sessions_base(*, output_base[, ...])

Resolve the directory used for persisted walker session files.

run_ipc_dir(run_dir)

Return the canonical IPC subdirectory for one run directory.

patch_output_sidecar_path(*, run_dir, patch, artifact_kind)

Build the canonical path for one patch-output sidecar artifact.

session_file_path(*, session_id, output_base[, ...])

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:

  1. Use configured_sessions_base when provided.

  2. 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:

pathlib.Path

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:

pathlib.Path