function TaskInfo.current_phase
The currently-active
TaskPhase, or None if no phase is open (tasks that never called task_update(..., phase=...) see None).
Returns a fresh snapshot per call — duration_ms is computed
against now. Callers wanting a refreshed elapsed re-invoke
the method.
function TaskInfo.phase
Mark a phase boundary.
First call: synthesizes an “init” phase covering task spawn to
now (so phase durations reconcile to total task time), then
opens phase
name.
Subsequent call with a different name: closes the active phase
(records its duration), opens a new one.
Subsequent call with the same name (incl. the active phase): no-op.
This makes it safe to pass phase= on bare data-refresh
task_update() emits inside a streaming loop.
emoji is an optional decoration string carried on the phase
record. Surface renderers prefix it onto the phase label when
non-empty (🔨 Build). Empty string when unset.
display_name is an optional display-label override. When
non-empty, renderers use it verbatim; when empty, they
titlecase name. Use it when naive titlecasing reads oddly;
regular underscore-separated identifiers (bazel_query →
Bazel query) don’t need it.
Same-name no-op calls don’t update emoji or display_name on
the already-open phase — set them on the call that opens the
phase.
function TaskInfo.phases
Snapshot of closed phases as a
list[TaskPhase]. The currently-active phase is NOT included — use current_phase() for that.
Each TaskPhase is a snapshot (not a live view):
duration_ms, interrupted, emoji, display_name, and
description are captured at the moment phases() is called.
Called as a method rather than an attribute because the list
is freshly allocated on each call (Starlark attributes don’t
expose the heap).
property TaskInfo.elapsed_ms
Task wall time so far in milliseconds (now - task spawn). Refreshed on every read; surface renderers use this for the “Task time” item in the status surface header.
property TaskInfo.group
The group(s) this task belongs to.
property TaskInfo.id
A globally unique UUID v4 for this task invocation. Always auto-generated; use key for a short human-readable discriminator.
property TaskInfo.key
A short human-readable key identifying this task invocation. Set via —task-key on the CLI, or auto-generated as a friendly name (e.g. “fluffy-parakeet”).
property TaskInfo.name
The name of the task.

