dsh-gitnexus-plus 0.1.3 → 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 (84) hide show
  1. package/README-CN.md +34 -10
  2. package/README.md +79 -14
  3. package/lib/bin/graph-helper.d.ts +21 -0
  4. package/lib/bin/graph-helper.d.ts.map +1 -0
  5. package/lib/bin/graph-helper.js +71 -0
  6. package/lib/bin/graph-helper.js.map +1 -0
  7. package/lib/client.js +4402 -2371
  8. package/lib/gitnexus/analyze.d.ts +54 -8
  9. package/lib/gitnexus/analyze.d.ts.map +1 -1
  10. package/lib/gitnexus/analyze.js +355 -84
  11. package/lib/gitnexus/analyze.js.map +1 -1
  12. package/lib/gitnexus/commands.d.ts +19 -2
  13. package/lib/gitnexus/commands.d.ts.map +1 -1
  14. package/lib/gitnexus/commands.js +42 -4
  15. package/lib/gitnexus/commands.js.map +1 -1
  16. package/lib/gitnexus/coverage.d.ts +8 -0
  17. package/lib/gitnexus/coverage.d.ts.map +1 -1
  18. package/lib/gitnexus/coverage.js +14 -2
  19. package/lib/gitnexus/coverage.js.map +1 -1
  20. package/lib/gitnexus/delta.d.ts +144 -0
  21. package/lib/gitnexus/delta.d.ts.map +1 -0
  22. package/lib/gitnexus/delta.js +347 -0
  23. package/lib/gitnexus/delta.js.map +1 -0
  24. package/lib/gitnexus/discover.d.ts +91 -0
  25. package/lib/gitnexus/discover.d.ts.map +1 -0
  26. package/lib/gitnexus/discover.js +214 -0
  27. package/lib/gitnexus/discover.js.map +1 -0
  28. package/lib/gitnexus/git-activity.d.ts +13 -21
  29. package/lib/gitnexus/git-activity.d.ts.map +1 -1
  30. package/lib/gitnexus/git-activity.js +60 -26
  31. package/lib/gitnexus/git-activity.js.map +1 -1
  32. package/lib/gitnexus/graph.d.ts +135 -0
  33. package/lib/gitnexus/graph.d.ts.map +1 -0
  34. package/lib/gitnexus/graph.js +474 -0
  35. package/lib/gitnexus/graph.js.map +1 -0
  36. package/lib/gitnexus/index-meta.d.ts +34 -6
  37. package/lib/gitnexus/index-meta.d.ts.map +1 -1
  38. package/lib/gitnexus/index-meta.js +47 -7
  39. package/lib/gitnexus/index-meta.js.map +1 -1
  40. package/lib/gitnexus/install.d.ts +11 -0
  41. package/lib/gitnexus/install.d.ts.map +1 -1
  42. package/lib/gitnexus/install.js +65 -9
  43. package/lib/gitnexus/install.js.map +1 -1
  44. package/lib/gitnexus/root.d.ts +0 -3
  45. package/lib/gitnexus/root.d.ts.map +1 -1
  46. package/lib/gitnexus/root.js +64 -5
  47. package/lib/gitnexus/root.js.map +1 -1
  48. package/lib/gitnexus/search.d.ts +34 -8
  49. package/lib/gitnexus/search.d.ts.map +1 -1
  50. package/lib/gitnexus/search.js +89 -13
  51. package/lib/gitnexus/search.js.map +1 -1
  52. package/lib/index.d.ts +13 -0
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +189 -7
  55. package/lib/index.js.map +1 -1
  56. package/lib/routes/analyze.d.ts +8 -6
  57. package/lib/routes/analyze.d.ts.map +1 -1
  58. package/lib/routes/analyze.js +25 -6
  59. package/lib/routes/analyze.js.map +1 -1
  60. package/lib/routes/coverage.d.ts +16 -10
  61. package/lib/routes/coverage.d.ts.map +1 -1
  62. package/lib/routes/coverage.js +31 -22
  63. package/lib/routes/coverage.js.map +1 -1
  64. package/lib/routes/delta.d.ts +22 -0
  65. package/lib/routes/delta.d.ts.map +1 -0
  66. package/lib/routes/delta.js +50 -0
  67. package/lib/routes/delta.js.map +1 -0
  68. package/lib/routes/file-diff.d.ts +19 -0
  69. package/lib/routes/file-diff.d.ts.map +1 -0
  70. package/lib/routes/file-diff.js +69 -0
  71. package/lib/routes/file-diff.js.map +1 -0
  72. package/lib/routes/graph.d.ts +22 -0
  73. package/lib/routes/graph.d.ts.map +1 -0
  74. package/lib/routes/graph.js +71 -0
  75. package/lib/routes/graph.js.map +1 -0
  76. package/lib/routes/guard.d.ts +3 -6
  77. package/lib/routes/guard.d.ts.map +1 -1
  78. package/lib/routes/guard.js +3 -6
  79. package/lib/routes/guard.js.map +1 -1
  80. package/lib/routes/projects.d.ts +21 -0
  81. package/lib/routes/projects.d.ts.map +1 -0
  82. package/lib/routes/projects.js +61 -0
  83. package/lib/routes/projects.js.map +1 -0
  84. package/package.json +2 -2
