sigmap 2.7.0 → 2.8.0

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.
package/CHANGELOG.md CHANGED
@@ -6,7 +6,27 @@ Format: [Semantic Versioning](https://semver.org/)
6
6
 
7
7
  ---
8
8
 
9
- ## [2.7.0] — upcoming · [#19](https://github.com/manojmallick/sigmap/issues/19) · branch: `feat/v2.7-ranking-optimization`
9
+ ## [2.8.0] — upcoming · [#21](https://github.com/manojmallick/sigmap/issues/21) · branch: `feat/v2.8-snippet-retrieval`
10
+
11
+ ### Planned additions
12
+ - **Snippet extraction** — `src/retrieval/snippets.js`: extract relevant code blocks (functions, classes, methods) from ranked files
13
+ - **Hybrid scoring** — combine file-level relevance with snippet-level relevance; snippets inherit file score + get their own local score
14
+ - **`--query --snippets` CLI flag** — return top-k snippets (not full file sigs), with line numbers and context
15
+ - **`query_context` MCP enhancement** — add `snippets: true` option; response includes snippet text + line ranges
16
+ - **Smart context window** — include 2-3 lines before/after snippet for context
17
+ - **Configuration** — `retrieval.snippets: { enabled: true, minLines: 3, maxSnippets: 5 }`
18
+ - **`test/integration/snippets.test.js`** — 12 tests: snippet extraction, scoring, line number accuracy, context window
19
+
20
+ ### Go / No-go criteria
21
+ - All tests green (21 extractor + all integration)
22
+ - `--query "extract signatures" --snippets` returns 3-5 relevant snippets with correct line numbers
23
+ - MCP `query_context` with `snippets: true` returns snippet text
24
+ - Snippet relevance improves precision@3 by ≥10% over full-file retrieval
25
+ - Performance: <150ms for 1000-file repos with snippets enabled
26
+
27
+ ---
28
+
29
+ ## [2.7.0] — 2026-04-05 · [#19](https://github.com/manojmallick/sigmap/issues/19)
10
30
 
11
31
  ### Planned additions
12
32
  - **Fine-tuned ranking weights** — optimize `exactToken`, `symbolMatch`, `prefixMatch`, `pathMatch`, and `recencyBoost` weights in `src/retrieval/ranker.js` based on benchmark-driven evaluation
package/README.md CHANGED
@@ -110,17 +110,17 @@ AI agent session starts with full context
110
110
 
111
111
  ---
112
112
 
113
- ## 🔭 What's next — v2.7 (in progress · [#19](https://github.com/manojmallick/sigmap/issues/19))
113
+ ## 🔭 What's next — v2.8 (in progress · [#21](https://github.com/manojmallick/sigmap/issues/21))
114
114
 
115
- ### v2.7Ranking Optimization
115
+ ### v2.8Hybrid Depth: Snippet Retrieval
116
116
 
117
117
  | Feature | Description |
118
118
  |---|---|
119
- | **Fine-tuned ranking weights** | Optimize weights in `src/retrieval/ranker.js` for better precision based on benchmark evaluation |
120
- | **TF-IDF scoring** | Add term frequency-inverse document frequency scoring option for better semantic relevance |
121
- | **Weight presets** | `precision`, `balanced`, `recall` presets configurable via `retrieval.preset` |
122
- | **Performance optimization** | <100ms query performance for 1000-file repos, optimized for large codebases (10K+ files) |
123
- | **Precision improvement** | Target ≥5% precision@5 improvement while maintaining hit@5 0.80 |
119
+ | **Snippet extraction** | Extract relevant code blocks (functions, classes, methods) from ranked files |
120
+ | **Hybrid scoring** | Combine file-level + snippet-level relevance for precision |
121
+ | **`--query --snippets`** | Return top-k snippets with line numbers and context (not full files) |
122
+ | **MCP enhancement** | `query_context` with `snippets: true` returns snippet text + line ranges |
123
+ | **Smart context** | Include 2-3 lines before/after each snippet for readability |
124
124
 
125
125
  ---
126
126
  | **`get_impact` MCP tool** | 9th MCP tool — `{ file, depth? }` → impacted files + signatures |
package/gen-context.js CHANGED
@@ -4304,7 +4304,7 @@ const path = require('path');
4304
4304
  const os = require('os');
4305
4305
  const { execSync } = require('child_process');
4306
4306
 
4307
- const VERSION = '2.7.0';
4307
+ const VERSION = '2.8.0';
4308
4308
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
4309
4309
 
4310
4310
  function requireSourceOrBundled(key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Zero-dependency AI context engine — 97% token reduction. No npm install. Runs on Node 18+.",
5
5
  "main": "gen-context.js",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-cli",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "SigMap CLI wrapper — thin adapter for programmatic CLI invocation",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -128,9 +128,9 @@ const health = score('/path/to/project');
128
128
 
129
129
  All existing CLI flags (`--generate`, `--watch`, `--mcp`, `--query`, `--analyze`, `--benchmark`, `--health`, …) are unchanged.
130
130
 
131
- ## What's next — v2.7
131
+ ## What's next — v2.8
132
132
 
133
- v2.7 adds ranking optimization and fine-tuned weights for better precision in query-aware retrieval. TF-IDF scoring option, configurable weight presets (precision, balanced, recall), and performance optimization for large codebases. See [issue #19](https://github.com/manojmallick/sigmap/issues/19).
133
+ v2.8 adds hybrid depth snippet retrieval return not just relevant files, but the exact code snippets within those files. Includes `--query --snippets` CLI flag and `snippets: true` option for MCP `query_context`. See [issue #21](https://github.com/manojmallick/sigmap/issues/21).
134
134
 
135
135
  See the full [roadmap](https://manojmallick.github.io/sigmap/roadmap.html).
136
136
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-core",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "SigMap core library — zero-dependency code signature extraction, retrieval, and security scanning",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/src/mcp/server.js CHANGED
@@ -18,7 +18,7 @@ const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, exp
18
18
 
19
19
  const SERVER_INFO = {
20
20
  name: 'sigmap',
21
- version: '2.7.0',
21
+ version: '2.8.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24