Skip to content

test: mark pgvector-index tests store-incompatible; isolate extension alembic tests - #5762

Merged
nicoloboschi merged 2 commits into
mainfrom
tests/store-incompatible-vector-indexes
Oct 19, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
tests/store-incompatible-vector-indexes

Conversation

@nicoloboschi

@nicoloboschi nicoloboschi commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Two test-hygiene fixes for running the suite against an alternative memories store.

Store-incompatible markers. These tests assert which pgvector indexes exist on memory_units, or drive the SQL graph arm over rows they INSERT directly:

  • test_repair_bank_vector_indexes.py (whole module)
  • test_admin_rename_bank::test_rename_rebuilds_vector_indexes_for_the_new_id
  • test_hnsw_indexes::test_retain_still_ends_up_with_per_bank_indexes
  • test_ann_iterative_scan::test_the_kill_switch_flips_real_retrieval_depth
  • test_ensure_vector_no_global_index::test_migration_drops_stale_global_index
  • the engine-backed tests in test_observation_expansion_scoring / test_observation_expansion_single_fetch (the statement-shape unit tests stay unmarked)

A store that keeps memories outside SQL builds none of these indexes and never sees those rows, so these tests measure the storage layout, which is what memory_backend_incompatible is for. Nothing changes on Postgres: they are still collected and run there.

More store-incompatible tests, same reasoning:

  • consolidation tests that seed source liveness through a mocked conn (test_consolidation_dedup ×6, test_consolidation_embedding_validation ×2). These use the same pattern as their already-marked siblings and only passed while a read of an uncreated bank answered empty.
  • recall harness tests that patch retrieve_all_fact_types_parallel (test_recall_boost_pipeline, test_recall_boost::test_recall_async_wires_stage2_and_keeps_interleave, test_recall_scoring_time, test_temporal_arm_ordering). A store-owned bank never takes that path, so its recall reaches the store for a bank the harness never created.
  • test_webhooks::test_fire_retain_webhook_queues_per_document, whose bank is a raw INSERT.

Alembic-tree isolation. test_extension_alembic_tree asserts exact location lists but inherited any extension configured by the surrounding run. With a memories extension configured, the collector returned that extension's tree too, and 4 of 6 tests failed. An autouse fixture now clears every HINDSIGHT_API_<KIND>_EXTENSION before each test.

Verified: test_extension_alembic_tree.py 6/6 with a memories extension configured (it was 2/6). In the touched files, -m 'not memory_backend_incompatible' deselects 59 of 88 tests.

…mpatible; isolate extension alembic tests

The per-bank vector index tests (repair/reconcile, rename rebuild, HNSW,
ANN iterative scan, global-index migration) assert which pgvector indexes
exist on memory_units, and the observation-expansion tests drive the SQL
graph arm over rows they INSERT directly. A memories store that keeps its
rows outside SQL builds no such indexes and never sees those rows, so these
measure the storage layout rather than behaviour. They keep running on
Postgres.

test_extension_alembic_tree asserted exact location lists while inheriting
whatever extensions the surrounding run configured, so a configured
memories store contributed its own tree and every exact match saw one
location too many. Each test now starts from no configured extensions.
…memory_backend_incompatible

Three more groups that exercise the Postgres path rather than behaviour:

- consolidation tests that seed source liveness through a mocked conn,
  the same pattern as their already-marked siblings;
- recall harness tests that patch retrieve_all_fact_types_parallel, which
  a store-owned bank never calls: its recall reaches the store for a bank
  the harness never created;
- a webhook test whose bank is a raw INSERT, so a store that owns its own
  storage never made one.
@nicoloboschi
nicoloboschi merged commit 49adebc into main Oct 19, 2026
116 checks passed
@nicoloboschi nicoloboschi mentioned this pull request Nov 3, 2026
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