From 0fa592f24ef82870b6d199fc3e53bf61a893cf85 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Thu, 23 Apr 2026 17:36:26 +0000 Subject: [PATCH] fix(context): replace type: ignore with cast() in ACMSPipeline semantic_chunking registration Use typing.cast(ContextStrategy, _sc_cls()) instead of a # type: ignore[assignment] comment when registering SemanticChunkingStrategy in ACMSPipeline.__init__. This eliminates the type suppression comment and makes the structural subtype relationship explicit to the type checker. --- src/cleveragents/application/services/acms_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cleveragents/application/services/acms_service.py b/src/cleveragents/application/services/acms_service.py index b87f8c4d5..1b82c57e8 100644 --- a/src/cleveragents/application/services/acms_service.py +++ b/src/cleveragents/application/services/acms_service.py @@ -26,7 +26,7 @@ import re from collections.abc import Sequence from dataclasses import dataclass from threading import local -from typing import TYPE_CHECKING, Any, ClassVar, Protocol, runtime_checkable +from typing import TYPE_CHECKING, Any, ClassVar, Protocol, cast, runtime_checkable import structlog @@ -785,7 +785,7 @@ class ACMSPipeline: # Imported lazily to avoid circular imports. if "semantic_chunking" not in self._strategies: _sc_cls = _get_semantic_chunking_strategy_class() - self._strategies["semantic_chunking"] = _sc_cls() # type: ignore[assignment] + self._strategies["semantic_chunking"] = cast(ContextStrategy, _sc_cls()) # Register the 6 spec-required built-in strategies via adapters. # These strategies implement the domain-model ContextStrategy protocol # (strategy_stubs.py) and are wrapped in SpecStrategyAdapter instances