SHA-256 hash check before embedding API call eliminates ~60-80% of
redundant embedding requests. Consolidates dual INSERT paths to single
INSERT with nullable embedding column.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sessions now auto-create CF Jira issues on start and post full session
output as comments on end, transitioning the issue to Done.
- Add src/services/jira.ts with createSessionIssue, addComment, transitionToDone
- Update session_start to create CF Jira issue and store key in sessions table
- Update session_end to post session output and close Jira issue
- Add migration 031 to archive local task tables (moved to Jira Cloud)
- Update .env.example with Jira Cloud env vars
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 3 cleanup: Transition complete to transcript-based recovery.
- Remove fallback to recoverNotesFromTempFile()
- All recovery now uses JSONL transcripts only
- Log warning if transcript not found for recovery
- Simplify recovery logic (no more dual-method path)
This completes the daemon elimination:
- LaunchAgent plist: Deleted
- session-notes-sync script: Deleted
- Legacy fallback code: Removed
- Result: Simpler architecture, no daemon overhead
Migration complete. System now uses only transcript-based recovery.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Migration 025: Add 'abandoned' status to sessions CHECK constraint (fixes blocking issue)
- Migration 026: Add recovery metadata columns (recovered_from, recovered_at) to track note recovery source
- Update sessionRecoverOrphaned to recover notes from temp files when marking sessions abandoned
- Update notes-parser to track recovery source and timestamp for analytics
These changes complete Priority 3, 5 and part of Priority 1 for CF-572 Session Notes Loss fix.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Check if session exists before inserting commit link
- Auto-create minimal session record if missing (status=active, no project)
- Prevents FK constraint violation when cache/DB drift occurs
- Return message indicates if session was auto-created for monitoring
- Handles edge cases: concurrent calls, missing committed_at, NULL project
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented 8 new session management tools:
- session_start: Initialize session with metadata tracking
- session_update: Update session metrics during execution
- session_end: Close session with summary and embedding
- session_list: List sessions with filtering
- session_search: Semantic search across sessions
- session_context: Get complete session context (tasks, commits, builds, memories)
- build_record: Link builds to sessions and versions
- session_commit_link: Link commits to sessions
Enhanced existing tools:
- memory_add: Added session_id and task_id parameters
- Updated all memory queries to use 'memories' table (renamed from session_memories)
Implementation:
- Created src/tools/sessions.ts with all session operations
- Updated src/tools/memories.ts for new schema
- Added 8 session tool definitions to src/tools/index.ts
- Registered all session tools in src/index.ts switch statement
- TypeScript compilation successful
Related: CF-167 (Fix shared session-summary.md file conflict)