style: apply ruff's automatic fixes and formatter
Mechanical only, and separated from the judgment calls that follow so the reviewable changes are not buried in a 98-file whitespace diff. 227 automatic fixes: 60 blank lines carrying whitespace, 60 unsorted import blocks, 34 Optional[X] to X | None, 28 unused imports, 16 deprecated typing imports, 12 datetime.timezone.utc to datetime.UTC, and assorted smaller modernisations. Then `ruff format` over src and tests: 98 files reformatted, 35 already conforming. No file among the unused-import findings defines __all__ or is an __init__.py, so nothing here removes a re-export. `make test`: 658 passed, unchanged from HEAD. Two things observed while verifying, neither addressed here: `pytest tests/` cannot collect — tests/e2e/test_orchestration_e2e.py uses an `e2e` marker that is not registered, and the config is strict about markers. This fails identically at HEAD, so it predates this change; `make test` passes because it ignores tests/e2e, tests/integration and tests/contracts. test_tatlock_tool_call_logging_calculator is flaky. It failed once in a full run with these changes and passed on the next, passes in isolation with them, and fails in isolation at HEAD. It is order- or timing-dependent, not a regression from this commit — established by running the full suite both ways rather than by reasoning about which change could have caused it. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ These tools enable The Biographer to record and recall the user's story:
|
||||
For direct key-based access (get/set profile, preferences),
|
||||
use memory_service directly - these tools are for semantic queries.
|
||||
"""
|
||||
|
||||
from src.core.context import get_user
|
||||
from src.core.embeddings import get_embedding_client
|
||||
from src.core.logging_config import get_logger
|
||||
@@ -23,6 +24,7 @@ logger = get_logger(__name__)
|
||||
# Semantic Recall
|
||||
# ============================================================================
|
||||
|
||||
|
||||
async def recall_semantic(
|
||||
query: str,
|
||||
memory_type: str = "",
|
||||
@@ -108,6 +110,7 @@ async def recall_semantic(
|
||||
# Store Memory
|
||||
# ============================================================================
|
||||
|
||||
|
||||
async def store_insight(
|
||||
key: str,
|
||||
value: str,
|
||||
@@ -158,7 +161,7 @@ async def store_insight(
|
||||
f"**Keywords:** {', '.join(keywords)}",
|
||||
f"**Importance:** {importance:.1f}",
|
||||
"",
|
||||
"_Memory is now searchable via semantic recall._"
|
||||
"_Memory is now searchable via semantic recall._",
|
||||
]
|
||||
|
||||
logger.info(
|
||||
@@ -216,7 +219,7 @@ async def update_profile(
|
||||
"## Profile Updated",
|
||||
f"**{key}:** {value}",
|
||||
"",
|
||||
"_Profile data is automatically included in context._"
|
||||
"_Profile data is automatically included in context._",
|
||||
]
|
||||
|
||||
logger.info(
|
||||
@@ -271,7 +274,7 @@ async def update_preference(
|
||||
"## Preference Updated",
|
||||
f"**{key}:** {value}",
|
||||
"",
|
||||
"_Preference will be applied to future responses._"
|
||||
"_Preference will be applied to future responses._",
|
||||
]
|
||||
|
||||
logger.info(
|
||||
@@ -293,6 +296,7 @@ async def update_preference(
|
||||
# List Memories
|
||||
# ============================================================================
|
||||
|
||||
|
||||
async def list_memories(
|
||||
memory_type: str = "learned_fact",
|
||||
limit: int = 20,
|
||||
@@ -378,6 +382,7 @@ async def list_memories(
|
||||
# Forget Memory
|
||||
# ============================================================================
|
||||
|
||||
|
||||
async def forget_memory(
|
||||
key: str,
|
||||
memory_type: str = "learned_fact",
|
||||
@@ -420,7 +425,7 @@ async def forget_memory(
|
||||
f"**Key:** {key}",
|
||||
f"**Type:** {memory_type}",
|
||||
"",
|
||||
"_Memory has been removed._"
|
||||
"_Memory has been removed._",
|
||||
]
|
||||
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user