@xenos1996/usa 2.27.0 → 2.28.1

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 (83) hide show
  1. package/README.md +3 -3
  2. package/dist/cli-help.d.ts.map +1 -1
  3. package/dist/cli-help.js +13 -0
  4. package/dist/cli-help.js.map +1 -1
  5. package/dist/cli-intent.d.ts +4 -0
  6. package/dist/cli-intent.d.ts.map +1 -0
  7. package/dist/cli-intent.js +108 -0
  8. package/dist/cli-intent.js.map +1 -0
  9. package/dist/cli-scan.d.ts +12 -0
  10. package/dist/cli-scan.d.ts.map +1 -0
  11. package/dist/cli-scan.js +142 -0
  12. package/dist/cli-scan.js.map +1 -0
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +4 -0
  15. package/dist/cli.js.map +1 -1
  16. package/dist/engine/evaluate.d.ts.map +1 -1
  17. package/dist/engine/evaluate.js +31 -8
  18. package/dist/engine/evaluate.js.map +1 -1
  19. package/dist/intent/match.d.ts +38 -0
  20. package/dist/intent/match.d.ts.map +1 -0
  21. package/dist/intent/match.js +108 -0
  22. package/dist/intent/match.js.map +1 -0
  23. package/dist/intent/otm.d.ts +16 -0
  24. package/dist/intent/otm.d.ts.map +1 -0
  25. package/dist/intent/otm.js +144 -0
  26. package/dist/intent/otm.js.map +1 -0
  27. package/dist/intent/types.d.ts +111 -0
  28. package/dist/intent/types.d.ts.map +1 -0
  29. package/dist/intent/types.js +16 -0
  30. package/dist/intent/types.js.map +1 -0
  31. package/dist/scanner/adapters/codeql.d.ts +14 -0
  32. package/dist/scanner/adapters/codeql.d.ts.map +1 -0
  33. package/dist/scanner/adapters/codeql.js +134 -0
  34. package/dist/scanner/adapters/codeql.js.map +1 -0
  35. package/dist/scanner/adapters/dependency-cruiser.d.ts +3 -0
  36. package/dist/scanner/adapters/dependency-cruiser.d.ts.map +1 -0
  37. package/dist/scanner/adapters/dependency-cruiser.js +195 -0
  38. package/dist/scanner/adapters/dependency-cruiser.js.map +1 -0
  39. package/dist/scanner/adapters/ort.d.ts +12 -0
  40. package/dist/scanner/adapters/ort.d.ts.map +1 -0
  41. package/dist/scanner/adapters/ort.js +259 -0
  42. package/dist/scanner/adapters/ort.js.map +1 -0
  43. package/dist/scanner/adapters/scorecard.d.ts +7 -0
  44. package/dist/scanner/adapters/scorecard.d.ts.map +1 -0
  45. package/dist/scanner/adapters/scorecard.js +209 -0
  46. package/dist/scanner/adapters/scorecard.js.map +1 -0
  47. package/dist/scanner/adapters/semgrep.d.ts +3 -0
  48. package/dist/scanner/adapters/semgrep.d.ts.map +1 -0
  49. package/dist/scanner/adapters/semgrep.js +163 -0
  50. package/dist/scanner/adapters/semgrep.js.map +1 -0
  51. package/dist/scanner/adapters/trivy.d.ts +3 -0
  52. package/dist/scanner/adapters/trivy.d.ts.map +1 -0
  53. package/dist/scanner/adapters/trivy.js +163 -0
  54. package/dist/scanner/adapters/trivy.js.map +1 -0
  55. package/dist/scanner/config.d.ts +4 -0
  56. package/dist/scanner/config.d.ts.map +1 -0
  57. package/dist/scanner/config.js +15 -0
  58. package/dist/scanner/config.js.map +1 -0
  59. package/dist/scanner/identity.d.ts +17 -0
  60. package/dist/scanner/identity.d.ts.map +1 -0
  61. package/dist/scanner/identity.js +50 -0
  62. package/dist/scanner/identity.js.map +1 -0
  63. package/dist/scanner/normalize.d.ts +40 -0
  64. package/dist/scanner/normalize.d.ts.map +1 -0
  65. package/dist/scanner/normalize.js +85 -0
  66. package/dist/scanner/normalize.js.map +1 -0
  67. package/dist/scanner/registry.d.ts +19 -0
  68. package/dist/scanner/registry.d.ts.map +1 -0
  69. package/dist/scanner/registry.js +43 -0
  70. package/dist/scanner/registry.js.map +1 -0
  71. package/dist/scanner/run.d.ts +71 -0
  72. package/dist/scanner/run.d.ts.map +1 -0
  73. package/dist/scanner/run.js +461 -0
  74. package/dist/scanner/run.js.map +1 -0
  75. package/dist/scanner/sarif.d.ts +21 -0
  76. package/dist/scanner/sarif.d.ts.map +1 -0
  77. package/dist/scanner/sarif.js +156 -0
  78. package/dist/scanner/sarif.js.map +1 -0
  79. package/dist/scanner/types.d.ts +242 -0
  80. package/dist/scanner/types.d.ts.map +1 -0
  81. package/dist/scanner/types.js +11 -0
  82. package/dist/scanner/types.js.map +1 -0
  83. package/package.json +2 -1
