sweet-search 2.6.11 → 2.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
variant: mcp
|
|
3
|
-
derived_from: p7-v1-
|
|
4
|
-
source_prompt: core/prompt-optimization/data/p7-variant-restarts/p7-gen3-candidates/
|
|
3
|
+
derived_from: p7-v1-mpppp
|
|
4
|
+
source_prompt: core/prompt-optimization/data/p7-variant-restarts/p7-gen3-candidates/Mpppp.md
|
|
5
5
|
benchmarked: false
|
|
6
6
|
note: >-
|
|
7
|
-
Hand-derived MCP-tool variant of the
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
Hand-derived MCP-tool variant of the M++++ champion (p7-v1-mpppp = M++ +
|
|
8
|
+
stop-discipline scoping edits: search-rules-only intro, "stop searching" /
|
|
9
|
+
"Search output" wording; routing unchanged from the frozen, benchmarked
|
|
10
|
+
M++). The STRATEGY core — routing by what-you-hold, trust-the-top-hit,
|
|
11
|
+
sufficiency stops, the two-probe absence rule, the <state_summary> gate, and
|
|
12
|
+
the search-output discipline — is preserved (semantics intact; the rest
|
|
13
|
+
carries only the tool-mechanics
|
|
12
14
|
rename). Only the tool-mechanics layer is remapped: the six ss-* CLI commands collapse onto the sweet-search MCP
|
|
13
15
|
tool surface (a UNIFIED `search` that subsumes ss-search/ss-find/ss-grep, plus
|
|
14
16
|
`trace` / `read-semantic` / `read` / `repo-map`). The anti-raw-scan discipline
|
|
@@ -21,9 +23,11 @@ note: >-
|
|
|
21
23
|
---
|
|
22
24
|
# Sweet-search — code search tool guide
|
|
23
25
|
|
|
26
|
+
These are code-search rules only — they never decide when the task is done; the deliverable is whatever the task/prompt asks for. When the task calls for a change, locating the right code is a means, not the finish line: apply the edit with your normal file-editing tool and never a description of the fix in place of the fix.
|
|
27
|
+
|
|
24
28
|
Sweet-search indexes the working tree (uncommitted edits too) and searches it faster and cheaper than scanning files by hand. Use the sweet-search tools for all code search and navigation, in preference to native Grep/Read or shell `grep`/`find`/`cat`/`ls` — the index covers every file, so a manual scan only re-confirms a sweet-search result at higher cost, never beats it. Reach for a raw read only for an edit too recent to be reconciled (seconds old). Never re-run a sweet-search hit as a native Grep. Any sub-agent you delegate to must use these sweet-search tools, with this system prompt verbatim.
|
|
25
29
|
|
|
26
|
-
## Tools
|
|
30
|
+
## Tools (search tools, via the sweet-search MCP server)
|
|
27
31
|
The sweet-search MCP server exposes these (call each by the name your client lists it under):
|
|
28
32
|
- **search** — hybrid code search; returns ranked, self-contained code blocks. Your primary tool: it subsumes semantic search, exact-literal search, and semantic-reranked regex. Give it a natural-language query for a concept, or pass a `regex` (or lexical mode) for an exact token.
|
|
29
33
|
- **trace** — a symbol's callers, callees and impact in one call.
|
|
@@ -39,13 +43,13 @@ The sweet-search MCP server exposes these (call each by the name your client lis
|
|
|
39
43
|
Trust the top ranked result; confirm with at most one narrow `read`, never a re-run of a matching hit.
|
|
40
44
|
|
|
41
45
|
## Multi-file
|
|
42
|
-
Chain inside the tools: land the entry file, `read-semantic` it for the import or handoff symbol, then `search` the downstream module. The trace is COMPLETE the moment you can name the link from the entry symbol to the thing it reaches; stop there. Leaf bodies, macro expansions, and the next hop down are not the answer unless asked, and chasing them — or dropping to a native Grep/Read to "just look" — is the main multi-file cost trap.
|
|
46
|
+
Chain inside the tools: land the entry file, `read-semantic` it for the import or handoff symbol, then `search` the downstream module. The trace is COMPLETE the moment you can name the link from the entry symbol to the thing it reaches; stop tracing there. Leaf bodies, macro expansions, and the next hop down are not the answer unless asked, and chasing them — or dropping to a native Grep/Read to "just look" — is the main multi-file cost trap.
|
|
43
47
|
|
|
44
|
-
## A confirmed absence is a complete answer
|
|
45
|
-
When what you're looking for may not exist, absence is settled once TWO complementary `search` probes come back empty for the same concept: one in natural language and one as a broad `regex` on its likeliest identifier (a short substring/prefix). A search that returns plausible-but-off-target code is the decoy, not a lead — do not chase it. Two empty index probes over the whole codebase are more conclusive than any native scan or file listing, so state the negative and stop: no third synonym, no native `grep`/`ls`/`cat` enumeration.
|
|
48
|
+
## A confirmed absence is a complete search answer
|
|
49
|
+
When what you're looking for may not exist, absence is settled once TWO complementary `search` probes come back empty for the same concept: one in natural language and one as a broad `regex` on its likeliest identifier (a short substring/prefix). A search that returns plausible-but-off-target code is the decoy, not a lead — do not chase it. Two empty index probes over the whole codebase are more conclusive than any native scan or file listing, so state the negative and stop searching: no third synonym, no native `grep`/`ls`/`cat` enumeration.
|
|
46
50
|
|
|
47
51
|
## Before the third probe
|
|
48
52
|
Before your third sweet-search probe in the current search iteration — or before your final answer, whichever comes first — output a `<state_summary>` block with exactly: (1) one sentence on what you've established, (2) one sentence on your current blind spot.
|
|
49
53
|
|
|
50
|
-
##
|
|
51
|
-
Stop the instant your evidence answers what you're looking for — one confirmed file+symbol, or one named cross-file link, is enough; gather no corroboration you were not asked for. Name the file(s) and symbol(s) and how they answer what you need, or `no-match
|
|
54
|
+
## Search output
|
|
55
|
+
Stop searching the instant your evidence answers what you're looking for — one confirmed file+symbol, or one named cross-file link, is enough; gather no corroboration you were not asked for. Name the file(s) and symbol(s) and how they answer what you need, or `no-match` — then finish whatever the task/prompt asks for.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
run_id: p7-v1-
|
|
2
|
+
run_id: p7-v1-mpppp
|
|
3
3
|
score_sonnet: 0.993
|
|
4
4
|
score_gpt5_5: 0.988
|
|
5
5
|
joint_maximin: 0.988
|
|
6
6
|
eas_factor: null
|
|
7
7
|
length_penalty: null
|
|
8
8
|
final_score: null
|
|
9
|
-
token_count:
|
|
9
|
+
token_count: 1175
|
|
10
10
|
scs_cwSCS: 0.931
|
|
11
11
|
scs_min_paraphrase_accuracy: 1
|
|
12
12
|
homp_family_pass: true
|
|
@@ -19,9 +19,11 @@ vault_within_15pct_of_heldout: true
|
|
|
19
19
|
---
|
|
20
20
|
# Sweet-search — code search tool guide
|
|
21
21
|
|
|
22
|
+
These are code-search rules only — they never decide when the task is done; the deliverable is whatever the task/prompt asks for. When the task calls for a change, locating the right code is a means, not the finish line: apply the edit with your normal file-editing tool and never a description of the fix in place of the fix.
|
|
23
|
+
|
|
22
24
|
Sweet-search indexes the working tree (uncommitted edits too) and searches it faster and cheaper than raw shell. Use the `ss-*` tools for all code search and navigation. Reach for raw `grep`/`find`/`cat`/`ls` or the native reader only for an edit too recent to be reconciled (seconds old) — otherwise the index covers every file, so a raw scan only re-confirms an `ss-*` result at higher cost, never beats it. Never re-run an `ss-*` hit as raw grep. Any sub-agent you delegate to must use these `ss-*` tools, with this system prompt verbatim.
|
|
23
25
|
|
|
24
|
-
## Tools (
|
|
26
|
+
## Tools (search commands, invoked via Bash)
|
|
25
27
|
`ss-search`/`ss-find` return ranked code blocks; `ss-grep` is file:line only; `ss-semantic` returns the top ranked spans in one file; `ss-trace` returns a symbol's callers, callees and impact. `ss-find` is `ss-grep`'s regex plus a query that semantically re-ranks the matches.
|
|
26
28
|
- `ss-search "<query>" [-k N]` — semantic; default when you have no exact symbol
|
|
27
29
|
- `ss-find "<query>" --regex "<regex>" [-k N]`
|
|
@@ -38,13 +40,13 @@ Sweet-search indexes the working tree (uncommitted edits too) and searches it fa
|
|
|
38
40
|
Trust the top ranked result; confirm with at most one narrow `ss-read`, never a re-run of a matching hit.
|
|
39
41
|
|
|
40
42
|
## Multi-file
|
|
41
|
-
Chain inside the tools: land the entry file, `ss-semantic` it for the import or handoff symbol, then `ss-search`/`ss-find` the downstream module. The trace is COMPLETE the moment you can name the link from the entry symbol to the thing it reaches; stop there. Leaf bodies, macro expansions, and the next hop down are not the answer unless asked, and chasing them — or dropping to raw `cat`/`grep` to "just look" — is the main multi-file cost trap.
|
|
43
|
+
Chain inside the tools: land the entry file, `ss-semantic` it for the import or handoff symbol, then `ss-search`/`ss-find` the downstream module. The trace is COMPLETE the moment you can name the link from the entry symbol to the thing it reaches; stop tracing there. Leaf bodies, macro expansions, and the next hop down are not the answer unless asked, and chasing them — or dropping to raw `cat`/`grep` to "just look" — is the main multi-file cost trap.
|
|
42
44
|
|
|
43
|
-
## A confirmed absence is a complete answer
|
|
44
|
-
When what you're looking for may not exist, absence is settled once TWO complementary index probes come back empty for the same concept: one `ss-search` in natural language and one broad `ss-grep` on its likeliest identifier (a short substring/prefix). A semantic search that returns plausible-but-off-target code is the decoy, not a lead — do not chase it. Two empty index probes over the whole codebase are more conclusive than any raw scan or file listing, so state the negative and stop: no third synonym, no `find`/`ls`/`cat` enumeration, no native scan.
|
|
45
|
+
## A confirmed absence is a complete search answer
|
|
46
|
+
When what you're looking for may not exist, absence is settled once TWO complementary index probes come back empty for the same concept: one `ss-search` in natural language and one broad `ss-grep` on its likeliest identifier (a short substring/prefix). A semantic search that returns plausible-but-off-target code is the decoy, not a lead — do not chase it. Two empty index probes over the whole codebase are more conclusive than any raw scan or file listing, so state the negative and stop searching: no third synonym, no `find`/`ls`/`cat` enumeration, no native scan.
|
|
45
47
|
|
|
46
48
|
## Before the third probe
|
|
47
49
|
Before your third sweet-search probe in the current search iteration — or before your final answer, whichever comes first — output a `<state_summary>` block with exactly: (1) one sentence on what you've established, (2) one sentence on your current blind spot.
|
|
48
50
|
|
|
49
|
-
##
|
|
50
|
-
Stop the instant your evidence answers what you're looking for — one confirmed file+symbol, or one named cross-file link, is enough; gather no corroboration you were not asked for. Name the file(s) and symbol(s) and how they answer what you need, or `no-match
|
|
51
|
+
## Search output
|
|
52
|
+
Stop searching the instant your evidence answers what you're looking for — one confirmed file+symbol, or one named cross-file link, is enough; gather no corroboration you were not asked for. Name the file(s) and symbol(s) and how they answer what you need, or `no-match` — then finish whatever the task/prompt asks for.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sweet-search",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12",
|
|
4
4
|
"description": "Sweet Search - SOTA Hybrid Code Search Engine with WASM CatBoost Query Router, Semantic/Lexical/Structural Search, and Multilingual Support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "core/search/sweet-search.js",
|
|
@@ -167,13 +167,13 @@
|
|
|
167
167
|
"vitest": "^4.0.16"
|
|
168
168
|
},
|
|
169
169
|
"optionalDependencies": {
|
|
170
|
-
"@sweet-search/native-darwin-arm64": "2.6.
|
|
171
|
-
"@sweet-search/native-darwin-x64": "2.6.
|
|
172
|
-
"@sweet-search/native-linux-arm64-gnu": "2.6.
|
|
173
|
-
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.
|
|
174
|
-
"@sweet-search/native-linux-x64-gnu": "2.6.
|
|
175
|
-
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.
|
|
176
|
-
"@sweet-search/bg-priority": "2.6.
|
|
170
|
+
"@sweet-search/native-darwin-arm64": "2.6.12",
|
|
171
|
+
"@sweet-search/native-darwin-x64": "2.6.12",
|
|
172
|
+
"@sweet-search/native-linux-arm64-gnu": "2.6.12",
|
|
173
|
+
"@sweet-search/native-linux-arm64-gnu-cuda": "2.6.12",
|
|
174
|
+
"@sweet-search/native-linux-x64-gnu": "2.6.12",
|
|
175
|
+
"@sweet-search/native-linux-x64-gnu-cuda": "2.6.12",
|
|
176
|
+
"@sweet-search/bg-priority": "2.6.12"
|
|
177
177
|
},
|
|
178
178
|
"engines": {
|
|
179
179
|
"node": ">=18.0.0"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* both the file and the settings entry.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
// Tool surface mirrors the shipped M
|
|
21
|
+
// Tool surface mirrors the shipped M++++ policy (the ss-* tools). Kept terse —
|
|
22
22
|
// the full decision tree lives in CLAUDE.md/AGENTS.md; this is just a nudge to
|
|
23
23
|
// stop the agent drifting back to raw grep/read between prompts.
|
|
24
24
|
const REMINDER = [
|
|
@@ -30,8 +30,9 @@ const REMINDER = [
|
|
|
30
30
|
'- Callers/callees/impact of a symbol: ss-trace <symbol>',
|
|
31
31
|
'- Known file, unclear span: ss-semantic <file> "<query>"',
|
|
32
32
|
'- Known file + line range: ss-read <file> <start> <end>',
|
|
33
|
-
'STOP the instant your evidence answers the query — one confirmed file+symbol is enough;',
|
|
33
|
+
'STOP searching the instant your evidence answers the query — one confirmed file+symbol is enough;',
|
|
34
34
|
'a second call costs more than it saves. Multi-file flow questions get one follow-up.',
|
|
35
|
+
'Search rules only — if the task asks for a change, apply the edit.',
|
|
35
36
|
'</sweet-search-reminder>',
|
|
36
37
|
'',
|
|
37
38
|
].join('\n');
|
|
@@ -46,17 +46,18 @@ function escapeRegex(s) {
|
|
|
46
46
|
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// ─── Canonical policy body = the
|
|
49
|
+
// ─── Canonical policy body = the M++++ champion (integration seam) ───────────
|
|
50
50
|
//
|
|
51
51
|
// Plan §10 / §3.7.1 step 13 / DDD "Integration seam": scripts/init.js is the
|
|
52
52
|
// SOLE consumer of the prompt-optimization ship-file. We read that artifact at
|
|
53
|
-
// load time and strip its YAML front-matter; the remaining body is the
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
53
|
+
// load time and strip its YAML front-matter; the remaining body is the M++++
|
|
54
|
+
// champion (PHASE7 M++ — held-out 0.988 Maximin, OOD 0.952, HOMP/SCS/counter
|
|
55
|
+
// all pass, 5-cell cross-harness validated — plus the stop-discipline scoping
|
|
56
|
+
// edits that fix M++'s over-stopping on FIX tasks; routing unchanged),
|
|
57
|
+
// injected VERBATIM into the harness files. Per-harness shims
|
|
57
58
|
// (Cursor frontmatter, @imports) are applied at write-time, not embedded here.
|
|
58
59
|
//
|
|
59
|
-
// The artifact is generated from
|
|
60
|
+
// The artifact is generated from Mpppp.md by
|
|
60
61
|
// `core/prompt-optimization/sweep/finalize-mpp.mjs` and shipped via the
|
|
61
62
|
// package.json "files" list. If it is missing we fail LOUDLY rather than
|
|
62
63
|
// silently shipping a placeholder/older policy.
|
|
@@ -75,7 +76,7 @@ export function stripFrontMatter(text) {
|
|
|
75
76
|
return text.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, '');
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
function readShippedPolicy(rel = SHIP_FILE_REL, { label = 'M
|
|
79
|
+
function readShippedPolicy(rel = SHIP_FILE_REL, { label = 'M++++' } = {}) {
|
|
79
80
|
const here = dirname(fileURLToPath(import.meta.url)); // <pkg>/scripts
|
|
80
81
|
const shipPath = join(here, '..', rel);
|
|
81
82
|
let raw;
|
|
@@ -102,7 +103,7 @@ let _mcpPolicyBody = null;
|
|
|
102
103
|
/** Lazily read + cache the MCP-variant policy body. */
|
|
103
104
|
export function getMcpPolicyBody() {
|
|
104
105
|
if (_mcpPolicyBody == null) {
|
|
105
|
-
_mcpPolicyBody = readShippedPolicy(MCP_SHIP_FILE_REL, { label: 'M
|
|
106
|
+
_mcpPolicyBody = readShippedPolicy(MCP_SHIP_FILE_REL, { label: 'M++++ (MCP variant)' });
|
|
106
107
|
}
|
|
107
108
|
return _mcpPolicyBody;
|
|
108
109
|
}
|