@ninjaxtools/slopdex 0.9.0 → 0.10.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/.agents/skills/slopdex/SKILL.md +22 -65
- package/README.md +28 -50
- package/dist/cli.js +72 -39
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/docs/implementation.md +5 -3
- package/package.json +1 -1
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: slopdex
|
|
3
|
-
description:
|
|
3
|
+
description: Semantic code search, find duplicate-function candidates, analyze physical code cohesion
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Slopdex operator guide for agents
|
|
7
7
|
|
|
8
|
-
Slopdex
|
|
9
|
-
|
|
10
|
-
## Choose the command that answers the task
|
|
11
|
-
|
|
12
|
-
Run the requested operation directly. Do not precede it with status, help, version, executable lookup, or credential probes unless those are the user's task or needed to diagnose a reported failure. Missing indexes initialize automatically.
|
|
8
|
+
Slopdex does semantic code search, finds similar-code candidates, and identifies related functions stored far apart.
|
|
13
9
|
|
|
14
10
|
### Find code by meaning
|
|
15
11
|
|
|
@@ -18,32 +14,37 @@ slopdex search "validate an authenticated session" --format summary --limit 10
|
|
|
18
14
|
slopdex search "persist user data" -e 'save|persist' --format summary --limit 5
|
|
19
15
|
```
|
|
20
16
|
|
|
21
|
-
Describe behavior rather than guessing a symbol name. `-e`
|
|
17
|
+
Describe behavior rather than guessing a symbol name. `-e` is a regex that restricts which symbols (functions) are searched.
|
|
22
18
|
|
|
23
19
|
### Search function purpose
|
|
24
20
|
|
|
21
|
+
Code purpose-summary generation needs to be enabled once:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
slopdex summaries enable # only needed once
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Then purpose-summaries can be searched:
|
|
28
|
+
|
|
25
29
|
```bash
|
|
26
|
-
slopdex use-summaries
|
|
27
30
|
slopdex search-summary "keep the repository index synchronized" --format summary --limit 10
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
Enabling needs `OPENAI_API_KEY` in the environment.
|
|
31
34
|
|
|
32
35
|
To select another model:
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
|
-
slopdex
|
|
38
|
+
slopdex summaries enable --summary-model <model-id>
|
|
36
39
|
```
|
|
37
40
|
|
|
38
|
-
The model persists for future updates. Do not enable summaries as a routine prerequisite for ordinary code search or duplicate discovery.
|
|
39
|
-
|
|
40
41
|
### Find duplicate candidates
|
|
41
42
|
|
|
42
43
|
```bash
|
|
43
44
|
slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.9 --limit 5
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
The default output is connected clusters. This excludes same-file matches and short functions.
|
|
47
|
+
The default output is connected clusters. This excludes same-file matches and short functions. For source-by-source matches, add `--format summary`.
|
|
47
48
|
|
|
48
49
|
Broaden discovery through adjacent score bands when needed:
|
|
49
50
|
|
|
@@ -52,7 +53,7 @@ slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.85-0.9 --limi
|
|
|
52
53
|
slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.8-0.85 --limit 5
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
Ranges include the lower bound and exclude the upper bound. Use `--min-lines 1` when one-line wrappers are relevant.
|
|
56
|
+
Ranges include the lower bound and exclude the upper bound. Use `--min-lines 1` when one-line wrappers are relevant.
|
|
56
57
|
|
|
57
58
|
### Review changes or a module
|
|
58
59
|
|
|
@@ -70,7 +71,7 @@ slopdex cross-search --source-path src -e 'validate' \
|
|
|
70
71
|
--cross-file-only --min-lines 4 --threshold 0.9
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
Here a source must have changed since the commit and belong to an uncommitted file, within the selected path/name scope. `--regex` is
|
|
74
|
+
Here a source must have changed since the commit and belong to an uncommitted file, within the selected path/name scope. `--regex` is an alias for `-e/--regexp`.
|
|
74
75
|
|
|
75
76
|
### Review physical cohesion
|
|
76
77
|
|
|
@@ -79,7 +80,7 @@ slopdex cohesion --threshold 0.8 --neighbors 20 --limit 50 --format summary
|
|
|
79
80
|
slopdex cohesion --source-path src/services --threshold 0.8 --format summary
|
|
80
81
|
```
|
|
81
82
|
|
|
82
|
-
Ranks related functions by semantic affinity and file/folder separation.
|
|
83
|
+
Ranks related functions by semantic affinity and file/folder separation. add `--include-source` only when full callable bodies are needed.
|
|
83
84
|
|
|
84
85
|
### Compare repositories
|
|
85
86
|
|
|
@@ -138,8 +139,7 @@ Explicit relative config/index paths resolve from the current directory. Source
|
|
|
138
139
|
| `--limit <number>` | Positive integer. `search`/`search-summary`: matches, default `10`. Cross-search: neighbors per source, default `5`. Cohesion: reported pairs and file rows, default `50`. |
|
|
139
140
|
| `--threshold <number\|min-max>` | Both query searches and analyses. Inclusive minimum or half-open range. Default `-1` for query/cross-search; `0.8` for cohesion. Cohesion minimum must be in `[-1, 1)`. |
|
|
140
141
|
| `--format <json\|summary\|clusters>` | Both query searches, cross-search, cohesion, index-errors. `clusters` only supports cross-search; output defaults below. |
|
|
141
|
-
| `-e <regex>`, `--regexp <regex>` |
|
|
142
|
-
| `--regex <regex>` | Cross-search/cohesion: filter both source and candidate qualified names. |
|
|
142
|
+
| `-e <regex>`, `--regexp <regex>`, `--regex <regex>` | Equivalent case-sensitive JavaScript regex options on qualified names. Query searches filter results before limiting; cross-search/cohesion filter sources only. |
|
|
143
143
|
| `--min-lines <number>` | Cross-search/cohesion: positive source/candidate length minimum, default `2`. |
|
|
144
144
|
| `--source-path <path>` | Cross-search/cohesion: source file or recursive directory within the root. |
|
|
145
145
|
| `--changed-since <commit>` | Cross-search/cohesion: added, modified, or moved functions since an ancestor of the indexed Git checkpoint, including working-tree changes. Requires Git. |
|
|
@@ -169,11 +169,11 @@ Use `--no-reindex` when the task calls for committed-only results or reuse of an
|
|
|
169
169
|
|
|
170
170
|
| Command | Default | Alternatives |
|
|
171
171
|
| --- | --- | --- |
|
|
172
|
-
| `search`, `search-summary` | JSON array
|
|
172
|
+
| `search`, `search-summary` | `summary` | JSON array; purpose search includes generated summary text |
|
|
173
173
|
| `cross-search` | `clusters` | `summary`, or `json` for JSONL with one row per matched source |
|
|
174
|
-
| `cohesion` |
|
|
175
|
-
| `index-errors` | JSON array |
|
|
176
|
-
| `status`, update commands, `
|
|
174
|
+
| `cohesion` | `summary` | One JSON report |
|
|
175
|
+
| `index-errors` | `summary` | JSON array |
|
|
176
|
+
| `status`, update commands, `summaries` | JSON object | — |
|
|
177
177
|
|
|
178
178
|
Prefer summary output for compact source review, clusters for duplicate families, and JSON/JSONL for structured processing. Stdout carries results; stderr carries notices and warnings. Cross-search omits sources without emitted matches. Empty output means no findings under the chosen coverage/filters, not proof that no similar code exists.
|
|
179
179
|
|
|
@@ -218,46 +218,3 @@ Cohesion: 184 functions analyzed, 37 semantic edges
|
|
|
218
218
|
- **JSON details:** `semanticWeight` reflects similarity above threshold; `separationWeight` reflects distance; `sourceTestPair` flags a path-inferred source/test relationship; file `externalAffinityRatio` measures affinity outside that file's folder.
|
|
219
219
|
|
|
220
220
|
The example merits reviewing separated authentication responsibilities, while accounting for intentional layering. There is no universal pass/fail threshold. Use comparable runs to evaluate changes. Filtered reports describe selected sources, not the full repository. Summary metrics use all qualifying edges; pairs/files are limited, and groups use reported pairs.
|
|
221
|
-
|
|
222
|
-
## Operational properties
|
|
223
|
-
|
|
224
|
-
- Requires Node.js 24+. Install with `npm install -g @ninjaxtools/slopdex` if installation is the task.
|
|
225
|
-
- Run from the repository root or pass `--root`. The default local index is `.slopdex/index.sqlite`; add `.slopdex/` to `.gitignore`.
|
|
226
|
-
- Most commands, including `status`, refresh before operating. With Git, the default is HEAD plus current working-tree changes; the checkpoint records the committed base. Without Git, refresh scans the working tree and warns. `index-errors`, help, and version do not refresh.
|
|
227
|
-
- Source filters narrow analysis, not the preceding refresh. Indexing and summary generation can make many API calls; unchanged inputs reuse cached results.
|
|
228
|
-
- Embedding keys are `OPENAI_API_KEY` or `JINA_API_KEY`; other than diagnostics/help/version, CLI commands require the configured embedding key even for cached analyses. Summaries also require OpenAI credentials when generation is needed.
|
|
229
|
-
- Function source and queries go to the embedding provider. Enabled summary generation sends repository name, path, callable source, and file context to OpenAI, and summary text to the embedding provider. Results and diagnostics remain in the local index. Never expose key values in tool calls, output, or commits.
|
|
230
|
-
- Coverage: Python `.py/.pyw`; JavaScript `.js/.mjs/.cjs/.jsx`; TypeScript `.ts/.mts/.cts/.tsx`; Rust `.rs`; Go `.go`; Java `.java`; C `.c/.h`. Named callables with bodies, including supported bound closures and nested functions, are indexed. Anonymous callbacks, bodyless declarations, macro expansion, and runtime relationships are outside coverage.
|
|
231
|
-
- Root/nested `.gitignore` rules apply even to tracked files and without Git. Current overlays use current rules; committed-only snapshots use committed rules. Refresh removes newly ignored files; explicit updates reject ignored paths.
|
|
232
|
-
- Dependency/build directories are excluded: `.git`, `.slopdex`, `node_modules`, `dist`, `build`, `coverage`, `vendor`, `generated`, `.venv`, `venv`, `__pycache__`, `.tox`, `.mypy_cache`, `.pytest_cache`, `target`. Config/ignore exceptions cannot override built-in exclusions or an ignored parent directory.
|
|
233
|
-
|
|
234
|
-
### Optional configuration
|
|
235
|
-
|
|
236
|
-
`<root>/.slopdex/config.json`:
|
|
237
|
-
|
|
238
|
-
```json
|
|
239
|
-
{
|
|
240
|
-
"provider": "jina",
|
|
241
|
-
"model": "jina-embeddings-v4",
|
|
242
|
-
"dimensions": 1024,
|
|
243
|
-
"exclude": ["**/fixtures/**"]
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Supported properties: `provider`, `model`, `dimensions`, `summaryModel`, `indexPath`, `include`, `exclude`, `maxFileSize`, `embeddingBatchSize`. Includes/excludes are repository-relative globs; an empty include list permits all eligible supported files. `maxFileSize` defaults to `1048576` bytes; `embeddingBatchSize` to `32`; both are positive integers. Keep credentials in the environment. Embedding-profile changes require `--force-reindex`.
|
|
248
|
-
|
|
249
|
-
## Failures and incomplete coverage
|
|
250
|
-
|
|
251
|
-
Parse, extraction, read, and file-size failures are saved while healthy functions remain searchable. Inspect `slopdex index-errors --format summary`; JSON adds locations, recovered names, source, and snapshot provenance. `status` reports `indexingErrorCount` and `failedFileCount`, and `functionCount` counts searchable callables.
|
|
252
|
-
|
|
253
|
-
Saved errors warn on stderr, including on cached runs and target indexes. `--ignore-errors` only silences the warning. Updates retry failed files; successful indexing, deletion, or exclusion clears records. Mention relevant incomplete coverage when interpreting results.
|
|
254
|
-
|
|
255
|
-
Preserve the exact command and error when an operation fails. Fix the reported cause instead of retrying equivalent initialization commands:
|
|
256
|
-
|
|
257
|
-
- Missing credentials or provider/configuration errors: report the actionable message without displaying keys.
|
|
258
|
-
- Divergent checkpoint: use `--rebuild-on-divergence` when proceeding with the requested snapshot.
|
|
259
|
-
- Incompatible index: `--force-reindex` recreates it with the requested profile.
|
|
260
|
-
- Source changed during indexing: rerun after edits settle.
|
|
261
|
-
- Bare runtime errors such as `Invalid argument`: report the failure and diagnose the runtime/tool rather than trying unrelated refresh commands.
|
|
262
|
-
|
|
263
|
-
Exit codes: `0` success, `2` argument/domain errors, `1` other failures or missing command. Use help to resolve capability questions and version to report the installed package version when needed.
|
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# slopdex
|
|
2
2
|
|
|
3
|
-
Search functions by meaning, find duplicate-code candidates, and locate related functions spread across a codebase.
|
|
3
|
+
Search functions by meaning, find duplicate-code candidates, and locate related functions spread across a codebase.
|
|
4
4
|
|
|
5
5
|
## Start here
|
|
6
6
|
|
|
7
|
-
Requires
|
|
7
|
+
Requires an embedding-provider API key. Install, set your key, and run commands from the repository you want to analyze (or pass `--root /path/to/repo`):
|
|
8
|
+
|
|
9
|
+
Coding agents should start with the bundled [Slopdex agent skill](.agents/skills/slopdex/SKILL.md).
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
12
|
npm install -g @ninjaxtools/slopdex
|
|
@@ -12,22 +14,26 @@ export OPENAI_API_KEY="your-api-key"
|
|
|
12
14
|
slopdex search "validate an authenticated session" --format summary --limit 10
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
The first command creates the index automatically. Later commands refresh it before searching.
|
|
17
|
+
The first command creates the index automatically. Later commands refresh it before searching.
|
|
18
|
+
|
|
19
|
+
Add `.slopdex/` to your repository's `.gitignore`.
|
|
16
20
|
|
|
17
|
-
###
|
|
21
|
+
### Search code
|
|
18
22
|
|
|
19
23
|
```bash
|
|
20
24
|
slopdex search "keep the repository index synchronized" --format summary --limit 10
|
|
21
25
|
```
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
To search generated descriptions of each function's role instead:
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
|
-
slopdex
|
|
30
|
+
slopdex summaries enable
|
|
27
31
|
slopdex search-summary "keep the repository index synchronized" --format summary --limit 10
|
|
28
32
|
```
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
This requires `OPENAI_API_KEY` even when Jina supplies embeddings, and adds generation costs. See [summaries and scoring](#summaries-and-scoring).
|
|
35
|
+
|
|
36
|
+
`summaries disable` turns off summary generation while retaining cached data.
|
|
31
37
|
|
|
32
38
|
### Find duplicate-code candidates
|
|
33
39
|
|
|
@@ -35,7 +41,7 @@ slopdex search-summary "keep the repository index synchronized" --format summary
|
|
|
35
41
|
slopdex cross-search --cross-file-only --min-lines 4 --threshold 0.9 --limit 5
|
|
36
42
|
```
|
|
37
43
|
|
|
38
|
-
Compare functions across files, exclude short wrappers, and group strong matches into clusters. `--limit 5` selects up to five neighbors **per source function**, not five clusters.
|
|
44
|
+
Compare functions across files, exclude short wrappers, and group strong matches into clusters. `--limit 5` selects up to five neighbors **per source function**, not five clusters.
|
|
39
45
|
|
|
40
46
|
### Review changed code or one module
|
|
41
47
|
|
|
@@ -45,7 +51,7 @@ slopdex cross-search --changed-since origin/main --format summary --threshold 0.
|
|
|
45
51
|
slopdex cross-search --source-path src/services -e '^UserService\.' --format summary --threshold 0.9
|
|
46
52
|
```
|
|
47
53
|
|
|
48
|
-
These select source functions while keeping the full eligible index available for matches. The same source filters work with `cohesion`.
|
|
54
|
+
These select source functions while keeping the full eligible index available for matches. The same source filters work with `cohesion`.
|
|
49
55
|
|
|
50
56
|
### Find related code stored far apart
|
|
51
57
|
|
|
@@ -53,7 +59,7 @@ These select source functions while keeping the full eligible index available fo
|
|
|
53
59
|
slopdex cohesion --threshold 0.8 --neighbors 20 --limit 50 --format summary
|
|
54
60
|
```
|
|
55
61
|
|
|
56
|
-
Ranks semantically related pairs by their physical separation.
|
|
62
|
+
Ranks semantically related pairs by their physical separation.
|
|
57
63
|
|
|
58
64
|
### Compare repositories
|
|
59
65
|
|
|
@@ -82,13 +88,13 @@ Usage: `slopdex <command> [arguments] [options]`.
|
|
|
82
88
|
|
|
83
89
|
| Command | Purpose | Output |
|
|
84
90
|
| --- | --- | --- |
|
|
85
|
-
| `search <query>` | Search function code by meaning. Quote multiword queries. |
|
|
86
|
-
| `
|
|
87
|
-
| `search-summary <query>` | Search purpose summaries after enabling them. |
|
|
91
|
+
| `search <query>` | Search function code by meaning. Quote multiword queries. | Summary; optional JSON array |
|
|
92
|
+
| `summaries <enable\|disable>` | Enable or disable automatic purpose summaries. Re-enabling with unchanged inputs reuses cached summaries. | JSON statistics |
|
|
93
|
+
| `search-summary <query>` | Search purpose summaries after enabling them. | Summary including summary text; optional JSON array |
|
|
88
94
|
| `cross-search` | Find neighbors for each selected function in this or another index. | `clusters` by default; optional `summary` or JSONL |
|
|
89
|
-
| `cohesion` | Analyze semantic relationships versus file/folder separation. |
|
|
95
|
+
| `cohesion` | Analyze semantic relationships versus file/folder separation. | Summary; optional JSON report |
|
|
90
96
|
| `status` | Refresh and show index metadata, counts, and profiles. | JSON object |
|
|
91
|
-
| `index-errors` | Read saved file/function indexing failures. |
|
|
97
|
+
| `index-errors` | Read saved file/function indexing failures. | Summary; optional JSON array |
|
|
92
98
|
| `update-git` | Explicitly refresh a Git snapshot, with current working-tree changes when targeting HEAD. | JSON update statistics |
|
|
93
99
|
| `update-files <path...>` | After automatic refresh, explicitly reparse selected working-tree files. Paths are repository-relative or absolute within the root. | JSON update statistics |
|
|
94
100
|
| `delete-files <path...>` | After automatic refresh, remove paths from the index; source files are not deleted. A later refresh can restore eligible files. | JSON update statistics |
|
|
@@ -103,10 +109,6 @@ slopdex update-git --target HEAD --rebuild-on-divergence
|
|
|
103
109
|
slopdex update-git --force-reindex
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
## Command-line arguments
|
|
107
|
-
|
|
108
|
-
Options are command-specific where indicated. Boolean flags default to off.
|
|
109
|
-
|
|
110
112
|
### Location, providers, and diagnostics
|
|
111
113
|
|
|
112
114
|
| Argument | Meaning / default |
|
|
@@ -122,7 +124,7 @@ Options are command-specific where indicated. Boolean flags default to off.
|
|
|
122
124
|
| `-h`, `--help` | Show CLI usage without refreshing. |
|
|
123
125
|
| `--version` | Print the package version and exit. |
|
|
124
126
|
|
|
125
|
-
Explicit relative config and index paths resolve from the current directory, not `--root`.
|
|
127
|
+
Explicit relative config and index paths resolve from the current directory, not `--root`.
|
|
126
128
|
|
|
127
129
|
### Search and analysis
|
|
128
130
|
|
|
@@ -131,8 +133,7 @@ Explicit relative config and index paths resolve from the current directory, not
|
|
|
131
133
|
| `--limit <number>` | Both query searches, cross-search, cohesion | Positive integer. Query matches: `10`; cross-search neighbors per source: `5`; cohesion reported pairs and file rows: `50`. |
|
|
132
134
|
| `--threshold <number\|min-max>` | Both query searches, cross-search, cohesion | Minimum similarity, or range with inclusive minimum and exclusive maximum. Default `-1` for query/cross-search, `0.8` for cohesion. Cohesion minimum must be at least `-1` and below `1`. |
|
|
133
135
|
| `--format <json\|summary\|clusters>` | Both query searches, cross-search, cohesion, index-errors | Output format; see the commands table. `clusters` is only for cross-search. |
|
|
134
|
-
| `-e <regex>`, `--regexp <regex>` | Both query searches, cross-search, cohesion |
|
|
135
|
-
| `--regex <regex>` | Cross-search, cohesion | Filter **both** source and candidate qualified names. |
|
|
136
|
+
| `-e <regex>`, `--regexp <regex>`, `--regex <regex>` | Both query searches, cross-search, cohesion | Equivalent case-sensitive JavaScript regex options over qualified names. Query searches: filter results before limiting. Analysis: filter sources only. |
|
|
136
137
|
| `--min-lines <number>` | Cross-search, cohesion | Minimum source and candidate callable length; positive integer, default `2`. Use `1` to include one-line wrappers. |
|
|
137
138
|
| `--source-path <path>` | Cross-search, cohesion | Select sources in a file or recursive directory, relative to the repository root (or absolute within it). |
|
|
138
139
|
| `--changed-since <commit>` | Cross-search, cohesion | Select added, modified, or moved functions relative to an ancestor of the indexed Git checkpoint, including working-tree changes. Requires Git. |
|
|
@@ -145,8 +146,6 @@ Explicit relative config and index paths resolve from the current directory, not
|
|
|
145
146
|
| `--target-index <path>` | Cross-search | Second index file; requires `--target-root`. |
|
|
146
147
|
| `--target-config <path>` | Cross-search | Target config; defaults to `<target-root>/.slopdex/config.json`. Requires both target options. |
|
|
147
148
|
|
|
148
|
-
Source restrictions intersect: with both Git filters, a function must have changed since the commit **and** belong to an uncommitted file. `-e`, `--source-path`, and Git filters do not restrict candidates; `--regex` and `--min-lines` do.
|
|
149
|
-
|
|
150
149
|
Review adjacent similarity bands without repeating boundary matches:
|
|
151
150
|
|
|
152
151
|
```bash
|
|
@@ -203,39 +202,19 @@ Cohesion: 184 functions analyzed, 37 semantic edges
|
|
|
203
202
|
|
|
204
203
|
The example suggests reviewing separated authentication responsibilities. It does not establish that they belong in one module. There is no universal cohesion pass threshold. Filtered reports describe selected sources, not the entire repository. Summary metrics cover all qualifying edges; reported pairs/files are limited, and groups are built from reported pairs.
|
|
205
204
|
|
|
206
|
-
For automation, query searches and diagnostics return JSON arrays; cross-search returns **JSONL**, one row per matched source; cohesion returns one JSON object containing `repository`, `parameters`, `summary`, `pairs`, `files`, and `groups`. Results go to stdout; notices and warnings go to stderr.
|
|
205
|
+
For automation, pass `--format json`: query searches and diagnostics return JSON arrays; cross-search returns **JSONL**, one row per matched source; cohesion returns one JSON object containing `repository`, `parameters`, `summary`, `pairs`, `files`, and `groups`. Results go to stdout; notices and warnings go to stderr.
|
|
207
206
|
|
|
208
207
|
## System behavior
|
|
209
208
|
|
|
210
|
-
### Freshness and cost
|
|
211
|
-
|
|
212
|
-
- Indexing, search, analysis, `use-summaries`, and `status` automatically refresh. With Git, results normally reflect HEAD plus staged, unstaged, and untracked working-tree contents. `gitCheckpoint` records the committed base, not the overlay.
|
|
213
|
-
- Without Git, commands warn and scan the working tree. `--no-reindex` has the limited behavior described above.
|
|
214
|
-
- `index-errors`, help, and version do not refresh. Other commands require the configured embedding key, even when cached data supplies the analysis.
|
|
215
|
-
- Function source and search queries go to the embedding provider. Source metadata, vectors, diagnostics, and enabled summaries stay in the local index. Summary generation also sends repository name, path, callable source, and surrounding file context to OpenAI; summary text goes to the embedding provider.
|
|
216
|
-
- Unchanged embedding and summary inputs reuse cached results. Initial indexing and enabling summaries can make many API calls. Source filters reduce analysis work, not the preceding index refresh.
|
|
217
|
-
|
|
218
209
|
### Summaries and scoring
|
|
219
210
|
|
|
220
|
-
Summaries are optional and disabled initially. `
|
|
211
|
+
Summaries are optional and disabled initially. `summaries enable` persists the selected summary model and keeps summaries current on later updates, including file-context and path changes. Use `slopdex summaries enable --summary-model <model-id>` to change it, or `slopdex summaries disable` to stop automatic updates and summary-based searching/scoring while retaining cached summaries. `status` exposes `summariesEnabled`, `summaryCount`, and `summaryProfile`.
|
|
221
212
|
|
|
222
213
|
`search` always searches code; `search-summary` always searches purpose summaries. When all callables have enabled summaries, cross-search and cohesion automatically use **50% code similarity + 50% summary similarity**. Cross-repository analysis needs complete summaries on both sides; otherwise the entire analysis uses code-only scores. Thresholds and neighbor limits apply to the selected score.
|
|
223
214
|
|
|
224
215
|
Text output labels combined scores. JSON exposes `codeSimilarity`, `summarySimilarity`, and scoring mode/weights (`scoring` for cross-search, `parameters` for cohesion). Compare runs only with matching scoring mode, weights, embedding and summary-generator profiles, threshold, neighbor count, and source/candidate filters.
|
|
225
216
|
|
|
226
|
-
###
|
|
227
|
-
|
|
228
|
-
| Language | File extensions |
|
|
229
|
-
| --- | --- |
|
|
230
|
-
| Python | `.py`, `.pyw` |
|
|
231
|
-
| JavaScript / JSX | `.js`, `.mjs`, `.cjs`, `.jsx` |
|
|
232
|
-
| TypeScript / TSX | `.ts`, `.mts`, `.cts`, `.tsx` |
|
|
233
|
-
| Rust | `.rs` |
|
|
234
|
-
| Go | `.go` |
|
|
235
|
-
| Java | `.java` |
|
|
236
|
-
| C | `.c`, `.h` |
|
|
237
|
-
|
|
238
|
-
Indexes named functions, methods, constructors, and supported variable-bound closures with bodies, including nested callables. Anonymous callbacks and bodyless declarations are omitted. No language server or project compiler setup is needed. Macro expansion and runtime behavior are not analyzed; `.h` files are treated as C.
|
|
217
|
+
### Exclusions
|
|
239
218
|
|
|
240
219
|
Root and nested `.gitignore` rules apply even to tracked files and without Git. Working-tree refreshes use current rules; committed-only snapshots use the target commit's rules. Refresh removes newly excluded files and discovers newly eligible ones. Explicit `update-files` rejects ignored files.
|
|
241
220
|
|
|
@@ -274,7 +253,6 @@ Optional file: `<root>/.slopdex/config.json`. Example using Jina (requires `JINA
|
|
|
274
253
|
|
|
275
254
|
Keep keys in the environment (`OPENAI_API_KEY`, `JINA_API_KEY`). Changing the embedding profile requires rebuilding with `--force-reindex`.
|
|
276
255
|
|
|
277
|
-
##
|
|
256
|
+
## Development
|
|
278
257
|
|
|
279
|
-
- [
|
|
280
|
-
- [Implementation and library API](docs/implementation.md): internals, programmatic usage, build, and development checks.
|
|
258
|
+
- [Implementation and library API](docs/implementation.md)
|