"""Shared base types for HTTP-exposed engine entities.

Extracted from schemas/engine.py so system_status.py can import _Versioned
without a bidirectional dependency on schemas/engine (which bottom-imports
system_status for codegen single-module discovery).
"""

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel, ConfigDict, Field

SCHEMA_VERSION: Literal[1] = 1


class _Versioned(BaseModel):
    """Base for HTTP-exposed engine entities.

    `populate_by_name=True` lets clients send either the snake_case Python name
    or the camelCase alias (matters for codegen → TS round-trip).
    `frozen=True` makes shapes value-types in handlers (no accidental mutation).
    """

    model_config = ConfigDict(populate_by_name=True, frozen=True)
    schema_version: Literal[1] = Field(default=SCHEMA_VERSION, alias="schemaVersion")
