From bffd641610db656a65154c7d5643620cfc784f95 Mon Sep 17 00:00:00 2001 From: joseph02 Date: Tue, 21 Jul 2026 11:57:22 -0700 Subject: [PATCH] docs(factory-plugin): note the Execute tokenizer's quoting limit --- gitnexus-factory-plugin/hooks/gitnexus-hook.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gitnexus-factory-plugin/hooks/gitnexus-hook.js b/gitnexus-factory-plugin/hooks/gitnexus-hook.js index 80eb79e83..6bae2d588 100644 --- a/gitnexus-factory-plugin/hooks/gitnexus-hook.js +++ b/gitnexus-factory-plugin/hooks/gitnexus-hook.js @@ -91,6 +91,12 @@ function extractPattern(toolName, toolInput) { const cmd = toolInput.command || ''; if (!/\brg\b|\bgrep\b/.test(cmd)) return null; + // NOTE: split(/\s+/) cannot handle shell quoting, same as the Cursor + // integration. `rg "User Service" src/` yields "User" (first token after + // rg/grep, quotes stripped) rather than the full phrase — BM25 is already + // token-tolerant, so the multi-word pattern is deliberately not + // reconstructed. Worst case is augment context for a narrower term than + // the agent searched. Quoted single tokens (`rg "validateUser"`) are exact. const tokens = cmd.split(/\s+/); let foundCmd = false; let skipNext = false;