Skip to content

Commit 38b0917

Browse files
prefrontalsysclaude
andcommitted
style: apply ruff formatting to 3 files
Applied automatic formatting to: - src/mnemex/cli/migrate.py - src/mnemex/tools/consolidate.py - src/mnemex/tools/search_unified.py Formatting changes: quote style normalization and line wrapping. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b60e77a commit 38b0917

3 files changed

Lines changed: 10 additions & 26 deletions

File tree

src/mnemex/cli/migrate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def migrate_env_file(env_path: Path, dry_run: bool = False) -> bool:
8383
content = f.read()
8484

8585
# Find all STM_* variables
86-
pattern = r'\bSTM_([A-Z_]+)\b'
86+
pattern = r"\bSTM_([A-Z_]+)\b"
8787
matches = re.findall(pattern, content)
8888

8989
if not matches:
@@ -104,7 +104,7 @@ def migrate_env_file(env_path: Path, dry_run: bool = False) -> bool:
104104
print(f" 💾 Backup created: {backup_path}")
105105

106106
# Replace all STM_* with MNEMEX_*
107-
new_content = re.sub(pattern, r'MNEMEX_\1', content)
107+
new_content = re.sub(pattern, r"MNEMEX_\1", content)
108108

109109
with open(env_path, "w") as f:
110110
f.write(new_content)

src/mnemex/tools/consolidate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def consolidate_memories(
7474
# Apply consolidation to all candidates
7575
results = []
7676
for cluster in candidates:
77-
result = execute_consolidation(
78-
cluster, db, centroid_embedding=cluster.centroid
79-
)
77+
result = execute_consolidation(cluster, db, centroid_embedding=cluster.centroid)
8078
results.append(result)
8179

8280
total_saved = sum(r.get("space_saved", 0) for r in results)

src/mnemex/tools/search_unified.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ def search_unified(
7979

8080
# Search STM
8181
try:
82-
stm_memories = db.search_memories(
83-
tags=tags, window_days=window_days, limit=limit * 2
84-
)
82+
stm_memories = db.search_memories(tags=tags, window_days=window_days, limit=limit * 2)
8583
if query:
86-
stm_memories = [
87-
m for m in stm_memories if query.lower() in m.content.lower()
88-
]
84+
stm_memories = [m for m in stm_memories if query.lower() in m.content.lower()]
8985

9086
now = int(time.time())
9187
for memory in stm_memories:
@@ -162,9 +158,7 @@ def search_unified(
162158
}
163159

164160

165-
def format_results(
166-
results: list[UnifiedSearchResult], *, verbose: bool = False
167-
) -> str:
161+
def format_results(results: list[UnifiedSearchResult], *, verbose: bool = False) -> str:
168162
"""Formats unified search results for display."""
169163
if not results:
170164
return "No results found."
@@ -196,18 +190,10 @@ def main() -> int:
196190
parser.add_argument("query", nargs="?", help="Search query")
197191
parser.add_argument("--tags", nargs="+", help="Filter by tags")
198192
parser.add_argument("--limit", type=int, default=10, help="Maximum results")
199-
parser.add_argument(
200-
"--stm-weight", type=float, default=1.0, help="Weight for STM results"
201-
)
202-
parser.add_argument(
203-
"--ltm-weight", type=float, default=0.7, help="Weight for LTM results"
204-
)
205-
parser.add_argument(
206-
"--window-days", type=int, help="Only search STM memories from last N days"
207-
)
208-
parser.add_argument(
209-
"--min-score", type=float, help="Minimum score for STM results"
210-
)
193+
parser.add_argument("--stm-weight", type=float, default=1.0, help="Weight for STM results")
194+
parser.add_argument("--ltm-weight", type=float, default=0.7, help="Weight for LTM results")
195+
parser.add_argument("--window-days", type=int, help="Only search STM memories from last N days")
196+
parser.add_argument("--min-score", type=float, help="Minimum score for STM results")
211197
parser.add_argument("--verbose", action="store_true", help="Show detailed metadata")
212198

213199
args = parser.parse_args()

0 commit comments

Comments
 (0)