Expose readiness_score on the agent plan widget for read and write

What does this MR do and why?

Exposes readinessScore on the WorkItemWidgetAgentPlan GraphQL type and makes it writable through the existing workItemUpdate mutation. Both paths are gated by the existing workplan_score feature flag (default off).

Read:

  • Returns a 0-100 integer when the flag is enabled and a score has been set.
  • Returns null when the flag is disabled, or when no score is available yet.
  • Scopes match sibling fields: [:api, :read_api, :ai_workflows].

Write:

  • Adds a readinessScore argument to WorkItemWidgetAgentPlanInput, so clients such as AI workflows persist the score through workItemUpdate instead of a separate write path.
  • content on that input becomes optional, so a caller can update the score alone without resending the plan content.
  • The AgentPlan callback applies content and readiness_score independently and validates the record. Plan create/update instrumentation events still fire on content changes only.
  • A supplied score is ignored while the flag is disabled, matching the read path.

GraphQL schema docs and introspection results are regenerated. EE-only change.

This is MR 2 of 2 for #611320 (closed), stacked on !249416 (merged) (model/storage layer).

References

Screenshots or screen recordings

Query:

Screenshot 2026-08-12 at 3.27.11 PM.png

Mutation:

Screenshot 2026-08-12 at 3.26.38 PM.png

How to set up and validate locally

  1. Enable the feature flag: Feature.enable(:workplan_score)

  2. Write a score through the mutation:

    mutation {
      workItemUpdate(input: {
        id: "gid://gitlab/WorkItem/1",
        agentPlanWidget: { readinessScore: 75 }
      }) {
        workItem {
          widgets {
            ... on WorkItemWidgetAgentPlan { content readinessScore }
          }
        }
        errors
      }
    }
  3. Verify readinessScore returns 75 and content is unchanged.

  4. Read it back:

    query {
      workItem(id: "gid://gitlab/WorkItem/1") {
        features {
          agentPlan {
            readinessScore
          }
        }
      }
    }
  5. Send readinessScore: 150 and verify the mutation returns a validation error.

  6. Disable the flag: Feature.disable(:workplan_score). Verify reads return null and writes are ignored.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Naman Jagdish Gala

Merge request reports

Loading
Loading