diff --git a/src/transcription/benchmarking.py b/src/transcription/benchmarking.py index 9f7c22b..c2c3908 100644 --- a/src/transcription/benchmarking.py +++ b/src/transcription/benchmarking.py @@ -13,24 +13,6 @@ class BenchmarkModel(BaseModel): model_config = ConfigDict(extra="forbid", frozen=True) -class BenchmarkItem(BenchmarkModel): - """One private benchmark item referenced by archival identity.""" - - source_id: UUID - source_digest_sha256: str = Field(pattern=r"^[0-9a-f]{64}$") - categories: frozenset[str] = Field(min_length=1) - reference_transcription: str = Field(min_length=1) - - -class BenchmarkManifest(BenchmarkModel): - """Versioned private benchmark definition without copied source media.""" - - schema_name: str = "transcription.private-benchmark" - schema_version: str = "1" - name: str = Field(min_length=1) - items: tuple[BenchmarkItem, ...] = Field(min_length=1) - - class EditorialAssessment(BenchmarkModel): """Manually reviewed errors not represented adequately by CER or WER.""" diff --git a/src/transcription/db/engine.py b/src/transcription/db/engine.py index 3f8c03c..8e77d23 100644 --- a/src/transcription/db/engine.py +++ b/src/transcription/db/engine.py @@ -73,14 +73,3 @@ async def dispose_engine(database_url: str) -> None: engine = _ENGINES.pop(database_url, None) if engine is not None: await engine.dispose() - - -async def dispose_all_engines() -> None: - while _ENGINES: - _, engine = _ENGINES.popitem() - await engine.dispose() - - -async def refresh_engine(database_url: str) -> AsyncEngine: - await dispose_engine(database_url) - return get_engine(database_url) diff --git a/src/transcription/ui/components/error_presenter.py b/src/transcription/ui/components/error_presenter.py index 2bca9bc..07bce53 100644 --- a/src/transcription/ui/components/error_presenter.py +++ b/src/transcription/ui/components/error_presenter.py @@ -10,7 +10,6 @@ from typing import TypeVar from nicegui import ui from transcription.errors import AppError -from transcription.errors import ErrorCategory from transcription.errors import canonical_error_category from transcription.errors import classify_unexpected_error @@ -70,11 +69,3 @@ def show_error(exc: Exception, *, title: str, operation: str) -> None: def display_error_category(error: AppError) -> str: """Return the canonical UI-facing category label for an AppError.""" return canonical_error_category(error) - - -def summarize_error(exc: Exception, *, operation: str) -> str: - """Return short one-line summary for status labels.""" - error = to_app_error(exc, operation=operation) - if error.category == ErrorCategory.INTERNAL_UNEXPECTED: - return f"Unexpected error (ref: {error.error_id})" - return f"{error.message} (ref: {error.error_id})" diff --git a/tests/test_orphan_sweep.py b/tests/test_orphan_sweep.py index 76d98ca..0035a47 100644 --- a/tests/test_orphan_sweep.py +++ b/tests/test_orphan_sweep.py @@ -31,11 +31,6 @@ REGISTRATION_DECORATOR_PREFIXES = ("router.", "app.", "ui.page") # rationale. Removing the code means removing the entry; adding an entry means an # explicit decision to keep unreferenced code. KNOWN_ORPHANS: dict[str, str] = { - "BenchmarkManifest": ( - "Benchmark manifest model in benchmarking.py with no current caller. " - "Uncertain - follow-up: confirm whether the benchmarking entrypoint is still " - "intended before removing." - ), "DocumentService.is_document_type_referenced": ( "Read helper currently bypassed by callers in favor of direct delete guards. " "Retained for now to preserve service API stability during cleanup." @@ -92,19 +87,6 @@ KNOWN_ORPHANS: dict[str, str] = { "Public read helper currently unused by runtime flows, but retained as part of " "the SourceService API pending endpoint consolidation." ), - "dispose_all_engines": ( - "Engine lifecycle helper in db/engine.py. Uncertain - follow-up: operational " - "teardown utility with no runtime or test caller." - ), - "refresh_engine": ( - "Engine lifecycle helper in db/engine.py. Uncertain - follow-up: paired with " - "dispose_all_engines and equally unreferenced." - ), - "summarize_error": ( - "Error-presentation helper in ui/components/error_presenter.py that no page or " - "component calls. Uncertain - follow-up: superseded by the presenter's other " - "entrypoints." - ), }