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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ Format: [Semantic Versioning](https://semver.org/)

---

## [6.6.4] — 2026-04-29

### Changed

- **JVM path pattern refactor** — Extracted JVM path regex pattern into a reusable constant `JVM_PATH_PATTERN` in source-root-scorer.js for improved testability and reusability. No behavior changes.

---

## [6.6.3] — 2026-04-29

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions docs-vp/guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ sigmap bench --submit --json
────────────────────────────────────────────────────────
SigMap Community Benchmark Submission
────────────────────────────────────────────────────────
SigMap version : 6.6.3
SigMap version : 6.6.4
Benchmark ID : sigmap-v6.5-main
Submitted : 2026-04-27
────────────────────────────────────────────────────────
Expand All @@ -471,7 +471,7 @@ JSON output (`--json`) returns a machine-readable object:

```json
{
"sigmapVersion": "6.6.3",
"sigmapVersion": "6.6.4",
"benchmarkId": "sigmap-v6.5-main",
"canonicalHitAt5": 81.1,
"canonicalReduction": 96.9,
Expand Down
4 changes: 2 additions & 2 deletions gen-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5387,7 +5387,7 @@ __factories["./src/mcp/server"] = function(module, exports) {

const SERVER_INFO = {
name: 'sigmap',
version: '6.6.3',
version: '6.6.4',
description: 'SigMap MCP server — code signatures on demand',
};

Expand Down Expand Up @@ -7855,7 +7855,7 @@ const path = require('path');
const os = require('os');
const { execSync } = require('child_process');

const VERSION = '6.6.3';
const VERSION = '6.6.4';
const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';

function requireSourceOrBundled(key) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sigmap",
"version": "6.6.3",
"version": "6.6.4",
"description": "Zero-dependency AI context engine — 97% token reduction. No npm install. Runs on Node 18+.",
"main": "gen-context.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sigmap-cli",
"version": "6.6.3",
"version": "6.6.4",
"description": "SigMap CLI wrapper — thin adapter for programmatic CLI invocation",
"main": "index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sigmap-core",
"version": "6.6.3",
"version": "6.6.4",
"description": "SigMap core library — zero-dependency code signature extraction, retrieval, and security scanning",
"main": "index.js",
"keywords": [
Expand Down
6 changes: 4 additions & 2 deletions src/discovery/source-root-scorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const PENALTY_DIRS = new Set([
'benchmarks','scripts',
]);

const JVM_PATH_PATTERN = /^(src\/main\/(java|kotlin|scala)|app\/src\/main\/(java|kotlin|scala))$/;

const ROOT_ENTRYPOINTS = {
go: ['main.go'],
python: ['app.py','main.py','wsgi.py','asgi.py'],
Expand All @@ -48,7 +50,7 @@ function scoreCandidate(dirName, fullPath, context) {
let score = 0;

// JVM paths (Java, Kotlin, Scala) get highest priority: +5.0
if (/^(src\/main\/(java|kotlin|scala)|app\/src\/main\/(java|kotlin|scala))$/.test(dirName)) score += 5.0;
if (JVM_PATH_PATTERN.test(dirName)) score += 5.0;

// Framework match: +3.0 if this dir is in the framework's srcDirs
if (frameworkSrcDirs.has(dirName)) score += 3.0;
Expand Down Expand Up @@ -98,4 +100,4 @@ function _countSourceFiles(dir, depth) {
return count;
}

module.exports = { scoreCandidate, getRecentlyChangedDirs, ROOT_ENTRYPOINTS };
module.exports = { scoreCandidate, getRecentlyChangedDirs, ROOT_ENTRYPOINTS, JVM_PATH_PATTERN };
2 changes: 1 addition & 1 deletion src/mcp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, exp

const SERVER_INFO = {
name: 'sigmap',
version: '6.6.3',
version: '6.6.4',
description: 'SigMap MCP server — code signatures on demand',
};

Expand Down
25 changes: 24 additions & 1 deletion test/integration/v650-source-root-resolver.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const os = require('os');
const { resolveSourceRoots } = require('../../src/discovery/source-root-resolver');
const { detectLanguages } = require('../../src/discovery/language-detector');
const { detectFrameworks } = require('../../src/discovery/framework-detector');
const { scoreCandidate } = require('../../src/discovery/source-root-scorer');
const { scoreCandidate, JVM_PATH_PATTERN } = require('../../src/discovery/source-root-scorer');
const { loadIgnorePatterns, matchesIgnorePattern } = require('../../src/discovery/sigmapignore');

function makeRepo(files) {
Expand Down Expand Up @@ -447,4 +447,27 @@ test('scoreCandidate gives +5.0 bonus to app/src/main/scala', () => {
assert(score >= 5.0, `app/src/main/scala should get +5.0 bonus, got ${score}`);
});

test('JVM_PATH_PATTERN is exported from source-root-scorer', () => {
assert(JVM_PATH_PATTERN instanceof RegExp, 'JVM_PATH_PATTERN should be a RegExp');
});

test('JVM_PATH_PATTERN matches src/main/ JVM paths', () => {
assert(JVM_PATH_PATTERN.test('src/main/java'), 'should match src/main/java');
assert(JVM_PATH_PATTERN.test('src/main/kotlin'), 'should match src/main/kotlin');
assert(JVM_PATH_PATTERN.test('src/main/scala'), 'should match src/main/scala');
});

test('JVM_PATH_PATTERN matches app/src/main/ JVM paths', () => {
assert(JVM_PATH_PATTERN.test('app/src/main/java'), 'should match app/src/main/java');
assert(JVM_PATH_PATTERN.test('app/src/main/kotlin'), 'should match app/src/main/kotlin');
assert(JVM_PATH_PATTERN.test('app/src/main/scala'), 'should match app/src/main/scala');
});

test('JVM_PATH_PATTERN rejects non-JVM paths', () => {
assert(!JVM_PATH_PATTERN.test('src/main/python'), 'should not match src/main/python');
assert(!JVM_PATH_PATTERN.test('src/test/java'), 'should not match src/test/java');
assert(!JVM_PATH_PATTERN.test('app/main/java'), 'should not match app/main/java');
assert(!JVM_PATH_PATTERN.test('src'), 'should not match bare src');
});

console.log('\nAll tests passed!');
Loading