@@ -21,15 +21,23 @@
21
21
  *
22
22
  * THE ONE RULE THAT MATTERS
23
23
  * -------------------------
24
- * `sandboxPolicy` is never set here, and must never be. Passing it would be this
25
- * plugin choosing its own confinement — the escalation the approval service exists to
26
- * gate, requested through a door that cannot ask. Leaving it undefined takes the
27
- * deployment's decision. A denial is then reported as a denial, not retried wider:
28
- * the same rule the subagent prompt states, for the same reason.
24
+ * This runner never **constructs** a sandbox policy and never chooses a mode. It may
25
+ * forward a policy the host resolved (`options.sandboxPolicy`), and the host may only
26
+ * fill in the workspace root — see `src/index.ts`. The reason is measured, not
27
+ * theoretical: an agentless route has no session, so `sandboxPolicy.resolve()` falls
28
+ * back to `config.workspaceRoot ?? process.cwd()` and the sandbox derives its write
29
+ * capability SID from *that* path. The repository's own grant then never applies, and
30
+ * every write inside `.gitnexus` is refused — the failure this plugin reported as
31
+ * "sandbox denies .gitnexus". Supplying the workspace root is not escalation: the mode
32
+ * still comes from the deployment, and a read-only deployment stays read-only.
33
+ *
34
+ * A denial is reported as a denial, not retried wider: the same rule the subagent
35
+ * prompt states, for the same reason.
29
36
  */
