build_tools.syllable_walk_web.services.pipeline_manifest
Manifest helpers for syllable-walk web pipeline runs.
This module centralises manifest.json creation and updates for pipeline runs
under _working/output/<run_id>/manifest.json.
Design goals:
deterministic output ordering (stable JSON, sorted artifact lists)
additive schema that tolerates partial/failed/cancelled runs
explicit stage timing records suitable for History-tab rendering
minimal coupling so pipeline runner orchestration remains readable
Attributes
Classes
Outcome of validating one manifest's IPC hash integrity. |
Functions
Return a UTC timestamp in ISO-8601 |
|
|
Create a new in-memory manifest document. |
|
Insert or update one stage record in-place. |
|
Set final run status and optional error in-place. |
|
Populate manifest |
|
Refresh deterministic IPC fields from current manifest state. |
|
Verify that stored manifest IPC hashes match deterministic payload hashes. |
|
Read |
|
Write manifest to |
Module Contents
- build_tools.syllable_walk_web.services.pipeline_manifest.IPC_SCHEMA_VERSION = 1
- build_tools.syllable_walk_web.services.pipeline_manifest.IPC_LIBRARY_NAME = 'pipeworks-ipc'
- build_tools.syllable_walk_web.services.pipeline_manifest.IPC_LIBRARY_REF
- class build_tools.syllable_walk_web.services.pipeline_manifest.ManifestIPCVerificationResult[source]
Outcome of validating one manifest’s IPC hash integrity.
- build_tools.syllable_walk_web.services.pipeline_manifest.utc_now_iso()[source]
Return a UTC timestamp in ISO-8601
YYYY-MM-DDTHH:MM:SSZformat.The manifest schema uses second precision because millisecond precision is unnecessary for stage telemetry and makes snapshot diffs noisier.
- build_tools.syllable_walk_web.services.pipeline_manifest.create_manifest(*, run_id, extractor, language, source_path, file_pattern, min_syllable_length, max_syllable_length, run_normalize, run_annotate, created_at_utc)[source]
Create a new in-memory manifest document.
- Parameters:
run_id (str) – Run directory name (e.g.
20260222_093033_pyphen).extractor (str) – Extractor type (
pyphenornltk).language (str) – Language selector used by the pipeline.
source_path (str | None) – Source file or directory input path.
file_pattern (str) – Glob pattern for directory mode extraction.
min_syllable_length (int) – Minimum syllable length filter.
max_syllable_length (int) – Maximum syllable length filter.
run_normalize (bool) – Whether normalize stage was requested.
run_annotate (bool) – Whether annotate stage was requested.
created_at_utc (str) – Run start timestamp in UTC ISO format.
- Returns:
Manifest dictionary matching schema v1.
- Return type:
- build_tools.syllable_walk_web.services.pipeline_manifest.upsert_stage(manifest, *, name, status, started_at_utc=None, ended_at_utc=None)[source]
Insert or update one stage record in-place.
- build_tools.syllable_walk_web.services.pipeline_manifest.set_terminal_status(manifest, *, status, completed_at_utc, error_message=None)[source]
Set final run status and optional error in-place.
- build_tools.syllable_walk_web.services.pipeline_manifest.refresh_metrics_and_artifacts(manifest, *, run_directory, source_path, file_pattern)[source]
Populate manifest
metricsandartifactsfrom run outputs.This helper is idempotent and deterministic:
artifact list is always sorted by relative path
file counts use a stable path/glob rule set
syllable count prefers
data/corpus.dbwhen present
- build_tools.syllable_walk_web.services.pipeline_manifest.refresh_ipc(manifest)[source]
Refresh deterministic IPC fields from current manifest state.
Input hash is computed from canonical run configuration fields. Output hash is computed from a canonical serialized payload containing:
artifact summaries (path/type/size), already deterministically sorted
selected metrics (syllable_count_unique/files_processed)
- build_tools.syllable_walk_web.services.pipeline_manifest.verify_manifest_ipc(manifest)[source]
Verify that stored manifest IPC hashes match deterministic payload hashes.
Returns
verifiedwhen both hashes are present and match canonical recomputation from manifest content.
- build_tools.syllable_walk_web.services.pipeline_manifest.verify_manifest_ipc_file(run_directory)[source]
Read
manifest.jsonand verify its IPC hash integrity.
- build_tools.syllable_walk_web.services.pipeline_manifest.write_manifest(run_directory, manifest)[source]
Write manifest to
run_directory/manifest.jsonatomically.Atomic write semantics:
Write JSON to
manifest.json.tmp.Replace target path with
Path.replace.
This prevents partially-written files if a run is interrupted mid-write.