Expand description
(#4351) The actionable TaskResult carried beside a Session snapshot.
The actionable outcome a caller gets back alongside a Session snapshot
(#4351).
Why: task.run and session.status used to hand back only id/status/
mode — opaque to an external caller, which then had no way to tell a
caller-facing story (“the change landed on branch X, here is the ref, the
run passed”). TaskResult is the additive answer: the same snapshot
still ships, with the actionable fields carried beside it.
What: TaskResultStatus classifies the run; TaskResult carries that
status plus diff_ref, branch, pr_ref and summary, every one of them
nullable so a producer that cannot know a field says so rather than
inventing it. #[non_exhaustive] keeps later fields additive: construct
through TaskResult::new / TaskResult::pending and the with_*
builders, never a struct literal from outside this crate.
Test: tests::status_maps_every_session_status,
tests::partial_exit_code_is_its_own_status_not_a_failure,
tests::exit_code_mapping_reads_the_numbers_from_the_enum,
tests::task_result_round_trips_through_json,
tests::absent_optional_fields_deserialise_as_none.
Structs§
- Task
Result - The actionable result of a task run, carried beside the
Sessionsnapshot.
Enums§
- Task
Result Status - Pass/fail classification of a run, wider than a boolean.