coerce_goal_status(
value: object,
) -> GoalStatus | None| Name | Type | Description |
|---|---|---|
value* | object | Raw value read from checkpoint state. |
Narrow a persisted goal-status value to a known GoalStatus.
A corrupt or forward-version checkpoint can carry an unexpected status
string (or a non-string). Coercing to None rather than passing the raw
value through keeps the GoalStatus Literal load-bearing on the read
path, so an unknown status is treated as "no goal status" instead of a
silently active goal. Resume/restore callers should log the discard
separately so it is surfaced rather than dropped; the model-read path
(_goal_snapshot) intentionally treats an unknown status as active
without logging.