Commit Graph

5 Commits

Author SHA1 Message Date
Profa 7d2712ef87 fix(build): resolve ESM typescript import failure in devcontainers (#267)
TypeScript's package.json has no "exports" field, causing Node.js 22+ ESM
legacyMainResolve to fail with ERR_MODULE_NOT_FOUND in devcontainer environments.
Add esbuild plugin to rewrite bare "typescript" specifier to explicit subpath
"typescript/lib/typescript.js" in both CLI and MCP bundles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 13:17:30 +00:00
Profa 062a7bc93a fix(build): resolve ERR_MODULE_NOT_FOUND for native modules on Node 22+
The published v3.6.5 bundle has bare ESM imports (`import Database from
"better-sqlite3"`) that fail on Node 22+ because legacyMainResolve
cannot handle packages without an "exports" field.

Fix the nativeRequirePlugin to:
- Use createRequire() shim for all 8 native modules (better-sqlite3,
  @ruvector/gnn, @ruvector/attention, @ruvector/sona, etc.)
- Export all named imports used across the codebase (TensorCompress,
  FlashAttention, pipeline, SonaEngine, etc.)
- Remove duplicate shebang (banner + entry point)
- Externalize chalk to avoid CJS require("os") failure in ESM mode

Also fix remaining embeddingDimension: 128 in learning.ts and audit.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:38:26 +00:00
Profa 2f216cce4f fix(hooks): use findProjectRoot() for single-DB resolution, remove FK constraint
Replace all process.cwd() with findProjectRoot() in hooks.ts, learning.ts,
and EmbeddingCache.ts to ensure all CLI commands and hooks write to the
project root DB regardless of CWD. This prevents double-DB creation in
monorepos or when running from subdirectories.

- hooks.ts: 4 CWD→findProjectRoot, recordOutcome guard fix (agent fallback)
- learning.ts: 6 CWD→findProjectRoot for all learning commands
- EmbeddingCache.ts: 1 CWD→findProjectRoot for cache path
- unified-memory.ts, sqlite-persistence.ts, v2-to-v3-migration.ts: remove
  FK constraint on qe_pattern_usage (hooks write synthetic pattern IDs)
- statusline-v3.cjs: include qe_pattern_usage in experience count
- qe-reasoning-bank.ts: log analytics write failures instead of swallowing
- build-cli.js, build-mcp.js: fix native-require plugin for named exports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:23:07 +00:00
Dragan Spiridonov 3e74d6605c fix(v3.4.1): bundle missing dependencies and test timeouts (#220)
- Fixed issue #219: MCP bundle failing due to missing packages
- Changed build scripts from --packages=external to selective externalization
- Pure JS deps (fast-json-patch, jose, uuid) now bundled inline
- Native modules properly externalized (better-sqlite3, hnswlib-node, etc.)
- CommonJS modules with dynamic requires externalized (typescript, fast-glob, yaml, commander, cli-progress, ora)
- Bundle size reduced from ~15MB to ~5MB
- Added timeouts to handleQualityAssess tests to prevent CI failures
- Updated version to 3.4.1

Closes #219

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:44:41 +01:00
Profa 8d9103f3cc fix(v3): resolve critical CLI bugs from issue #197
Bug 1: Version check now reads from root package.json
- Added build-time version injection via esbuild --define
- Created v3/scripts/build-cli.js and build-mcp.js
- CLI uses __CLI_VERSION__ constant injected at build time
- Fixes MODULE_NOT_FOUND error when v3/package.json not published

Bug 2: Test execute command now works
- Added runTests() convenience method to TestExecutionAPI
- Implemented in coordinator with auto-framework detection
- Exposed in plugin.ts for CLI access
- Supports parallel execution, retry, and sensible defaults

Closes #197

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 08:17:50 +00:00