chore(context): apply linter fixes and sort imports (#86)

Phase 8 of Context Management Engine - Final Cleanup:

- Sort __all__ exports alphabetically
- Sort imports per isort conventions
- Fix minor linting issues

Final test results:
- 311 context management tests passing
- 2507 total backend tests passing
- 85% code coverage

Context Management Engine is complete with all 8 phases:
1. Foundation: Types, Config, Exceptions
2. Token Budget Management
3. Context Scoring & Ranking
4. Context Assembly Pipeline
5. Model Adapters (Claude, OpenAI)
6. Caching Layer (Redis + in-memory)
7. Main Engine & Integration
8. Testing & Documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-04 02:46:56 +01:00
parent 027ebfc332
commit 6c7b72f130
9 changed files with 38 additions and 41 deletions

View File

@@ -10,7 +10,7 @@ from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
from ..types import BaseContext
if TYPE_CHECKING:
from app.services.mcp.client_manager import MCPClientManager
pass
@runtime_checkable

View File

@@ -6,15 +6,14 @@ Combines multiple scoring strategies with configurable weights.
import asyncio
import logging
from dataclasses import dataclass, field
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any
from .base import BaseScorer
from ..config import ContextSettings, get_context_settings
from ..types import BaseContext
from .priority import PriorityScorer
from .recency import RecencyScorer
from .relevance import RelevanceScorer
from ..config import ContextSettings, get_context_settings
from ..types import BaseContext
if TYPE_CHECKING:
from app.services.mcp.client_manager import MCPClientManager

View File

@@ -6,8 +6,8 @@ Scores context based on assigned priority levels.
from typing import Any
from ..types import BaseContext, ContextType
from .base import BaseScorer
from ..types import BaseContext, ContextPriority, ContextType
class PriorityScorer(BaseScorer):

View File

@@ -6,11 +6,11 @@ More recent content gets higher scores.
"""
import math
from datetime import UTC, datetime, timedelta
from datetime import UTC, datetime
from typing import Any
from .base import BaseScorer
from ..types import BaseContext, ContextType
from .base import BaseScorer
class RecencyScorer(BaseScorer):

View File

@@ -9,8 +9,8 @@ import logging
import re
from typing import TYPE_CHECKING, Any
from ..types import BaseContext, KnowledgeContext
from .base import BaseScorer
from ..types import BaseContext, ContextType, KnowledgeContext
if TYPE_CHECKING:
from app.services.mcp.client_manager import MCPClientManager