mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
dc0ac612e2
The v3.10.4 publish failed: rvf-pattern-store.test.ts expected RvfPatternStore but got PatternStore. createPatternStore's #516 change used `require('../kernel/unified-memory.js')` to get findProjectRoot; esbuild inlines that in the shipped bundle, but under vitest (the CI publish gate) it throws "Cannot find module", so the whole RVF block fell through to the plain store — i.e. RVF pattern store was silently disabled under the test runner. Fix: extract findProjectRoot/clearProjectRootCache into a lightweight, sqlite-free module (src/kernel/project-root.ts) and import it STATICALLY from the RVF hot paths. unified-memory.ts now imports + re-exports them, so existing `import { findProjectRoot } from '.../unified-memory.js'` sites are unchanged. A static import avoids both the vitest require-resolution failure and dragging unified-memory's eager better-sqlite3 load into these modules. - src/kernel/project-root.ts: new module (fs/path only) - src/kernel/unified-memory.ts: import + re-export (internal callers keep a binding) - src/learning/pattern-store.ts: static import; drop require() - src/integrations/ruvector/shared-rvf-adapter.ts: same (latent same bug) - rvf-pattern-store.test.ts: pin AQE_PROJECT_ROOT to a hermetic temp root with .agentic-qe so the RVF branch is taken deterministically (was relying on a prior test creating ./.agentic-qe in cwd) Verified locally (native RVF available): rvf-pattern-store 16/16, find-project-root 4/4, 181 non-sqlite ruvector tests pass, typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>