Files
Profa 2253d05618 feat: flatten project structure — archive v2, promote v3 to root
Remove the nested v3/ subdirectory by moving all active source code,
tests, configs, and assets directly to the project root. Archive v2/
(dead code, 847MB) to v2-archive.tar.gz.

Key changes:
- Move v3/src/ → src/, v3/tests/ → tests/, v3/packages/ → packages/
- Move v3/tsconfig.json, v3/vitest.config.ts to root
- Merge v3/package.json into root package.json (ESM, scripts, deps, exports)
- Merge v3/scripts/ into scripts/, v3/implementation/ into docs/implementation/
- Update all CI workflows to remove "cd v3 &&" and v3/ path prefixes
- Fix all init installer path resolution (3-level-up → 2-level-up)
- Fix hooks to use "node ./dist/cli/bundle.js" instead of bare "aqe"
- Update settings.json ADR/DDD directories to docs/implementation/
- Fix helper scripts (statusline, adr-compliance, ddd-tracker, guidance-hooks)
- Update 58 agent definitions: aqe/v3/ → aqe/ memory namespaces
- Update 15 guidance shards: v3/src/ → src/ path references
- Fix sync interfaces: remove v3/ and v2/ path references
- Fix test path calculations (process.cwd() + '..' no longer needed)
- Fix flaky perf test threshold (500ms → 1000ms for CI environments)
- Fix complexity-analyzer test to match ADR-051 keyword-based eligibility

Build passes, 17,901 tests pass, CLI and MCP bundles verified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:35:41 +00:00

73 lines
2.6 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Agentic QE v3 - Vitest Configuration
*/
import { defineConfig } from 'vitest/config';
import path from 'path';
import os from 'os';
export default defineConfig({
test: {
globals: true,
environment: 'node',
env: {
// ISOLATION: Use temp directory so tests never write to production memory.db.
// Each test process (via forks pool) gets its own DB in the OS temp dir.
// This prevents test runs from inflating .agentic-qe/memory.db.
AQE_PROJECT_ROOT: path.join(os.tmpdir(), `aqe-vitest-${process.pid}`),
},
reporters: ['default', 'junit'],
outputFile: {
junit: 'junit.xml',
},
include: ['tests/**/*.test.ts'],
benchmark: {
include: ['tests/**/*.bench.ts'],
},
exclude: [
'node_modules',
'dist',
'**/browser/**',
'**/*.e2e.test.ts',
'**/vibium/**',
'**/browser-swarm-coordinator.test.ts',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'junit'],
include: ['src/**/*.ts'],
exclude: ['src/**/*.d.ts', 'src/**/index.ts'],
},
testTimeout: 10000,
hookTimeout: 15000, // Prevent beforeEach/afterEach hangs (e.g., fleet init)
// OOM & Segfault Prevention for DevPod/Codespaces (Vitest 4 format)
// Process isolation via forks prevents HNSW native module segfaults.
// fileParallelism is OFF in DevPod to prevent concurrent fleet inits from
// allocating multiple HNSW indices + Queen + Kernel stacks simultaneously.
// CI uses sequential execution too since test files share global fleet state.
pool: 'forks',
// OOM Prevention (Issue #294):
// DevPod has 16GB total. VS Code (~2GB) + Claude (~5GB) = 7GB overhead.
// Each fleet init allocates ~200-400MB (13 domain plugins + HNSW native memory).
// With maxForks=2 + main process: 3 × 1GB heap + native = ~4-5GB for tests.
// Setting maxForks=1 keeps peak at ~2-3GB, leaving headroom for the environment.
fileParallelism: false,
maxForks: 1,
minForks: 1,
isolate: true, // Full process isolation prevents native module conflicts
// Fail fast on OOM-prone environments
bail: process.env.CI ? 5 : 3,
},
resolve: {
alias: {
'@shared': path.resolve(__dirname, './src/shared'),
'@kernel': path.resolve(__dirname, './src/kernel'),
'@domains': path.resolve(__dirname, './src/domains'),
'@coordination': path.resolve(__dirname, './src/coordination'),
'@adapters': path.resolve(__dirname, './src/adapters'),
'@integrations': path.resolve(__dirname, './src/integrations'),
'@': path.resolve(__dirname, './src'),
},
},
});