Skip to content

Commit 499b92a

Browse files
committed
docs: v1.4.0 — explain_file, list_modules, strategy-aware health score
1 parent 83faa07 commit 499b92a

3 files changed

Lines changed: 47 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,50 @@ Format: [Semantic Versioning](https://semver.org/)
66

77
---
88

9-
## [1.3.0] — 2026-04-03
9+
## [1.4.0] — 2026-04-04
10+
11+
### Added
12+
- **`explain_file` MCP tool** — deep-dive tool for a single file. Given a relative path, returns three sections: `## Signatures` (from the indexed context file), `## Imports` (resolved relative dependencies from the live source file), and `## Callers` (reverse import lookup across all indexed files). Gracefully returns partial output if the file is not on disk.
13+
- **`list_modules` MCP tool** — returns a markdown table listing all top-level module directories found in the context file, sorted by token count descending, with columns: `Module | Files | Tokens`. Helps agents pick the right `module` arg for `read_context`.
14+
- **Strategy-aware health scorer**`src/health/scorer.js` and `--health` display now read `gen-context.config.json` and adjust the low-reduction penalty threshold by strategy:
15+
- `full` (default): 60% reduction threshold — unchanged behaviour.
16+
- `hot-cold` / `per-module`: reduction penalty disabled — intentionally small hot outputs are not penalised.
17+
- `hot-cold` only: adds a `context-cold.md` freshness check (`strategyFreshnessDays`). If the cold context file is >1 day stale, up to 10 pts are deducted.
18+
- **New `--health` output fields**`strategy:` line always visible; `cold freshness:` line shown for `hot-cold` strategy.
19+
- **`test/integration/mcp-v14.test.js`** — 13 integration tests covering `explain_file` and `list_modules`:
20+
- 7-tool count verification
21+
- Signature extraction from index
22+
- Imports and Callers sections (file on disk)
23+
- Graceful error for unknown path, missing arg, no context file
24+
- Token count and table structure in `list_modules`
25+
- Multi-call session combining both new tools
26+
- **`test/integration/observability.test.js`** — 12 new unit tests for strategy-aware scorer:
27+
- `strategy` field in all return objects
28+
- No reduction penalty for `hot-cold` and `per-module`
29+
- Reduction penalty still applied for `full`
30+
- `strategyFreshnessDays` null/populated correctly
31+
- Grade A for a fresh, untracked project
32+
33+
### Fixed
34+
- Health scorer: projects with **zero tracking history** (brand-new or never run with `--track`) are no longer penalised for "0% reduction". `tokenReductionPct` is only set when `totalRuns > 0`.
35+
36+
### Changed
37+
- MCP server now exposes **7 tools** (was 5 before v1.3, 5 in v1.3). `tools/list` assertion updated in `mcp-server.test.js`.
38+
- `gen-context.js` VERSION bumped to `1.4.0`
39+
- MCP server `SERVER_INFO.version` bumped to `1.4.0`
40+
- `package.json` version bumped to `1.4.0`
41+
42+
### Validation gate
43+
- `node gen-context.js --version``1.4.0`
44+
- `echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node gen-context.js --mcp` → 7 tools ✔
45+
- `node test/integration/mcp-v14.test.js` → 13/13 pass ✔
46+
- `node test/integration/observability.test.js` → 35/35 pass ✔
47+
- `node test/integration/mcp-server.test.js` → 16/16 pass ✔
48+
- `node test/run.js` → 21/21 extractor tests pass ✔
49+
50+
---
51+
52+
1053

1154
### Added
1255
- **`--diff` CLI flag** — generates context only for files changed in the current git working tree (`git diff HEAD --name-only`). Useful in CI and pre-review workflows where you only want signatures for files you've touched.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ npx repomix --compress # deep dive sessions
8787

8888
## CLI reference
8989

90-
> **Note:** `node gen-context.js`, `--watch`, `--setup`, `--report`, `--mcp`, `--routing`, `--diff`, and `--init` are live in v1.3.
90+
> **Note:** `node gen-context.js`, `--watch`, `--setup`, `--report`, `--mcp`, `--routing`, `--diff`, and `--init` are live in v1.4.
9191
> Features marked `(v0.x)` or `(v1.x)` were added incrementally — see [CHANGELOG.md](CHANGELOG.md) for when each shipped.
9292
9393
```

TIMELINE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ A version is NOT done until its validation gate is 100% green.
3434
| v1.1 | Context strategies | 3 days | per-module: −70% / hot-cold: −90% per question |
3535
| v1.2 | Version bump + test hardening | 1 day | correctness + npm discoverability |
3636
| v1.3 | `--diff` flag + watch debounce | 2 days | −50–90% tokens during active PR work |
37-
| v1.4 | MCP `explain_file` + strategy-aware health | 2 days | precision queries, accurate scoring |
37+
| v1.4 | MCP `explain_file` + strategy-aware health | 2 days | precision queries, accurate scoring |
3838
| v1.5 | VS Code extension + npm publish + docs search | 1 week | 10× adoption surface |
3939

4040
---
@@ -789,7 +789,7 @@ node test/run.js
789789
---
790790

791791
## v1.4 — MCP `explain_file` tool + strategy-aware health score
792-
**Status: 📋 PLANNED**
792+
**Status: ✅ SHIPPED — v1.4.0**
793793
**Duration: 2 days | Owner: Platform**
794794

795795
### What ships

0 commit comments

Comments
 (0)