Skip to content

feat: fidelis sessions — searchable, purge-able session memory#2

Open
roli-lpci wants to merge 6 commits into
mainfrom
feat/fidelis-sessions
Open

feat: fidelis sessions — searchable, purge-able session memory#2
roli-lpci wants to merge 6 commits into
mainfrom
feat/fidelis-sessions

Conversation

@roli-lpci

Copy link
Copy Markdown
Collaborator

fidelis sessions — searchable, purge-able Claude Code session memory

Claude Code deletes sessions after 30 days. fidelis can now keep them locally and make them searchable.

Commands

  • fidelis sessions search <query> — find past conversations (best on multi-turn queries)
  • fidelis sessions list / stats — browse + summarize indexed sessions
  • fidelis sessions ingest — index sessions (default: last 7 days; --all for full history)
  • fidelis sessions purge — delete from the search index (NEVER touches ~/.claude/projects or backups)

Privacy posture (user-chosen)

  • FIDELIS_SESSIONS_MODE=opt-in|opt-out (default opt-out). opt-in indexes only FIDELIS_SESSIONS_INCLUDE projects; opt-out indexes all except FIDELIS_SESSIONS_EXCLUDE.
  • Stored locally in ~/.cogito (chmod 700), not application-encrypted; see SECURITY.md.

Verification

  • 135 tests pass; ruff clean; fresh pip install exposes the command; purge is index-only and audited.
  • Built behind a CLEAN-bar review + simulated user-interview pass.

roli-lpci and others added 6 commits June 6, 2026 14:09
…y-list

MVP-A: searchable, purge-able Claude Code session memory.
- fidelis sessions {ingest,search,list,purge,stats} wrapping existing
  query_sessions() + ingest(); ~80 lines new surface, no new deps.
- purge (the CTO blocker): index-only deletion, never touches source
  ~/.claude/projects or ~/Backups/claude-sessions; logs to purge_log.jsonl;
  default-N confirm; collects ingest_hash for ledger cleanup.
- ingest deny-list (FIDELIS_SESSIONS_EXCLUDE / exclude=) — honest pre-ingest
  privacy lever; chmod 700 ~/.cogito defensively.
- honesty: no retrieval-benchmark numbers in product strings (gate-tested).
- 11 new pure-logic gate tests (no services needed); full suite 111 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Honesty/polish fix from CLEAN-bar review: the dry-run/confirm summary now
reports the date span of the sessions that WILL be deleted, not the entire
corpus span. Regression-guarded by a new test. Full suite 111 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Caught by local CI simulation before push — ruff F401 would have failed CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sub-agent authored, verified against real --help (no invented flags),
honesty rules enforced (no benchmark numbers, purge boundary stated,
deny-list documented).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…X, deny-list discoverability

From simulated user-interview panel (FIX-FIRST verdict):
- SECURITY.md + README privacy block: honest plaintext-at-rest disclosure
  (chmod 700 + FileVault, purge=index-only, deny-list lever). Facts verified in code.
- ingest prints 'Indexing N sessions…' before the loop (no silent-hang on large history).
- first-run nudge to --all when default 7-day window would miss older history.
- FIDELIS_SESSIONS_EXCLUDE documented in 'sessions ingest --help' epilog.
- 6 new tests lock the first-run/count behavior. Suite: 118 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Each user picks their own privacy posture once (env FIDELIS_SESSIONS_MODE or
~/.cogito/config.json sessions_mode; default opt-out, behavior-preserving):
- opt-out: index all except FIDELIS_SESSIONS_EXCLUDE deny-list (existing behavior)
- opt-in:  index nothing except FIDELIS_SESSIONS_INCLUDE allow-list
- opt-in + empty allow-list: prints onboarding guidance, indexes nothing (no silent no-op)
Mirrors the existing exclude mechanism; touches only ingest logic + help/docs + tests.
purge/search/list/stats untouched. 17 new tests; suite 135 passed; ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant