dsh-gitnexus-plus 0.1.4 → 0.1.5

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 (58) hide show
  1. package/README-CN.md +14 -5
  2. package/README.md +40 -8
  3. package/lib/client.js +386 -66
  4. package/lib/gitnexus/analyze.d.ts +6 -0
  5. package/lib/gitnexus/analyze.d.ts.map +1 -1
  6. package/lib/gitnexus/analyze.js +10 -0
  7. package/lib/gitnexus/analyze.js.map +1 -1
  8. package/lib/gitnexus/commands.d.ts +11 -1
  9. package/lib/gitnexus/commands.d.ts.map +1 -1
  10. package/lib/gitnexus/commands.js +27 -8
  11. package/lib/gitnexus/commands.js.map +1 -1
  12. package/lib/gitnexus/coverage.d.ts +8 -0
  13. package/lib/gitnexus/coverage.d.ts.map +1 -1
  14. package/lib/gitnexus/coverage.js +14 -2
  15. package/lib/gitnexus/coverage.js.map +1 -1
  16. package/lib/gitnexus/discover.d.ts +91 -0
  17. package/lib/gitnexus/discover.d.ts.map +1 -0
  18. package/lib/gitnexus/discover.js +214 -0
  19. package/lib/gitnexus/discover.js.map +1 -0
  20. package/lib/gitnexus/graph.d.ts +9 -0
  21. package/lib/gitnexus/graph.d.ts.map +1 -1
  22. package/lib/gitnexus/graph.js +2 -0
  23. package/lib/gitnexus/graph.js.map +1 -1
  24. package/lib/gitnexus/index-meta.d.ts +34 -6
  25. package/lib/gitnexus/index-meta.d.ts.map +1 -1
  26. package/lib/gitnexus/index-meta.js +47 -7
  27. package/lib/gitnexus/index-meta.js.map +1 -1
  28. package/lib/gitnexus/install.d.ts +11 -0
  29. package/lib/gitnexus/install.d.ts.map +1 -1
  30. package/lib/gitnexus/install.js +65 -9
  31. package/lib/gitnexus/install.js.map +1 -1
  32. package/lib/gitnexus/search.d.ts +13 -0
  33. package/lib/gitnexus/search.d.ts.map +1 -1
  34. package/lib/gitnexus/search.js +2 -0
  35. package/lib/gitnexus/search.js.map +1 -1
  36. package/lib/index.d.ts +7 -0
  37. package/lib/index.d.ts.map +1 -1
  38. package/lib/index.js +27 -7
  39. package/lib/index.js.map +1 -1
  40. package/lib/routes/analyze.d.ts +5 -4
  41. package/lib/routes/analyze.d.ts.map +1 -1
  42. package/lib/routes/analyze.js +17 -4
  43. package/lib/routes/analyze.js.map +1 -1
  44. package/lib/routes/coverage.d.ts +16 -10
  45. package/lib/routes/coverage.d.ts.map +1 -1
  46. package/lib/routes/coverage.js +31 -22
  47. package/lib/routes/coverage.js.map +1 -1
  48. package/lib/routes/delta.js +8 -8
  49. package/lib/routes/delta.js.map +1 -1
  50. package/lib/routes/guard.d.ts +3 -6
  51. package/lib/routes/guard.d.ts.map +1 -1
  52. package/lib/routes/guard.js +3 -6
  53. package/lib/routes/guard.js.map +1 -1
  54. package/lib/routes/projects.d.ts +21 -0
  55. package/lib/routes/projects.d.ts.map +1 -0
  56. package/lib/routes/projects.js +61 -0
  57. package/lib/routes/projects.js.map +1 -0
  58. package/package.json +1 -1
package/README-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) · **简体中文**
4
4
 