@@ -0,0 +1,195 @@
1
+ /**
2
+ * dependency-cruiser — Tier 1.
3
+ *
4
+ * The critical fact driving this adapter: `-T json` **exits 0 regardless of
5
+ * violations** (the CLI docs are explicit; only the err-family reporters exit
6
+ * with the count of error-severity violations). Reading the exit code here
7
+ * would make every architecture violation invisible. The verdict is parsed
8
+ * from the JSON, never from the process status.
9
+ */
10
+ import { spawnSync } from 'node:child_process';
11
+ import { statSync } from 'node:fs';
12
+ import path from 'node:path';
13
+ import { buildEvidence } from '../identity.js';
14
+ import { DETERMINISTIC_CONFIDENCE, dig, tryParseJson } from '../normalize.js';
15
+ export const dependencyCruiserAdapter = {
16
+ id: 'dependency-cruiser',
17
+ name: 'Dependency graph and architecture rules (JS/TS)',
18
+ defaultConfig() {
19
+ return { args: ['src'], rules: '' };
20
+ },
21
+ /**
22
+ * `--config` is passed only when the project supplies a rules file. The
23
+ * alternative — always `--no-config` — would make this adapter a graph
24
+ * printer: a cruise with no rules produces zero violations, and "0
25
+ * violations" is exactly the unfalsifiable result this subsystem refuses to
26
+ * emit. Verified against depcruise 18.7.0: the JSON has no `rules` key, so
27
+ * whether rules ran is a *configuration* fact, not something to detect from
28
+ * the output.
29
+ */
30
+ probe(target) {
31
+ // A scanner installed as the project's own devDependency is not on PATH, and
32
+ // it is the *better* binary: it has the project's node_modules and can
33
+ // resolve the project's TypeScript. Measured on this repository — a globally
34
+ // installed depcruise cruised **0 modules**, the devDependency cruised 108.
35
+ // So the local bin directory is searched first, not last.
36
+ const local = target ? localBin(target.path) : null;
37
+ for (const binary of ['depcruise', 'dependency-cruiser']) {
38
+ const executable = local?.[binary] ?? which(binary);
39
+ if (executable) {
40
+ return { available: true, version: versionOf(executable), executable };
41
+ }
42
+ }
43
+ return {
44
+ available: false,
45
+ version: '',
46
+ reason: 'depcruise executable not found on PATH or in the project node_modules/.bin (not installed in this environment)',
47
+ };
48
+ },
49
+ buildCommand(target, config) {
50
+ const args = config.args ?? ['src'];
51
+ // The rules file has to reach argv, not only the parser. A parser told that
52
+ // rules exist stops guarding an empty violation list (see `parse`), so a
53
+ // cruise that never loaded the rules would report `ok` with no rows — a
54
+ // silent pass on the one thing this adapter exists to detect.
55
+ const rules = String(config.rules ?? '');
56
+ return {
57
+ argv: [
58
+ 'depcruise',
59
+ '--output-type',
60
+ 'json',
61
+ ...(rules ? ['--config', rules] : ['--no-config']),
62
+ ...args,
63
+ ],
64
+ timeoutMs: 120_000,
65
+ };
66
+ },
67
+ parse(raw, context) {
68
+ const parsed = tryParseJson(raw);
69
+ if (!parsed.ok) {
70
+ return [unknown(context, `dependency-cruiser output was not valid JSON: ${parsed.error}`)];
71
+ }
72
+ const modules = dig(parsed.value, ['modules']);
73
+ if (!Array.isArray(modules)) {
74
+ return [
75
+ unknown(context, 'dependency-cruiser report carried no modules array (nothing scanned?)'),
76
+ ];
77
+ }
78
+ const violations = dig(parsed.value, ['summary', 'violations']);
79
+ const list = Array.isArray(violations) ? violations : [];
80
+ // No rules configured means the cruise produced a graph, not a verdict —
81
+ // and "0 violations" would be indistinguishable from "no problems".
82
+ if (list.length === 0 && !String(context.config.rules ?? '')) {
83
+ return [
84
+ unknown(context, 'dependency-cruiser ran without a rules config — a graph, not a verdict'),
85
+ ];
86
+ }
87
+ return list.map((violation, index) => violationToEvidence(violation, index, context.adapterVersion));
88
+ },
89
+ };
90
+ /** One edge violation → one evidence row naming both endpoints. */
91
+ /**
92
+ * depcruise 18.7.0 emits `from`/`to` as plain strings ("a.js"); some versions
93
+ * and the `--output-type err` family use objects. Accept both rather than
94
+ * guessing, which is how the first version of this adapter produced `? → ?`.
95
+ */
96
+ function endpoint(value) {
97
+ if (typeof value === 'string')
98
+ return value;
99
+ return String(dig(value, ['path']) ?? 'unknown');
100
+ }
101
+ function violationToEvidence(violation, index, adapterVersion) {
102
+ const from = endpoint(dig(violation, ['from']));
103
+ const to = endpoint(dig(violation, ['to']));
104
+ const ruleName = String(dig(violation, ['rule', 'name']) ?? dig(violation, ['rule', 'id']) ?? 'unnamed-rule');
105
+ const severityWord = String(dig(violation, ['rule', 'severity']) ?? 'warn');
106
+ return buildEvidence({
107
+ source: {
108
+ tool: 'dependency-cruiser',
109
+ kind: 'dependency-edge',
110
+ version: adapterVersion,
111
+ identifier: ruleName,
112
+ },
113
+ provenance: placeholder(),
114
+ claim: `${from} → ${to} breaks rule ${ruleName} (${severityWord})`,
115
+ severity: mapSeverity(severityWord),
116
+ confidence: DETERMINISTIC_CONFIDENCE,
117
+ status: 'FAIL',
118
+ location: { file: from },
119
+ rawReference: { jsonPath: `summary.violations[${index}]` },
120
+ });
121
+ }
122
+ function mapSeverity(word) {
123
+ if (word === 'error')
124
+ return 'HIGH';
125
+ if (word === 'info')
126
+ return 'INFO';
127
+ return 'MEDIUM';
128
+ }
129
+ function unknown(context, reason) {
130
+ return {
131
+ id: `UNKNOWN-dependency-cruiser-${reason}`.replace(/[^A-Za-z0-9-]/g, '-').slice(0, 48),
132
+ source: {
133
+ tool: 'dependency-cruiser',
134
+ version: context.adapterVersion,
135
+ kind: 'check',
136
+ identifier: 'UNKNOWN',
137
+ },
138
+ provenance: placeholder(),
139
+ claim: reason,
140
+ severity: 'INFO',
141
+ severitySource: 'adapter-default',
142
+ confidence: DETERMINISTIC_CONFIDENCE,
143
+ status: 'UNKNOWN',
144
+ location: null,
145
+ rawReference: {},
146
+ };
147
+ }
148
+ function placeholder() {
149
+ return {
150
+ executionId: '',
151
+ command: [],
152
+ config: {},
153
+ repositoryRevision: '',
154
+ timestamp: '',
155
+ executable: '',
156
+ timeoutMs: 0,
157
+ elapsedMs: 0,
158
+ };
159
+ }
160
+ /** Executables in the project's own `node_modules/.bin`, keyed by binary name. */
161
+ function localBin(root) {
162
+ const dir = path.join(root, 'node_modules', '.bin');
163
+ const found = {};
164
+ for (const binary of ['depcruise', 'dependency-cruiser']) {
165
+ try {
166
+ if (statSync(path.join(dir, binary)).isFile())
167
+ found[binary] = path.join(dir, binary);
168
+ }
169
+ catch {
170
+ /* not installed locally — fall through to PATH */
171
+ }
172
+ }
173
+ return found;
174
+ }
175
+ function which(binary) {
176
+ for (const dir of (process.env.PATH ?? '').split(path.delimiter)) {
177
+ if (!dir)
178
+ continue;
179
+ const candidate = path.join(dir, binary);
180
+ try {
181
+ if (statSync(candidate).isFile())
182
+ return candidate;
183
+ }
184
+ catch {
185
+ /* keep looking */
186
+ }
187
+ }
188
+ return null;
189
+ }
190
+ function versionOf(executable) {
191
+ const proc = spawnSync(executable, ['--version'], { encoding: 'utf8', timeout: 15_000 });
192
+ const match = /([\w.]+)/.exec(String(proc.stdout ?? proc.stderr ?? ''));
193
+ return match?.[1] ?? 'unknown';
194
+ }
195
+ //# sourceMappingURL=dependency-cruiser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-cruiser.js","sourceRoot":"","sources":["../../../src/scanner/adapters/dependency-cruiser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACtD,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,iDAAiD;IAEvD,aAAa;QACX,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACtC,CAAC;IAED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CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACxF,CAAC;QAAC,MAAM,CAAC;YACP,kDAAkD;QACpD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,KAAK,CAAC,MAAc;IAC3B,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACjE,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE;gBAAE,OAAO,SAAS,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,SAAS,CAAC,UAAkB;IACnC,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;AACjC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ScannerAdapter } from '../types.js';
2
+ /** The artifact `analyze` writes and `evaluate` reads. */
3
+ export declare const ORT_ANALYZER_RESULT = "analyzer-result.yml";
4
+ /** The artifact `evaluate -f JSON` writes — the one this adapter parses. */
5
+ export declare const ORT_EVALUATION_RESULT = "evaluation-result.json";
6
+ /**
7
+ * The ruleset ORT bundles. Reachable only with the leading slash (measured);
8
+ * `scanners.ort.rulesFile` replaces it with a project's own `.kts` script.
9
+ */
10
+ export declare const ORT_DEFAULT_RULES = "/rules/osadl.rules.kts";
11
+ export declare const ortAdapter: ScannerAdapter;
12
+ //# sourceMappingURL=ort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ort.d.ts","sourceRoot":"","sources":["../../../src/scanner/adapters/ort.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,aAAa,CAAC;AAI1E,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D,eAAO,MAAM,UAAU,EAAE,cAkFxB,CAAC"}
@@ -0,0 +1,259 @@
1
+ /**
2
+ * OSS Review Toolkit (ORT) — Tier 2.
3
+ *
4
+ * ORT is a staged pipeline: `analyze` → `scan` → `advise` → `evaluate` → `report`.
5
+ * The stage whose output is *evidence* is `evaluate`: policy rules applied to a
6
+ * resolved dependency graph, producing rule violations with a package, a
7
+ * version and a rule name.
8
+ *
9
+ * CLI and payload verified against ORT 97.0.0 (run from the project's container
10
+ * image, `ghcr.io/oss-review-toolkit/ort`):
11
+ *
12
+ * ort analyze --input-dir <dir> --output-dir <dir> # → analyzer-result.yml
13
+ * ort evaluate -i <analyzer-result.yml> -o <dir> -f JSON # → evaluation-result.json
14
+ *
15
+ * Four things measured here that the documentation does not say:
16
+ *
17
+ * 1. `evaluate` does not take `--input-dir`; the input is `-i/--ort-file` and
18
+ * it takes the result *file*.
19
+ * 2. `evaluate` refuses to run without a rules *script* ("No rules specified.").
20
+ * The ruleset ORT ships is a classpath resource, and `--rules-resource` needs
21
+ * a **leading slash** (`/rules/osadl.rules.kts`): the un-prefixed form
22
+ * resolves against the command's own jar and dies with a NullPointerException.
23
+ * 3. The violations are written to a **file**, not stdout — stdout carries
24
+ * progress logs. An adapter that parses stdout parses the wrong stream.
25
+ * 4. `evaluate` **exits 2** when it finds violations. That is a successful run
26
+ * that objects, so exit status is recorded and never interpreted.
27
+ *
28
+ * The payload is `{ evaluator: { violations: [ { rule, pkg, license,
29
+ * license_sources, severity, message, how_to_fix } ] } }` where `pkg` is a
30
+ * coordinate string (`NPM::lodash:4.17.21`) or `null` for a violation that is
31
+ * not attached to a package.
32
+ */
33
+ import { spawnSync } from 'node:child_process';
34
+ import { statSync } from 'node:fs';
35
+ import path from 'node:path';
36
+ import { parse as parseYaml } from 'yaml';
37
+ import { buildEvidence } from '../identity.js';
38
+ import { DETERMINISTIC_CONFIDENCE, dig, tryParseJson } from '../normalize.js';
39
+ /** The artifact `analyze` writes and `evaluate` reads. */
40
+ export const ORT_ANALYZER_RESULT = 'analyzer-result.yml';
41
+ /** The artifact `evaluate -f JSON` writes — the one this adapter parses. */
42
+ export const ORT_EVALUATION_RESULT = 'evaluation-result.json';
43
+ /**
44
+ * The ruleset ORT bundles. Reachable only with the leading slash (measured);
45
+ * `scanners.ort.rulesFile` replaces it with a project's own `.kts` script.
46
+ */
47
+ export const ORT_DEFAULT_RULES = '/rules/osadl.rules.kts';
48
+ export const ortAdapter = {
49
+ id: 'ort',
50
+ name: 'OSS Review Toolkit dependency policy evaluator',
51
+ // Only `analyze` reaches the network: it resolves the dependency graph from
52
+ // the package registry. `evaluate` reads a file.
53
+ needsNetwork: true,
54
+ networkConfigKey: 'scanners.ort.ortFile',
55
+ defaultConfig() {
56
+ return {
57
+ outputDir: '.ort-results',
58
+ ortFile: '',
59
+ rulesFile: '',
60
+ rulesResource: ORT_DEFAULT_RULES,
61
+ };
62
+ },
63
+ probe() {
64
+ const executable = which('ort');
65
+ if (!executable) {
66
+ return {
67
+ available: false,
68
+ version: '',
69
+ reason: 'ort executable not found on PATH (JVM package from oss-review-toolkit/ort; ' +
70
+ 'the container image ghcr.io/oss-review-toolkit/ort is the verified runner)',
71
+ };
72
+ }
73
+ return { available: true, version: versionOf(executable), executable };
74
+ },
75
+ buildCommand(target, config) {
76
+ const outputDir = String(config.outputDir ?? '.ort-results');
77
+ // A pre-computed result file turns this into a single offline stage.
78
+ const ortFile = String(config.ortFile ?? '');
79
+ const rulesFile = String(config.rulesFile ?? '');
80
+ const rulesResource = String(config.rulesResource ?? ORT_DEFAULT_RULES);
81
+ const input = ortFile || path.posix.join(outputDir, ORT_ANALYZER_RESULT);
82
+ const rules = rulesFile ? ['-r', rulesFile] : [`--rules-resource=${rulesResource}`];
83
+ return {
84
+ argv: ['ort', 'evaluate', '-i', input, '-o', outputDir, '-f', 'JSON', ...rules],
85
+ prepare: ortFile
86
+ ? []
87
+ : [
88
+ {
89
+ argv: ['ort', 'analyze', '--input-dir', target.workdir, '--output-dir', outputDir],
90
+ timeoutMs: 900_000,
91
+ },
92
+ ],
93
+ artifacts: [path.posix.join(outputDir, ORT_EVALUATION_RESULT)],
94
+ network: !ortFile,
95
+ timeoutMs: 600_000,
96
+ };
97
+ },
98
+ parse(raw, context) {
99
+ // ORT writes YAML by default; `-f JSON` (what the adapter asks for) writes
100
+ // JSON. Accept both so a hand-converted artifact still parses.
101
+ let doc;
102
+ if (raw.trimStart().startsWith('{')) {
103
+ const parsed = tryParseJson(raw);
104
+ if (!parsed.ok)
105
+ return [unknown(context, `ORT output was not valid JSON: ${parsed.error}`)];
106
+ doc = parsed.value;
107
+ }
108
+ else {
109
+ try {
110
+ doc = parseYaml(raw);
111
+ }
112
+ catch (err) {
113
+ return [unknown(context, `ORT output was not valid YAML: ${err.message}`)];
114
+ }
115
+ }
116
+ // ORT 97 nests the result under `evaluator`; older layouts put it at the
117
+ // top. Accept both, and say so when neither is present rather than
118
+ // reporting a clean scan.
119
+ const violations = dig(doc, ['evaluator', 'violations']) ?? dig(doc, ['violations']);
120
+ if (!Array.isArray(violations)) {
121
+ return [unknown(context, 'ORT evaluation carried no violations array (nothing evaluated?)')];
122
+ }
123
+ if (violations.length === 0)
124
+ return [cleanRun(doc, context)];
125
+ return violations.map((violation, index) => violationToEvidence(violation, index, context.adapterVersion));
126
+ },
127
+ };
128
+ /**
129
+ * A clean evaluation is a fact, and its absence is not.
130
+ *
131
+ * With no row, "the policy was applied and nothing violated it" and "the policy
132
+ * never ran" look identical to a rule consuming this evidence.
133
+ */
134
+ function cleanRun(doc, context) {
135
+ const packages = dig(doc, ['analyzer', 'result', 'packages']);
136
+ const count = Array.isArray(packages) ? packages.length : null;
137
+ const ruleset = String(context.config.rulesFile || context.config.rulesResource || ORT_DEFAULT_RULES);
138
+ return buildEvidence({
139
+ source: {
140
+ tool: 'ort',
141
+ kind: 'policy-evaluation',
142
+ version: context.adapterVersion,
143
+ identifier: 'evaluation',
144
+ },
145
+ provenance: placeholder(),
146
+ claim: `ORT evaluated ${count === null ? 'an unrecorded number of' : count} package(s) ` +
147
+ `under ${ruleset}: no rule violations`,
148
+ severity: 'INFO',
149
+ severitySource: 'adapter-default',
150
+ confidence: DETERMINISTIC_CONFIDENCE,
151
+ status: 'PASS',
152
+ location: null,
153
+ rawReference: { jsonPath: 'evaluator.violations' },
154
+ });
155
+ }
156
+ /** ORT's own severity words, mapped once here rather than inside the normaliser. */
157
+ function ortSeverity(word) {
158
+ switch (word.toUpperCase()) {
159
+ case 'ERROR':
160
+ return 'HIGH';
161
+ case 'WARNING':
162
+ return 'MEDIUM';
163
+ case 'HINT':
164
+ return 'INFO';
165
+ default:
166
+ return 'LOW';
167
+ }
168
+ }
169
+ /** A string field, trimmed; anything else is empty rather than "[object Object]". */
170
+ function text(value) {
171
+ return typeof value === 'string' ? value.trim() : '';
172
+ }
173
+ function violationToEvidence(violation, index, adapterVersion) {
174
+ const rule = text(dig(violation, ['rule'])) || 'unknown rule';
175
+ // `pkg` is a coordinate string or null. Null is not "unknown package": it is
176
+ // a violation the ruleset attached to the result rather than to a package.
177
+ const pkg = text(dig(violation, ['pkg'])) || null;
178
+ const message = text(dig(violation, ['message']));
179
+ const howToFix = text(dig(violation, ['how_to_fix']));
180
+ const license = text(dig(violation, ['license']));
181
+ const severityWord = text(dig(violation, ['severity'])) || 'ERROR';
182
+ // A licence-policy violation is only actionable if the licence is in the
183
+ // claim: the rule name alone does not say which licence tripped it.
184
+ const about = license ? ` (license ${license})` : '';
185
+ const detail = message ? `: ${message}` : '';
186
+ return buildEvidence({
187
+ source: {
188
+ tool: 'ort',
189
+ kind: 'policy-violation',
190
+ version: adapterVersion,
191
+ identifier: rule,
192
+ },
193
+ provenance: placeholder(),
194
+ claim: `${pkg ?? 'the repository'} violates policy rule ${rule}${about}${detail}`,
195
+ severity: ortSeverity(severityWord),
196
+ confidence: DETERMINISTIC_CONFIDENCE,
197
+ status: 'FAIL',
198
+ location: null,
199
+ rawReference: {
200
+ jsonPath: `evaluator.violations[${index}]`,
201
+ ...(howToFix ? { excerpt: howToFix } : {}),
202
+ },
203
+ });
204
+ }
205
+ function unknown(context, reason) {
206
+ return {
207
+ id: `UNKNOWN-ort-${reason}`.replace(/[^A-Za-z0-9-]/g, '-').slice(0, 48),
208
+ source: { tool: 'ort', version: context.adapterVersion, kind: 'check', identifier: 'UNKNOWN' },
209
+ provenance: placeholder(),
210
+ claim: reason,
211
+ severity: 'INFO',
212
+ severitySource: 'adapter-default',
213
+ confidence: DETERMINISTIC_CONFIDENCE,
214
+ status: 'UNKNOWN',
215
+ location: null,
216
+ rawReference: {},
217
+ };
218
+ }
219
+ function placeholder() {
220
+ return {
221
+ executionId: '',
222
+ command: [],
223
+ config: {},
224
+ repositoryRevision: '',
225
+ timestamp: '',
226
+ executable: '',
227
+ timeoutMs: 0,
228
+ elapsedMs: 0,
229
+ };
230
+ }
231
+ function which(binary) {
232
+ for (const dir of (process.env.PATH ?? '').split(path.delimiter)) {
233
+ if (!dir)
234
+ continue;
235
+ const candidate = path.join(dir, binary);
236
+ try {
237
+ if (statSync(candidate).isFile())
238
+ return candidate;
239
+ }
240
+ catch {
241
+ /* keep looking */
242
+ }
243
+ }
244
+ return null;
245
+ }
246
+ function versionOf(executable) {
247
+ const proc = spawnSync(executable, ['--version'], { encoding: 'utf8', timeout: 60_000 });
248
+ // Measured: `ort --version` prints JVM warnings first, and one of them names a
249
+ // jar (`jna-5.19.1.jar`) — a loose regex on the whole output reports 5.19.1 as
250
+ // the ORT version. Only a line that *is* a version counts, and the real one is
251
+ // last.
252
+ const lines = String(proc.stdout ?? proc.stderr ?? '')
253
+ .split('\n')
254
+ .map((line) => line.trim())
255
+ .filter((line) => /^\d+\.\d+\.\d+/.test(line));
256
+ const last = lines.at(-1);
257
+ return last ? /^(\d+\.\d+\.\d+)/.exec(last)[1] : 'unknown';
258
+ }
259
+ //# sourceMappingURL=ort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ort.js","sourceRoot":"","sources":["../../../src/scanner/adapters/ort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE9E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,EAAE,EAAE,KAAK;IACT,IAAI,EAAE,gDAAgD;IACtD,4EAA4E;IAC5E,iDAAiD;IAC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MAAM,IAAI,EAAE,CAAC;SACnD,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ScannerAdapter } from '../types.js';
2
+ /** The file-based checks that survive `--local` (verified against v5.6.0). */
3
+ export declare const LOCAL_CHECKS: string[];
4
+ export declare const scorecardAdapter: ScannerAdapter;
5
+ /** `git@github.com:org/repo.git` or `https://github.com/org/repo.git` → `org/repo`. */
6
+ export declare function deriveRepoSlug(targetPath: string): string;
7
+ //# sourceMappingURL=scorecard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scorecard.d.ts","sourceRoot":"","sources":["../../../src/scanner/adapters/scorecard.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAA0B,cAAc,EAAiB,MAAM,aAAa,CAAC;AAIzF,8EAA8E;AAC9E,eAAO,MAAM,YAAY,UAQxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cA6D9B,CAAC;AAsFF,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CASzD"}