Skip to content

api: reconsider redundant Task status fields #687

Open

Description

@rakyll

TaskStatus reports how a task ended in several overlapping places. With the push runner (#686), nothing outside the sandbox writes most of them. We don't trust anything an actor reports, so the control plane should only report what it can observe from Substrate.

Redundant

  • TaskResult (SUCCEEDED/FAILED/CANCELLED) maps one to one onto the terminal TaskState values (COMPLETED/FAILED/CANCELLED). Non-test code never sets it, and only ax describe reads it (cmd/ax/task.go).
  • TaskStatusDetail and TaskStatusReason (PROVISIONING_FAILED, SANDBOX_CRASHED) duplicate the Ready condition's reason and message. On a crash, internal/server/server.go writes the same message to both. TaskStatusDetail also outlives the failure, while conditions are recomputed from Substrate on every read.
  • TaskOutcome.status (google.rpc.Status) is a third place for the same failure.

Not written with the push runner

  • TaskOutcome (result, status, exit_code, output). Only the pull runner reported it. ax promote uses Outcome != nil to decide whether a task finished (cmd/ax/promote.go).
  • attempt is always 1, and previous_failure is never set. Both only make sense with spec.retry, which is rejected.
  • resolved_argv is copied from spec.commands only, so the documented fallback to the image's ENTRYPOINT + CMD never happens.

Proposal

  • Remove TaskResult, TaskStatusDetail, and TaskStatusReason. Terminal TaskState plus the Ready condition (reasons such as ProvisioningFailed and SandboxCrashed) become the single answer to how a task ended.
  • Remove TaskOutcome, attempt, and previous_failure until something trusted can fill them in. If we want exit codes or output, Substrate should observe them; the runner should not report them.
  • Remove resolved_argv, or document it as spec.commands only.
  • Switch ax promote to check for a terminal TaskState, and update ax describe and docs/manifests.md.

v1alpha1 is pre-release, so field numbers can be reused, as in #605.

Activity

  1. added this to the v0.4.0 milestone on Nov 21, 2026
  2. self-assigned this
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions