Repository navigation
Closed
Description
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 terminalTaskStatevalues (COMPLETED/FAILED/CANCELLED). Non-test code never sets it, and onlyax describereads it (cmd/ax/task.go).TaskStatusDetailandTaskStatusReason(PROVISIONING_FAILED,SANDBOX_CRASHED) duplicate theReadycondition's reason and message. On a crash,internal/server/server.gowrites the same message to both.TaskStatusDetailalso 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 promoteusesOutcome != nilto decide whether a task finished (cmd/ax/promote.go).attemptis always 1, andprevious_failureis never set. Both only make sense withspec.retry, which is rejected.resolved_argvis copied fromspec.commandsonly, so the documented fallback to the image'sENTRYPOINT+CMDnever happens.
Proposal
- Remove
TaskResult,TaskStatusDetail, andTaskStatusReason. TerminalTaskStateplus theReadycondition (reasons such asProvisioningFailedandSandboxCrashed) become the single answer to how a task ended. - Remove
TaskOutcome,attempt, andprevious_failureuntil 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 asspec.commandsonly. - Switch
ax promoteto check for a terminalTaskState, and updateax describeanddocs/manifests.md.
v1alpha1 is pre-release, so field numbers can be reused, as in #605.
Activity
api: remove redundant TaskResult and TaskStatusReason enums
api: remove TaskResult, TaskStatusReason, and TaskStatusDetail (googl…