Skip to content

Commit f0ff658

Browse files
fix: content CLI signatures, code dedup, and 226 new tests
Content CLI fixes (cli/_content.py): - generate/download/syllabus/autopilot/from_obsidian: corrected to match service function signatures (tuple chapter_range, client contexts, etc.) Code deduplication: - create_backup: sync.py imports from maintenance.py (was exact copy) - list_course_summaries: extracted to services/review.py, shared by MCP + web Test coverage (+226 tests for agent-session-tools): - test_classifier.py (56), test_deduplication.py (45), test_query_logic.py (77), test_maintenance.py (40) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4ad808e commit f0ff658

10 files changed

Lines changed: 2866 additions & 103 deletions

File tree

packages/agent-session-tools/src/agent_session_tools/sync.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import os
1212
import re
1313
import shlex
14-
import shutil
1514
import sqlite3
1615
import subprocess
1716
from datetime import datetime
@@ -349,18 +348,7 @@ def _stream_sql_to_target(sql: str, target: Path | tuple[str, str]) -> bool:
349348
return True
350349

351350

352-
def create_backup(db_path: Path) -> Path:
353-
"""Create a timestamped backup of the database."""
354-
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
355-
backup_dir = get_backup_dir(config)
356-
backup_dir.mkdir(parents=True, exist_ok=True)
357-
358-
backup_path = backup_dir / f"{db_path.stem}_backup_{timestamp}.db"
359-
shutil.copy2(db_path, backup_path)
360-
361-
logger.info(f"Backup created: {backup_path}")
362-
console.print(f"[green]✅ Backup created:[/green] {backup_path}")
363-
return backup_path
351+
from agent_session_tools.maintenance import create_backup # noqa: E402
364352

365353

366354
def show_db_stats(db_path: Path, label: str = "Database") -> None:

0 commit comments

Comments
 (0)