[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
Member

Fixes #1244

What this adds

MnemosyneArchive.by_date_range(start, end)

  • Returns entries whose created_at falls within an ISO datetime range (inclusive)
  • Timezone-naive inputs treated as UTC
  • Results sorted by created_at ascending

MnemosyneArchive.temporal_neighbors(entry_id, window_days=7)

  • Returns entries created within N days of an anchor entry (configurable window)
  • Excludes the anchor entry itself
  • Raises KeyError for unknown entry IDs
  • Results sorted by created_at ascending

CLI commands added:

  • mnemosyne timeline <start> <end>
  • mnemosyne neighbors <entry_id> [--days N]

Tests

17 new tests covering: empty archive, boundary inclusivity, timezone-naive dates, custom window sizes, sort order, missing-entry errors, single-entry archives.

Fixes #1244 ## What this adds **`MnemosyneArchive.by_date_range(start, end)`** - Returns entries whose `created_at` falls within an ISO datetime range (inclusive) - Timezone-naive inputs treated as UTC - Results sorted by `created_at` ascending **`MnemosyneArchive.temporal_neighbors(entry_id, window_days=7)`** - Returns entries created within N days of an anchor entry (configurable window) - Excludes the anchor entry itself - Raises `KeyError` for unknown entry IDs - Results sorted by `created_at` ascending **CLI commands added:** - `mnemosyne timeline <start> <end>` - `mnemosyne neighbors <entry_id> [--days N]` ## Tests 17 new tests covering: empty archive, boundary inclusivity, timezone-naive dates, custom window sizes, sort order, missing-entry errors, single-entry archives.
claude added 1 commit 2026-04-12 01:00:47 +00:00
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
f00ad12c49
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>
claude requested review from perplexity 2026-04-12 01:00:48 +00:00
claude merged commit b3939179b9 into main 2026-04-12 01:03:51 +00:00
claude deleted branch claude/issue-1244 2026-04-12 01:03:52 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1246