squeze-cli 3.0.3 → 3.1.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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.0 — 2026-11-16
4
+
5
+ ### Added
6
+ - `squeze.explorer.ignore` (VS Code, resource-scoped, default `[]`): gitignore-style patterns for files to hide from the Code Explorer. Hidden files are removed before the node limit applies, so they do not use its slots. They stay indexed, so packs and MCP results are unchanged. Up to 200 patterns of at most 500 characters; invalid entries are skipped.
7
+
8
+ ### Changed
9
+ - The Code Explorer draws the top 2,000 files by rank by default, which is also the maximum (was 600 by default, 2,000 maximum). The summary shows the ignored count when `squeze.explorer.ignore` hides files.
10
+ - The `squeze graph --html` export draws the top 2,000 files by default and at most (was 400 and 1,500). Repositories of 400 files or fewer produce the same output as before. At 2,000 files the page is about 620 KiB and renders in about 0.35 s on synthetic graphs.
11
+
3
12
  ## 3.0.3 — 2026-11-15
4
13
 
5
14
  ### Added
package/README.md CHANGED
@@ -98,7 +98,7 @@ Search **Squeze** in the Extensions view, or install from the terminal:
98
98
  code --install-extension 2002-rokkam.squeze-cli # VS Code Marketplace
99
99
  ```
100
100
 
101
- The same extension is on [Open VSX](https://open-vsx.org/extension/2002-rokkam/squeze-cli) for VSCodium and other forks. To build a VSIX from source instead, run `npm run package` (writes `releases/squeze-cli-3.0.3.vsix`) and install that file with `code --install-extension`.
101
+ The same extension is on [Open VSX](https://open-vsx.org/extension/2002-rokkam/squeze-cli) for VSCodium and other forks. To build a VSIX from source instead, run `npm run package` (writes `releases/squeze-cli-3.1.0.vsix`) and install that file with `code --install-extension`.
102
102
 
103
103
  Enable **Squeze Context**, **Expand** and **Map** in Copilot's tool picker, or write `#squeze` in a prompt. Run **Squeze: Install Copilot Instructions** once per repository for retrieval-first guidance.
104
104
 
@@ -185,13 +185,13 @@ Details and rationale: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). A source-ve
185
185
 
186
186
  | Area | Change |
187
187
  | --- | --- |
188
- | Code Explorer | `Squeze: Open Code Explorer`: a searchable, interactive map of the code graph with subsystems, hubs and links. Renders under a per-render nonce CSP with no network requests. Draws the top 600 files by rank by default (2,000 maximum) with at most 6,000 edges; when files are left out the summary reads "showing top N files", and graphs built from a candidate subset are labelled "PARTIAL graph" |
188
+ | Code Explorer | `Squeze: Open Code Explorer`: a searchable, interactive map of the code graph with subsystems, hubs and links. Renders under a per-render nonce CSP with no network requests. Draws the top 2,000 files by rank (the maximum) with at most 6,000 edges. `squeze.explorer.ignore` hides files before that limit, so hidden files do not use its slots. The summary reads "N of M files" (N drawn, M in the repository) and shows the ignored count, and graphs built from a candidate subset are labelled "partial graph" |
189
189
  | Index freshness | `squeze.autoRefresh` (on by default) and `Squeze: Refresh Index`. File changes are picked up through a debounced, single-flight refresh |
190
190
  | Token savings | `Squeze: Show Token Savings`: a local ledger of input tokens avoided by each pack call (whole-repository input minus pack output). It is an estimate from pack calls only, not billing data |
191
191
  | Reuse safety | Index reuse also checks change time and inode. Files whose newest timestamp is within 2 s of the scan are always re-read. Cache format 2: older caches are discarded once |
192
- | Graph command | `Squeze: Show Code Graph` now opens the Code Explorer. The `squeze graph --html` export is unchanged (byte-identical on express, gin and requests) |
192
+ | Graph command | `Squeze: Show Code Graph` now opens the Code Explorer. The `squeze graph --html` export draws the top 2,000 files by default (it drew 400 in 3.0.x); repositories of 400 files or fewer produce the same output as before |
193
193
  | Fixes | A nested `.gitignore` that re-includes a file is honoured (checked against `git ls-files`); the MCP server reported 2.2.0 while the package was 2.2.1; a file changed between indexing and loading no longer fails `context` (the pack is rebuilt, at most three attempts); test scratch repositories moved out of the repository root |
194
- | Tests | `npm test` (678 tests); `npm run test:ui` (9 browser tests of the Explorer at 1440, 768 and 360 px; run `npx playwright install chromium` first); `npm run test:editor` (VS Code extension host; set `VSCODE_EXECUTABLE_PATH` to a VS Code binary) |
194
+ | Tests | `npm test` (687 tests); `npm run test:ui` (9 browser tests of the Explorer at 1440, 768 and 360 px; run `npx playwright install chromium` first); `npm run test:editor` (VS Code extension host; set `VSCODE_EXECUTABLE_PATH` to a VS Code binary) |
195
195
  | Proof | `npm run bench:proof` (public corpus at pinned commits; needs network); `node --import tsx bench/proof/run.ts local <path>` (private repository; aggregate output only) |
196
196
 
197
197
  Behaviour changes to know about: `Squeze: Show Code Graph` opens the Explorer, and the cache format moved to version 2 (older caches are discarded once).
@@ -351,7 +351,7 @@ The 2.1.0 profile on the 921-file repo: tokenizing the whole repository only to
351
351
 
352
352
  ### 11. Tests and robustness
353
353
 
354
- `npm test` runs 678 tests (unit, property, adversarial, MCP protocol, cache corruption and concurrency, read-only checkout). All 678 pass on the 3.0.3 tree. Two tests have wall-clock limits (a 60 s MCP request timeout and a 1 s bound on 2 MiB of adversarial text) and can fail under heavy machine load, so re-run before treating a failure as a regression.
354
+ `npm test` runs 687 tests (unit, property, adversarial, MCP protocol, cache corruption and concurrency, read-only checkout). All 687 pass on the 3.1.0 tree. Two tests have wall-clock limits (a 60 s MCP request timeout and a 1 s bound on 2 MiB of adversarial text) and can fail under heavy machine load, so re-run before treating a failure as a regression.
355
355
 
356
356
  A many-repository robustness and adversarial suite is in [bench/robustness](bench/robustness). Only a partial run was completed on the final build: 2 repositories (gin, requests), 32 commands, 0 crashes, 0 timeouts, 0 budget violations, 0 secret-regex hits in outputs ([report](benchmarks/v3/robustness-final.md)). That run flagged 4 of 8 repeat comparisons as non-identical while the machine load was about 50; serial re-runs of `map` on the same checkout were byte-identical 3 of 3 times and `context` cold and warm were identical on a second checkout, so the cause was not identified. The adversarial section did not finish and is **not** claimed.
357
357
 
