Skip to content

Commit 995dd50

Browse files
committed
refactor: remove dead ports, config models, factory shim, JSON helper
Delete vestigial port contracts (SecretsProvider/WorkflowSerializer/ CacheProtocol + duplicate ModelProvider), unread config models/flags (Prompt* trio, deep_extraction_*, interrogation_rounds), the llm.factory re-export shim, select_model_with_highest_context alias, the dead extract_json_from_text extractor, and two empty application packages. Claude-Session: https://claude.ai/code/session_01KGUEXHcGDrqkCGPz7Y1G88
1 parent e499da2 commit 995dd50

17 files changed

Lines changed: 7 additions & 184 deletions

File tree

src/certamen/application/serialization/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/certamen/application/services/__init__.py

Whitespace-only changes.

src/certamen/application/workflow/nodes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BaseNode(DomainBaseNode):
3939
async def ensure_models_or_empty(
4040
self, models_input: Any, single: bool = False
4141
) -> tuple[dict[str, Any], dict[str, Any] | None]:
42-
from certamen.infrastructure.llm.factory import (
42+
from certamen.infrastructure.llm.model_factory import (
4343
ensure_model_instances,
4444
ensure_single_model_instance,
4545
)

src/certamen/application/workflow/nodes/disagreement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def execute(
6666
from certamen.domain.disagreement.detector import (
6767
DisagreementDetector,
6868
)
69-
from certamen.infrastructure.llm.factory import (
69+
from certamen.infrastructure.llm.model_factory import (
7070
ensure_single_model_instance,
7171
)
7272

src/certamen/application/workflow/nodes/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
from certamen.application.workflow.registry import register_node
1313
from certamen.infrastructure.config.env import get_ollama_base_url
14-
from certamen.infrastructure.llm.factory import (
14+
from certamen.infrastructure.llm.model_factory import (
1515
ensure_single_model_instance,
1616
)
1717
from certamen.infrastructure.llm.registry import ProviderRegistry

src/certamen/infrastructure/config/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
PROMPTS,
66
RETRY,
77
get_defaults,
8-
select_model_with_highest_context,
98
)
109
from certamen.infrastructure.config.env import (
1110
get_bool_env,
@@ -29,6 +28,5 @@
2928
"get_int_env",
3029
"get_ollama_base_url",
3130
"get_str_env",
32-
"select_model_with_highest_context",
3331
"validate_config",
3432
]

src/certamen/infrastructure/config/defaults.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
from typing import Any
22

3-
from certamen.domain.model_selection import select_model_by_capacity
4-
5-
6-
def select_model_with_highest_context(models: dict[str, Any]) -> str | None:
7-
return select_model_by_capacity(models, include_max_tokens=False)
8-
9-
103
# Models are discovered dynamically from LiteLLM and Ollama API.
114
# For Ollama: queries local server at OLLAMA_BASE_URL/api/tags
125
# For cloud providers: uses litellm.models_by_provider as source of truth
@@ -35,11 +28,8 @@ def select_model_with_highest_context(models: dict[str, Any]) -> str | None:
3528
"disagreement_investigation_enabled": True, # Deep-dive into model disagreements
3629
"confidence_calibration_enabled": True, # Append confidence tags to initial prompts
3730
"knowledge_map_enabled": True, # Build structured knowledge map after tournament
38-
"deep_extraction_enabled": False, # Recursive sub-tournaments on exploration branches (expensive)
39-
"deep_extraction_depth": 2, # Max recursion depth for deep extraction
4031
"persistence_enabled": True, # Persist knowledge maps to SQLite across tournaments
4132
"persistence_db_path": "certamen_knowledge.db", # Path to knowledge store database
42-
"interrogation_rounds": 1, # Number of interrogation rounds (round 2 probes round 1 findings)
4333
}
4434

4535
# Default prompts (JSON-like structured format)

src/certamen/infrastructure/config/models.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class FeaturesConfig(BaseModel):
2424
disagreement_investigation_enabled: bool = True
2525
confidence_calibration_enabled: bool = True
2626
knowledge_map_enabled: bool = True
27-
deep_extraction_enabled: bool = False
28-
deep_extraction_depth: int = 2
2927
persistence_enabled: bool = True
3028
persistence_db_path: str = "certamen_knowledge.db"
3129

@@ -36,24 +34,6 @@ class KnowledgeBankConfig(BaseModel):
3634
max_insights: int = Field(default=100, ge=1)
3735

3836

39-
class PromptMetadata(BaseModel):
40-
version: str = "1.0"
41-
type: str = "instruction"
42-
phase: str
43-
44-
45-
class PromptConfig(BaseModel):
46-
content: str
47-
metadata: PromptMetadata
48-
49-
50-
class PromptsConfig(BaseModel):
51-
initial: PromptConfig
52-
feedback: PromptConfig
53-
improvement: PromptConfig
54-
evaluate: PromptConfig
55-
56-
5737
class ModelConfig(BaseModel):
5838
model_config = {"extra": "allow"}
5939

src/certamen/infrastructure/llm/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from certamen.infrastructure.llm.factory import (
1+
from certamen.infrastructure.llm.litellm_adapter import LiteLLMModel
2+
from certamen.infrastructure.llm.model_factory import (
23
ensure_model_instances,
34
ensure_single_model_instance,
45
)
5-
from certamen.infrastructure.llm.litellm_adapter import LiteLLMModel
66
from certamen.infrastructure.llm.registry import ProviderRegistry
77
from certamen.infrastructure.llm.retry import run_with_retry
88

src/certamen/infrastructure/llm/factory.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)