Keep the self-report shapes in a module the line budget can hold

9f91ff7 pushed schemas.py from 498 to 534 lines and broke the 500-line rule
the repo enforces on every file. The status family (CacheLayerStatus,
MemoryStatus, RuntimeStatus, SenseStatus, SystemStatus) moves to
status_schemas.py, where it is self-contained: it needs only
TrainingAdapterKind from schemas.py, and schemas.py no longer looks back.

The same commit added three multi-line docstrings (browse.picture,
senses.sense_facts, SenseStatus). Each is now one line; the absent-vs-missing
distinction they carried survives in SenseStatus's own line, and the producer
senses.py still states why the two failures need different sentences.

Measured, not asserted: 263 tests pass; ruff clean on the eight touched
files; repo-wide mypy still 24 errors in 6 files (runtime.py's two are in
that baseline and reproduce on the HEAD copy of the file); pyright reports
the same two pre-existing runtime.py tuple findings on both trees;
multi-line docstrings repo-wide are back to 114, the parent's count.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 06:44:36 -04:00
1 parent 9f91ff7ed7
commit 6df713d135
8 files changed
+83 -81

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
"""What the machine reports about itself: runtime, memory, cache layers, senses."""
from __future__ import annotations
from datetime import datetime
from typing import Any, Literal
from pydantic import BaseModel
from .schemas import TrainingAdapterKind
class CacheLayerStatus(BaseModel):
layer: str
entries: int
bytes_estimate: int
hit_count: int
miss_count: int
last_event_at: datetime | None
class MemoryStatus(BaseModel):
active_atoms: int
active_token_equivalent: int
cartridges: int
library_token_equivalent: int
layers: list[CacheLayerStatus]
class RuntimeStatus(BaseModel):
backend: str
model_id: str
available: bool
detail: str
adapter_path: str | None = None
adapter_kind: TrainingAdapterKind | None = None
adapter_id: str | None = None
adapter_sha256: str | None = None
gpu_name: str | None = None
cuda: str | None = None
vram_total_mb: int | None = None
vram_used_mb: int | None = None
SenseState = Literal["absent", "missing", "ready"]
VisualState = Literal["absent", "stale", "ready"]
DenseState = Literal["off", "missing", "behind", "current"]
class SenseStatus(BaseModel):
"""What the machine can perceive now; absent means no model was given, missing means the one it was given is gone."""
dense: DenseState
dense_covered: int
store_atoms: int
picture_atoms: int
picture_bytes_missing: int
visual: VisualState
audio_atoms: int
speech: SenseState
captioning: SenseState
clip_path: str | None = None
asr_path: str | None = None
vlm_path: str | None = None
class SystemStatus(BaseModel):
app: str = "Ely-Eye"
version: str
runtime: RuntimeStatus
memory: MemoryStatus
senses: SenseStatus
profiles: dict[str, dict[str, Any]]
data_home: str