import { defineConfig } from 'vitest/config'

/**
 * Tier-2 (semantic) test configuration — REAL embedding model.
 *
 * Holds the relevance/recall assertions that are only meaningful with real embeddings
 * (Tier 1's deterministic embedder gives self-identity 1.0 but no cross-text structure).
 * Opt-in: `npm run test:semantic`. Sequential + isolated forks, like the integration tier,
 * because real model loads are memory-heavy.
 */
export default defineConfig({
  test: {
    globals: true,
    setupFiles: ['./tests/setup-semantic.ts'],
    environment: 'node',

    testTimeout: 300000, // 5 minutes per test (real model load + inference)
    hookTimeout: 120000,
    teardownTimeout: 30000,

    include: ['tests/semantic/**/*.test.ts'],

    // Sequential execution — real models are memory-heavy.
    pool: 'forks',
    poolOptions: {
      forks: { maxForks: 1, minForks: 1, singleFork: true, isolate: true }
    },
    maxConcurrency: 1,
    fileParallelism: false,

    reporters: process.env.CI ? ['dot'] : ['basic'],
    coverage: { enabled: false },
    retry: 1
  }
})
