Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ Format: [Semantic Versioning](https://semver.org/)

---

## [6.12.0] — 2026-06-05

### Added

- **Surgical Context Phase 2 — demand-driven retrieval (#219, PR #220):**
- **`get_lines` MCP tool** (10th tool) — fetch an exact `{ file, start, end }` line range on demand. Lines are clamped to the file bounds, secret-scanned via the existing redactor, and sandboxed to the project root. This is the demand-driven workhorse: agents read the lines behind a `:start-end` anchor instead of re-opening whole files.
- **`sigmap ask --mode index`** — two-tier output that emits only symbol-header pointers (`symbol :start-end`), dropping parameter lists, return types, and bodies. Agents re-fetch bodies via `get_lines`.
- **`sigmap ask --since <ref>`** — delta context that restricts ranked output to files changed since a git ref.
- **Token Reduction dashboard panel (Surface A)** — `sigmap --report` now renders a "Token Reduction" panel (whole-file baseline vs ranked signatures vs surgical, with per-repo rows), sourced from `benchmarks/reports/token-reduction.json` — numbers are never hand-typed.
- New **Surgical Context** guide (`docs-vp/guide/surgical-context.md`) covering line anchors, `--mode index`, `--since`, and the `get_lines` MCP tool.

### Changed

- **Budget-aware progressive disclosure** — when generated context exceeds `maxTokens`, the token budget now collapses signature bodies to their line anchors (keeping `symbol :start-end`) *before* dropping whole files, degrading gracefully.
- **CI** — added `workflow_dispatch` to the develop→main sync workflow so it can be run on demand (PR #218).

---

## [6.11.1] — 2026-06-04

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ To ensure proper attribution:

We welcome contributions! See [Contributing](./docs/CONTRIBUTING.md) for guidelines.

### Recent Contributors (v6.12.0)
- **@manojmallick** — feat: Surgical Context Phase 2 — `get_lines` MCP tool, `ask --mode index`, `ask --since`, budget-aware body collapse, Token Reduction dashboard panel (#219, PR #220)
- **@manojmallick** — ci: add `workflow_dispatch` to the develop→main sync workflow (PR #218)

### Recent Contributors (v6.11.1)
- **@rudi193-cmd** — fix: include hot-cold cold signatures in the bundled MCP server (#201, PR #216)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ Ask → Rank → Context → Validate → Judge → Learn
## Benchmark

```
Benchmark : sigmap-v6.11-main (21 repositories, including R language)
Date : 2026-06-04
Benchmark : sigmap-v6.12-main (21 repositories, including R language)
Date : 2026-06-05

Hit@5 : 81.1% (baseline 13.6% — 6.0× lift)
Token reduction: 96.5% (across 21 repos)
Expand Down Expand Up @@ -183,7 +183,7 @@ Use SigMap with open-source tools and fully self-hosted setups:
| **JetBrains** | [Marketplace](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/) | [github.com/manojmallick/sigmap-jetbrains](https://github.com/manojmallick/sigmap-jetbrains) | IntelliJ IDEA, WebStorm, PyCharm, GoLand — tool window + actions |
| **Neovim** | lazy.nvim / packer / vim-plug | [github.com/manojmallick/sigmap.nvim](https://github.com/manojmallick/sigmap.nvim) | `:SigMap`, `:SigMapQuery` float window, statusline widget |

**MCP server** — 9 on-demand tools for Claude Code and Cursor:
**MCP server** — 10 on-demand tools for Claude Code and Cursor:

```bash
sigmap --mcp
Expand Down
15 changes: 8 additions & 7 deletions docs-vp/guide/benchmark.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
title: Benchmark overview
description: Official v6.11.1 benchmark snapshot. 96.5% average token reduction across 21 repos, 81% retrieval hit@5, 41.8% fewer prompts, and R language support verified.
description: Official v6.12.0 benchmark snapshot. 96.5% average token reduction across 21 repos, 81% retrieval hit@5, 41.8% fewer prompts, and R language support verified.
head:
- - meta
- property: og:title
content: "SigMap benchmark overview — v6.11.1 snapshot with R language"
content: "SigMap benchmark overview — v6.12.0 snapshot with R language"
- - meta
- property: og:description
content: "Token, retrieval, quality, and task metrics from latest v6.11.1 benchmark run (2026-06-04) with 21 repositories including R language support."
content: "Token, retrieval, quality, and task metrics from latest v6.12.0 benchmark run (2026-06-05) with 21 repositories including R language support."
- - meta
- property: og:url
content: "https://manojmallick.github.io/sigmap/guide/benchmark"
---

# Benchmark overview

::: info Official v6.11.1 benchmark snapshot (21 repos, including R language)
**Benchmark ID:** sigmap-v6.11-main &nbsp;·&nbsp; **Date:** 2026-06-04
::: info Official v6.12.0 benchmark snapshot (21 repos, including R language)
**Benchmark ID:** sigmap-v6.12-main &nbsp;·&nbsp; **Date:** 2026-06-05

| Metric | Value |
|---|---:|
Expand All @@ -37,9 +37,9 @@ This is the landing page for the public benchmark story. It answers four differe
| SigMap reduces retries and wrong-context answers | [Task benchmark](/guide/task-benchmark) |
| SigMap keeps large repos inside model limits | [Quality benchmark](/guide/quality-benchmark) |

## Official v6.11.1 snapshot (with R language support)
## Official v6.12.0 snapshot (with R language support)

Latest saved benchmark run: **2026-06-04 (v6.11.1)**
Latest saved benchmark run: **2026-06-05 (v6.12.0)**

| Metric | Result |
|---|---:|
Expand All @@ -65,6 +65,7 @@ Latest saved benchmark run: **2026-06-04 (v6.11.1)**
- ggplot2: 94.3% reduction (381.5K → 21.7K tokens)
- dplyr: 93.4% reduction (145.1K → 9.5K tokens)
- shiny: 96.2% reduction (264.6K → 10.0K tokens)
- **New in v6.12.0:** demand-driven *Surgical Context* (`ask --mode index` + the `get_lines` MCP tool) cuts upfront `ask` context further on top of the figures above by emitting symbol pointers instead of bodies — see the [Surgical Context guide](/guide/surgical-context).

### 2. Retrieval quality

Expand Down
42 changes: 40 additions & 2 deletions docs-vp/guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ head:
content: "SigMap CLI Reference — every command and flag with examples"
- - meta
- property: og:description
content: "All 37 SigMap commands and flags documented with examples. ask, plan, bench, judge, validate, roots, history, --ci, --cost, --coverage, --watch, --diff, --mcp, --report, --health, weights --export/--import and more."
content: "All 39 SigMap commands and flags documented with examples. ask, plan, bench, judge, validate, roots, history, --ci, --cost, --coverage, --watch, --diff, --mcp, --report, --health, weights --export/--import and more."
- - meta
- property: og:url
content: "https://manojmallick.github.io/sigmap/guide/cli"
Expand All @@ -19,7 +19,7 @@ head:
content: "SigMap CLI Reference — every command and flag with examples"
- - meta
- name: twitter:description
content: "All 37 SigMap commands and flags documented with examples. ask, plan, bench, judge, validate, history, --ci, --cost, --coverage, --watch, --diff, --mcp, --report, --health, weights --export/--import and more."
content: "All 39 SigMap commands and flags documented with examples. ask, plan, bench, judge, validate, history, --ci, --cost, --coverage, --watch, --diff, --mcp, --report, --health, weights --export/--import and more."
- - meta
- name: twitter:image:alt
content: "SigMap CLI Reference"
Expand Down Expand Up @@ -47,6 +47,8 @@ If you are new to the product, start with the workflow pages first:
| `ask "<query>" --followup` | Reuse previous session context for follow-up queries (session carry-forward) |
| `ask "<query>" --package <name>` | Scope retrieval to a specific monorepo workspace package |
| `ask "<query>" --global` | Disable package scoping; search entire repo (monorepo override) |
| `ask "<query>" --mode index` | Surgical Context: emit symbol-header pointers (`symbol :start-end`) only — no bodies; fetch on demand via `get_lines` |
| `ask "<query>" --since <ref>` | Delta context: restrict ranked output to files changed since a git ref |
| `plan "<goal>"` | Analyze change impact and plan modifications — returns files grouped by confidence |
| `judge --response <f> --context <f>` | Rule-based groundedness scoring for LLM responses |
| `validate` | Validate config and coverage; optional query symbol check |
Expand Down Expand Up @@ -180,6 +182,42 @@ sigmap ask "find all auth handlers" --global --json
|--------|-------------|
| `--global` | Disable automatic package inference; search entire repo |

### ask --mode index (Surgical Context)

Emit a two-tier **symbol index** instead of full signature blocks. Each ranked file is reduced to its declaration heads plus line anchors (`symbol :start-end`) — parameter lists, return types, and bodies are dropped. The agent reads this minimal map, then fetches the exact lines it needs on demand via the [`get_lines` MCP tool](/guide/mcp). This is the demand-driven half of *Surgical Context* (line anchors are the first half — see above).

```bash
sigmap ask "where is config loaded" --mode index
```

```
# SigMap Query Context (index mode)
> Symbol index only — fetch exact lines on demand via the `get_lines` MCP tool.

## src/config/loader.js
function loadConfig :42-58
function detectAutoSrcDirs :12-39
```

| Option | Description |
|--------|-------------|
| `--mode index` | Emit symbol-header pointers only; bodies fetched on demand via `get_lines` |

When over `maxTokens`, the regular (non-index) generate path now degrades the same way automatically: it collapses bodies to anchors before dropping whole files. See the [Surgical Context guide](/guide/surgical-context).

### ask --since (delta context)

Restrict ranked output to files changed since a git ref, so a steady-state turn carries near-zero context. Combine with `--mode index` for the leanest possible turn.

```bash
sigmap ask "finish the refactor" --since main
sigmap ask "what did I touch" --since HEAD~3 --mode index
```

| Option | Description |
|--------|-------------|
| `--since <ref>` | Keep only ranked files changed since `<ref>` (any git ref: branch, tag, or SHA) |

---

## plan
Expand Down
8 changes: 4 additions & 4 deletions docs-vp/guide/generalization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Generalization — SigMap across languages, domains & repo sizes
description: SigMap generalizes across 21 repos, 31 languages, and multiple domains with 81.1% hit@5 in the latest saved v6.11.1 retrieval run.
description: SigMap generalizes across 21 repos, 31 languages, and multiple domains with 81.1% hit@5 in the latest saved v6.12.0 retrieval run.
head:
- - meta
- property: og:title
Expand All @@ -19,8 +19,8 @@ head:
SigMap was not tuned for one repo. This benchmark matters because it shows the same workflow transfers across different languages, repo sizes, and architectures without manual tuning.
:::

::: info Official v6.11.1 benchmark snapshot
**Benchmark ID:** sigmap-v6.11-main &nbsp;·&nbsp; **Date:** 2026-06-04 (with R language)
::: info Official v6.12.0 benchmark snapshot
**Benchmark ID:** sigmap-v6.12-main &nbsp;·&nbsp; **Date:** 2026-06-05 (with R language)

| Metric | Value |
|---|---:|
Expand All @@ -37,7 +37,7 @@ The important part of SigMap's benchmark story is not just the topline score. It
::: info What "generalization" means here
SigMap's signature extractors are hand-written regex patterns, not ML models. Generalization
means: *do the patterns hold up on codebases the authors never inspected?* The answer across
these 90 tasks is yes — 81% hit@5 with no per-repo tuning in the latest saved v6.11.1 run.
these 90 tasks is yes — 81% hit@5 with no per-repo tuning in the latest saved v6.12.0 run.
:::

- **21 repos** (including 3 R language repos)
Expand Down
16 changes: 10 additions & 6 deletions docs-vp/guide/mcp.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: MCP server setup
description: Set up the SigMap MCP server for Claude Code, Cursor, and Windsurf. On-demand codebase access with 9 tools over stdio. Zero npm install.
description: Set up the SigMap MCP server for Claude Code, Cursor, and Windsurf. On-demand codebase access with 10 tools over stdio. Zero npm install.
head:
- - meta
- property: og:title
content: "SigMap MCP Server — on-demand codebase context"
- - meta
- property: og:description
content: "Give Claude Code, Cursor, and Windsurf on-demand access to your codebase signatures. 9 MCP tools over stdio."
content: "Give Claude Code, Cursor, and Windsurf on-demand access to your codebase signatures. 10 MCP tools over stdio."
- - meta
- property: og:url
content: "https://manojmallick.github.io/sigmap/guide/mcp"
Expand All @@ -22,7 +22,7 @@ head:

Give Claude Code, Cursor, and Windsurf on-demand access to your codebase signatures. Zero npm install.

The SigMap MCP server exposes 9 tools over the stdio Model Context Protocol. Your AI agent calls only what it needs — keeping token costs low.
The SigMap MCP server exposes 10 tools over the stdio Model Context Protocol. Your AI agent calls only what it needs — keeping token costs low.

> **Setup time: under 2 minutes.** Use `sigmap --setup` for automatic configuration.

Expand Down Expand Up @@ -96,10 +96,10 @@ Stack both MCP servers for the two-layer context strategy — SigMap for always-
}
```

## 9 available tools
## 10 available tools

::: tip New in v6.3.0 — native tool registration
Claude Code and Codex now receive the full tool list at MCP startup without a discovery round-trip. The server declares all 9 tools in the `initialize` response, so your AI sees them immediately. No config change needed — upgrade via `npm install -g sigmap@latest`.
Claude Code and Codex now receive the full tool list at MCP startup without a discovery round-trip. The server declares all 10 tools in the `initialize` response, so your AI sees them immediately. No config change needed — upgrade via `npm install -g sigmap@latest`.
:::

All tools are available on-demand — your AI agent calls only what it needs.
Expand All @@ -114,6 +114,8 @@ All tools are available on-demand — your AI agent calls only what it needs.
| `create_checkpoint` | Records session progress with a git state snapshot. | `summary` (required string) | `create_checkpoint(summary="Added rate limiting")` |
| `get_routing` | Returns the model tier hints table (fast / balanced / powerful per file) based on complexity scores. | none | `get_routing()` |
| `query_context` | Ranks all files by relevance to a free-text query using TF-IDF scoring. Returns top-K files. New in v2.3. | `query` (required string), `topK` (optional number, default 10) | `query_context(query="authentication flow")` |
| `get_impact` | Returns the blast radius of a file — direct importers, transitive importers, affected tests and routes. | `file` (required string), `depth` (optional number, default 3) | `get_impact(file="src/auth/service.ts")` |
| `get_lines` | **Surgical Context** demand-driven fetch: returns an exact line range from a file behind a `:start-end` anchor. Clamped to file bounds, secret-scanned, sandboxed to the project root. New in v6.12.0. | `file` (required string), `start` (required number), `end` (required number) | `get_lines(file="src/config/loader.js", start=42, end=58)` |

## Token cost per tool call

Expand Down Expand Up @@ -165,7 +167,9 @@ Expected output:
{ "name": "list_modules" },
{ "name": "create_checkpoint" },
{ "name": "get_routing" },
{ "name": "query_context" }
{ "name": "query_context" },
{ "name": "get_impact" },
{ "name": "get_lines" }
]
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs-vp/guide/quality-benchmark.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Quality benchmark
description: What token reduction means operationally in v6.11.1. 16/21 repos overflow GPT-4o without SigMap, 5,200+ files would be hidden, and GPT-4o input savings reach $10,500+/month at 10 calls/day.
description: What token reduction means operationally in v6.12.0. 16/21 repos overflow GPT-4o without SigMap, 5,200+ files would be hidden, and GPT-4o input savings reach $10,500+/month at 10 calls/day.
head:
- - meta
- property: og:title
Expand All @@ -15,8 +15,8 @@ head:

# Quality benchmark

::: info Official v6.11.1 benchmark snapshot
**Benchmark ID:** sigmap-v6.11-main &nbsp;·&nbsp; **Date:** 2026-06-04 (with R language)
::: info Official v6.12.0 benchmark snapshot
**Benchmark ID:** sigmap-v6.12-main &nbsp;·&nbsp; **Date:** 2026-06-05 (with R language)

| Metric | Value |
|---|---:|
Expand All @@ -34,7 +34,7 @@ Token reduction is the mechanism. This benchmark shows the operational consequen
- how much code would be hidden without SigMap?
- what does that mean for API cost?

Latest saved run: **2026-06-04 (v6.11.1)**
Latest saved run: **2026-06-05 (v6.12.0)**

## Headline numbers

Expand Down
8 changes: 4 additions & 4 deletions docs-vp/guide/retrieval-benchmark.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Retrieval benchmark
description: Latest saved retrieval benchmark for SigMap v6.11.1. 81% hit@5 vs 13.6% random baseline across 90 tasks on 18 repos, with R language support.
description: Latest saved retrieval benchmark for SigMap v6.12.0. 81% hit@5 vs 13.6% random baseline across 90 tasks on 18 repos, with R language support.
head:
- - meta
- property: og:title
Expand All @@ -15,8 +15,8 @@ head:

# Retrieval benchmark

::: info Official v6.11.1 benchmark snapshot
**Benchmark ID:** sigmap-v6.11-main &nbsp;·&nbsp; **Date:** 2026-06-04 (with R language)
::: info Official v6.12.0 benchmark snapshot
**Benchmark ID:** sigmap-v6.12-main &nbsp;·&nbsp; **Date:** 2026-06-05 (with R language)

| Metric | Value |
|---|---:|
Expand All @@ -29,7 +29,7 @@ head:
| GPT-4o overflow (without → with) | **16/21 → 0/21** |
:::

Latest saved run: **2026-06-04 (v6.11.1)**
Latest saved run: **2026-06-05 (v6.12.0)**

**Result:** SigMap finds the right file in the top 5 far more often than chance — **81% hit@5** vs **13.6%** random baseline across 90 tasks on 18 real repos.

Expand Down
Loading
Loading