codegate-ai 0.14.3 → 0.14.4
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/dist/cli.js +14 -8
- package/dist/scan-target/staging.js +2 -0
- package/dist/scan-target/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -296,16 +296,22 @@ function addScanCommand(program, version, deps) {
|
|
|
296
296
|
? true
|
|
297
297
|
: (baseConfig.workflow_audits?.enabled ?? false),
|
|
298
298
|
},
|
|
299
|
-
// When the
|
|
300
|
-
// temp dir
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
//
|
|
305
|
-
//
|
|
299
|
+
// When the raw input was a single local file (now staged into a
|
|
300
|
+
// temp dir), walking the full user-scope tree is off-target — the
|
|
301
|
+
// user asked to scan one file, not their whole home. Without
|
|
302
|
+
// this guard, sibling findings (e.g. `~/.agents/skills/*/SKILL.md`)
|
|
303
|
+
// leak into scans of files like `.claude/settings.json` or
|
|
304
|
+
// `.idea/workspace.xml`.
|
|
305
|
+
//
|
|
306
|
+
// Earlier we gated on `explicitCandidates.length > 0`, but that
|
|
307
|
+
// falsely passed for files whose extension is not in the
|
|
308
|
+
// text-like format list (XML, binary-ish configs, etc.) — those
|
|
309
|
+
// produce zero explicit candidates and the guard never fired.
|
|
310
|
+
// Using `stagedFromLocalFile` is the reliable signal.
|
|
311
|
+
// Explicit opt-in via `--include-user-scope` still forces it on.
|
|
306
312
|
scan_user_scope: options.includeUserScope === true
|
|
307
313
|
? true
|
|
308
|
-
: resolvedTarget.
|
|
314
|
+
: resolvedTarget.stagedFromLocalFile === true
|
|
309
315
|
? false
|
|
310
316
|
: (baseConfig.scan_user_scope ?? false),
|
|
311
317
|
};
|
|
@@ -78,6 +78,7 @@ export function stageLocalFile(absolutePath) {
|
|
|
78
78
|
scanTarget: tempRoot,
|
|
79
79
|
displayTarget: absolutePath,
|
|
80
80
|
explicitCandidates: collectExplicitCandidates(tempRoot),
|
|
81
|
+
stagedFromLocalFile: true,
|
|
81
82
|
cleanup: () => cleanupTempDir(tempRoot),
|
|
82
83
|
};
|
|
83
84
|
}
|
|
@@ -89,6 +90,7 @@ export function stageLocalFile(absolutePath) {
|
|
|
89
90
|
scanTarget: tempRoot,
|
|
90
91
|
displayTarget: absolutePath,
|
|
91
92
|
explicitCandidates: collectExplicitCandidates(tempRoot),
|
|
93
|
+
stagedFromLocalFile: true,
|
|
92
94
|
cleanup: () => cleanupTempDir(tempRoot),
|
|
93
95
|
};
|
|
94
96
|
}
|
|
@@ -10,6 +10,14 @@ export interface ResolvedScanTarget {
|
|
|
10
10
|
scanTarget: string;
|
|
11
11
|
displayTarget: string;
|
|
12
12
|
explicitCandidates?: ExplicitScanCandidate[];
|
|
13
|
+
/**
|
|
14
|
+
* `true` when the raw input was a local file that got staged into a
|
|
15
|
+
* temp directory. This is the signal the CLI uses to disable the
|
|
16
|
+
* user-scope walk, regardless of whether `explicitCandidates` could be
|
|
17
|
+
* inferred for the file (an XML / binary / unrecognised extension
|
|
18
|
+
* would still benefit from the scope guard).
|
|
19
|
+
*/
|
|
20
|
+
stagedFromLocalFile?: boolean;
|
|
13
21
|
cleanup?: () => Promise<void> | void;
|
|
14
22
|
}
|
|
15
23
|
export interface ResolveScanTargetInput {
|