vigilsutra 0.2.3 → 0.4.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/CHANGELOG.md +22 -0
- package/README.md +33 -27
- package/advisories/db.json.gz +0 -0
- package/agents/agents-registry.json +14 -2
- package/agents/agentshield/SKILL.md +12 -0
- package/agents/apishield/SKILL.md +12 -0
- package/agents/codeguard/SKILL.md +1 -1
- package/agents/compliancemap/SKILL.md +12 -0
- package/agents/datashield/SKILL.md +12 -0
- package/agents/identityguard/SKILL.md +12 -0
- package/agents/mobileshield/SKILL.md +12 -0
- package/agents/pipelineguard/SKILL.md +12 -0
- package/agents/remedy/SKILL.md +12 -0
- package/agents/riskrank/SKILL.md +12 -0
- package/agents/secretwatch/SKILL.md +1 -1
- package/agents/supplywatch/SKILL.md +12 -0
- package/agents/threatmap/SKILL.md +12 -0
- package/agents/webshield/SKILL.md +12 -0
- package/dist/adapters.js +35 -19
- package/dist/advisories.js +83 -0
- package/dist/cli.js +95 -17
- package/dist/components.js +116 -0
- package/dist/engine.js +99 -13
- package/dist/fix.js +85 -0
- package/dist/git-index.js +17 -6
- package/dist/git-objects.js +558 -0
- package/dist/policy.js +21 -2
- package/dist/redact.js +7 -1
- package/dist/rules/code.js +23 -6
- package/dist/rules/index.js +3 -2
- package/dist/rules/secrets.js +72 -0
- package/dist/rules/supply.js +103 -0
- package/dist/rules/util.js +29 -16
- package/dist/scope.js +3 -4
- package/dist/taint.js +83 -0
- package/docs/agent-contract.md +1 -1
- package/docs/assurance/benchmark.md +2 -0
- package/docs/assurance/coverage-raw.txt +151 -111
- package/docs/assurance/coverage.md +26 -18
- package/docs/assurance/fuzzing.md +1 -1
- package/docs/assurance/internal-review.md +3 -1
- package/docs/ci-cd.md +13 -4
- package/docs/compatibility.md +4 -4
- package/docs/index.html +75 -0
- package/docs/quickstart.md +3 -2
- package/docs/rules.md +92 -2
- package/docs/security-model.md +1 -1
- package/llms.txt +2 -2
- package/package.json +3 -2
- package/policies/safe-default.yaml +3 -0
- package/templates/pre-commit +7 -0
package/dist/rules/secrets.js
CHANGED
|
@@ -96,5 +96,77 @@ export const secretRules = [
|
|
|
96
96
|
});
|
|
97
97
|
return idx >= 0 ? [{ line: idx + 1, excerpt: "(file contents not shown)" }] : [];
|
|
98
98
|
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
...base,
|
|
102
|
+
id: "VS-SECRET-007",
|
|
103
|
+
title: "JSON Web Token in source",
|
|
104
|
+
severity: "medium",
|
|
105
|
+
confidence: "medium",
|
|
106
|
+
status: "potential",
|
|
107
|
+
description: "A string with the three-part JWT compact shape (header.payload.signature) is committed. The match proves the shape, not that the token is still accepted.",
|
|
108
|
+
falsePositives: "Documentation samples and tokens that were already revoked. Public, non-sensitive sample tokens still look the same.",
|
|
109
|
+
applies: () => true,
|
|
110
|
+
check: (f) => lineRule(f, /\b(eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,})\b/, { secretGroup: 1, filter: (m) => !/example|placeholder/i.test(m[1]) })
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
...base,
|
|
114
|
+
id: "VS-SECRET-008",
|
|
115
|
+
title: "npm access token in source",
|
|
116
|
+
severity: "high",
|
|
117
|
+
confidence: "high",
|
|
118
|
+
status: "confirmed",
|
|
119
|
+
description: "A string matching an npm access token (npm_ plus 36 or more token characters) is committed.",
|
|
120
|
+
falsePositives: "Revoked tokens and values that only share the npm_ prefix.",
|
|
121
|
+
applies: () => true,
|
|
122
|
+
check: (f) => lineRule(f, /\b(npm_[A-Za-z0-9]{36,})\b/, { secretGroup: 1 })
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
...base,
|
|
126
|
+
id: "VS-SECRET-009",
|
|
127
|
+
title: "Stripe secret key in source",
|
|
128
|
+
severity: "high",
|
|
129
|
+
confidence: "high",
|
|
130
|
+
status: "confirmed",
|
|
131
|
+
description: "A string matching a Stripe secret or restricted key (sk_live_, sk_test_, rk_live_, rk_test_) is committed.",
|
|
132
|
+
falsePositives: "Revoked keys. Publishable keys (pk_) are not matched.",
|
|
133
|
+
applies: () => true,
|
|
134
|
+
check: (f) => lineRule(f, /\b((?:sk|rk)_(?:live|test)_[0-9A-Za-z]{16,})\b/, { secretGroup: 1 })
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
...base,
|
|
138
|
+
id: "VS-SECRET-010",
|
|
139
|
+
title: "Google API key in source",
|
|
140
|
+
severity: "high",
|
|
141
|
+
confidence: "medium",
|
|
142
|
+
status: "potential",
|
|
143
|
+
description: "A string matching a Google API key (AIza plus 35 characters) is committed. The match proves the shape, not which API it can call.",
|
|
144
|
+
falsePositives: "Keys restricted to a public client and already-rotated keys. Restrict or rotate if the repository was shared.",
|
|
145
|
+
applies: () => true,
|
|
146
|
+
check: (f) => lineRule(f, /\b(AIza[0-9A-Za-z_-]{35})\b/, { secretGroup: 1 })
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
...base,
|
|
150
|
+
id: "VS-SECRET-011",
|
|
151
|
+
title: "Azure storage account key in source",
|
|
152
|
+
severity: "high",
|
|
153
|
+
confidence: "high",
|
|
154
|
+
status: "confirmed",
|
|
155
|
+
description: "An Azure Storage connection string contains an AccountKey value.",
|
|
156
|
+
falsePositives: "Documentation that shows the AccountKey name with a placeholder shorter than 40 characters.",
|
|
157
|
+
applies: () => true,
|
|
158
|
+
check: (f) => lineRule(f, /AccountKey=([A-Za-z0-9+/]{40,}={0,2})/, { secretGroup: 1 })
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
...base,
|
|
162
|
+
id: "VS-SECRET-012",
|
|
163
|
+
title: "GitLab personal access token in source",
|
|
164
|
+
severity: "high",
|
|
165
|
+
confidence: "high",
|
|
166
|
+
status: "confirmed",
|
|
167
|
+
description: "A string matching a GitLab personal access token (glpat-) is committed.",
|
|
168
|
+
falsePositives: "Revoked tokens.",
|
|
169
|
+
applies: () => true,
|
|
170
|
+
check: (f) => lineRule(f, /\b(glpat-[A-Za-z0-9_-]{20,})\b/, { secretGroup: 1 })
|
|
99
171
|
}
|
|
100
172
|
];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const b = {
|
|
2
|
+
version: "1.0.0",
|
|
3
|
+
category: "supply",
|
|
4
|
+
agent: "SupplyWatch",
|
|
5
|
+
cwe: ["CWE-829"],
|
|
6
|
+
verification: "Re-run `vigilsutra audit` after the manifest change.",
|
|
7
|
+
remediation: "Pin a trusted version from the official registry over HTTPS. Review install scripts before they run."
|
|
8
|
+
};
|
|
9
|
+
function hitAt(file, needle) {
|
|
10
|
+
const idx = file.lines.findIndex((l) => l.includes(needle));
|
|
11
|
+
return { line: idx >= 0 ? idx + 1 : 1, excerpt: idx >= 0 ? file.lines[idx] : needle };
|
|
12
|
+
}
|
|
13
|
+
export const supplyRules = [
|
|
14
|
+
{
|
|
15
|
+
...b,
|
|
16
|
+
id: "VS-SUPPLY-001",
|
|
17
|
+
title: "Dependency fetched over an unauthenticated URL",
|
|
18
|
+
severity: "high",
|
|
19
|
+
confidence: "high",
|
|
20
|
+
status: "confirmed",
|
|
21
|
+
description: "A package manifest downloads a dependency with http:// or git://. Those URLs can be changed in transit. No advisory database is consulted.",
|
|
22
|
+
falsePositives: "An internal registry that is only reachable over plain HTTP on a network you trust. Prefer HTTPS anyway.",
|
|
23
|
+
applies: (f) => f.name === "package.json" || f.name === "requirements.txt",
|
|
24
|
+
check: (f) => {
|
|
25
|
+
if (f.name === "requirements.txt") {
|
|
26
|
+
return f.lines.flatMap((line, i) => (/^\s*(?:-i|--index-url|--extra-index-url)\s+http:\/\//i.test(line) || /(?:git\+)?http:\/\/|git:\/\//i.test(line) ? [{ line: i + 1, excerpt: line }] : []));
|
|
27
|
+
}
|
|
28
|
+
return depHits(f, (ver) => /^(?:git\+)?http:\/\//i.test(ver) || /^git:\/\//i.test(ver));
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
...b,
|
|
33
|
+
id: "VS-SUPPLY-002",
|
|
34
|
+
title: "Dependency version is a wildcard",
|
|
35
|
+
severity: "medium",
|
|
36
|
+
confidence: "medium",
|
|
37
|
+
status: "potential",
|
|
38
|
+
description: "A package.json dependency is `*`, `latest`, or empty, so a later install can resolve to a different version. This is not a vulnerability match.",
|
|
39
|
+
falsePositives: "A private tool that regenerates the lockfile in the same change. The lockfile, when present, is what the install actually uses.",
|
|
40
|
+
applies: (f) => f.name === "package.json",
|
|
41
|
+
check: (f) => depHits(f, (ver) => ver === "*" || ver === "latest" || ver === "")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
...b,
|
|
45
|
+
id: "VS-SUPPLY-003",
|
|
46
|
+
title: "Install script downloads code",
|
|
47
|
+
severity: "medium",
|
|
48
|
+
confidence: "medium",
|
|
49
|
+
status: "potential",
|
|
50
|
+
cwe: ["CWE-829"],
|
|
51
|
+
description: "A package.json lifecycle script (preinstall, install, or postinstall) downloads or pipes remote content. The script runs on install. The remote body was not fetched.",
|
|
52
|
+
falsePositives: "A script that downloads a checksum-pinned artifact inside a build you already review.",
|
|
53
|
+
applies: (f) => f.name === "package.json",
|
|
54
|
+
check: (f) => {
|
|
55
|
+
let pkg;
|
|
56
|
+
try {
|
|
57
|
+
pkg = JSON.parse(f.text);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const hits = [];
|
|
63
|
+
for (const key of ["preinstall", "install", "postinstall"]) {
|
|
64
|
+
const script = pkg.scripts?.[key];
|
|
65
|
+
if (typeof script === "string" && /\b(curl|wget|Invoke-WebRequest)\b|https?:\/\//i.test(script))
|
|
66
|
+
hits.push(hitAt(f, script.slice(0, 40)));
|
|
67
|
+
}
|
|
68
|
+
return hits;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
...b,
|
|
73
|
+
id: "VS-SUPPLY-004",
|
|
74
|
+
title: "Dependency version matches a recorded advisory",
|
|
75
|
+
severity: "high",
|
|
76
|
+
confidence: "high",
|
|
77
|
+
status: "confirmed",
|
|
78
|
+
cwe: ["CWE-1395"],
|
|
79
|
+
description: "A resolved package version falls inside a range recorded in the advisory database shipped with VigilSutra. The database is a snapshot, not a live feed, and the scan does not call the network.",
|
|
80
|
+
remediation: "Upgrade to the fixed version named in the finding, then re-run the audit. If the database has no fix, remove the package or replace it.",
|
|
81
|
+
falsePositives: "An advisory withdrawn after this database was built, or a version the range comparison mis-orders because it is not numeric semver.",
|
|
82
|
+
verification: "The lockfile resolves to a version outside the recorded range. Re-run `vigilsutra audit`.",
|
|
83
|
+
applies: () => false,
|
|
84
|
+
check: () => []
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
function depHits(file, bad) {
|
|
88
|
+
let pkg;
|
|
89
|
+
try {
|
|
90
|
+
pkg = JSON.parse(file.text);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.optionalDependencies };
|
|
96
|
+
const hits = [];
|
|
97
|
+
for (const [name, ver] of Object.entries(deps)) {
|
|
98
|
+
if (typeof ver !== "string" || !bad(ver))
|
|
99
|
+
continue;
|
|
100
|
+
hits.push(hitAt(file, `"${name}"`));
|
|
101
|
+
}
|
|
102
|
+
return hits;
|
|
103
|
+
}
|
package/dist/rules/util.js
CHANGED
|
@@ -24,26 +24,39 @@ export function lineRule(file, re, opts = {}) {
|
|
|
24
24
|
const hits = [];
|
|
25
25
|
const g = new RegExp(re.source, re.flags.includes("g") ? re.flags : re.flags + "g");
|
|
26
26
|
file.lines.forEach((line, i) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
// Long lines are scanned in overlapping windows so a token past 2,000 characters is still seen.
|
|
28
|
+
// The excerpt is the window, not the whole line.
|
|
29
|
+
const parts = line.length > 2000 ? windows(line, 2000, 1900) : [{ text: line }];
|
|
30
|
+
for (const part of parts) {
|
|
31
|
+
if (opts.skipComments && isCommentLine(part.text))
|
|
32
|
+
continue;
|
|
33
|
+
g.lastIndex = 0;
|
|
34
|
+
const m = g.exec(part.text);
|
|
35
|
+
if (!m)
|
|
36
|
+
continue;
|
|
37
|
+
if (opts.filter && !opts.filter(m, part.text, i + 1))
|
|
38
|
+
continue;
|
|
39
|
+
const hit = { line: i + 1, excerpt: part.text };
|
|
40
|
+
if (opts.secretGroup !== undefined) {
|
|
41
|
+
const val = m[opts.secretGroup];
|
|
42
|
+
const start = part.text.indexOf(val, m.index);
|
|
43
|
+
hit.secretSpan = [start, start + val.length];
|
|
44
|
+
}
|
|
45
|
+
hits.push(hit);
|
|
46
|
+
break;
|
|
42
47
|
}
|
|
43
|
-
hits.push(hit);
|
|
44
48
|
});
|
|
45
49
|
return hits;
|
|
46
50
|
}
|
|
51
|
+
function windows(line, size, step) {
|
|
52
|
+
const out = [];
|
|
53
|
+
for (let i = 0; i < line.length; i += step) {
|
|
54
|
+
out.push({ text: line.slice(i, i + size) });
|
|
55
|
+
if (i + size >= line.length)
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
47
60
|
/** True when index `idx` of `line` is inside a single-, double- or backtick-quoted string. */
|
|
48
61
|
export function insideString(line, idx) {
|
|
49
62
|
let quote = "";
|
package/dist/scope.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lstatSync, readdirSync, realpathSync, openSync, readSync, closeSync, fstatSync } from "node:fs";
|
|
2
2
|
import { join, basename, extname, relative, isAbsolute } from "node:path";
|
|
3
3
|
import { makeIgnoreMatcher } from "./policy.js";
|
|
4
|
-
import { createGitCache, shouldSkipUntrackedDotenv } from "./git-index.js";
|
|
4
|
+
import { createGitCache, sameIdentity, shouldSkipUntrackedDotenv } from "./git-index.js";
|
|
5
5
|
/** True when `p` is `root` or lies beneath it (case-insensitive on Windows). */
|
|
6
6
|
export function isInside(root, p) {
|
|
7
7
|
const fix = (s) => (process.platform === "win32" ? s.toLowerCase() : s);
|
|
@@ -17,7 +17,7 @@ function readChecked(abs, expected) {
|
|
|
17
17
|
const fd = openSync(abs, "r");
|
|
18
18
|
try {
|
|
19
19
|
const now = fstatSync(fd);
|
|
20
|
-
if (!
|
|
20
|
+
if (!sameIdentity(expected, now))
|
|
21
21
|
return "swapped";
|
|
22
22
|
const buf = Buffer.alloc(now.size);
|
|
23
23
|
let off = 0;
|
|
@@ -41,7 +41,7 @@ function readChecked(abs, expected) {
|
|
|
41
41
|
* Read-only inventory. Symlinks are never followed (they are counted and skipped), so a
|
|
42
42
|
* repository can not redirect the scan outside its root. Nothing is executed.
|
|
43
43
|
*/
|
|
44
|
-
export function inventory(rootInput, policy) {
|
|
44
|
+
export function inventory(rootInput, policy, deadline = Date.now() + policy.timeLimitMs) {
|
|
45
45
|
const root = realpathSync(rootInput);
|
|
46
46
|
const ignored = makeIgnoreMatcher(policy.ignore);
|
|
47
47
|
const stats = {
|
|
@@ -58,7 +58,6 @@ export function inventory(rootInput, policy) {
|
|
|
58
58
|
const files = [];
|
|
59
59
|
const allPaths = new Set();
|
|
60
60
|
const gitCache = createGitCache();
|
|
61
|
-
const deadline = Date.now() + policy.timeLimitMs;
|
|
62
61
|
const walk = (dirAbs, dirRel) => {
|
|
63
62
|
if (stats.truncated)
|
|
64
63
|
return;
|
package/dist/taint.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { isJs, isPy } from "./rules/util.js";
|
|
3
|
+
const SOURCE = /\b(req|request|params|query|body|input|event)\b/;
|
|
4
|
+
/**
|
|
5
|
+
* Tracks identifier names from a request-like assignment across relative imports.
|
|
6
|
+
* Does not follow object fields, dynamic import(), or function calls.
|
|
7
|
+
*/
|
|
8
|
+
export function propagateTaint(files) {
|
|
9
|
+
const byPath = new Map(files.filter((f) => !f.path.startsWith("git-history/")).map((f) => [f.path, f]));
|
|
10
|
+
const tainted = new Map();
|
|
11
|
+
for (const f of byPath.values()) {
|
|
12
|
+
const set = new Set();
|
|
13
|
+
if (isJs(f) || isPy(f)) {
|
|
14
|
+
for (const line of f.lines) {
|
|
15
|
+
const assigned = /(?:^|[^\w$])([A-Za-z_$][\w$]*)\s*=\s*([^=].*)$/.exec(line);
|
|
16
|
+
if (assigned && SOURCE.test(assigned[2]))
|
|
17
|
+
set.add(assigned[1]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
tainted.set(f.path, set);
|
|
21
|
+
}
|
|
22
|
+
let changed = true;
|
|
23
|
+
for (let guard = 0; changed && guard < byPath.size + 1; guard++) {
|
|
24
|
+
changed = false;
|
|
25
|
+
for (const f of byPath.values()) {
|
|
26
|
+
const mine = tainted.get(f.path);
|
|
27
|
+
if (!mine)
|
|
28
|
+
continue;
|
|
29
|
+
for (const line of f.lines) {
|
|
30
|
+
for (const binding of importBindings(line)) {
|
|
31
|
+
const target = resolveImport(f.path, binding.from, byPath);
|
|
32
|
+
const theirs = target ? tainted.get(target) : undefined;
|
|
33
|
+
if (!theirs || !theirs.has(binding.remote) || mine.has(binding.local))
|
|
34
|
+
continue;
|
|
35
|
+
mine.add(binding.local);
|
|
36
|
+
changed = true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const [path, set] of tainted) {
|
|
42
|
+
const file = byPath.get(path);
|
|
43
|
+
if (file && set.size)
|
|
44
|
+
file.tainted = set;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function importBindings(line) {
|
|
48
|
+
const js = /\bimport\s*\{([^}]+)\}\s*from\s*["'](\.[^"']+)["']/.exec(line) ?? /\b(?:const|let|var)\s*\{([^}]+)\}\s*=\s*require\(\s*["'](\.[^"']+)["']\s*\)/.exec(line);
|
|
49
|
+
if (js) {
|
|
50
|
+
return js[1].split(",").flatMap((part) => {
|
|
51
|
+
const m = /^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/.exec(part);
|
|
52
|
+
if (!m)
|
|
53
|
+
return [];
|
|
54
|
+
return [{ from: js[2], remote: m[1], local: m[2] ?? m[1] }];
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const py = /^\s*from\s+(\.+[\w.]*)\s+import\s+([A-Za-z_][\w,\s]*)/.exec(line);
|
|
58
|
+
if (!py)
|
|
59
|
+
return [];
|
|
60
|
+
const spec = pythonSpec(py[1]);
|
|
61
|
+
if (!spec)
|
|
62
|
+
return [];
|
|
63
|
+
return py[2].split(",").flatMap((part) => {
|
|
64
|
+
const m = /^\s*([A-Za-z_]\w*)(?:\s+as\s+([A-Za-z_]\w*))?\s*$/.exec(part);
|
|
65
|
+
if (!m)
|
|
66
|
+
return [];
|
|
67
|
+
return [{ from: spec, remote: m[1], local: m[2] ?? m[1] }];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function pythonSpec(raw) {
|
|
71
|
+
const m = /^(\.+)(.*)$/.exec(raw);
|
|
72
|
+
if (!m?.[2])
|
|
73
|
+
return "";
|
|
74
|
+
const ups = m[1].length - 1;
|
|
75
|
+
const rest = m[2].replace(/\./g, "/");
|
|
76
|
+
const prefix = ups === 0 ? "." : Array.from({ length: ups }, () => "..").join("/");
|
|
77
|
+
return `${prefix}/${rest}`;
|
|
78
|
+
}
|
|
79
|
+
function resolveImport(fromFile, spec, files) {
|
|
80
|
+
const base = join(dirname(fromFile), spec).replace(/\\/g, "/").replace(/^\.\//, "");
|
|
81
|
+
const candidates = [base, `${base}.js`, `${base}.mjs`, `${base}.cjs`, `${base}.ts`, `${base}.tsx`, `${base}.py`, `${base}/index.js`, `${base}/index.ts`];
|
|
82
|
+
return candidates.find((c) => files.has(c)) ?? null;
|
|
83
|
+
}
|
package/docs/agent-contract.md
CHANGED
|
@@ -10,4 +10,4 @@ Skills in `agents/*/SKILL.md` use YAML frontmatter (`name`, `description`) follo
|
|
|
10
10
|
6. Propose fixes as diffs or steps; never commit, push or rotate without approval.
|
|
11
11
|
7. Use the CLI JSON as the deterministic baseline and add only context-based review on top.
|
|
12
12
|
|
|
13
|
-
`agents/agents-registry.json` lists
|
|
13
|
+
`agents/agents-registry.json` lists every shipped skill. A skill that describes a gap (mobile apps, compliance, advisories) must say "not assessed". Do not add a role name without a `SKILL.md`.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
## What was measured
|
|
6
6
|
|
|
7
|
+
> The numbers below are the v0.1.0 study. They were not re-measured for 0.3.0 or 0.4.0. Recall was not measured. Labels were not an independent human review.
|
|
8
|
+
|
|
7
9
|
VigilSutra was run on **18 public repositories** (shallow clones at the commits below, read-only, nothing executed): 7 deliberately vulnerable projects and 11 mainstream projects. The first run used the released rules (v0.1.0). 240 findings were labeled in three samples, the false positives were studied, the rules were fixed, and the same commits were scanned again to check that real findings were kept.
|
|
8
10
|
|
|
9
11
|
### Labeling rubric
|