30
- import { existsSync, mkdirSync } from 'node:fs';
37
+ import { existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs';
31
38
  import path from 'node:path';
32
39
  import { defaultGitnexusHome, effectiveSkipFts } from './commands.js';
40
+ import { hasGitMarker } from './index-meta.js';
33
41
  import { findGitnexusCli } from './toolchain.js';
34
42
  const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000;
35
43
  const DEFAULT_OUTPUT_LIMIT = 256 * 1024;
@@ -74,9 +82,18 @@ export function analyzeCommandLine(cliPath, repoPath, options = {}) {
74
82
  // is spawned through `node`. This is the better shape when available: no shim, no
75
83
  // `.cmd`/`.ps1` selection, and therefore no reliance on the shell's call operator.
76
84
  const viaNode = options.viaNode === true;
85
+ // Repair and skip are contradictory, and both flags are accepted by the CLI without
86
+ // complaining: `--skip-fts --repair-fts` exits 0 having done nothing. Guard here
87
+ // rather than trusting callers to keep them apart.
88
+ const repairFts = options.repairFts === true;
89
+ const skipFts = options.skipFts === true && !repairFts;
90
+ const skipGit = options.skipGit === true;
91
+ const force = options.force === true && !repairFts;
77
92
  const args = `analyze --index-only` +
78
- `${options.skipFts === true ? ' --skip-fts' : ''}` +
79
- `${options.force === true ? ' --force' : ''} ` +
93
+ `${repairFts ? ' --repair-fts' : ''}` +
94
+ `${skipGit ? ' --skip-git' : ''}` +
95
+ `${skipFts ? ' --skip-fts' : ''}` +
96
+ `${force ? ' --force' : ''} ` +
80
97
  quoteFor(flavor, repoPath);
81
98
  const head = viaNode ? `node ${quoteFor(flavor, cliPath)}` : quoteFor(flavor, cliPath);
82
99
  // On Windows a `.cmd` or `.ps1` reached by absolute path needs `&`. POSIX needs none,
@@ -98,27 +115,151 @@ export function analyzeCommandLine(cliPath, repoPath, options = {}) {
98
115
  /**
99
116
  * A sandbox refusal, recognised from the marker DSH writes into the output.
100
117
  *
101
- * Tested before the generic non-zero path because a denial is not a failure of
102
- * GitNexus — retrying it, or reporting it as "analyze failed", both mislead.
118
+ * The marker is the only reliable signal. It used to also match a bare `EPERM`, which
119
+ * is how a transient Windows file lock got reported as "the sandbox refused this
120
+ * write" — and the operator was told to stop trying, when retrying was the answer.
103
121
  */
104
122
  function looksDenied(text) {
105
- return /\[sandbox:[^\]]*denied/i.test(text) || /access is denied|permission denied|EPERM/i.test(text);
123
+ return /\[sandbox:[^\]]*denied/i.test(text) || /access is denied/i.test(text);
124
+ }
125
+ /** Delay before the single transient-lock retry. Long enough for a scanner to let go. */
126
+ const RETRY_DELAY_MS = 1500;
127
+ /**
128
+ * Whether a failure looks like a transient file lock rather than a policy refusal.
129
+ *
130
+ * Measured on GitNexus 1.6.12: the first write inside `.gitnexus` is
131
+ * `lbug.init.lock`, opened with `O_CREAT | O_EXCL`, and Windows can refuse it with
132
+ * `EPERM` while another scanner or a previous process holds the directory. The same
133
+ * class produces `unable to acquire init lock` when a crashed run left the file behind.
134
+ * Both are worth one retry; a sandbox marker never is, and neither is a denied
135
+ * directory creation — see {@link isSandboxStoreDenied}.
136
+ */
137
+ function isTransientLock(text) {
138
+ if (/\[sandbox:[^\]]*denied/i.test(text))
139
+ return false;
140
+ // The parse store is a directory the analyzer must create; a retry cannot grant a
141
+ // right the confined token does not have, so that class is handled separately.
142
+ if (isSandboxStoreDenied(text))
143
+ return false;
144
+ // A refused `spawn` is the sandbox blocking a child process (the FTS installer), not a
145
+ // held file: waiting and retrying changes nothing.
146
+ if (/spawn EPERM/i.test(text))
147
+ return false;
148
+ if (/unable to acquire init lock/i.test(text))
149
+ return true;
150
+ return /(EPERM|EBUSY|resource busy)/i.test(text) && /\.gitnexus|init\.lock|lbug/i.test(text);
151
+ }
152
+ /**
153
+ * Whether GitNexus tried to start a child process and the sandbox refused.
154
+ *
155
+ * Measured on a `--repair-fts` run: `Analysis failed: spawn EPERM`. The FTS extension is
156
+ * installed/loaded out of process, which a confined shell denies. This is the same class
157
+ * as the respawn problem `GITNEXUS_MEMORY=off` was added for — but this one is a child
158
+ * the analyzer starts deliberately, and no flag suppresses it.
159
+ */
160
+ function looksSpawnDenied(text) {
161
+ return /spawn EPERM/i.test(text);
162
+ }
163
+ /**
164
+ * Whether the FTS extension was found and still could not be loaded.
165
+ *
166
+ * That is an upstream runtime problem, not a sandbox refusal and not something a retry
167
+ * can fix: on Windows it usually names a missing DLL (`找不到指定的模块`), which the
168
+ * upstream message traces to the VC++ 2015-2022 x64 redistributable or OpenSSL 3.
169
+ */
170
+ function looksFtsUnloadable(text) {
171
+ return (/FTS extension file was found but could not be loaded/i.test(text) ||
172
+ (/failed to load library/i.test(text) && /fts/i.test(text)));
173
+ }
174
+ /**
175
+ * Whether the parse worker was refused permission to create its cache directories.
176
+ *
177
+ * Measured in a confined DSH profile: the token can create **files** under `.gitnexus`
178
+ * (`lbug.init.lock` succeeds) but not **directories**, so `persistParsedFileShardSync`
179
+ * dies at `mkdir .gitnexus/parsedfile-store` and the pool trips its circuit breaker.
180
+ * Pre-creating the directory does not help either — GitNexus deletes it at the start of
181
+ * every parse, and that delete is refused for the same reason (0.1.3 shipped exactly
182
+ * that workaround and produced `EPERM … rmdir`). This is a property of the deployment,
183
+ * so the honest answer is one precise message pointing at the terminal, not a retry.
184
+ */
185
+ function isSandboxStoreDenied(text) {
186
+ return (/EPERM[^\n]*mkdir[^\n]*\.gitnexus[\\/](parsedfile-store|parsedfile-cache|parse-cache)/i.test(text) ||
187
+ /mkdir[^\n]*\.gitnexus[\\/](parsedfile-store|parsedfile-cache|parse-cache)[^\n]*EPERM/i.test(text));
188
+ }
189
+ /**
190
+ * Remove the init lock a crashed run left behind, so the retry can take it.
191
+ *
192
+ * Safe by construction: this runner holds one run per repository, so no other analyze
193
+ * started by this plugin can be inside the window. A live lock from another tool is
194
+ * left to GitNexus's own staleness detection — this only clears the file, it does not
195
+ * decide who owns it.
196
+ */
197
+ function clearStaleLock(repoPath) {
198
+ try {
199
+ rmSync(path.join(repoPath, '.gitnexus', 'lbug.init.lock'), { force: true });
200
+ }
201
+ catch {
202
+ /* the retry may still succeed once a scanner releases it */
203
+ }
106
204
  }
107
205
  /**
108
- * GitNexus 1.6.12 creates these cache directories from the parse worker.
206
+ * Whether the manifest on disk records no commit.
109
207
  *
110
- * A worker running under a restricted host token can be denied `mkdir` on the
111
- * project's inherited `.gitnexus` ACL even though it can write files there. The
112
- * failure is EPERM at the first shard write and takes the whole parse phase down
113
- * with it. Creating the directories from the host, before the shell starts, makes
114
- * the worker use the directories that already exist. Returns an actionable error
115
- * instead of letting the worker fail on a path the panel then has to explain.
208
+ * In a confined shell the analyzer cannot start `git`, so it writes an empty
209
+ * `lastCommit` even on a successful run. The index itself is fine — the baseline is not
210
+ * — and that is what makes the refresh gate answer "无法确认" instead of "已是最新".
211
+ * Reported to the operator rather than repaired here: the manifest belongs to GitNexus,
212
+ * and writing a commit into it is the analyzer's decision, not this plugin's.
116
213
  */
117
- const ANALYZE_CACHE_DIRS = ['parsedfile-store', 'parsedfile-cache', 'parse-cache'];
214
+ function lacksCommitBaseline(repoPath) {
215
+ try {
216
+ const raw = JSON.parse(readFileSync(path.join(repoPath, '.gitnexus', 'gitnexus.json'), 'utf8'));
217
+ return typeof raw.lastCommit !== 'string' || raw.lastCommit === '';
218
+ }
219
+ catch {
220
+ return false;
221
+ }
222
+ }
223
+ /**
224
+ * The **durable** caches, created from the host before the shell starts.
225
+ *
226
+ * A worker running under a restricted host token can be denied `mkdir` on the project's
227
+ * inherited `.gitnexus` ACL even though it can write files there. The failure is EPERM
228
+ * at the first shard write and takes the whole parse phase down with it. Creating these
229
+ * two from the host, before the shell starts, makes the worker use directories that
230
+ * already exist. They are never cleared between runs, so a pre-created one is inert.
231
+ */
232
+ const ANALYZE_CACHE_DIRS = ['parsedfile-cache', 'parse-cache'];
233
+ /**
234
+ * GitNexus's **run-scoped** parsed-file store. Deliberately not pre-created.
235
+ *
236
+ * `parse-impl` calls `clearParsedFileStore()` unconditionally at the start of parsing,
237
+ * which is `fs.rm(dir, { recursive: true, force: true })`. `force` only forgives a
238
+ * missing directory — not a refusal or a lock. So a directory that exists there must be
239
+ * deleted before every parse, and 0.1.3 pre-created exactly that: it fixed a worker
240
+ * `mkdir` and introduced a delete the restricted process has to perform on a directory
241
+ * the **host** created. When that delete is denied or briefly locked, the parse dies
242
+ * with `EPERM … rmdir '<repo>\\.gitnexus\\parsedfile-store'` — the failure reported
243
+ * against 0.1.3.
244
+ *
245
+ * Measured against GitNexus 1.6.12: with the directory absent, a cold `--force` parse
246
+ * succeeds and never creates it, while the durable chunk directories it does create
247
+ * show the confined process can `mkdir`. So the store is left to GitNexus, and a
248
+ * leftover from an older plugin version is removed before spawning instead.
249
+ */
250
+ const RUN_SCOPED_STORE = 'parsedfile-store';
118
251
  function prepareAnalyzeCacheDirs(repoPath) {
119
252
  const indexDir = path.join(repoPath, '.gitnexus');
120
253
  if (!existsSync(indexDir))
121
254
  return null;
255
+ // Best effort. If this cannot be removed, GitNexus's own clear gets the next attempt;
256
+ // failing the run here would only replace one EPERM with a less accurate one.
257
+ try {
258
+ rmSync(path.join(indexDir, RUN_SCOPED_STORE), { recursive: true, force: true });
259
+ }
260
+ catch {
261
+ /* the analyzer's clear is the next attempt; do not pre-empt it */
262
+ }
122
263
  for (const name of ANALYZE_CACHE_DIRS) {
123
264
  const target = path.join(indexDir, name);
124
265
  try {
@@ -146,14 +287,35 @@ export function createAnalyzeRunner(options) {
146
287
  const outputLimit = options.outputLimit ?? DEFAULT_OUTPUT_LIMIT;
147
288
  const tailLimit = options.tailLimit ?? DEFAULT_TAIL_LIMIT;
148
289
  const now = options.now ?? (() => Date.now());
290
+ const retryDelayMs = options.retryDelayMs ?? RETRY_DELAY_MS;
149
291
  const shellFlavor = process.platform === 'win32' ? 'win32' : 'posix';
150
292
  const runs = new Map();
151
293
  const inFlight = new Map();
294
+ // One status per repository, and a long session can touch many. The map used to grow
295
+ // with every repository ever visited, each entry holding a 4 KB output tail; an idle
296
+ // panel never needs more than the repositories it can still show.
297
+ const RUNS_MAX = 32;
298
+ /** Store the latest status, evicting finished entries beyond the cap, oldest first. */
299
+ const rememberRun = (key, status) => {
300
+ runs.delete(key);
301
+ runs.set(key, status);
302
+ if (runs.size <= RUNS_MAX)
303
+ return;
304
+ for (const [other, entry] of runs) {
305
+ if (entry.state === 'running')
306
+ continue;
307
+ runs.delete(other);
308
+ if (runs.size <= RUNS_MAX)
309
+ break;
310
+ }
311
+ };
152
312
  /** The shape a status starts from, before any run has touched it. */
153
313
  const BLANK = {
154
314
  state: 'failed',
155
315
  force: false,
316
+ repairFts: false,
156
317
  command: '',
318
+ attempts: 0,
157
319
  startedAt: 0,
158
320
  finishedAt: null,
159
321
  exitCode: null,
@@ -171,7 +333,7 @@ export function createAnalyzeRunner(options) {
171
333
  // silent no-op. The spread above cannot express that.
172
334
  finishedAt: patch.finishedAt ?? now(),
173
335
  };
174
- runs.set(repoPath, next);
336
+ rememberRun(repoPath, next);
175
337
  inFlight.delete(repoPath);
176
338
  return next;
177
339
  };
@@ -180,11 +342,23 @@ export function createAnalyzeRunner(options) {
180
342
  // Named `request`, not `options`: the runner's own configuration is the outer
181
343
  // `options`, and shadowing it silently dropped `toolchain`, `memoryOff` and
182
344
  // `heapMb` from every run built after the force argument was added.
183
- const force = request.force === true;
345
+ //
346
+ // Repair wins over force: a caller asking for both wants the smaller, more targeted
347
+ // operation, and running a full rebuild to fix FTS would be a much larger change
348
+ // than the button said. `analyzeCommandLine` enforces the same precedence so the
349
+ // displayed command cannot disagree with the one executed.
350
+ const repairFts = request.repairFts === true;
351
+ const force = repairFts ? false : request.force === true;
184
352
  // Both decisions are per repository, not per plugin: the skip-fts policy depends
185
353
  // on the index's own FTS capability, and the registry redirect belongs beside the
186
- // index so it stays inside the workspace the host was granted.
187
- const skipFts = effectiveSkipFts(key, options.skipFts === true);
354
+ // index so it stays inside the workspace the host was granted. A repair run never
355
+ // skips FTS — that would be the one flag combination that does nothing at all.
356
+ const skipFts = repairFts ? false : effectiveSkipFts(key, options.skipFts === true);
357
+ // GitNexus checks for `.git` before it reads any option, so a plain folder is
358
+ // refused even when its path is explicit. `--skip-git` is the CLI's own answer:
359
+ // it indexes the folder and warns that commit tracking and incremental updates
360
+ // are disabled. The panel reports the same consequence.
361
+ const skipGit = !hasGitMarker(key);
188
362
  const gitnexusHome = options.gitnexusHome ?? defaultGitnexusHome(key);
189
363
  // One run per repository. Two concurrent `analyze` processes would contend for the
190
364
  // same store, and the second would report a failure that says nothing about the
@@ -192,11 +366,19 @@ export function createAnalyzeRunner(options) {
192
366
  const running = runs.get(key);
193
367
  if (running !== undefined && running.state === 'running')
194
368
  return running;
369
+ // The command as a human would type it, for the states that never reach a real
370
+ // invocation. Kept in one place so an early return cannot describe a different
371
+ // operation than the one the request asked for.
372
+ const previewCommand = `gitnexus analyze --index-only` +
373
+ `${repairFts ? ' --repair-fts' : ''}` +
374
+ `${skipGit ? ' --skip-git' : ''}` +
375
+ `${force ? ' --force' : ''}`;
195
376
  if (shell === null) {
196
377
  return finish(key, {
197
378
  state: 'unavailable',
198
379
  force,
199
- command: `gitnexus analyze --index-only${force ? ' --force' : ''}`,
380
+ repairFts,
381
+ command: previewCommand,
200
382
  startedAt: now(),
201
383
  output: '',
202
384
  message: '当前部署没有提供 shell 执行器(ctx.shell 未挂载),无法运行命令。' +
@@ -211,7 +393,8 @@ export function createAnalyzeRunner(options) {
211
393
  return finish(key, {
212
394
  state: 'unavailable',
213
395
  force,
214
- command: `gitnexus analyze --index-only${force ? ' --force' : ''}`,
396
+ repairFts,
397
+ command: previewCommand,
215
398
  startedAt: now(),
216
399
  output: '',
217
400
  message: '本机没有找到 gitnexus 命令,无法执行。安装后重试:`npm i -g gitnexus`。' +
@@ -227,7 +410,9 @@ export function createAnalyzeRunner(options) {
227
410
  heapMb: options.heapMb,
228
411
  viaNode: cli.viaNode,
229
412
  force,
413
+ repairFts,
230
414
  skipFts,
415
+ skipGit,
231
416
  gitnexusHome,
232
417
  });
233
418
  const cacheError = prepareAnalyzeCacheDirs(key);
@@ -235,6 +420,7 @@ export function createAnalyzeRunner(options) {
235
420
  return finish(key, {
236
421
  state: 'failed',
237
422
  force,
423
+ repairFts,
238
424
  command,
239
425
  startedAt: now(),
240
426
  output: '',
@@ -247,14 +433,20 @@ export function createAnalyzeRunner(options) {
247
433
  repoPath: key,
248
434
  state: 'running',
249
435
  force,
436
+ repairFts,
250
437
  command,
438
+ attempts: 1,
251
439
  startedAt: now(),
252
440
  finishedAt: null,
253
441
  exitCode: null,
254
442
  message: null,
255
443
  output: '',
256
444
  };
257
- runs.set(key, started);
445
+ rememberRun(key, started);
446
+ // The host resolves the policy; this runner only carries it. Absent when the
447
+ // deployment has no `sandboxPolicy` service, and then the executor's own default
448
+ // applies — exactly as before.
449
+ const sandboxPolicy = options.sandboxPolicy?.(key);
258
450
  const spec = shell.resolve({
259
451
  command,
260
452
  workdir: key,
@@ -262,68 +454,147 @@ export function createAnalyzeRunner(options) {
262
454
  onExpiry: 'kill',
263
455
  stdoutMaxBytes: outputLimit,
264
456
  signal: controller.signal,
265
- // `sandboxPolicy` is deliberately absent. See the module comment.
457
+ ...(sandboxPolicy === undefined ? {} : { sandboxPolicy }),
266
458
  });
267
459
  void (async () => {
268
- let execution;
269
- try {
270
- execution = await shell.execute(spec);
271
- }
272
- catch (cause) {
273
- // `execute` rejects only for infrastructure failures — an unusable workdir, no
274
- // shell. A cancellation rejects here too, before a handle exists.
275
- const aborted = controller.signal.aborted;
276
- finish(key, {
277
- state: aborted ? 'cancelled' : 'failed',
278
- message: aborted ? '已取消。' : `无法启动命令:${String(cause?.message ?? cause)}`,
279
- });
280
- return;
281
- }
282
- let result;
283
- try {
284
- result = await execution.result();
285
- }
286
- catch (cause) {
287
- finish(key, { state: 'failed', message: `执行失败:${String(cause?.message ?? cause)}` });
460
+ // A single retry, and only for one class of failure.
461
+ //
462
+ // Measured: GitNexus's first write inside `.gitnexus` is the init lock, and on
463
+ // Windows that `open` can fail with `EPERM` while a virus scanner or the indexer
464
+ // holds the directory — a transient refusal, not a policy one. The ACL for that
465
+ // path was verified healthy (`WRITE_DAC`/`WRITE_OWNER` present, no foreign
466
+ // entries), so retrying once after clearing a stale lock is the response, not an
467
+ // escalation. Anything carrying the sandbox's own marker is never retried.
468
+ for (let attempt = 1; attempt <= 2; attempt += 1) {
469
+ let execution;
470
+ try {
471
+ execution = await shell.execute(spec);
472
+ }
473
+ catch (cause) {
474
+ // `execute` rejects only for infrastructure failures — an unusable workdir, no
475
+ // shell. A cancellation rejects here too, before a handle exists.
476
+ const aborted = controller.signal.aborted;
477
+ finish(key, {
478
+ state: aborted ? 'cancelled' : 'failed',
479
+ attempts: attempt,
480
+ message: aborted ? '已取消。' : `无法启动命令:${String(cause?.message ?? cause)}`,
481
+ });
482
+ return;
483
+ }
484
+ let result;
485
+ try {
486
+ result = await execution.result();
487
+ }
488
+ catch (cause) {
489
+ finish(key, {
490
+ state: 'failed',
491
+ attempts: attempt,
492
+ message: `执行失败:${String(cause?.message ?? cause)}`,
493
+ });
494
+ return;
495
+ }
496
+ const combined = `${result.stdout?.text ?? ''}${result.stderr?.text ?? ''}`;
497
+ const body = tail(combined, tailLimit);
498
+ const exitCode = typeof result.exitCode === 'number' ? result.exitCode : null;
499
+ if (attempt === 1 &&
500
+ result.timedOut !== true &&
501
+ !controller.signal.aborted &&
502
+ isTransientLock(combined)) {
503
+ clearStaleLock(key);
504
+ await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
505
+ if (controller.signal.aborted) {
506
+ finish(key, { state: 'cancelled', attempts: attempt, exitCode, output: body, message: '已取消。' });
507
+ return;
508
+ }
509
+ continue;
510
+ }
511
+ // Order matters. A denial can also be a non-zero exit, and reporting it as a
512
+ // generic failure sends the operator looking for a GitNexus bug that is not
513
+ // there. Cancellation is checked before timeout because a kill from `cancel()`
514
+ // and a kill from the deadline both surface as a killed process.
515
+ if (controller.signal.aborted) {
516
+ finish(key, { state: 'cancelled', attempts: attempt, exitCode, output: body, message: '已取消。' });
517
+ }
518
+ else if (result.timedOut === true) {
519
+ finish(key, {
520
+ state: 'timed-out',
521
+ attempts: attempt,
522
+ exitCode,
523
+ output: body,
524
+ message: `超过 ${Math.round(timeoutMs / 1000)} 秒上限已终止。大仓库的全量重建可能需要更长时间。`,
525
+ });
526
+ }
527
+ else if (looksFtsUnloadable(combined)) {
528
+ // The extension is present and still cannot load: an upstream runtime gap, not
529
+ // a sandbox refusal and not a retry candidate.
530
+ finish(key, {
531
+ state: 'failed',
532
+ attempts: attempt,
533
+ exitCode,
534
+ output: body,
535
+ message: 'FTS 扩展文件存在但加载失败 —— 通常是 Windows 缺少原生运行时(VC++ 2015-2022 x64 与 OpenSSL 3),' +
536
+ '不是索引损坏,也不是本插件能修的。装好运行时后再试;在此之前搜索仍按名称/路径匹配。',
537
+ });
538
+ }
539
+ else if (looksSpawnDenied(combined)) {
540
+ finish(key, {
541
+ state: 'denied',
542
+ attempts: attempt,
543
+ exitCode,
544
+ output: body,
545
+ message: '分析器要启动一个子进程(FTS 扩展的安装/加载),当前沙箱不允许 spawn。请在普通终端执行下面的命令;' +
546
+ '若终端里仍报扩展无法加载,那是缺少原生运行时。',
547
+ });
548
+ }
549
+ else if (isSandboxStoreDenied(combined)) {
550
+ // Deterministic, not transient: the confined token may create files in
551
+ // `.gitnexus` but not directories, and the parse worker needs a directory.
552
+ // Retrying would only spend another parse; say what to do instead.
553
+ finish(key, {
554
+ state: 'denied',
555
+ attempts: attempt,
556
+ exitCode,
557
+ output: body,
558
+ message: '分析器的解析阶段要在 .gitnexus 下创建缓存目录,当前沙箱不允许(可以建文件、不能建目录),' +
559
+ '预建目录也会被 GitNexus 在解析开始时删除。请在普通终端执行下面的命令,再回到面板刷新。',
560
+ });
561
+ }
562
+ else if (looksDenied(combined)) {
563
+ finish(key, {
564
+ state: 'denied',
565
+ attempts: attempt,
566
+ exitCode,
567
+ output: body,
568
+ message: '沙箱拒绝了这次写入。本插件不会申请扩权 —— 需要在终端里手动执行这条命令。',
569
+ });
570
+ }
571
+ else if (exitCode === 0) {
572
+ finish(key, {
573
+ state: 'done',
574
+ attempts: attempt,
575
+ exitCode,
576
+ output: body,
577
+ // A confined shell cannot start `git`, so GitNexus cannot record the commit
578
+ // it indexed. The index is still correct; only the baseline is missing, and
579
+ // the gate will honestly say "无法确认" until a terminal run fills it in.
580
+ message: lacksCommitBaseline(key)
581
+ ? '刷新完成。但沙箱里分析器读不到 git,索引没有记录提交基线 —— 想让门禁给出"已是最新",在普通终端再跑一次下面的命令。'
582
+ : null,
583
+ });
584
+ }
585
+ else {
586
+ finish(key, {
587
+ state: 'failed',
588
+ attempts: attempt,
589
+ exitCode,
590
+ output: body,
591
+ message: attempt > 1 && isTransientLock(combined)
592
+ ? '缓存或锁文件被临时占用(EPERM/EBUSY),已自动重试一次仍失败。稍后重试;若持续出现,把下面的命令放到普通终端执行。'
593
+ : `gitnexus 以退出码 ${exitCode ?? '未知'} 结束。`,
594
+ });
595
+ }
288
596
  return;
289
597
  }
290
- const combined = `${result.stdout?.text ?? ''}${result.stderr?.text ?? ''}`;
291
- const body = tail(combined, tailLimit);
292
- const exitCode = typeof result.exitCode === 'number' ? result.exitCode : null;
293
- // Order matters. A denial can also be a non-zero exit, and reporting it as a
294
- // generic failure sends the operator looking for a GitNexus bug that is not
295
- // there. Cancellation is checked before timeout because a kill from `cancel()`
296
- // and a kill from the deadline both surface as a killed process.
297
- if (controller.signal.aborted) {
298
- finish(key, { state: 'cancelled', exitCode, output: body, message: '已取消。' });
299
- }
300
- else if (result.timedOut === true) {
301
- finish(key, {
302
- state: 'timed-out',
303
- exitCode,
304
- output: body,
305
- message: `超过 ${Math.round(timeoutMs / 1000)} 秒上限已终止。大仓库的全量重建可能需要更长时间。`,
306
- });
307
- }
308
- else if (looksDenied(combined)) {
309
- finish(key, {
310
- state: 'denied',
311
- exitCode,
312
- output: body,
313
- message: '沙箱拒绝了这次写入。本插件不会申请扩权 —— 需要在终端里手动执行这条命令。',
314
- });
315
- }
316
- else if (exitCode === 0) {
317
- finish(key, { state: 'done', exitCode, output: body, message: null });
318
- }
319
- else {
320
- finish(key, {
321
- state: 'failed',
322
- exitCode,
323
- output: body,
324
- message: `gitnexus 以退出码 ${exitCode ?? '未知'} 结束。`,
325
- });
326
- }
327
598
  })();
328
599
  return started;
329
600
  };
@@ -1 +1 @@
1
- {"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/gitnexus/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,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