personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: route remaining day-path bypasses through day_path()

Catches bypasses missed by the VPE bulk cleanup: ingest.py,
routes.py, sense.py, conversation.py, runner.py, sol/routes.py.
All now use day_path() from think.utils instead of manually
constructing journal/day paths. Pre-cleanup for chronicle migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+10 -14
-1
apps/import/ingest.py
··· 128 128 if not isinstance(segments, list): 129 129 return jsonify({"error": "Missing segments array"}), 400 130 130 131 - journal_root = Path(state.journal_root) 132 131 log_path = get_state_directory(key_prefix) / "segments" / "log.jsonl" 133 132 134 133 copied = 0
+2 -2
apps/import/routes.py
··· 27 27 update_import_metadata_fields, 28 28 write_import_metadata, 29 29 ) 30 - from think.utils import now_ms 30 + from think.utils import day_path, now_ms 31 31 32 32 from .journal_sources import ( 33 33 STATE_AREAS, ··· 693 693 key = seg.get("key", "") 694 694 if not day or not key: 695 695 continue 696 - seg_dir = journal_root / day / f"import.{source_type}" / key 696 + seg_dir = day_path(day, create=False) / f"import.{source_type}" / key 697 697 if not seg_dir.exists(): 698 698 continue 699 699
+2 -2
apps/sol/routes.py
··· 19 19 from think.facets import get_facets 20 20 from think.models import calc_agent_cost 21 21 from think.talent import get_output_path, get_talent_configs 22 - from think.utils import updated_days 22 + from think.utils import day_path, updated_days 23 23 24 24 sol_bp = Blueprint( 25 25 "app:sol", ··· 510 510 if filename.startswith("facets/"): 511 511 file_path = (journal_root / filename).resolve() 512 512 else: 513 - file_path = (journal_root / day / filename).resolve() 513 + file_path = (day_path(day, create=False) / filename).resolve() 514 514 515 515 # Security: ensure path is within the journal directory 516 516 try:
+2 -5
observe/sense.py
··· 619 619 620 620 # Build full paths for all files in this segment 621 621 # Files are in segment directories: YYYYMMDD/stream/HHMMSS_LEN/filename 622 - segment_dir = ( 623 - self.journal_dir / day / stream / segment 624 - if stream 625 - else self.journal_dir / day / segment 626 - ) 622 + dp = day_path(day, create=False) 623 + segment_dir = dp / stream / segment if stream else dp / segment 627 624 file_paths = [segment_dir / filename for filename in files] 628 625 629 626 # Pre-register segment tracking with complete file list
+2 -2
think/conversation.py
··· 20 20 from datetime import datetime 21 21 from pathlib import Path 22 22 23 - from think.utils import get_journal, now_ms 23 + from think.utils import day_path, get_journal, now_ms 24 24 25 25 logger = logging.getLogger(__name__) 26 26 ··· 102 102 time_key = dt.strftime("%H%M%S") 103 103 segment = f"{time_key}_1" 104 104 105 - seg_dir = Path(journal) / day / CONVERSATION_STREAM / segment / "agents" 105 + seg_dir = day_path(day) / CONVERSATION_STREAM / segment / "agents" 106 106 seg_dir.mkdir(parents=True, exist_ok=True) 107 107 108 108 time_str = dt.strftime("%Y-%m-%d %H:%M:%S")
+2 -2
think/runner.py
··· 28 28 from pathlib import Path 29 29 30 30 from think.callosum import CallosumConnection 31 - from think.utils import get_journal, now_ms 31 + from think.utils import day_path, get_journal, now_ms 32 32 33 33 logger = logging.getLogger(__name__) 34 34 ··· 48 48 49 49 Returns: journal/{day}/health/{ref}_{name}.log 50 50 """ 51 - return _get_journal_path() / day / "health" / f"{ref}_{name}.log" 51 + return day_path(day) / "health" / f"{ref}_{name}.log" 52 52 53 53 54 54 def _atomic_symlink(link_path: Path, target: str) -> None: