User-reported bugs across MCP tooling, fixed and verified end-to-end.
#467 (__dirname not defined in ESM):
- Added fileURLToPath polyfill to workflow-loader, quality-criteria-service,
init/phases/07-hooks, init/phases/10-workers, cli/commands/sync,
integrations/n8n/n8n-adapter, and integrations/n8n/agent-factory.
#469 (qe_embeddings search returns no results, similarity near zero):
- Routed the ONNX embedding generator through the real @xenova/transformers
pipeline (all-MiniLM-L6-v2) instead of the random-vector mock. Cosine
similarity of "apple pie" vs "apple fruit pie recipe" now ~0.78 (was -0.07).
- Replaced `threshold || 0.5` with `threshold ?? 0.5` so explicit 0 is honored.
#470 (qe_coherence_collapse riskLevel critical with isAtRisk false):
- Guarded categorizeRisk against NaN/null/undefined (returns 'low' on
non-finite input instead of falling through to 'critical').
- Defaulted missing numeric fields in heuristicAnalysis to safe values so
degenerate input can't propagate NaN through the risk score.
- Derived isAtRisk from riskLevel so the two can never disagree.
#472 (qe_tests_schedule "this.config.phases is not iterable"):
- Pipeline now falls back to DEFAULT_TEST_PHASES when the MCP wrapper
doesn't pass an explicit phase list.
#473 (session_cache_stats reports 0% hit rate):
- Wired SessionOperationCache into the MCP tools/call dispatcher for
isConcurrencySafe tools. Cache fingerprint is computed from the tool
name and canonical args. Cache hits short-circuit the handler.
#474 (test_generate_enhanced ignores language parameter):
- Validate `language` against the supported set; reject unknown values
with a clear error and the list of supported languages.
- Auto-derive `framework` from `language` (DEFAULT_FRAMEWORKS) when not
provided, instead of always defaulting to vitest.
- Reject language/framework mismatches that would produce wrong output.
- Expanded the MCP schema enum for framework to expose the full set of
generators we already ship.
Verified via scripts/verify-iteration-1.mjs which spawns the freshly-built
MCP bundle and runs the user's exact reproductions over JSON-RPC.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>