httk.workflow.runtime

Attempt identity and supervised commands.

The attempt context and run_command() are protocol-level facilities every native runner uses; the environment-binding helper below is what the authoring SDK and the Bash bridge both recover an attempt through.

Classes

AttemptContext

The immutable identity and restart evidence for one running attempt.

CommandResult

Result of an argv-only supervised child process.

Functions

run_command(→ CommandResult)

Run an argv array and terminate its process group on timeout.

Module Contents

class httk.workflow.runtime.AttemptContext[source]

The immutable identity and restart evidence for one running attempt.

workspace_id: str[source]
job_id: str[source]
job_key: str[source]
placement: str[source]
step: str[source]
activation_id: str[source]
attempt_id: str[source]
activation_ordinal: int | None[source]
attempt_ordinal: int | None[source]
total_attempts: int | None[source]
is_restart: bool[source]
is_unclean_restart: bool[source]
attempt_reason: str | None[source]
previous_attempt_id: str | None[source]
activation_reason: str | None[source]
workdir_mode: str | None[source]
workdir_reused: bool[source]
unsafe_persistent_takeover: bool[source]
data_generation: int | None[source]
durable: bool[source]
settings: collections.abc.Mapping[str, object][source]
resources: collections.abc.Mapping[str, object][source]
join: object[source]
raw: collections.abc.Mapping[str, Any][source]
classmethod read(path: str | os.PathLike[str]) Self[source]

Read and validate a manager-written attempt context.

class httk.workflow.runtime.CommandResult[source]

Result of an argv-only supervised child process.

argv: tuple[str, Ellipsis][source]
returncode: int[source]
stdout: bytes[source]
stderr: bytes[source]
timed_out: bool[source]
httk.workflow.runtime.run_command(argv: collections.abc.Sequence[str], *, timeout: float | None = None, cwd: str | os.PathLike[str] | None = None, environment: collections.abc.Mapping[str, str] | None = None, termination_grace: float = 10.0) CommandResult[source]

Run an argv array and terminate its process group on timeout.