"""Data shapes for the `godot` domain.""" from __future__ import annotations from pydantic import BaseModel, ConfigDict class ParseResult(BaseModel): """The outcome of a parse check. Three distinct not-ok states, kept apart because they mean different things and only one of them is a verdict about the code: - `engine_failed` — godot itself crashed or is missing. NOT a parse verdict, and reporting it as one would blame the tree for a broken toolchain. - `did_not_run` — the sweep produced no completion marker, so it checked nothing. Zero errors from a check that never ran reads as clean, which is the false-green this exists to close. - `lines` non-empty — genuine parse failures. """ model_config = ConfigDict(frozen=True) lines: list[str] = [] summary: str = "" engine_failed: bool = False engine_exit: int = 0 did_not_run: bool = False @property def ok(self) -> bool: return not (self.lines or self.engine_failed or self.did_not_run)