@@ -380,6 +380,7 @@ A many-repository robustness and adversarial suite is in [bench/robustness](benc
380
380
  | `REPOSQUEEZE_MAX_CANDIDATES` | Candidates parsed in large-repository mode (100–5,000) |
381
381
  | `--semantic-model all-minilm` | Optional local Ollama embeddings of the 300 strongest lexical candidates; sent to `127.0.0.1:11434` only |
382
382
  | `squeze.autoRefresh` (VS Code) | Index in the background when a trusted folder opens and refresh after file changes (on by default); off means indexing runs only when you use a Squeze command |
383
+ | `squeze.explorer.ignore` (VS Code) | Gitignore-style patterns hidden from the Code Explorer, for example `vendor/` or `**/*.generated.ts` (up to 200 patterns, 500 characters each). Hidden files do not count against the 2,000-file limit. They are still indexed, so packs and MCP results do not change |
383
384
  | `.reposqueeze-v2ignore` | Extra ignore rules (gitignore syntax) |
384
385
 
385
386
  ## Security model
@@ -397,13 +398,13 @@ A many-repository robustness and adversarial suite is in [bench/robustness](benc
397
398
  - Safety limits: 100,000 files, 2 GiB indexed text, 2 MiB per file, depth 60. Exceeding one is reported in the output.
398
399
  - Token counts use `o200k_base`; provider counts differ.
399
400
  - Public non-inferiority failure: against whole-repository reading, squeze loses 3.1 points of symbol-lookup recall on the public corpus, outside the 2.0-point margin (section 0 of Evidence).
400
- - Explorer: the top 600 files by rank are drawn by default (2,000 maximum); the summary then reads "showing top N files". Graphs built from a candidate subset are labelled "PARTIAL graph".
401
+ - Explorer: the top 2,000 files by rank are drawn (the maximum), because layout cost grows with the square of the drawn files. Files matched by `squeze.explorer.ignore` are hidden before that limit, so a large repository shows the top 2,000 of its remaining files; the summary reads "N of M files". Graphs built from a candidate subset are labelled "partial graph". The `squeze graph --html` export uses the same 2,000-file limit.
401
402
  - Windows: the CLI and extension are built for it, but some benchmark and chunker tests still assume `/` path separators, so the Windows CI job is informational.
402
403
 
403
404
  ## Reproduce
404
405
 
405
406
  ```sh
406
- npm ci && npm run check && npm test # type-check and the 678-test suite
407
+ npm ci && npm run check && npm test # type-check and the 687-test suite
407
408
  npm run measure:overhead # section 3
408
409
  npm run bench:fetch && npm run bench:devsuite # section 2 (runs the current checkout)
409
410
  npx playwright install chromium && npm run test:ui # browser tests of the Explorer
package/dist/cli.cjs CHANGED
@@ -57321,6 +57321,7 @@ function layout(count, community, links, seeds, width = LAYOUT_WIDTH, height = L
57321
57321
  }
57322
57322
 
57323
57323
  // src/graph-html.ts
57324
+ var MAX_HTML_NODES = 2e3;
57324
57325
  var WIDTH = 1200;
57325
57326
  var HEIGHT = 800;
57326
57327
  var MAX_EDGES = 4e3;
@@ -57335,7 +57336,7 @@ line{stroke:#999;stroke-opacity:.35;stroke-width:1}line.ref{stroke-dasharray:3 3
57335
57336
  svg.focus circle{opacity:.12}svg.focus line{stroke-opacity:.04}svg.focus circle.hot{opacity:1;stroke:#000}svg.focus line.hot{stroke-opacity:.9;stroke:#000}`;
57336
57337
  var sha = (text) => `'sha256-${(0, import_node_crypto6.createHash)("sha256").update(text).digest("base64")}'`;
57337
57338
  function renderHtml(graph, options = {}) {
57338
- const maxNodes = Math.max(1, Math.min(1500, options.maxNodes ?? 400));
57339
+ const maxNodes = Math.max(1, Math.min(MAX_HTML_NODES, options.maxNodes ?? MAX_HTML_NODES));
57339
57340
  const shown = graph.filesByRank().slice(0, maxNodes);
57340
57341
  const index = new Map(shown.map((f, i2) => [f, i2]));
57341
57342
  const community = shown.map((f) => graph.community[f]);
@@ -57798,7 +57799,7 @@ async function runGraph(repo, request = {}) {
57798
57799
  }
57799
57800
 
57800
57801
  // src/mcp.ts
57801
- var VERSION2 = "3.0.3";
57802
+ var VERSION2 = "3.1.0";
57802
57803
  async function serve(root, options = {}) {
57803
57804
  const { semanticModel, tools = "core", features } = typeof options === "string" ? { semanticModel: options } : options;
57804
57805
  const repo = new Engine(root, { semanticModel, features });
@@ -16650,6 +16650,7 @@ function layout(count, community, links, seeds, width = LAYOUT_WIDTH, height = L
16650
16650
  }
16651
16651
 
16652
16652
  // src/graph-html.ts
16653
+ var MAX_HTML_NODES = 2e3;
16653
16654
  var WIDTH = 1200;
16654
16655
  var HEIGHT = 800;
16655
16656
  var MAX_EDGES = 4e3;
@@ -16664,7 +16665,7 @@ line{stroke:#999;stroke-opacity:.35;stroke-width:1}line.ref{stroke-dasharray:3 3
16664
16665
  svg.focus circle{opacity:.12}svg.focus line{stroke-opacity:.04}svg.focus circle.hot{opacity:1;stroke:#000}svg.focus line.hot{stroke-opacity:.9;stroke:#000}`;
16665
16666
  var sha = (text) => `'sha256-${(0, import_node_crypto6.createHash)("sha256").update(text).digest("base64")}'`;
16666
16667
  function renderHtml(graph, options = {}) {
16667
- const maxNodes = Math.max(1, Math.min(1500, options.maxNodes ?? 400));
16668
+ const maxNodes = Math.max(1, Math.min(MAX_HTML_NODES, options.maxNodes ?? MAX_HTML_NODES));
16668
16669
  const shown = graph.filesByRank().slice(0, maxNodes);
16669
16670
  const index = new Map(shown.map((f, i2) => [f, i2]));
16670
16671
  const community = shown.map((f) => graph.community[f]);
@@ -17128,11 +17129,14 @@ async function runGraph(repo, request = {}) {
17128
17129
 
17129
17130
  // src/explorer-model.ts
17130
17131
  init_import_meta();
17131
- var EXPLORER_MODEL_VERSION = 1;
17132
- var DEFAULT_EXPLORER_NODES = 600;
17132
+ var import_ignore2 = __toESM(require_ignore(), 1);
17133
+ var EXPLORER_MODEL_VERSION = 2;
17134
+ var DEFAULT_EXPLORER_NODES = 2e3;
17133
17135
  var MAX_EXPLORER_NODES = 2e3;
17134
17136
  var DEFAULT_EXPLORER_EDGES = 6e3;
17135
17137
  var MAX_EXPLORER_EDGES = 1e4;
17138
+ var MAX_IGNORE_PATTERNS = 200;
17139
+ var MAX_IGNORE_PATTERN_LENGTH = 500;
17136
17140
  var clampInt = (value, min, max, fallback) => {
17137
17141
  if (value === void 0 || !Number.isFinite(value)) return fallback;
17138
17142
  return Math.min(max, Math.max(min, Math.floor(value)));
@@ -17146,6 +17150,13 @@ function isShownPath(model, path) {
17146
17150
  return model.nodes.some((node) => node.path === path);
17147
17151
  }
17148
17152
  var MAX_OPEN_PATH = 1024;
17153
+ function ignoreMatcher(patterns) {
17154
+ if (!Array.isArray(patterns)) return void 0;
17155
+ const accepted = patterns.filter((pattern) => typeof pattern === "string" && pattern.trim().length > 0 && pattern.length <= MAX_IGNORE_PATTERN_LENGTH).slice(0, MAX_IGNORE_PATTERNS);
17156
+ if (accepted.length === 0) return void 0;
17157
+ const matcher = (0, import_ignore2.default)().add(accepted);
17158
+ return (path) => matcher.ignores(path);
17159
+ }
17149
17160
  function explorerOpenPath(message) {
17150
17161
  if (typeof message !== "object" || message === null) return void 0;
17151
17162
  const { type, path } = message;
@@ -17155,7 +17166,10 @@ function explorerOpenPath(message) {
17155
17166
  function buildExplorerModel(graph, options = {}) {
17156
17167
  const maxNodes = clampInt(options.maxNodes, 1, MAX_EXPLORER_NODES, DEFAULT_EXPLORER_NODES);
17157
17168
  const maxEdges = clampInt(options.maxEdges, 0, MAX_EXPLORER_EDGES, DEFAULT_EXPLORER_EDGES);
17158
- const shown = graph.filesByRank().slice(0, maxNodes);
17169
+ const ranked = graph.filesByRank();
17170
+ const isIgnored = ignoreMatcher(options.ignore);
17171
+ const visible = isIgnored ? ranked.filter((file) => !isIgnored(graph.label[file])) : ranked;
17172
+ const shown = visible.slice(0, maxNodes);
17159
17173
  const index = new Map(shown.map((file, i2) => [file, i2]));
17160
17174
  const candidates = [];
17161
17175
  shown.forEach((file, from) => {
@@ -17219,6 +17233,7 @@ function buildExplorerModel(graph, options = {}) {
17219
17233
  cycles: graph.cycles.length
17220
17234
  },
17221
17235
  shown: { nodes: nodes.length, edges: kept.length },
17236
+ ignored: ranked.length - visible.length,
17222
17237
  bounds,
17223
17238
  nodes,
17224
17239
  edges: kept.map((edge) => ({ from: edge.from, to: edge.to, imports: edge.imports, weight: round(edge.weight, 3) })),
@@ -17599,7 +17614,10 @@ function activate(context) {
17599
17614
  }
17600
17615
  function modelFor(session) {
17601
17616
  if (!session.graph) return void 0;
17602
- if (!session.model) session.model = buildExplorerModel(session.graph, { title: session.folder.name });
17617
+ if (!session.model) {
17618
+ const ignore3 = vscode.workspace.getConfiguration("squeze", session.folder.uri).get("explorer.ignore", []);
17619
+ session.model = buildExplorerModel(session.graph, { title: session.folder.name, ignore: ignore3 });
17620
+ }
17603
17621
  return session.model;
17604
17622
  }
17605
17623
  function pushModel(session) {
@@ -17816,6 +17834,9 @@ ${INSTRUCTIONS}`));
17816
17834
  void refresh(session, false);
17817
17835
  }
17818
17836
  }
17837
+ } else if (event.affectsConfiguration("squeze.explorer.ignore")) {
17838
+ for (const session of sessions.values()) session.model = void 0;
17839
+ if (explorer) pushModel(explorer.session);
17819
17840
  }
17820
17841
  updateStatus();
17821
17842
  }));
package/media/explorer.js CHANGED
@@ -43,6 +43,7 @@
43
43
  notes: [],
44
44
  totals: { files: 0, links: 0, definitions: 0, importEdges: 0, referenceEdges: 0, subsystems: 0, cycles: 0 },
45
45
  shown: { nodes: 0, edges: 0 },
46
+ ignored: 0,
46
47
  bounds: { minX: 0, minY: 0, maxX: 0, maxY: 0 },
47
48
  nodes: [],
48
49
  edges: [],
@@ -123,7 +124,9 @@
123
124
  function describeModel(m) {
124
125
  const t = m.totals;
125
126
  const s = m.shown;
126
- let text = fmt(s.nodes) + ' of ' + fmt(t.files) + ' files \u00b7 ' + fmt(s.edges) + ' of ' + fmt(t.links)
127
+ let text = fmt(s.nodes) + ' of ' + fmt(t.files) + ' files';
128
+ if (m.ignored > 0) text += ' \u00b7 ' + fmt(m.ignored) + ' ignored';
129
+ text += ' \u00b7 ' + fmt(s.edges) + ' of ' + fmt(t.links)
127
130
  + ' links \u00b7 ' + fmt(t.subsystems) + ' subsystems';
128
131
  if (m.partial) text += ' \u00b7 partial graph';
129
132
  return text;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "mcpName": "io.github.2002-rokkam/squeze",
4
4
  "displayName": "Squeze",
5
5
  "description": "Local, deterministic, token-budgeted code context for GitHub Copilot and MCP coding agents. Fewer input tokens per task: cited source excerpts and a code graph.",
6
- "version": "3.0.3",
6
+ "version": "3.1.0",
7
7
  "publisher": "2002-rokkam",
8
8
  "icon": "media/icon.png",
9
9
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "test": "node --import tsx --test tests/*.test.ts",
41
41
  "bench": "node --import tsx scripts/benchmark.ts",
42
42
  "bench:fetch": "node scripts/fetch-bench.mjs",
43
- "package": "npm run build && vsce package --no-dependencies --allow-missing-repository -o releases/squeze-cli-3.0.3.vsix",
43
+ "package": "npm run build && vsce package --no-dependencies --allow-missing-repository -o releases/squeze-cli-3.1.0.vsix",
44
44
  "prepare": "npm run build",
45
45
  "test:editor": "node scripts/test-extension.mjs",
46
46
  "test:ui": "node --import tsx --test tests/ui/*.test.ts",
@@ -128,6 +128,17 @@
128
128
  "type": "boolean",
129
129
  "default": true,
130
130
  "description": "Index the workspace in the background when a trusted folder opens, and refresh the index after file changes (debounced). Turn off to index only when you run a Squeze command."
131
+ },
132
+ "squeze.explorer.ignore": {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "string",
136
+ "maxLength": 500
137
+ },
138
+ "maxItems": 200,
139
+ "default": [],
140
+ "scope": "resource",
141
+ "markdownDescription": "Gitignore-style patterns for files to hide from the Code Explorer, for example `vendor/`, `**/*.generated.ts` or `docs/**`. Hidden files are not drawn and do not count against the Explorer's 2,000-file limit. Squeze still indexes them, so packs and MCP results are unchanged. To remove files from Squeze entirely, list them in `.reposqueeze-v2ignore`."
131
142
  }
132
143
  }
133
144
  },