Add readinessScoreStatus to the agent plan widget
What does this MR do and why?
Adds an experimental readinessScoreStatus field to WorkItemWidgetAgentPlan, so the frontend can tell "still scoring" from "failed" or "canceled" when the score is empty.
The workplan flow saves the plan first and writes readiness_score last, so a null score is ambiguous (see #633076 (comment 3984035672)).
The status is derived from the score and the latest workplan/v1 workflow, and is null when workplan_score is disabled:
| Status | When |
|---|---|
EVALUATING |
the workflow is running, even if an earlier score exists |
EVALUATED |
a score exists and no workflow is running |
FAILED |
no score, a plan exists and the workflow failed |
CANCELED |
no score, a plan exists and the workflow was stopped by a user |
NOT_EVALUATED |
no score otherwise (failed or canceled before a plan was written, finished without a score, waiting for input, never ran) |
A running workflow wins over a stored score, so a regeneration never shows the previous score. Rewriting the plan content also clears the stored readiness_score and readiness_score_feedback, unless the same call sets new ones.
generationStatus folds canceled into failed, which is why this is a separate field. The latest workflow is loaded in one batched query, like generationStatus.
Relates to #633076
How to set up and validate locally
- Enable
workplan_score. - Query
readinessScoreStatuson the agent plan widget of a work item with aworkplan/v1workflow, e.g. running, stopped or failed with no score.
MR acceptance checklist
- Specs for the model, the type and a GraphQL request
- GraphQL docs and introspection schema regenerated