@promptci/core 0.2.2 → 0.3.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/dist/ai-config.d.ts +13 -6
- package/dist/ai-config.d.ts.map +1 -1
- package/dist/ai-config.js +25 -78
- package/dist/ai-config.js.map +1 -1
- package/dist/close-match.d.ts +97 -0
- package/dist/close-match.d.ts.map +1 -0
- package/dist/close-match.js +215 -0
- package/dist/close-match.js.map +1 -0
- package/dist/command-validity.d.ts.map +1 -1
- package/dist/command-validity.js +126 -20
- package/dist/command-validity.js.map +1 -1
- package/dist/context-optimizer.d.ts.map +1 -1
- package/dist/context-optimizer.js +9 -2
- package/dist/context-optimizer.js.map +1 -1
- package/dist/dead-references.d.ts +8 -1
- package/dist/dead-references.d.ts.map +1 -1
- package/dist/dead-references.js +149 -15
- package/dist/dead-references.js.map +1 -1
- package/dist/dependency-staleness.d.ts.map +1 -1
- package/dist/dependency-staleness.js +24 -38
- package/dist/dependency-staleness.js.map +1 -1
- package/dist/detectors.js +1 -1
- package/dist/detectors.js.map +1 -1
- package/dist/discovery.d.ts +138 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +569 -0
- package/dist/discovery.js.map +1 -0
- package/dist/fix-engine.d.ts.map +1 -1
- package/dist/fix-engine.js +75 -1
- package/dist/fix-engine.js.map +1 -1
- package/dist/frameworks/dotnet.d.ts.map +1 -1
- package/dist/frameworks/dotnet.js +10 -11
- package/dist/frameworks/dotnet.js.map +1 -1
- package/dist/frameworks/go.d.ts.map +1 -1
- package/dist/frameworks/go.js +8 -4
- package/dist/frameworks/go.js.map +1 -1
- package/dist/frameworks/nextjs.d.ts.map +1 -1
- package/dist/frameworks/nextjs.js +8 -17
- package/dist/frameworks/nextjs.js.map +1 -1
- package/dist/frameworks/python.d.ts.map +1 -1
- package/dist/frameworks/python.js +5 -3
- package/dist/frameworks/python.js.map +1 -1
- package/dist/frameworks/rust.d.ts.map +1 -1
- package/dist/frameworks/rust.js +3 -3
- package/dist/frameworks/rust.js.map +1 -1
- package/dist/frameworks/unity.d.ts.map +1 -1
- package/dist/frameworks/unity.js +6 -5
- package/dist/frameworks/unity.js.map +1 -1
- package/dist/gitignore.d.ts +31 -2
- package/dist/gitignore.d.ts.map +1 -1
- package/dist/gitignore.js +33 -8
- package/dist/gitignore.js.map +1 -1
- package/dist/hooks-settings-detector.d.ts.map +1 -1
- package/dist/hooks-settings-detector.js +5 -1
- package/dist/hooks-settings-detector.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/known-paths.d.ts +82 -0
- package/dist/known-paths.d.ts.map +1 -0
- package/dist/known-paths.js +152 -0
- package/dist/known-paths.js.map +1 -0
- package/dist/makefile.d.ts.map +1 -1
- package/dist/makefile.js +17 -13
- package/dist/makefile.js.map +1 -1
- package/dist/manifest-consistency.d.ts +1 -1
- package/dist/manifest-consistency.d.ts.map +1 -1
- package/dist/manifest-consistency.js +12 -8
- package/dist/manifest-consistency.js.map +1 -1
- package/dist/mcp-config-detector.d.ts.map +1 -1
- package/dist/mcp-config-detector.js +5 -1
- package/dist/mcp-config-detector.js.map +1 -1
- package/dist/project-type.d.ts +2 -1
- package/dist/project-type.d.ts.map +1 -1
- package/dist/project-type.js +36 -48
- package/dist/project-type.js.map +1 -1
- package/dist/prompt-cache.d.ts.map +1 -1
- package/dist/prompt-cache.js +13 -2
- package/dist/prompt-cache.js.map +1 -1
- package/dist/repo-context.d.ts +9 -0
- package/dist/repo-context.d.ts.map +1 -1
- package/dist/repo-context.js +32 -35
- package/dist/repo-context.js.map +1 -1
- package/dist/repo-tree.d.ts +163 -9
- package/dist/repo-tree.d.ts.map +1 -1
- package/dist/repo-tree.js +226 -34
- package/dist/repo-tree.js.map +1 -1
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +3 -0
- package/dist/report.js.map +1 -1
- package/dist/sarif.d.ts +27 -0
- package/dist/sarif.d.ts.map +1 -0
- package/dist/sarif.js +357 -0
- package/dist/sarif.js.map +1 -0
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +8 -2
- package/dist/scan.js.map +1 -1
- package/dist/scanner.d.ts +4 -3
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +36 -77
- package/dist/scanner.js.map +1 -1
- package/dist/security-pack.d.ts.map +1 -1
- package/dist/security-pack.js +34 -35
- package/dist/security-pack.js.map +1 -1
- package/dist/skill-supply-chain.d.ts.map +1 -1
- package/dist/skill-supply-chain.js +29 -19
- package/dist/skill-supply-chain.js.map +1 -1
- package/dist/skills-detector.d.ts.map +1 -1
- package/dist/skills-detector.js +11 -3
- package/dist/skills-detector.js.map +1 -1
- package/dist/token-estimates.d.ts +42 -0
- package/dist/token-estimates.d.ts.map +1 -0
- package/dist/token-estimates.js +200 -0
- package/dist/token-estimates.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +5 -2
package/dist/repo-context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-context.js","sourceRoot":"","sources":["../src/repo-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,eAA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W,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE5F,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,KAAK;QACL,WAAW;QACX,SAAS;QACT,WAAW,EAAE,qBAAqB,CAAC,WAAW,EAAE,SAAS,CAAC;QAC1D,SAAS;QACT,UAAU,EAAE,kBAAkB,CAAC,SAAS;QACxC,mBAAmB,EAAE,kBAAkB,CAAC,SAAS;QACjD,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC;QAC3C,2EAA2E;QAC3E,uEAAuE;QACvE,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,WAAW,EAAE,aAAa;QAChE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,IAAI,WAAW,EAAE,iBAAiB;QAC5E,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;QAClD,aAAa;QACb,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
package/dist/repo-tree.d.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* Every such check goes through {@link RepoTree}, which never touches a path
|
|
10
10
|
* outside the root.
|
|
11
11
|
*/
|
|
12
|
-
import * as fs from 'node:fs';
|
|
13
|
-
import type fg from 'fast-glob';
|
|
14
12
|
import type { IssueCategory, PromptCiIssue } from './types.js';
|
|
13
|
+
import { PathInventory } from './known-paths.js';
|
|
14
|
+
import type { KnownPaths } from './known-paths.js';
|
|
15
15
|
/**
|
|
16
16
|
* True for a path that is absolute on ANY platform: POSIX (`/x`), Windows drive
|
|
17
17
|
* or UNC (`C:\x`, `\\host\share`), or drive-relative (`C:x`, which Windows
|
|
@@ -37,6 +37,53 @@ export type Lookup = {
|
|
|
37
37
|
| {
|
|
38
38
|
state: 'unreadable';
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* One directory entry, as much of `fs.Dirent` as a detector needs. A real
|
|
42
|
+
* `fs.Dirent` satisfies it; so does an entry synthesized from a
|
|
43
|
+
* {@link PathInventory} (pcic-csf), which never stands for a symlink.
|
|
44
|
+
*/
|
|
45
|
+
export type TreeEntry = {
|
|
46
|
+
name: string;
|
|
47
|
+
isFile(): boolean;
|
|
48
|
+
isDirectory(): boolean;
|
|
49
|
+
isSymbolicLink(): boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* What {@link RepoTree.readText} found. See its doc comment for why
|
|
53
|
+
* `unreadable` and `unfetched` are different answers.
|
|
54
|
+
*/
|
|
55
|
+
export type ReadResult = {
|
|
56
|
+
state: 'found';
|
|
57
|
+
content: string;
|
|
58
|
+
} | {
|
|
59
|
+
state: 'missing' | 'outside' | 'unreadable' | 'unfetched' | 'too-large';
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The slice of fast-glob's `FileSystemAdapter` {@link RepoTree.walkFs} supplies.
|
|
63
|
+
* Declared structurally on purpose: fast-glob is an implementation detail of
|
|
64
|
+
* this package, and naming its type here would put it in the published
|
|
65
|
+
* declarations of everything that touches a tree.
|
|
66
|
+
*/
|
|
67
|
+
export type WalkFsAdapter = {
|
|
68
|
+
readdirSync: (dir: string, options?: {
|
|
69
|
+
withFileTypes: true;
|
|
70
|
+
}) => never;
|
|
71
|
+
};
|
|
72
|
+
/** How a {@link RepoTree} answers existence questions. */
|
|
73
|
+
export type RepoTreeOptions = {
|
|
74
|
+
/**
|
|
75
|
+
* pcic-csf: the repo-relative POSIX paths the repository holds. Consulted
|
|
76
|
+
* before the filesystem by every existence check a scan makes.
|
|
77
|
+
*/
|
|
78
|
+
knownPaths?: KnownPaths;
|
|
79
|
+
/**
|
|
80
|
+
* True when `knownPaths` is the WHOLE repository, so a path it does not list
|
|
81
|
+
* is genuinely absent and the filesystem is never consulted. False (the
|
|
82
|
+
* default) treats it as a partial view: an unlisted path is still looked for
|
|
83
|
+
* on disk.
|
|
84
|
+
*/
|
|
85
|
+
knownPathsComplete?: boolean;
|
|
86
|
+
};
|
|
40
87
|
/** The `code` of a filesystem error (`EACCES`, `ENOENT`, …), when it has one. */
|
|
41
88
|
export declare function errorCode(err: unknown): string | undefined;
|
|
42
89
|
/**
|
|
@@ -65,19 +112,111 @@ export declare class RepoTree {
|
|
|
65
112
|
/** The root's real path, when it differs (a root under a symlink, like macOS `/var`). */
|
|
66
113
|
private readonly realRoot;
|
|
67
114
|
private readonly listings;
|
|
115
|
+
/**
|
|
116
|
+
* pcic-csf: the caller's inventory of the repository, when one was given.
|
|
117
|
+
* Consulted before the filesystem; see {@link PathInventory}.
|
|
118
|
+
*/
|
|
119
|
+
readonly inventory: PathInventory | undefined;
|
|
68
120
|
/** What could not be read, as shown in the report (`dir/` or a link's path) → why. */
|
|
69
121
|
readonly unreadable: Map<string, string>;
|
|
70
|
-
constructor(repoRoot: string);
|
|
122
|
+
constructor(repoRoot: string, options?: RepoTreeOptions);
|
|
71
123
|
/** Forward-slash path relative to the root (`.` for the root itself); never absolute. */
|
|
72
124
|
relative(abs: string): string;
|
|
125
|
+
/** {@link relative} in the inventory's own spelling: `''` for the root, never `.`. */
|
|
126
|
+
private relativePosix;
|
|
73
127
|
/** Record what could not be read: a directory (shown as `dir/`) or a link (shown as its path). */
|
|
74
128
|
noteUnreadable(p: string, reason: string, kind?: 'dir' | 'link'): void;
|
|
75
|
-
/** The entries of an in-root directory, by exact name. */
|
|
129
|
+
/** The entries of an in-root directory on the filesystem, by exact name. */
|
|
130
|
+
private listFs;
|
|
131
|
+
/**
|
|
132
|
+
* The entries of an in-root directory, by exact name.
|
|
133
|
+
*
|
|
134
|
+
* pcic-csf: with an inventory, its listing is authoritative when it is
|
|
135
|
+
* complete; otherwise the two are merged, so a path the caller named is
|
|
136
|
+
* found even though the scan root holds only the instruction files. A
|
|
137
|
+
* directory the inventory describes is never reported as unreadable, since
|
|
138
|
+
* nothing had to be read to answer.
|
|
139
|
+
*
|
|
140
|
+
* On a name they both carry the inventory wins — EXCEPT when what is on disk
|
|
141
|
+
* is a symlink. An inventory entry is a plain file or directory, so letting
|
|
142
|
+
* one shadow a real link would hide it from {@link lookup}'s containment
|
|
143
|
+
* check and the subsequent read would follow it wherever it points. The link
|
|
144
|
+
* wins, and `lookup` judges it as it judges any other.
|
|
145
|
+
*/
|
|
76
146
|
private list;
|
|
77
147
|
/** In-root equivalent of a link target written against the root's real path. */
|
|
78
148
|
private fromRealRoot;
|
|
149
|
+
/**
|
|
150
|
+
* Where a link's target lands inside the root, or `null` when following it
|
|
151
|
+
* would leave the root.
|
|
152
|
+
*
|
|
153
|
+
* pcic-e6xa: a RELATIVE target is resolved segment by segment against the
|
|
154
|
+
* link's own directory and refused the moment it climbs above the root —
|
|
155
|
+
* even when a later segment names the root's own directory again
|
|
156
|
+
* (`x -> ../<root dir name>/y`). Resolving such a link lexically lands back
|
|
157
|
+
* inside the root, so the old containment check passed it and the verdict
|
|
158
|
+
* came to depend on the name of the directory the scan runs in: whoever
|
|
159
|
+
* wrote the scanned repository could learn it, and a hosted scan's temp
|
|
160
|
+
* directory name is not theirs to learn. An ABSOLUTE target cannot climb, so
|
|
161
|
+
* it keeps the plain containment check (plus the root's real path, for a root
|
|
162
|
+
* that itself sits under a link, like macOS `/var`) — a Windows junction's
|
|
163
|
+
* target, which is always absolute, resolves this way.
|
|
164
|
+
*
|
|
165
|
+
* A Windows drive or UNC target (`C:\x`, `\\host\share\x`) read on POSIX, and
|
|
166
|
+
* a drive-RELATIVE one (`C:x`) anywhere, are outside full stop: neither is
|
|
167
|
+
* absolute to `path` there, so `path.resolve` would join it to the process's
|
|
168
|
+
* working directory and the verdict would depend on where the scan was
|
|
169
|
+
* started from — which could be the root itself.
|
|
170
|
+
*/
|
|
171
|
+
private linkTargetWithinRoot;
|
|
79
172
|
lookup(candidate: string): Lookup;
|
|
80
173
|
isDir(candidate: string): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* pcic-e6xa: the one way a detector asks whether a FIXED name exists
|
|
176
|
+
* (`.env`, `supabase/migrations`, `Cargo.toml`, `requirements.txt`,
|
|
177
|
+
* `.clinerules`). The name is not user input, but the tree around it is: a
|
|
178
|
+
* committed link out of the repository made the answer depend on a path
|
|
179
|
+
* outside the scan root, and a hosted scan's root is a server temp
|
|
180
|
+
* directory. Going through {@link lookup} keeps every such check inside the
|
|
181
|
+
* root — and lets a caller's inventory answer it (pcic-csf).
|
|
182
|
+
*
|
|
183
|
+
* `candidate` may be repo-relative or absolute inside the root. Anything
|
|
184
|
+
* outside, or under a directory that could not be listed, reads as absent:
|
|
185
|
+
* these checks are signals ("does this repo use Supabase?"), and the honest
|
|
186
|
+
* answer when the scan cannot look is the one that adds no finding.
|
|
187
|
+
*/
|
|
188
|
+
exists(candidate: string): boolean;
|
|
189
|
+
/** {@link exists}, restricted to a regular file (or a link to one inside the root). */
|
|
190
|
+
isFile(candidate: string): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* The text of an in-root file, or why there is none to read. The only way a
|
|
193
|
+
* detector reads a file it located through this tree.
|
|
194
|
+
*
|
|
195
|
+
* `missing` and `outside` come from {@link lookup}, so a path the walk judged
|
|
196
|
+
* out of the root is never opened. The read is ALSO containment-checked
|
|
197
|
+
* against the file actually on disk, which `lookup` alone cannot guarantee:
|
|
198
|
+
* an inventory entry is a plain file (pcic-csf), so with a complete inventory
|
|
199
|
+
* no directory is listed and a real symlink sitting at that path is never
|
|
200
|
+
* seen — opening it by name would follow it wherever it points. The same
|
|
201
|
+
* check that governs every other read in the scan
|
|
202
|
+
* ({@link realPathWithinRoot}) runs here, so an in-repo link stays readable
|
|
203
|
+
* and one leaving the repository reads as `outside`.
|
|
204
|
+
*
|
|
205
|
+
* The two "cannot read" states are kept apart on purpose:
|
|
206
|
+
* - `unreadable` — the file is on disk and the scan failed to read it
|
|
207
|
+
* (permissions, a cycle, an unlistable parent). Recorded in
|
|
208
|
+
* {@link unreadable} so the scan can name it, and callers may raise a
|
|
209
|
+
* "check incomplete" warning.
|
|
210
|
+
* - `unfetched` — a caller's inventory says the repository has it but its
|
|
211
|
+
* bytes were never fetched. Nothing failed and there is nothing to name,
|
|
212
|
+
* so callers stay SILENT: no finding, and no warning either.
|
|
213
|
+
*
|
|
214
|
+
* Neither may be read as "absent": that is what keeps a hosted scan from
|
|
215
|
+
* reporting a file it never downloaded as missing.
|
|
216
|
+
*/
|
|
217
|
+
readText(candidate: string, options?: {
|
|
218
|
+
maxBytes?: number;
|
|
219
|
+
}): ReadResult;
|
|
81
220
|
/**
|
|
82
221
|
* An extension-less module path names the file that carries the extension:
|
|
83
222
|
* `src/lib/db` is `src/lib/db.ts`. True when the directory holds `<name>.*`.
|
|
@@ -87,14 +226,29 @@ export declare class RepoTree {
|
|
|
87
226
|
* pcic-x1vl: the entries of the in-root directory at `candidate`, by exact
|
|
88
227
|
* name, or why there are none to give (a file counts as `missing`).
|
|
89
228
|
*/
|
|
90
|
-
entries(candidate: string): ReadonlyMap<string,
|
|
229
|
+
entries(candidate: string): ReadonlyMap<string, TreeEntry> | 'missing' | 'outside' | 'unreadable';
|
|
91
230
|
/**
|
|
92
|
-
* fast-glob's directory reads, routed through
|
|
93
|
-
* walk cannot list is recorded instead of silently dropping out of the
|
|
94
|
-
*
|
|
231
|
+
* fast-glob's directory reads, routed through this tree so a directory the
|
|
232
|
+
* walk cannot list is recorded instead of silently dropping out of the
|
|
233
|
+
* result — and so a caller's inventory is what the walk sees (pcic-csf),
|
|
234
|
+
* which is the whole repository rather than the handful of files a hosted
|
|
235
|
+
* scan fetched. The walk itself (`cwd` = root, links not followed) never
|
|
236
|
+
* leaves the root.
|
|
95
237
|
*/
|
|
96
|
-
walkFs(onError: () => void):
|
|
238
|
+
walkFs(onError: () => void): WalkFsAdapter;
|
|
97
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* The scan's {@link RepoTree}: the one built while the context was assembled,
|
|
242
|
+
* so every detector shares its directory cache and its inventory (pcic-csf).
|
|
243
|
+
*
|
|
244
|
+
* Hand-built contexts (tests, older callers) carry no tree, and get a plain
|
|
245
|
+
* filesystem-backed one over the same root — the behavior before pcic-e6xa
|
|
246
|
+
* routed these checks through the tree, minus the out-of-root access.
|
|
247
|
+
*/
|
|
248
|
+
export declare function treeFor(context: {
|
|
249
|
+
repoRoot: string;
|
|
250
|
+
tree?: RepoTree;
|
|
251
|
+
}): RepoTree;
|
|
98
252
|
/** A reference left unchecked because part of the tree could not be read, aggregated per evidence line. */
|
|
99
253
|
export type UncheckedRef = {
|
|
100
254
|
filePaths: Set<string>;
|
package/dist/repo-tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-tree.d.ts","sourceRoot":"","sources":["../src/repo-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"repo-tree.d.ts","sourceRoot":"","sources":["../src/repo-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,2CAA2C;AAC3C,MAAM,MAAM,MAAM,GACd;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,C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AAI,GAAG,aAAa;CAe3C;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,GAAG,QAAQ,CAEhF;AAED,2GAA2G;AAC3G,MAAM,MAAM,YAAY,GAAG;IAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAKxG;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,YAAY,EAAE,EACpB,IAAI,EAAE;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;CACjB,GACA,aAAa,CAmCf"}
|
package/dist/repo-tree.js
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as fs from 'node:fs';
|
|
13
13
|
import * as path from 'node:path';
|
|
14
|
-
import { isWithinRoot, realPath } from './path-containment.js';
|
|
14
|
+
import { isWithinRoot, realPath, realPathWithinRoot } from './path-containment.js';
|
|
15
|
+
import { buildInventory } from './known-paths.js';
|
|
15
16
|
/**
|
|
16
17
|
* True for a path that is absolute on ANY platform: POSIX (`/x`), Windows drive
|
|
17
18
|
* or UNC (`C:\x`, `\\host\share`), or drive-relative (`C:x`, which Windows
|
|
@@ -23,6 +24,15 @@ import { isWithinRoot, realPath } from './path-containment.js';
|
|
|
23
24
|
export function isAbsoluteAnywhere(p) {
|
|
24
25
|
return path.posix.isAbsolute(p) || path.win32.isAbsolute(p) || /^[A-Za-z]:/.test(p);
|
|
25
26
|
}
|
|
27
|
+
/** A {@link TreeEntry} for an inventory entry: a plain file or directory, never a link. */
|
|
28
|
+
function inventoryEntry(name, kind) {
|
|
29
|
+
return {
|
|
30
|
+
name,
|
|
31
|
+
isFile: () => kind === 'file',
|
|
32
|
+
isDirectory: () => kind === 'dir',
|
|
33
|
+
isSymbolicLink: () => false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
26
36
|
/** The `code` of a filesystem error (`EACCES`, `ENOENT`, …), when it has one. */
|
|
27
37
|
export function errorCode(err) {
|
|
28
38
|
const code = err?.code;
|
|
@@ -56,17 +66,28 @@ export class RepoTree {
|
|
|
56
66
|
/** The root's real path, when it differs (a root under a symlink, like macOS `/var`). */
|
|
57
67
|
realRoot;
|
|
58
68
|
listings = new Map();
|
|
69
|
+
/**
|
|
70
|
+
* pcic-csf: the caller's inventory of the repository, when one was given.
|
|
71
|
+
* Consulted before the filesystem; see {@link PathInventory}.
|
|
72
|
+
*/
|
|
73
|
+
inventory;
|
|
59
74
|
/** What could not be read, as shown in the report (`dir/` or a link's path) → why. */
|
|
60
75
|
unreadable = new Map();
|
|
61
|
-
constructor(repoRoot) {
|
|
76
|
+
constructor(repoRoot, options = {}) {
|
|
62
77
|
this.root = path.resolve(repoRoot);
|
|
63
78
|
const real = realPath(this.root);
|
|
64
79
|
this.realRoot = real !== null && real !== this.root ? real : undefined;
|
|
80
|
+
this.inventory = buildInventory(options.knownPaths, options.knownPathsComplete);
|
|
65
81
|
}
|
|
66
82
|
/** Forward-slash path relative to the root (`.` for the root itself); never absolute. */
|
|
67
83
|
relative(abs) {
|
|
68
84
|
return path.relative(this.root, abs).split(path.sep).join('/') || '.';
|
|
69
85
|
}
|
|
86
|
+
/** {@link relative} in the inventory's own spelling: `''` for the root, never `.`. */
|
|
87
|
+
relativePosix(abs) {
|
|
88
|
+
const rel = this.relative(abs);
|
|
89
|
+
return rel === '.' ? '' : rel;
|
|
90
|
+
}
|
|
70
91
|
/** Record what could not be read: a directory (shown as `dir/`) or a link (shown as its path). */
|
|
71
92
|
noteUnreadable(p, reason, kind = 'dir') {
|
|
72
93
|
const abs = path.resolve(this.root, p);
|
|
@@ -78,25 +99,61 @@ export class RepoTree {
|
|
|
78
99
|
if (!this.unreadable.has(shown))
|
|
79
100
|
this.unreadable.set(shown, reason);
|
|
80
101
|
}
|
|
81
|
-
/** The entries of an in-root directory, by exact name. */
|
|
102
|
+
/** The entries of an in-root directory on the filesystem, by exact name. */
|
|
103
|
+
listFs(dir, note) {
|
|
104
|
+
try {
|
|
105
|
+
return new Map(fs.readdirSync(dir, { withFileTypes: true }).map((d) => [d.name, d]));
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
const code = errorCode(err);
|
|
109
|
+
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
110
|
+
return 'missing';
|
|
111
|
+
if (note)
|
|
112
|
+
this.noteUnreadable(dir, code ?? 'error');
|
|
113
|
+
return 'unreadable';
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The entries of an in-root directory, by exact name.
|
|
118
|
+
*
|
|
119
|
+
* pcic-csf: with an inventory, its listing is authoritative when it is
|
|
120
|
+
* complete; otherwise the two are merged, so a path the caller named is
|
|
121
|
+
* found even though the scan root holds only the instruction files. A
|
|
122
|
+
* directory the inventory describes is never reported as unreadable, since
|
|
123
|
+
* nothing had to be read to answer.
|
|
124
|
+
*
|
|
125
|
+
* On a name they both carry the inventory wins — EXCEPT when what is on disk
|
|
126
|
+
* is a symlink. An inventory entry is a plain file or directory, so letting
|
|
127
|
+
* one shadow a real link would hide it from {@link lookup}'s containment
|
|
128
|
+
* check and the subsequent read would follow it wherever it points. The link
|
|
129
|
+
* wins, and `lookup` judges it as it judges any other.
|
|
130
|
+
*/
|
|
82
131
|
list(dir) {
|
|
83
132
|
let listing = this.listings.get(dir);
|
|
84
|
-
if (listing
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
133
|
+
if (listing !== undefined)
|
|
134
|
+
return listing;
|
|
135
|
+
const inventoryChildren = this.inventory?.children(this.relativePosix(dir));
|
|
136
|
+
const fromInventory = inventoryChildren === undefined
|
|
137
|
+
? undefined
|
|
138
|
+
: new Map([...inventoryChildren].map(([name, kind]) => [name, inventoryEntry(name, kind)]));
|
|
139
|
+
if (this.inventory !== undefined && this.inventory.complete) {
|
|
140
|
+
listing = fromInventory ?? 'missing';
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
const onDisk = this.listFs(dir, fromInventory === undefined);
|
|
144
|
+
if (fromInventory === undefined)
|
|
145
|
+
listing = onDisk;
|
|
146
|
+
else if (typeof onDisk === 'string')
|
|
147
|
+
listing = fromInventory;
|
|
148
|
+
else {
|
|
149
|
+
const merged = new Map([...onDisk, ...fromInventory]);
|
|
150
|
+
for (const [name, entry] of onDisk)
|
|
151
|
+
if (entry.isSymbolicLink())
|
|
152
|
+
merged.set(name, entry);
|
|
153
|
+
listing = merged;
|
|
97
154
|
}
|
|
98
|
-
this.listings.set(dir, listing);
|
|
99
155
|
}
|
|
156
|
+
this.listings.set(dir, listing);
|
|
100
157
|
return listing;
|
|
101
158
|
}
|
|
102
159
|
/** In-root equivalent of a link target written against the root's real path. */
|
|
@@ -105,6 +162,49 @@ export class RepoTree {
|
|
|
105
162
|
return p;
|
|
106
163
|
return path.join(this.root, path.relative(this.realRoot, p));
|
|
107
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Where a link's target lands inside the root, or `null` when following it
|
|
167
|
+
* would leave the root.
|
|
168
|
+
*
|
|
169
|
+
* pcic-e6xa: a RELATIVE target is resolved segment by segment against the
|
|
170
|
+
* link's own directory and refused the moment it climbs above the root —
|
|
171
|
+
* even when a later segment names the root's own directory again
|
|
172
|
+
* (`x -> ../<root dir name>/y`). Resolving such a link lexically lands back
|
|
173
|
+
* inside the root, so the old containment check passed it and the verdict
|
|
174
|
+
* came to depend on the name of the directory the scan runs in: whoever
|
|
175
|
+
* wrote the scanned repository could learn it, and a hosted scan's temp
|
|
176
|
+
* directory name is not theirs to learn. An ABSOLUTE target cannot climb, so
|
|
177
|
+
* it keeps the plain containment check (plus the root's real path, for a root
|
|
178
|
+
* that itself sits under a link, like macOS `/var`) — a Windows junction's
|
|
179
|
+
* target, which is always absolute, resolves this way.
|
|
180
|
+
*
|
|
181
|
+
* A Windows drive or UNC target (`C:\x`, `\\host\share\x`) read on POSIX, and
|
|
182
|
+
* a drive-RELATIVE one (`C:x`) anywhere, are outside full stop: neither is
|
|
183
|
+
* absolute to `path` there, so `path.resolve` would join it to the process's
|
|
184
|
+
* working directory and the verdict would depend on where the scan was
|
|
185
|
+
* started from — which could be the root itself.
|
|
186
|
+
*/
|
|
187
|
+
linkTargetWithinRoot(linkDir, link) {
|
|
188
|
+
const windowsRooted = /^[A-Za-z]:/.test(link) || link.startsWith('\\\\');
|
|
189
|
+
if (windowsRooted && !path.isAbsolute(link))
|
|
190
|
+
return null;
|
|
191
|
+
if (path.isAbsolute(link)) {
|
|
192
|
+
const absolute = this.fromRealRoot(path.resolve(link));
|
|
193
|
+
return isWithinRoot(this.root, absolute) ? absolute : null;
|
|
194
|
+
}
|
|
195
|
+
const parts = path.relative(this.root, linkDir).split(path.sep).filter(Boolean);
|
|
196
|
+
if (parts.includes('..') || path.isAbsolute(parts.join(path.sep)))
|
|
197
|
+
return null;
|
|
198
|
+
for (const segment of link.split(/[\\/]/)) {
|
|
199
|
+
if (segment === '' || segment === '.')
|
|
200
|
+
continue;
|
|
201
|
+
if (segment !== '..')
|
|
202
|
+
parts.push(segment);
|
|
203
|
+
else if (parts.pop() === undefined)
|
|
204
|
+
return null; // climbed above the root
|
|
205
|
+
}
|
|
206
|
+
return path.join(this.root, ...parts);
|
|
207
|
+
}
|
|
108
208
|
lookup(candidate) {
|
|
109
209
|
let target = path.resolve(this.root, candidate);
|
|
110
210
|
let lastLink = '';
|
|
@@ -139,10 +239,13 @@ export class RepoTree {
|
|
|
139
239
|
return { state: 'unreadable' };
|
|
140
240
|
}
|
|
141
241
|
lastLink = entryPath;
|
|
142
|
-
// Resolved
|
|
143
|
-
// from the root: the containment
|
|
144
|
-
// under the target is touched.
|
|
145
|
-
|
|
242
|
+
// Resolved against the link's own directory and refused if it leaves
|
|
243
|
+
// the root (pcic-e6xa), then re-walked from the root: the containment
|
|
244
|
+
// check above runs again before anything under the target is touched.
|
|
245
|
+
const landing = this.linkTargetWithinRoot(dir, link);
|
|
246
|
+
if (landing === null)
|
|
247
|
+
return { state: 'outside' };
|
|
248
|
+
next = path.join(landing, ...parts.slice(i + 1));
|
|
146
249
|
break;
|
|
147
250
|
}
|
|
148
251
|
isDir = entry.isDirectory();
|
|
@@ -160,6 +263,83 @@ export class RepoTree {
|
|
|
160
263
|
const found = this.lookup(candidate);
|
|
161
264
|
return found.state === 'found' && found.isDir;
|
|
162
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* pcic-e6xa: the one way a detector asks whether a FIXED name exists
|
|
268
|
+
* (`.env`, `supabase/migrations`, `Cargo.toml`, `requirements.txt`,
|
|
269
|
+
* `.clinerules`). The name is not user input, but the tree around it is: a
|
|
270
|
+
* committed link out of the repository made the answer depend on a path
|
|
271
|
+
* outside the scan root, and a hosted scan's root is a server temp
|
|
272
|
+
* directory. Going through {@link lookup} keeps every such check inside the
|
|
273
|
+
* root — and lets a caller's inventory answer it (pcic-csf).
|
|
274
|
+
*
|
|
275
|
+
* `candidate` may be repo-relative or absolute inside the root. Anything
|
|
276
|
+
* outside, or under a directory that could not be listed, reads as absent:
|
|
277
|
+
* these checks are signals ("does this repo use Supabase?"), and the honest
|
|
278
|
+
* answer when the scan cannot look is the one that adds no finding.
|
|
279
|
+
*/
|
|
280
|
+
exists(candidate) {
|
|
281
|
+
return this.lookup(candidate).state === 'found';
|
|
282
|
+
}
|
|
283
|
+
/** {@link exists}, restricted to a regular file (or a link to one inside the root). */
|
|
284
|
+
isFile(candidate) {
|
|
285
|
+
const found = this.lookup(candidate);
|
|
286
|
+
return found.state === 'found' && !found.isDir;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The text of an in-root file, or why there is none to read. The only way a
|
|
290
|
+
* detector reads a file it located through this tree.
|
|
291
|
+
*
|
|
292
|
+
* `missing` and `outside` come from {@link lookup}, so a path the walk judged
|
|
293
|
+
* out of the root is never opened. The read is ALSO containment-checked
|
|
294
|
+
* against the file actually on disk, which `lookup` alone cannot guarantee:
|
|
295
|
+
* an inventory entry is a plain file (pcic-csf), so with a complete inventory
|
|
296
|
+
* no directory is listed and a real symlink sitting at that path is never
|
|
297
|
+
* seen — opening it by name would follow it wherever it points. The same
|
|
298
|
+
* check that governs every other read in the scan
|
|
299
|
+
* ({@link realPathWithinRoot}) runs here, so an in-repo link stays readable
|
|
300
|
+
* and one leaving the repository reads as `outside`.
|
|
301
|
+
*
|
|
302
|
+
* The two "cannot read" states are kept apart on purpose:
|
|
303
|
+
* - `unreadable` — the file is on disk and the scan failed to read it
|
|
304
|
+
* (permissions, a cycle, an unlistable parent). Recorded in
|
|
305
|
+
* {@link unreadable} so the scan can name it, and callers may raise a
|
|
306
|
+
* "check incomplete" warning.
|
|
307
|
+
* - `unfetched` — a caller's inventory says the repository has it but its
|
|
308
|
+
* bytes were never fetched. Nothing failed and there is nothing to name,
|
|
309
|
+
* so callers stay SILENT: no finding, and no warning either.
|
|
310
|
+
*
|
|
311
|
+
* Neither may be read as "absent": that is what keeps a hosted scan from
|
|
312
|
+
* reporting a file it never downloaded as missing.
|
|
313
|
+
*/
|
|
314
|
+
readText(candidate, options = {}) {
|
|
315
|
+
const found = this.lookup(candidate);
|
|
316
|
+
if (found.state !== 'found')
|
|
317
|
+
return { state: found.state };
|
|
318
|
+
if (found.isDir)
|
|
319
|
+
return { state: 'missing' };
|
|
320
|
+
// The path `lookup` settled on may still BE a link on disk (see above).
|
|
321
|
+
if (!realPathWithinRoot(this.root, found.path))
|
|
322
|
+
return { state: 'outside' };
|
|
323
|
+
try {
|
|
324
|
+
if (options.maxBytes !== undefined) {
|
|
325
|
+
const stat = fs.statSync(found.path);
|
|
326
|
+
if (!stat.isFile())
|
|
327
|
+
return { state: 'missing' };
|
|
328
|
+
if (stat.size > options.maxBytes)
|
|
329
|
+
return { state: 'too-large' };
|
|
330
|
+
}
|
|
331
|
+
return { state: 'found', content: fs.readFileSync(found.path, 'utf8') };
|
|
332
|
+
}
|
|
333
|
+
catch (err) {
|
|
334
|
+
const code = errorCode(err);
|
|
335
|
+
if (code === 'ENOENT' || code === 'ENOTDIR') {
|
|
336
|
+
// Listed by the inventory but not on disk: known to exist, never fetched.
|
|
337
|
+
return { state: this.inventory !== undefined ? 'unfetched' : 'missing' };
|
|
338
|
+
}
|
|
339
|
+
this.noteUnreadable(found.path, code ?? 'error', 'link');
|
|
340
|
+
return { state: 'unreadable' };
|
|
341
|
+
}
|
|
342
|
+
}
|
|
163
343
|
/**
|
|
164
344
|
* An extension-less module path names the file that carries the extension:
|
|
165
345
|
* `src/lib/db` is `src/lib/db.ts`. True when the directory holds `<name>.*`.
|
|
@@ -190,28 +370,40 @@ export class RepoTree {
|
|
|
190
370
|
return this.list(dir.path);
|
|
191
371
|
}
|
|
192
372
|
/**
|
|
193
|
-
* fast-glob's directory reads, routed through
|
|
194
|
-
* walk cannot list is recorded instead of silently dropping out of the
|
|
195
|
-
*
|
|
373
|
+
* fast-glob's directory reads, routed through this tree so a directory the
|
|
374
|
+
* walk cannot list is recorded instead of silently dropping out of the
|
|
375
|
+
* result — and so a caller's inventory is what the walk sees (pcic-csf),
|
|
376
|
+
* which is the whole repository rather than the handful of files a hosted
|
|
377
|
+
* scan fetched. The walk itself (`cwd` = root, links not followed) never
|
|
378
|
+
* leaves the root.
|
|
196
379
|
*/
|
|
197
380
|
walkFs(onError) {
|
|
198
381
|
const readdirSync = (dir, options) => {
|
|
199
|
-
|
|
200
|
-
|
|
382
|
+
const listing = this.list(dir);
|
|
383
|
+
if (listing === 'missing') {
|
|
384
|
+
throw Object.assign(new Error(`ENOENT: no such file or directory, scandir '${dir}'`), { code: 'ENOENT' });
|
|
201
385
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (code !== 'ENOENT') {
|
|
206
|
-
this.noteUnreadable(dir, code ?? 'error');
|
|
207
|
-
onError();
|
|
208
|
-
}
|
|
209
|
-
throw err;
|
|
386
|
+
if (listing === 'unreadable') {
|
|
387
|
+
onError();
|
|
388
|
+
throw Object.assign(new Error(`EACCES: permission denied, scandir '${dir}'`), { code: 'EACCES' });
|
|
210
389
|
}
|
|
390
|
+
const entries = [...listing.values()];
|
|
391
|
+
return options ? entries : entries.map((entry) => entry.name);
|
|
211
392
|
};
|
|
212
393
|
return { readdirSync: readdirSync };
|
|
213
394
|
}
|
|
214
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* The scan's {@link RepoTree}: the one built while the context was assembled,
|
|
398
|
+
* so every detector shares its directory cache and its inventory (pcic-csf).
|
|
399
|
+
*
|
|
400
|
+
* Hand-built contexts (tests, older callers) carry no tree, and get a plain
|
|
401
|
+
* filesystem-backed one over the same root — the behavior before pcic-e6xa
|
|
402
|
+
* routed these checks through the tree, minus the out-of-root access.
|
|
403
|
+
*/
|
|
404
|
+
export function treeFor(context) {
|
|
405
|
+
return context.tree ?? new RepoTree(context.repoRoot);
|
|
406
|
+
}
|
|
215
407
|
/** Evidence lines listed per kind before the rest is summarised. */
|
|
216
408
|
const MAX_INCOMPLETE_EVIDENCE = 10;
|
|
217
409
|
/**
|