personal memory agent
0
fork

Configure Feed

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

Remove dead code and fix stale documentation

- Remove unused get_entries_for_range() from cluster.py
- Remove deprecated cluster_segments_multi alias from cluster.py
- Remove unused cancel_task() from supervisor.py
- Fix type hints: any -> Any in cluster_segments()
- Update planner.md: journal://insight -> journal://agents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+4 -69
+2 -53
think/cluster.py
··· 288 288 return audio_ranges, screen_ranges 289 289 290 290 291 - def cluster_segments(day: str) -> List[Dict[str, any]]: 291 + def cluster_segments(day: str) -> List[Dict[str, Any]]: 292 292 """Return individual recording segments for a day with their content types. 293 293 294 294 Unlike ``cluster_scan()`` which collapses segments into 15-minute ranges, ··· 311 311 return [] 312 312 313 313 day_path_obj = Path(day_dir) 314 - segments: List[Dict[str, any]] = [] 314 + segments: List[Dict[str, Any]] = [] 315 315 316 316 for item in day_path_obj.iterdir(): 317 317 start_time, end_time = segment_parse(item.name) ··· 511 511 return markdown, len(entries) 512 512 513 513 514 - # Deprecated alias for backwards compatibility 515 - cluster_segments_multi = cluster_span 516 514 517 515 518 516 def _segments_overlap( ··· 561 559 ] 562 560 groups = _group_entries(entries) 563 561 return _groups_to_markdown(groups) 564 - 565 - 566 - def get_entries_for_range( 567 - day: str, 568 - start: str, 569 - end: str, 570 - audio: bool = True, 571 - screen: bool = True, 572 - agents: bool = False, 573 - ) -> List[Dict[str, Any]]: 574 - """Return filtered transcript entries for a time range. 575 - 576 - Public API for routes/tools that need raw entry data (not markdown). 577 - Returns entries with metadata for further processing (e.g., media file lookup). 578 - 579 - Args: 580 - day: Day in YYYYMMDD format 581 - start: Start time in HHMMSS format 582 - end: End time in HHMMSS format 583 - audio: Whether to include audio transcripts 584 - screen: Whether to include raw screen data from *screen.jsonl files 585 - agents: Whether to include agent output summaries from *.md files 586 - 587 - Returns: 588 - List of entry dicts with keys: 589 - - timestamp: datetime of segment start 590 - - segment_key: segment directory name 591 - - segment_start: datetime of segment start 592 - - segment_end: datetime of segment end 593 - - prefix: "audio", "screen", or "agent_output" 594 - - output_name: (agents only) stem of the .md filename 595 - - content: formatted transcript text 596 - - name: relative path like "HHMMSS_LEN/audio.jsonl" 597 - """ 598 - 599 - day_dir = str(day_path(day)) 600 - if not os.path.isdir(day_dir): 601 - return [] 602 - 603 - date_str = _date_str(day_dir) 604 - start_dt = datetime.strptime(date_str + start, "%Y%m%d%H%M%S") 605 - end_dt = datetime.strptime(date_str + end, "%Y%m%d%H%M%S") 606 - 607 - entries = _load_entries(day_dir, audio, screen, agents) 608 - return [ 609 - e 610 - for e in entries 611 - if _segments_overlap(e["segment_start"], e["segment_end"], start_dt, end_dt) 612 - ] 613 562 614 563 615 564 def main():
+2 -2
think/planner.md
··· 14 14 15 15 ### Resource Access 16 16 - **get_resource**: Retrieves complete journal resources: 17 - - `journal://insight/{day}/{topic}` - Full markdown insight for a specific topic on a day 17 + - `journal://agents/{day}/{topic}` - Full markdown insight for a specific topic on a day 18 18 - `journal://transcripts/full/{day}/{time}/{length}` - Full transcripts for specific time windows (audio + raw screen) 19 19 - `journal://transcripts/audio/{day}/{time}/{length}` - Audio transcripts only for specific time windows 20 20 - `journal://transcripts/screen/{day}/{time}/{length}` - Screen summaries only for specific time windows ··· 39 39 - Use `get_events(day)` when you need all events for a specific day 40 40 41 41 **Deep Analysis Phase** (Use resources for complete information): 42 - - Access full insights via `journal://insight/{day}/{topic}` for identified topics 42 + - Access full insights via `journal://agents/{day}/{topic}` for identified topics 43 43 - Retrieve raw transcripts via `journal://transcripts/full/{day}/{time}/{length}` for detailed reconstruction 44 44 - Access media files if visual/audio context is needed 45 45
-14
think/supervisor.py
··· 648 648 logging.warning(f"Cannot restart {service}: not found in managed processes") 649 649 650 650 651 - def cancel_task(ref: str) -> bool: 652 - """Cancel a running task. 653 - 654 - Args: 655 - ref: Task correlation ID 656 - 657 - Returns: 658 - True if task was found and terminated, False otherwise 659 - """ 660 - if _task_queue: 661 - return _task_queue.cancel(ref) 662 - return False 663 - 664 - 665 651 def get_task_status(ref: str) -> dict: 666 652 """Get status of a task. 667 653