The read gate stops consulting the unnamed isReady() boolean: every provider
may expose healthReport() (sync, O(1), composed from exact ledgers —
HealthReport with a monotonic generation, per-invariant source
ledger|deep|unledgered, missing {count, sample}), and one readiness
authority (assessProviderHealth) derives the verdict. Unledgered families
are UNKNOWN — never healthy, never broken; a report that throws is a loud
not-ready, never a shrug. Reads at the four index choke points refuse with
the typed NotReady errors, narrated once per (provider, generation) — a
read NEVER starts a store walk:
- the first-read lazy build retires (open builds instead, regardless of
size — the ≥10k deferral and the "lazy loading on first query" branch go;
disableAutoRebuild is re-meant honestly in its docs);
- the verify*Live read-path rebuild triggers retire (refuse-or-serve);
- the read-time consistency probe that could launch a dark rebuild from an
ordinary find() retires;
- repairIndex({ rebuild: ['metadata'|'graph'|'vector'] | 'all' }) is the
one explicit door: rebuilds the named leg unconditionally and reports
rebuilt per family; bare repairIndex() stays report-driven.
test(lifecycle): the biography lane — a store's whole life, refereed
tests/lifecycle/: an independent shadow model referees every read after
every chapter (founding, a working day, clean restart, crash, repair,
second life). Chapters 1-3 green. Chapters 4-6 assert the true contract and
are marked .fails as a release-blocking finding (the kill-matrix
convention): after a crash + adopt reopen the metadata index computes its
'catchup' watermark verdict and nothing consumes it — find() serves the
pre-crash index while canonical and counts recover. The catchup wiring is
the cure; a passing .fails will force the marker's removal. The lane runs
in the integration gate (config + coverage guard).
58 lines
No EOL
1.5 KiB
TypeScript
58 lines
No EOL
1.5 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
|
|
/**
|
|
* Integration Test Configuration - REAL AI MODELS
|
|
*
|
|
* Based on industry practices: fewer tests, real models, high memory
|
|
* Only run critical AI functionality to verify production readiness
|
|
*/
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
setupFiles: ['./tests/setup-integration.ts'],
|
|
environment: 'node',
|
|
|
|
// INTEGRATION TESTS: Real AI, need time and memory
|
|
testTimeout: 300000, // 5 minutes per test
|
|
hookTimeout: 120000, // 2 minutes for setup
|
|
teardownTimeout: 30000,
|
|
|
|
// Include only integration tests
|
|
include: [
|
|
'tests/integration/**/*.test.ts',
|
|
// The lifecycle biography lane (day-in-the-life scenarios; see
|
|
// tests/lifecycle/README.md) runs in the integration gate.
|
|
'tests/lifecycle/**/*.test.ts',
|
|
'tests/**/*.integration.test.ts'
|
|
],
|
|
|
|
// CRITICAL: Sequential execution to prevent memory exhaustion
|
|
pool: 'forks',
|
|
poolOptions: {
|
|
forks: {
|
|
maxForks: 1, // One test at a time
|
|
minForks: 1,
|
|
singleFork: true, // Absolute isolation
|
|
isolate: true
|
|
}
|
|
},
|
|
|
|
// No parallelism
|
|
maxConcurrency: 1,
|
|
fileParallelism: false,
|
|
|
|
// Minimal reporting to reduce memory
|
|
reporters: process.env.CI ? ['dot'] : ['basic'],
|
|
|
|
// No coverage (saves memory)
|
|
coverage: {
|
|
enabled: false
|
|
},
|
|
|
|
// Test sharding for CI
|
|
shard: process.env.VITEST_SHARD,
|
|
|
|
// Retry once for flaky AI tests
|
|
retry: 1
|
|
}
|
|
}) |