API reference

Core hashing and normalization utilities for IPC provenance tracking.

class pipeworks_ipc.hashing.DirectoryHashEntry(path: str, file_count: int, hash: str)[source]

Bases: object

Deterministic hash summary for one policy directory subtree.

file_count: int
hash: str
path: str
class pipeworks_ipc.hashing.PolicyHashEntry(relative_path: str, content_hash: str)[source]

Bases: object

Canonical file entry used to compute deterministic policy tree digests.

content_hash: str
relative_path: str
class pipeworks_ipc.hashing.SupportsModelDump(*args, **kwargs)[source]

Bases: Protocol

Protocol for objects exposing Pydantic-style model_dump().

model_dump() dict[str, Any][source]

Return a plain dictionary representation.

pipeworks_ipc.hashing.compute_ipc_id(*, input_hash: str, system_prompt_hash: str, model: str, temperature: float, max_tokens: int, seed: int) str[source]

Return IPC identifier digest using explicit colon-delimited provenance fields.

pipeworks_ipc.hashing.compute_output_hash(output_text: str) str[source]

Return SHA-256 hex digest for normalized output text.

pipeworks_ipc.hashing.compute_payload_hash(payload_dict: dict) str[source]

Return SHA-256 hex digest for canonicalized payload JSON.

pipeworks_ipc.hashing.compute_policy_directory_hashes(file_entries: list[PolicyHashEntry]) list[DirectoryHashEntry][source]

Return subtree hashes for each non-root directory in the policy tree.

pipeworks_ipc.hashing.compute_policy_file_hash(relative_path: str, content_bytes: bytes) str[source]

Return deterministic hash for one policy file path and its raw bytes.

pipeworks_ipc.hashing.compute_policy_tree_hash(file_entries: list[PolicyHashEntry]) str[source]

Return deterministic digest for a full policy file-set snapshot.

pipeworks_ipc.hashing.compute_system_prompt_hash(prompt_text: str) str[source]

Return SHA-256 hex digest for normalized system prompt text.

pipeworks_ipc.hashing.payload_hash(payload: SupportsModelDump) str[source]

Convenience wrapper: hash an object exposing model_dump().