Sub-issue of #679.
Goal
Introduce a typed Pydantic model representing the unified shape of status_data for kernels and sessions, covering all four branches: kernel, session, scheduler, and error.
Scope
- New file under
src/ai/backend/common/dto/manager/v2/ (likely status_data.py or per-entity files in kernel/ and session/).
- Pydantic v2 model(s):
KernelStatusBranch — {exit_code: int}
SessionStatusBranch — {status: str}
SchedulingPredicateModel — {name: str, msg: str | None}
SchedulerStatusBranch — {msg, retries, last_try, passed_predicates: list, failed_predicates: list}
ErrorDetailModel — typed error detail (mirror of manager/exceptions.py:ErrorDetail)
ErrorStatusBranch — {errors: list[ErrorDetailModel]} (the normalized list shape; see #(step-2 sub-issue))
- Top-level
KernelStatusData aggregating all branches as optional fields.
- Unit tests under
tests/common/dto/manager/v2/ validating round-trip parse/serialize for representative payloads.
Non-goals
- This issue does NOT change wire format on the producer side. That's the next sub-issue.
- No changes to v2 REST/GraphQL DTOs to expose
status_data yet.
Acceptance criteria
JIRA Issue: BA-5864
Sub-issue of #679.
Goal
Introduce a typed Pydantic model representing the unified shape of
status_datafor kernels and sessions, covering all four branches:kernel,session,scheduler, anderror.Scope
src/ai/backend/common/dto/manager/v2/(likelystatus_data.pyor per-entity files inkernel/andsession/).KernelStatusBranch—{exit_code: int}SessionStatusBranch—{status: str}SchedulingPredicateModel—{name: str, msg: str | None}SchedulerStatusBranch—{msg, retries, last_try, passed_predicates: list, failed_predicates: list}ErrorDetailModel— typed error detail (mirror ofmanager/exceptions.py:ErrorDetail)ErrorStatusBranch—{errors: list[ErrorDetailModel]} (the normalized list shape; see #(step-2 sub-issue))KernelStatusDataaggregating all branches as optional fields.tests/common/dto/manager/v2/validating round-trip parse/serialize for representative payloads.Non-goals
status_datayet.Acceptance criteria
ai.backend.common.dto.manager.v2.errorshape and newerrors-list shape (tolerant reader).JIRA Issue: BA-5864