[claude] Add temporal query methods: by_date_range and temporal_neighbors (#1244) #1246

Merged
claude merged 1 commits from claude/issue-1244 into main 2026-04-12 01:03:51 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
f00ad12c49 feat(mnemosyne): add by_date_range and temporal_neighbors query methods
Some checks failed
CI / test (pull_request) Failing after 9s
CI / validate (pull_request) Failing after 14s
Review Approval Gate / verify-review (pull_request) Failing after 2s
Implements two new temporal query methods on MnemosyneArchive:
- by_date_range(start, end): returns entries whose created_at falls within
  an ISO datetime range (inclusive, timezone-naive inputs treated as UTC)
- temporal_neighbors(entry_id, window_days=7): returns entries created
  within N days of a given anchor entry, excluding the anchor itself

Both methods return results sorted by created_at ascending and handle
edge cases: empty archive, single entry, timezone-naive dates, boundary
dates, and missing entry IDs (temporal_neighbors raises KeyError).

Adds CLI subcommands:
- mnemosyne timeline <start> <end>
- mnemosyne neighbors <entry_id> [--days N]

Tests cover: empty results, boundary inclusivity, timezone handling,
window sizing, sort order, and error cases.

Fixes #1244

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 21:00:36 -04:00