/**
 * Integration Test Setup — Tier 1: Functional end-to-end (deterministic embedder)
 *
 * These tests exercise every real code path — HNSW build + search, graph
 * traversal, metadata filtering, triple-intelligence composition, MVCC
 * transactions, sharding/persistence, VFS, aggregation, import — but with a
 * DETERMINISTIC embedder instead of the real WASM transformer. The embedding's
 * semantic *quality* is irrelevant to these assertions (which are structural:
 * counts, ids, relationships, self-retrieval, transaction outcomes); making the
 * vector deterministic turns a multi-hour, un-completable suite into a sub-minute
 * one that any contributor can run on any machine, no GPU or 16 GB required.
 *
 * Semantic relevance + the real embedding pipeline are covered separately by the
 * Tier-2 semantic suite (`tests/semantic/`, real model) — see
 * `tests/configs/vitest.semantic.config.ts`.
 */

beforeAll(() => {
  console.log('🧪 Integration (Tier 1): deterministic embedder, all other code paths real')

  // Deterministic embeddings — see src/embeddings/deterministicEmbedMode.ts.
  process.env.BRAINY_DETERMINISTIC_EMBEDDINGS = 'true'
  ;(globalThis as { __BRAINY_DETERMINISTIC_EMBED__?: boolean }).__BRAINY_DETERMINISTIC_EMBED__ = true

  // Marker retained for any test that branches on the integration environment.
  ;(globalThis as { __BRAINY_INTEGRATION_TEST__?: boolean }).__BRAINY_INTEGRATION_TEST__ = true
})

afterAll(() => {
  delete process.env.BRAINY_DETERMINISTIC_EMBEDDINGS
  delete (globalThis as { __BRAINY_DETERMINISTIC_EMBED__?: boolean }).__BRAINY_DETERMINISTIC_EMBED__
  delete (globalThis as { __BRAINY_INTEGRATION_TEST__?: boolean }).__BRAINY_INTEGRATION_TEST__
})

/**
 * No-op retained for back-compat. Tier-1 integration tests use the deterministic
 * embedder, so the real model's 16 GB requirement no longer applies — there is
 * nothing to gate on. (Real-model memory cost lives in the Tier-2 semantic suite.)
 *
 * @param _minGB - Ignored.
 */
export function requiresMemory(_minGB: number): void {
  // Intentionally empty — see the doc comment above.
}
