Skip to content

test(memory): add direct unit tests for edges_at_timestamp, edge_history, bfs_at_timestamp#1784

Merged
bug-ops merged 1 commit intomainfrom
test-memory-add-direct-unit-te
Mar 14, 2026
Merged

test(memory): add direct unit tests for edges_at_timestamp, edge_history, bfs_at_timestamp#1784
bug-ops merged 1 commit intomainfrom
test-memory-add-direct-unit-te

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 14, 2026

Closes #1776

Summary

Tests added

edges_at_timestamp (4 tests)

  • valid_from_inclusive: edge with valid_from==ts is visible at ts
  • valid_to_exclusive: edge with valid_to==ts is NOT visible at ts; also asserts visibility at ts-1s
  • multiple_edges_same_entity: returns all matching edges for an entity
  • no_edges_returns_empty: returns empty for an entity with no edges at timestamp

edge_history (5 tests)

  • basic_history: returns all versions ordered by timestamp (strict > ordering on distinct timestamps)
  • limit_parameter: pre-condition proves 5 rows exist; limit=2 returns exactly 2
  • non_matching_relation_returns_empty: filter with no matches returns empty
  • empty_entity: entity with no edges returns empty history
  • edge_history_fact_substring_filters_subset: structural proof that filtered count < total count

bfs_at_timestamp (5 tests)

  • zero_hops: depth=0 returns only the start entity (with real temporal data in range)
  • expired_intermediate_blocks: expired A→B edge prevents reaching C even with active B→C
  • disconnected_entity: entity with no edges returns only itself
  • reverse_direction: reverse traversal includes edge presence assertion
  • valid_to_boundary: edge with valid_to==ts is not traversed at ts; visible at ts-1s

Test plan

cargo nextest run --config-file .github/nextest.toml -p zeph-memory --features full --lib

All 5591 workspace tests pass.

@github-actions github-actions bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes tests Test-related changes size/XL Extra large PR (500+ lines) labels Mar 14, 2026
…ory, bfs_at_timestamp

Add 14 unit tests covering boundary conditions and happy paths for three
methods added in #1775:

- edges_at_timestamp: valid_from==ts inclusive, valid_to==ts exclusive
  (with ts-1s boundary pair), multiple edges on same entity, no-edge entity
- edge_history: basic ordering, limit truncation (with pre-condition proof),
  non-matching relation, empty entity, fact substring filtering (subset proof)
- bfs_at_timestamp: zero hops, expired intermediate blocks traversal,
  disconnected entity, reverse direction, valid_to==ts exclusive boundary

Closes #1776
@bug-ops bug-ops force-pushed the test-memory-add-direct-unit-te branch from 2896234 to 209df73 Compare March 14, 2026 20:47
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 20:47
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 14, 2026
@bug-ops bug-ops merged commit cc3866e into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the test-memory-add-direct-unit-te branch March 14, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/XL Extra large PR (500+ lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(memory): add direct unit tests for edges_at_timestamp, edge_history, bfs_at_timestamp

1 participant