5
- **当前版本:0.1.4** · [npm](https://www.npmjs.com/package/dsh-gitnexus-plus) ·
5
+ **当前版本:0.1.5** · [npm](https://www.npmjs.com/package/dsh-gitnexus-plus) ·
6
6
  [问题反馈](https://github.com/Moowningstar/gitnexus-plus/issues)
7
7
 
8
8
  [插件做什么](#插件做什么) · [安装](#安装) · [遇到问题怎么解决](#遇到问题怎么解决) ·
@@ -24,7 +24,8 @@
24
24
  - **语言分布**:按字节拆分“能解析进图的语言 / 只识别格式的语言 / 其他”;GitNexus 不在时用内置扩展名映射,并标为 `builtin`,不冒充已解析。
25
25
  - **关键词搜索**:按图节点的 `name` / `filePath` 匹配,返回 kind、path、line;点击结果打开文件并定位到行,右侧“复制”按钮复制 `path:line`。
26
26
  - **源码回退**:图查询子进程起不来时(无可用 shell 沙箱、DLL/ABI、索引忙),在索引清单内的文件里做有界源码行匹配,结果标为 `mode: "text"`。
27
- - **无索引也有信息**:git 项目尚未建索引时,显示扫描概览、语言分布和初始化命令,而不是空白面板。
27
+ - **工作区多项目与切换器**:工作区本身可以是容器(例如 `D:\Project` 下放着 `gitnexus-plus/`、`viewer/`,或 `geo/` 下放着 `frontend/`、`backend/`)。面板会从当前工作区**向下**收集工作区自身、已索引项目,以及尚未建索引的 git 仓库;默认选一个,标题栏显示项目数并可切换;选择按工作区记住。未索引的 git 项目也会列出来,选中后可以针对该目录初始化。
28
+ - **无索引也有信息**:git 项目或普通文件夹尚未建索引时,显示扫描概览、语言分布和初始化命令,而不是空白面板。普通文件夹的索引由 `--skip-git` 建立。
28
29
  - **维护**:初始化、增量刷新、全量重建(`--force`)都通过 DSH 的 shell 执行器运行,不自行请求提权。索引报告 FTS 不可用时,面板另外提供 **修复搜索索引(FTS)**,只跑 `analyze --repair-fts`,不重跑分析。
29
30
 
30
31
  ## 安装
@@ -71,12 +72,13 @@ npm install --prefix <DSH_HOME>/gitnexus-plus/gitnexus gitnexus@^1.6.12
71
72
 
72
73
  ## 使用
73
74
 
74
- 面板会报告当前工作区指向的项目,不提供全局仓库列表。它以“项目根”(有 `.gitnexus` 索引或 `.git`)为边界,不会变成文件系统探测器。
75
+ 面板会报告当前工作区指向的项目,不提供全局仓库列表。它会从工作区开始**向下**收集:工作区自身、子目录里的 `.gitnexus` 索引,以及还没有索引的 git 仓库;遇到已索引或带 `.git` 的目录就把它当项目边界,不再向下钻。候选多于一个时,标题栏的路径位置变成切换器,下方写明“工作区 … · N 个项目(X 个已索引)· 当前 <路径>”;未索引项目会标注“未索引”。切换后刷新、差量、搜索、图查询、维护命令都针对新项目,选择按工作区持久化。默认选择顺序是:上次选择 → 工作区自身索引 → 第一个已索引项目 → 工作区扫描。没有已索引项目时停在“本工作区”扫描,并列出未索引的 git 项目供初始化。目录必须存在、且不是文件系统根目录;没有 `.git` 的普通文件夹照样能扫描,并可用 `--skip-git` 建索引(没有提交基线,也没有增量刷新)。路由不提供浏览/列举其它路径的接口。
75
76
 
76
77
  DSH 内暴露:
77
78
 
78
79
  - 工具 `gitnexus_coverage`:`{ repo, includeLanguages? }`
79
80
  - 工具 `gitnexus_delta`:`{ repo }` —— 这次刷新会不会改变索引
81
+ - 路由 `GET /api/gitnexus/projects?root=<workspace>`:列出工作区下的项目(已索引与未索引 git)
80
82
  - 路由 `GET /api/gitnexus/coverage?repo=<project>`
81
83
  - 路由 `GET /api/gitnexus/search?repo=<project>&q=<keyword>&limit=20`
82
84
  - 路由 `GET /api/gitnexus/file-history?repo=<project>&path=<file>&days=7`:单个文件的
@@ -114,9 +116,11 @@ npm test
114
116
  | 现象 | 这里怎么做 | 上游 GitNexus 路径 |
115
117
  | --- | --- | --- |
116
118
  | 面板说 GitNexus 不存在 | 自己安装,或用面板的安装按钮;非标准位置设 `GITNEXUS_CLI=/path/to/gitnexus/dist/cli/index.js`。 | [`gitnexus/README.md` — Requirements](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#requirements)、[Quick Start](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#quick-start) |
117
- | 项目还没有索引 | 点 **初始化索引**,或执行 `gitnexus analyze --index-only <repo>`。 | [`README.md` — CLI Reference](https://github.com/abhigyanpatwari/GitNexus/blob/main/README.md#cli-reference)、[`RUNBOOK.md` — Index out of date](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#index-out-of-date--stale-tools) |
119
+ | 项目还没有索引 | 点 **初始化索引**,或执行 `gitnexus analyze --index-only <repo>`。目录不是 git 仓库时,面板的命令会自动带 `--skip-git`(上游要求),代价是没有提交基线与增量刷新。 | [`README.md` — CLI Reference](https://github.com/abhigyanpatwari/GitNexus/blob/main/README.md#cli-reference)、[`RUNBOOK.md` — Index out of date](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#index-out-of-date--stale-tools) |
120
+ | 子目录里已有索引,切换器里却没有 | 面板只从当前工作区**向下**找,不会向上或找兄弟目录;默认跳过隐藏目录、`node_modules` 与构建产物,且有层数/目录数/时间上限。确认索引位于 `<工作区>/<子目录>/.gitnexus/gitnexus.json`;若它在被跳过的目录或很深的层级,直接把工作区设到该子目录。多个项目会在标题栏切换器里列出,未建索引的 git 项目也会列出;搜索被截断时面板会写明“可能还有未列出的项目”。 | 本插件的目录发现;无上游 GitNexus 路径。 |
118
121
  | 刷新失败、`spawn EPERM`,或索引停在 `incremental-in-progress` | 面板命令已带 `GITNEXUS_MEMORY=off`、`NODE_OPTIONS=--max-old-space-size=8192`、`GITNEXUS_HOME=<repo>/.gitnexus/plugin-home`、`--index-only`。沙箱仍拒绝时,把命令复制到自己的终端跑;插件不会扩权。 | [`RUNBOOK.md` — LadybugDB / lock errors](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#ladybugdb--lock-errors)、[Memory / analyze crashes](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#memory--analyze-crashes) |
119
122
  | 刷新报 `EPERM … mkdir` 或 `rmdir '<repo>\.gitnexus\parsedfile-store'` | GitNexus 在每次解析开始时**删除**这个 run 级存储,解析过程中再由 worker 重新创建——两个方向都可能被拒。0.1.4 处理了两个成因:不再预建该目录(那是 0.1.3 的 `rmdir` 来源);同时让分析器的 shell 调用带上**仓库**作为沙箱工作区根。面板路由没有 session,沙箱以前会回退到 DSH 应用目录,那条路径的写能力是**另一个身份**,仓库的写授权对它无效,于是 `.gitnexus` 里的写入全被拒。若仍失败,说明部署模式是只读——把复制出的命令放到普通终端执行。 | [`RUNBOOK.md` — LadybugDB / lock errors](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#ladybugdb--lock-errors)、[`RUNBOOK.md` — Clean slate](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#clean-slate-corrupt-or-huge-gitnexus) |
123
+ | Windows 报 `windows-acl-run: SetNamedSecurityInfoW failed (Win32 5): grantWrite(D:\Program Files\DSH Desktop)` | 这是 DSH 的 Windows ACL 沙箱在给**工作区根**授权时失败;`D:\Program Files\DSH Desktop` 是 DSH 应用目录,不是项目。0.1.5 起搜索/图子进程使用 `<repo>/.gitnexus` 作为策略根,安装使用插件前缀作为策略根,安装失败会返回可复制命令。如果**普通 shell 命令**仍报同一错误,说明会话工作区本身就是安装目录:把工作区切到可写项目;不要给 Program Files 加 ACL。 | 本插件的策略根修复;DSH 沙箱本身无上游 GitNexus 路径。 |
120
124
  | 增量分析卡住,或数据库报 `Maximum database size … has been reached` | 用 **全量重建**(`--force`),或按 clean slate 清理后重建。 | [`RUNBOOK.md` — Clean slate](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#clean-slate-corrupt-or-huge-gitnexus)、[`gitnexus/README.md` — Troubleshooting](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#troubleshooting) |
121
125
  | 刷新报 `EPERM … open '<repo>\.gitnexus\lbug.init.lock'` 或 `unable to acquire init lock` | 这是瞬时的文件锁,不是权限问题:报出该错误的机器上做过权限体检,`.gitnexus` 的权限是健康的。GitNexus 的第一个写操作就是这把锁,杀毒、索引器或上一次崩溃都可能持有它。插件会清掉残留锁并自动重试一次(运行状态里 `attempts: 2`)。仍失败就等一会儿再刷新,或把复制出的命令放到普通终端执行。 | 本插件的重试 + 分析器自己的锁文件;无上游 GitNexus 路径。 |
122
126
  | 搜索报 `A dynamic link library (DLL) initialization routine failed` / `lbugjs.node` | 图查询在 `lib/bin/search-helper.js` 里跑,不在 Electron 宿主里加载原生模块;升级后重启 DSH,并确保 shell PATH 上有 `node`。helper 起不来时会回退源码。 | [`gitnexus/README.md` — Troubleshooting](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#troubleshooting) |
@@ -124,6 +128,7 @@ npm test
124
128
  | 刷新按钮显示“无需刷新”且不可点 | 这是 Tier 0 的判断,不是故障:索引记录的文件内容哈希全部没变,再跑分析器也不会改变索引。**仍然刷新** 可以强制跑一次(例如 GitNexus 升级或 schema 变化后)。如果索引没有记录提交基线,面板**不会**说“无需刷新”,而是显示“无法确认”并保持按钮可用。 | 本插件的差量引擎;无上游 GitNexus 路径。 |
125
129
  | 门禁显示“无法确认”,而不是“无需刷新” | 索引没有记录提交,所以只能比较工作区。受限沙箱里的 analyze 起不了 `git` 子进程,manifest 的 `lastCommit` 因此为空——本机实测:同一条命令在普通终端会写入提交,在沙箱里留空。想要更强的结论,把复制出的命令在沙箱外跑一次;无论哪种状态,刷新按钮都可用。 | 本插件差量引擎 + 分析器的 git 访问;无上游 GitNexus 路径。 |
126
130
  | 图视图空白,或报 404 | 404 说明宿主还没有 `/api/gitnexus/graph` 路由,重启 DSH,而不是只刷新页面。空白画布但下面有说明,通常是索引还没有社区(旧索引)或索引忙:刷新索引即可。节点数按预算截断,卡片会写明省略了多少。 | 本插件宿主路由;图数据本身来自 GitNexus 索引。 |
131
+ | 图视图对某些项目一直加载或 504,另一些正常 | Windows ACL 沙箱第一次给 workspace 授权时会把可继承 ACE 传播到整棵仓库树,大仓库可能超过 25 秒 helper 超时;已授权过的项目则很快。0.1.5 起搜索/图 helper 的 workspace 根收窄到 `<repo>/.gitnexus`,只覆盖索引目录;重启 DSH 后生效。仍失败时确认 `.gitnexus/lbug` 存在,并检查是否有另一个 analyze 正占用该索引。 | 本插件的 sandbox 策略根;图数据本身来自 GitNexus 索引。 |
127
132
  | 点击搜索结果没有打开文件 | 点击依赖 `ctx.sidebarRight.openResourceIn`;没有该服务的 profile 会退回复制 `path:line`。重启 DSH;仍不行就用“复制”。 | 面板/DSH 边界,无上游 GitNexus 路径。 |
128
133
  | 文件时间线报 404/401 | 客户端先热更新了,宿主还没加载 `/api/gitnexus/file-history` 路由。重启 DSH,不是只刷新页面。 | 本插件宿主路由;无上游 GitNexus 路径。 |
129
134
  | 分析内存不足 | 保留面板的 `NODE_OPTIONS` / `GITNEXUS_MEMORY`,或手动提高 heap;必要时全量重建。 | [`gitnexus/README.md` — Analysis runs out of memory](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#analysis-runs-out-of-memory)、[`RUNBOOK.md` — Memory / analyze crashes](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#memory--analyze-crashes) |
@@ -159,7 +164,9 @@ $env:GITNEXUS_MEMORY='off'; $env:NODE_OPTIONS='--max-old-space-size=8192'; `
159
164
  ```
160
165
 
161
166
  全量重建再加 `--force`;只修搜索索引用 `--repair-fts`(面板在索引报告 FTS 不可用时提供
162
- **修复搜索索引(FTS)**,不会重跑分析)。
167
+ **修复搜索索引(FTS)**,不会重跑分析)。目录没有 `.git` 时,命令还会带 `--skip-git`。
168
+
169
+ - `--skip-git`:GitNexus 默认拒绝没有 `.git` 的目录(即使路径是显式传入的);这个标记让它直接索引该目录。代价是索引没有提交基线、没有增量刷新,也没有 Git 活动,面板会如实说明。
163
170
 
164
171
  - `GITNEXUS_MEMORY=off`:阻止 CLI 通过管道重新 spawn 自己(受限沙箱会 `spawn EPERM`)。
165
172
  - `NODE_OPTIONS=--max-old-space-size=8192`:补上它本来想通过 respawn 拿到的 heap。
@@ -186,4 +193,6 @@ $env:GITNEXUS_MEMORY='off'; $env:NODE_OPTIONS='--max-old-space-size=8192'; `
186
193
  - 只报告 GitNexus 索引的事实,不重写解析器,不重新实现图数据库。
187
194
  - 搜索的 graph 模式是名称/路径匹配,不搜正文;text 模式才按行匹配,且有上限。
188
195
  - 源码回退只覆盖索引清单里的文件,新文件需先刷新索引。
196
+ - 没有 `.git` 的目录用 `--skip-git` 建的索引没有提交基线:门禁只能说“无法确认”,刷新是完整重分析(不是增量),Git 活动卡片也不会出现。
197
+ - 子目录搜索是**有界**的:默认最多 12 层、4000 个目录、2 秒;跳过 `node_modules`、构建产物和所有隐藏目录,不跟随符号链接。多项目时默认优先已索引项目(上次选择 → 工作区自身索引 → 第一个已索引 → 工作区扫描),标题栏可切换;遇到已索引或 `.git` 目录即停止下钻;搜索被上限截断时面板会说明“可能还有未列出的项目”。
189
198
  - 更深的设计与构建记录不放进公开 README;本文件只讲“做什么”和“出问题怎么处理”。
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **English** · [简体中文](README-CN.md)
4
4
 
5
- **Current release: [0.1.4](https://github.com/Moowningstar/gitnexus-plus/releases/tag/v0.1.4)** ·
5
+ **Current release: [0.1.5](https://github.com/Moowningstar/gitnexus-plus/releases/tag/v0.1.5)** ·
6
6
  [npm](https://www.npmjs.com/package/dsh-gitnexus-plus) ·
7
7
  [Issues](https://github.com/Moowningstar/gitnexus-plus/issues)
8
8
 
@@ -49,8 +49,15 @@ It does not fork GitNexus, rewrite its parser, or bundle/redistribute it. `gitne
49
49
  - **Source fallback** — when the graph helper cannot start (no usable shell sandbox,
50
50
  DLL/ABI, busy index), a bounded line search over the indexed files returns
51
51
  `mode: "text"` instead of pretending to be the graph.
52
- - **No-index visibility** — a git project without an index shows a scan overview,
53
- language split and the initialize command instead of an empty panel.
52
+ - **Multiple projects in one workspace** — the workspace can be a container (`D:\Project`
53
+ holding `gitnexus-plus/`, `viewer/`, or `geo/` holding `frontend/`, `backend/`). The
54
+ panel discovers the workspace itself, every indexed project below it, *and* git
55
+ repositories that have no index yet. It selects one by default and offers a header
56
+ switcher when there is more than one; a selection is remembered per workspace, and an
57
+ unindexed git project can be selected and initialized there.
58
+ - **No-index visibility** — a git project *or a plain folder* without an index shows a
59
+ scan overview, language split and the initialize command instead of an empty panel. A
60
+ folder with no `.git` is indexed with `--skip-git`.
54
61
  - **Maintenance** — initialize, incremental refresh and full rebuild (`--force`) run
55
62
  through DSH's shell executor, with no self-escalation. When the index reports FTS as
56
63
  unavailable, a **修复搜索索引(FTS)** action runs `analyze --repair-fts` — the search
@@ -103,14 +110,24 @@ Treat the first install as unverified and fall back to the manual command if it
103
110
 
104
111
  ## Usage
105
112
 
106
- The panel reports the project the current workspace points at; it has no global
107
- repository list. Its bound is a project root (a `.gitnexus` index or a `.git` marker), so
108
- it cannot become a filesystem probe.
113
+ The panel reports the projects the current workspace contains; it has no global
114
+ repository list. It looks **downward** from the workspace: the workspace itself, every
115
+ indexed descendant, and git repositories without an index are candidates; an indexed or
116
+ `.git` directory is a project boundary. When there is more than one candidate the header
117
+ path becomes a switcher, with a line naming the workspace, the project/index counts and
118
+ the active path; unindexed projects are labelled. Refreshes, delta, search, graph and
119
+ maintenance then target the selected project. The default is the remembered choice, then
120
+ the workspace's own index, then the first indexed project, then the workspace scan; an
121
+ unindexed container stays on the workspace scan and lists its git projects for
122
+ initialization. The directory must exist and must not be a filesystem root; a plain folder
123
+ is still scanned and can be indexed with `--skip-git` (no commit baseline, no incremental
124
+ refresh). The route offers no way to browse or list any other path.
109
125
 
110
126
  Inside DSH:
111
127
 
112
128
  - tool `gitnexus_coverage`: `{ repo, includeLanguages? }`
113
129
  - tool `gitnexus_delta`: `{ repo }` — would a refresh change anything?
130
+ - route `GET /api/gitnexus/projects?root=<workspace>` — the workspace's projects (indexed and unindexed git)
114
131
  - route `GET /api/gitnexus/coverage?repo=<project>`
115
132
  - route `GET /api/gitnexus/search?repo=<project>&q=<keyword>&limit=20`
116
133
  - route `GET /api/gitnexus/file-history?repo=<project>&path=<file>&days=7` — one file's
@@ -156,9 +173,11 @@ GitNexus path owns the rest.
156
173
  | Symptom | What to do here | Upstream GitNexus path |
157
174
  | --- | --- | --- |
158
175
  | The panel says GitNexus is absent | Install it yourself, or use the panel's install. For a non-standard location set `GITNEXUS_CLI=/path/to/gitnexus/dist/cli/index.js`. | [`gitnexus/README.md` — Requirements](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#requirements), [Quick Start](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#quick-start) |
159
- | The project has no index | Use **初始化索引** in the panel, or run `gitnexus analyze --index-only <repo>`. | [`README.md` — CLI Reference](https://github.com/abhigyanpatwari/GitNexus/blob/main/README.md#cli-reference), [`RUNBOOK.md` — Index out of date](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#index-out-of-date--stale-tools) |
176
+ | The project has no index | Use **初始化索引** in the panel, or run `gitnexus analyze --index-only <repo>`. For a folder that is not a git repository the panel's command adds `--skip-git` (upstream requires it); the resulting index has no commit baseline and no incremental refresh. | [`README.md` — CLI Reference](https://github.com/abhigyanpatwari/GitNexus/blob/main/README.md#cli-reference), [`RUNBOOK.md` — Index out of date](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#index-out-of-date--stale-tools) |
177
+ | A subdirectory has an index but the switcher does not list it | The search only goes **down** from the current workspace, never up or to siblings. It skips hidden directories, `node_modules` and build output, and has depth/count/time limits. Confirm `<workspace>/<child>/.gitnexus/gitnexus.json`; if the index is in a skipped or very deep directory, open that directory as the workspace. Multiple projects appear in the header switcher, including git projects without an index; a truncated search is labelled as such. | This plugin's discovery; no upstream GitNexus path. |
160
178
  | Refresh fails, `spawn EPERM`, or the index stays `incremental-in-progress` | The panel's command already sets `GITNEXUS_MEMORY=off`, `NODE_OPTIONS=--max-old-space-size=8192`, `GITNEXUS_HOME=<repo>/.gitnexus/plugin-home` and `--index-only`. If the sandbox still refuses, run the copied command in your own shell; the plugin will not escalate. | [`RUNBOOK.md` — LadybugDB / lock errors](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#ladybugdb--lock-errors), [Memory / analyze crashes](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#memory--analyze-crashes) |
161
179
  | Refresh fails with `EPERM … mkdir` or `rmdir '<repo>\.gitnexus\parsedfile-store'` | GitNexus deletes this run-scoped store at the start of every parse, and a parse worker creates it again during the parse — both directions can be refused. Two causes, both addressed in 0.1.4: the plugin no longer pre-creates the directory (that was 0.1.3's `rmdir`), and the analyzer's shell call now carries the **repository** as its sandbox workspace root. A panel route has no session, so the sandbox used to fall back to the DSH application directory, whose write capability is a different identity — the repository's write grant never applied. If it still fails, the deployment's mode is read-only: run the copied command in a normal terminal. | [`RUNBOOK.md` — LadybugDB / lock errors](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#ladybugdb--lock-errors), [`RUNBOOK.md` — Clean slate](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#clean-slate-corrupt-or-huge-gitnexus) |
180
+ | Windows reports `windows-acl-run: SetNamedSecurityInfoW failed (Win32 5): grantWrite(D:\Program Files\DSH Desktop)` | The ACL sandbox failed to grant write on the **workspace root**; `D:\Program Files\DSH Desktop` is the DSH application directory, not a project. Since 0.1.5 the search/graph helpers use `<repo>/.gitnexus` as the policy root, and the installer uses the plugin prefix; a failed install returns the copyable command. If an ordinary **shell command** still fails this way, the session workspace itself is the install directory: open a writable project. Do not add ACL grants to Program Files. | This plugin's policy-root fix; the DSH sandbox itself has no upstream GitNexus path. |
162
181
  | Incremental analyze hangs, or the database reports `Maximum database size … has been reached` | Use **全量重建** (`--force`), or the clean-slate steps. | [`RUNBOOK.md` — Clean slate](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#clean-slate-corrupt-or-huge-gitnexus), [`gitnexus/README.md` — Troubleshooting](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#troubleshooting) |
163
182
  | Refresh fails with `EPERM … open '<repo>\.gitnexus\lbug.init.lock'` or `unable to acquire init lock` | A transient file lock, not a permissions problem: the ACL for `.gitnexus` was checked on the machine that reported it and came back healthy. GitNexus's first write is that lock, and a scanner, the indexer, or a crashed run can hold it. The plugin clears a stale lock and retries once automatically (the run shows `attempts: 2`). If it still fails, wait a moment and retry, or run the copied command in a normal terminal. | This plugin's retry plus the analyzer's own lock file; no upstream GitNexus path. |
164
183
  | Search fails with `A dynamic link library (DLL) initialization routine failed` / `lbugjs.node` | Graph search runs in `lib/bin/search-helper.js`, never in the Electron host. Restart DSH after upgrading and keep `node` on the shell PATH. If the helper cannot start at all, search falls back to source text. | [`gitnexus/README.md` — Troubleshooting](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#troubleshooting) |
@@ -166,6 +185,7 @@ GitNexus path owns the rest.
166
185
  | The refresh button says 无需刷新 and is disabled | That is the Tier 0 verdict, not a failure: every file the index recorded still hashes the same, so re-running the analyzer would change nothing. **仍然刷新** forces it anyway (useful after a schema or GitNexus upgrade). If the index recorded no commit baseline, the panel does **not** claim 无需刷新 — it says it cannot confirm and leaves the button enabled. | This plugin's delta engine; no upstream GitNexus path. |
167
186
  | The gate says 无法确认 instead of 无需刷新 | The index recorded no commit, so the comparison can only see the working tree. A confined analyze cannot start `git`, which is how the manifest ends up with an empty `lastCommit` — measured here: the same command writes it in a normal terminal and leaves it empty under the sandbox. Run the copied command outside the sandbox once if you want the stronger verdict; the refresh button stays usable either way. | This plugin's delta engine plus the analyzer's git access; no upstream GitNexus path. |
168
187
  | The graph card is empty, or fails with 404 | A 404 means the host predates `/api/gitnexus/graph` — restart DSH, not just the page. An empty canvas with a message means the index has no communities yet (an old index), or the store is busy: refresh the index. Nodes are capped by design; the card states how much it left out. | This plugin's host route; graph data itself comes from the GitNexus index. |
188
+ | The graph loads for some projects but spins or returns 504 for others | On Windows the ACL sandbox's first workspace grant propagates an inheritable ACE across the whole repository, which can exceed the 25 s helper timeout on a large tree; a project whose grant is already cached is fast. Since 0.1.5 the search/graph helpers root the policy at `<repo>/.gitnexus`, so the grant covers only the index; restart DSH. If it still fails, confirm `.gitnexus/lbug` exists and that no analyze is holding the index. | This plugin's sandbox policy root; graph data itself comes from the GitNexus index. |
169
189
  | Clicking a search hit does not open a file | The click uses `ctx.sidebarRight.openResourceIn`; a profile without that service falls back to copying `path:line`. Restart DSH; if it persists, use the Copy button. | This panel/DSH boundary; no upstream GitNexus path. |
170
190
  | The file timeline fails with 404/401 | The client hot-reloaded before the host did, so `/api/gitnexus/file-history` is not mounted yet. Restart DSH (not just refresh the page). | This plugin's host route; no upstream GitNexus path. |
171
191
  | Analyze runs out of memory | Keep the panel's `NODE_OPTIONS` / `GITNEXUS_MEMORY` settings, or raise the heap manually; the index may need a full rebuild. | [`gitnexus/README.md` — Analysis runs out of memory](https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/README.md#analysis-runs-out-of-memory), [`RUNBOOK.md` — Memory / analyze crashes](https://github.com/abhigyanpatwari/GitNexus/blob/main/RUNBOOK.md#memory--analyze-crashes) |
@@ -203,7 +223,11 @@ $env:GITNEXUS_MEMORY='off'; $env:NODE_OPTIONS='--max-old-space-size=8192'; `
203
223
 
204
224
  Add `--force` for a full rebuild, or `--repair-fts` alone to rebuild the search indexes
205
225
  without touching the graph (the panel offers that as **修复搜索索引(FTS)** when the index
206
- reports FTS as unavailable).
226
+ reports FTS as unavailable). A folder without `.git` also gets `--skip-git`.
227
+
228
+ - `--skip-git` — GitNexus refuses a directory without `.git` even when its path is
229
+ explicit; this flag indexes the folder directly. The index then has no commit baseline,
230
+ no incremental refresh and no Git activity, and the panel says so.
207
231
 
208
232
  - `GITNEXUS_MEMORY=off` — stops the CLI from re-spawning itself over piped stdio, which a
209
233
  confined sandbox denies (`spawn EPERM`).
@@ -250,5 +274,13 @@ the related features puts that use under it.**
250
274
  capped.
251
275
  - The source fallback only covers files in the index manifest; refresh the index for new
252
276
  files.
277
+ - An index built with `--skip-git` has no commit baseline: the gate can only say it cannot
278
+ confirm, a refresh re-analyses the whole folder, and the Git activity cards do not
279
+ appear.
280
+ - The workspace search is **bounded**: 12 levels, 4000 directories and 2 seconds by
281
+ default; it skips `node_modules`, build output and every hidden directory, and does not
282
+ follow symlinks. Indexed projects are preferred by default; unindexed git projects are
283
+ listed and can be initialized. An indexed or `.git` directory stops the descent. When a
284
+ bound stops the search the panel says it may have missed a project.
253
285
  - Deeper design/build notes are kept out of the public README; this file stays at the
254
286
  "what it does" and "how to fix it" level.