dsh-plugin-codegraph 0.1.6 → 0.1.7

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.
Files changed (2) hide show
  1. package/README.md +7 -1
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
+ [![dshfind](https://dshfind.com/api/badge/CC19990113/dsh-plugin-codegraph?lang=zh)](https://dshfind.com/zh/plugins/CC19990113/dsh-plugin-codegraph?ref=badge)
6
+
5
7
  Structural code intelligence for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`).
6
8
 
7
9
  Gives the agent two tools — `codegraph` and `codegraph_index` — so it can ask **where is this declared**, **who calls it**, **what breaks if I change it**, and **how does one symbol reach another**, answered from a pre-built index instead of from text search.
@@ -72,7 +74,9 @@ The **store is format-bound, not language-bound**: a graph built by the `codegra
72
74
 
73
75
  ## Call resolution never guesses
74
76
 
75
- Every call site resolves in a fixed order: an import that lands on an indexed file wins; otherwise a unique workspace-wide name wins; otherwise **no edge is emitted** and the site is recorded as unresolved.
77
+ Every call site resolves in a fixed order: an import that lands on an indexed file wins; otherwise a declaration **in the calling file itself** wins when exactly one carries the name — lexical scope settles it before the workspace gets a say, which is what keeps a helper declared in two test files, or a `render` in two components, from being counted as ambiguous; otherwise a unique workspace-wide name wins; otherwise **no edge is emitted** and the site is recorded as unresolved.
78
+
79
+ The same-file tier applies to bare calls only. A member call (`x.map()`) names a property of a receiver this resolver cannot type, so letting a same-named local declaration win it would be a guess, not a scope resolution.
76
80
 
77
81
  That last rule is deliberate. The model acts on `callers` output, so a confidently wrong caller sends it to edit the wrong file, while a missing caller merely sends it back to text search. The index report's `unresolved_count` is not, by itself, that gap's size — a type-free resolver was never going to settle a member call (`x.map()`) or a name already imported from elsewhere, and those dominate the total in a typical workspace. `unresolved_likely_internal_count` is the subset worth judging completeness by: bare, undeclared names that were structurally plausible workspace calls.
78
82
 
@@ -104,6 +108,7 @@ The bundle mounts all four plugins in one layer. Retune any of them from the pro
104
108
  languages: ['typescript', 'tsx']
105
109
  exclude: ['node_modules', 'dist', 'vendor']
106
110
  respectGitignore: true
111
+ skipMinified: true # the default; set false to index committed bundles anyway
107
112
  watch: true # the default; shown for clarity — set false to keep indexing purely explicit
108
113
 
109
114
  - id: codegraph-tool
@@ -131,6 +136,7 @@ The split is not ceremony. The seam carries no source text and performs no files
131
136
  - **Watching is on by default, and self-limiting where it wouldn't help.** A successful `codegraph_index` starts watching that root automatically — a single recursive `fs.watch` on macOS/Windows, one inotify watch per directory on Linux — refreshing the index after a debounced quiet period. Set `watch: false` to keep indexing purely explicit instead. It's overridden back off on a WSL2 kernel watching a path mounted in from the Windows host (`/mnt/<drive>/...`), since inotify doesn't reliably deliver events over that mount; `CODEGRAPH_FORCE_WATCH=1` and `CODEGRAPH_NO_WATCH=1` override that default either way. Whether or not watching is on, `status` still reports how many indexed files have gone stale — modified or removed since the last run — found by statting the filesystem directly, so a caller can always tell a trustworthy index from a drifted one instead of assuming the best.
132
137
  - **Git hooks and worktree detection ship as library functions only** — `installGitHooks`/`uninstallGitHooks` (a `post-checkout`/`post-merge`/`post-commit`/`post-rewrite` hook running a command of your choosing, for environments where live watching isn't available) and `detectWorktree` (whether a root is a linked `git worktree`, and where its main repository lives). Neither is wired into plugin load or exposed as a model-visible tool: `.git/hooks/*` is shared, ambient state this package doesn't own, so installing it is left to a caller's own init script, never automatic.
133
138
  - **Exclusion unions the built-in default directories with the project's own `.gitignore`.** Build output that lands outside `node_modules`/`dist`/`build`/`coverage` (a `lib` a TypeScript project compiles to, say) is almost always gitignored too, and indexing it alongside its own source would hand call resolution two same-named declarations of one symbol to pick between arbitrarily. Only a practical subset of gitignore syntax is understood — no `**`, character classes, or per-directory `.gitignore` files. Turn it off with `respectGitignore: false`.
139
+ - **Committed build output is left out by shape, not by `.gitignore`.** Some deployments commit `dist/` so a server can serve it straight from the repository, which makes it neither gitignored nor named in `exclude`. Those files are still bundler output: a workspace sampled here had 25 such files that contributed 90% of the declarations, 86% of the edges, and 92% of the unresolved call sites in a graph that otherwise described 335 source files — and their mangled one-letter names collided with real symbols, making the unique-name rule refuse calls it could have settled. `skipMinified` (default on) skips a file whose path carries a `.min.` segment, or whose average line length is past 500 characters — roughly 7× the widest average found in hand-written source — and reports the count as `files_minified`. It is a heuristic, not a build-system integration: naming the artifact directory in `exclude` is still the exact fix, and `skipMinified: false` indexes such files anyway.
134
140
  - **The unresolved tail can be large**, and most of it is not a gap. `unresolved_count` includes every member call and already-imported name a type-free resolver could never have settled; `unresolved_likely_internal_count` is the narrower number that reflects re-exports and dynamic dispatch the graph actually missed.
135
141
  - **`context` ranks by identifier-term overlap**, so a task phrased without naming any symbol ranks poorly. There is no semantic matching.
136
142
  - `dsh` itself is in developer preview and iterating fast; expect compatibility-breaking changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-codegraph",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Structural code intelligence for DeepSeek Harness — gives the agent codegraph and codegraph_index tools to find where a symbol is declared, what calls it, what a change reaches, and how one symbol reaches another, from a tree-sitter index it builds itself",
5
5
  "keywords": [
6
6
  "dsh",
@@ -42,9 +42,9 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "dsh-plugin-codegraph-service": "^0.1.6",
46
- "dsh-plugin-codegraph-tool": "^0.1.6",
47
- "dsh-plugin-codegraph-sqlite": "^0.1.6",
48
- "dsh-plugin-codegraph-tree-sitter": "^0.1.6"
45
+ "dsh-plugin-codegraph-sqlite": "^0.1.7",
46
+ "dsh-plugin-codegraph-tree-sitter": "^0.1.7",
47
+ "dsh-plugin-codegraph-service": "^0.1.7",
48
+ "dsh-plugin-codegraph-tool": "^0.1.7"
49
49
  }
50
50
  }