@vibgrate/cli 2026.711.2 → 2026.717.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.
- package/DOCS.md +55 -2
- package/README.md +2 -2
- package/dist/baseline-YWGSHCKW.js +6 -0
- package/dist/{baseline-SRVG4ZAD.js.map → baseline-YWGSHCKW.js.map} +1 -1
- package/dist/{chunk-75ZJYYJE.js → chunk-L42NVMD6.js} +268 -111
- package/dist/chunk-L42NVMD6.js.map +1 -0
- package/dist/{chunk-NNU2PW2H.js → chunk-M62BGJMK.js} +274 -56
- package/dist/chunk-M62BGJMK.js.map +1 -0
- package/dist/{chunk-X5YT263H.js → chunk-VFO5UDAT.js} +21 -2
- package/dist/chunk-VFO5UDAT.js.map +1 -0
- package/dist/{chunk-4IHO6VUL.js → chunk-WZNIDXZP.js} +628 -4
- package/dist/chunk-WZNIDXZP.js.map +1 -0
- package/dist/cli.js +1426 -169
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +29 -6
- package/dist/index.js +3 -3
- package/dist/parse-worker.d.ts +1 -1
- package/dist/parse-worker.js +2 -1
- package/dist/parse-worker.js.map +1 -1
- package/dist/{types-CXnp1uGj.d.ts → types-BgNa-FZQ.d.ts} +8 -0
- package/package.json +2 -2
- package/dist/baseline-SRVG4ZAD.js +0 -6
- package/dist/chunk-4IHO6VUL.js.map +0 -1
- package/dist/chunk-75ZJYYJE.js.map +0 -1
- package/dist/chunk-NNU2PW2H.js.map +0 -1
- package/dist/chunk-X5YT263H.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { redactUrlCredentials } from './chunk-RXP66R2E.js';
|
|
2
|
-
import { pathExists, readJsonFile, Semaphore, FileCache, quickTreeCount, ensureDir, writeJsonFile, writeTextFile,
|
|
2
|
+
import { pathExists, readTextFile, readJsonFile, Semaphore, FileCache, quickTreeCount, ensureDir, writeJsonFile, writeTextFile, findPackageJsonFiles, findFiles, findSolutionFiles } from './chunk-GI6W53LM.js';
|
|
3
3
|
import * as path29 from 'path';
|
|
4
4
|
import { basename, dirname } from 'path';
|
|
5
5
|
import chalk3 from 'chalk';
|
|
@@ -19,7 +19,7 @@ import * as zlib from 'zlib';
|
|
|
19
19
|
import { promisify } from 'util';
|
|
20
20
|
|
|
21
21
|
// src/version.ts
|
|
22
|
-
var VERSION = "2026.
|
|
22
|
+
var VERSION = "2026.717.1";
|
|
23
23
|
var TOP_LEVEL_NODE_MODULES = /^node_modules\/((?:@[^/]+\/)?[^/]+)$/;
|
|
24
24
|
function parsePackageLock(json) {
|
|
25
25
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -977,14 +977,6 @@ function aggregateLibyears(values) {
|
|
|
977
977
|
if (measured === 0) return null;
|
|
978
978
|
return { total, max, measured };
|
|
979
979
|
}
|
|
980
|
-
function freshnessScoreFromLibyears(agg) {
|
|
981
|
-
if (!agg || agg.measured === 0) return null;
|
|
982
|
-
const avg = agg.total / agg.measured;
|
|
983
|
-
const avgPenalty = Math.min(avg * 20, 100);
|
|
984
|
-
const maxPenalty = Math.min(agg.max * 10, 100);
|
|
985
|
-
const score = 100 - (avgPenalty * 0.7 + maxPenalty * 0.3);
|
|
986
|
-
return Math.max(0, Math.min(100, Math.round(score)));
|
|
987
|
-
}
|
|
988
980
|
|
|
989
981
|
// src/core-open/runtimes/catalog.ts
|
|
990
982
|
function productForType(type) {
|
|
@@ -1178,6 +1170,8 @@ var BUNDLED_RUNTIME_CATALOG = {
|
|
|
1178
1170
|
};
|
|
1179
1171
|
|
|
1180
1172
|
// src/core-open/scanners/node-scanner.ts
|
|
1173
|
+
var MS_PER_DAY2 = 864e5;
|
|
1174
|
+
var ABANDONED_MAX_DAYS = 730;
|
|
1181
1175
|
var KNOWN_FRAMEWORKS = {
|
|
1182
1176
|
// ── Frontend ──
|
|
1183
1177
|
"react": "React",
|
|
@@ -1445,6 +1439,14 @@ async function scanOnePackageJson(packageJsonPath, rootDir, npmCache, cache, cat
|
|
|
1445
1439
|
}
|
|
1446
1440
|
const ageDays = ageDaysBetween(resolvedVersion, latestStable2, meta.releaseDates);
|
|
1447
1441
|
const libyears = daysToLibyears(ageDays);
|
|
1442
|
+
const latestIso = latestStable2 ? meta.releaseDates?.[latestStable2] : void 0;
|
|
1443
|
+
let abandoned = false;
|
|
1444
|
+
if (latestIso) {
|
|
1445
|
+
const publishedMs = Date.parse(latestIso);
|
|
1446
|
+
if (!Number.isNaN(publishedMs)) {
|
|
1447
|
+
abandoned = (Date.now() - publishedMs) / MS_PER_DAY2 > ABANDONED_MAX_DAYS;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1448
1450
|
dependencies.push({
|
|
1449
1451
|
package: pkg,
|
|
1450
1452
|
section,
|
|
@@ -1455,7 +1457,8 @@ async function scanOnePackageJson(packageJsonPath, rootDir, npmCache, cache, cat
|
|
|
1455
1457
|
drift,
|
|
1456
1458
|
license: buildDependencyLicense(meta.license, "registry"),
|
|
1457
1459
|
ageDays,
|
|
1458
|
-
libyears
|
|
1460
|
+
libyears,
|
|
1461
|
+
...abandoned ? { abandoned: true } : {}
|
|
1459
1462
|
});
|
|
1460
1463
|
if (pkg in KNOWN_FRAMEWORKS) {
|
|
1461
1464
|
frameworks.push({
|
|
@@ -1741,10 +1744,10 @@ function parseTfmMajor(tfm) {
|
|
|
1741
1744
|
return null;
|
|
1742
1745
|
}
|
|
1743
1746
|
function isDotnetProjectFile(name) {
|
|
1744
|
-
return name.endsWith(".csproj") || name.endsWith(".vbproj");
|
|
1747
|
+
return name.endsWith(".csproj") || name.endsWith(".vbproj") || name.endsWith(".sqlproj");
|
|
1745
1748
|
}
|
|
1746
1749
|
function stripDotnetProjectExtension(filePath) {
|
|
1747
|
-
return path29.basename(filePath).replace(/\.(cs|vb)proj$/i, "");
|
|
1750
|
+
return path29.basename(filePath).replace(/\.(cs|vb|sql)proj$/i, "");
|
|
1748
1751
|
}
|
|
1749
1752
|
function parseDotnetProjectFile(xml, filePath) {
|
|
1750
1753
|
const parsed = parser.parse(xml);
|
|
@@ -1813,7 +1816,7 @@ async function scanDotnetProjects(rootDir, nugetCache, cache, projectScanTimeout
|
|
|
1813
1816
|
try {
|
|
1814
1817
|
const slnContent = cache ? await cache.readTextFile(slnPath) : await readTextFile(slnPath);
|
|
1815
1818
|
const slnDir = path29.dirname(slnPath);
|
|
1816
|
-
const projectRegex = /Project\("[^"]*"\)\s*=\s*"[^"]*",\s*"([^"]+\.(?:cs|vb)proj)"/g;
|
|
1819
|
+
const projectRegex = /Project\("[^"]*"\)\s*=\s*"[^"]*",\s*"([^"]+\.(?:cs|vb|sql)proj)"/g;
|
|
1817
1820
|
let match;
|
|
1818
1821
|
while ((match = projectRegex.exec(slnContent)) !== null) {
|
|
1819
1822
|
if (match[1]) {
|
|
@@ -6604,7 +6607,166 @@ var PubCache = class {
|
|
|
6604
6607
|
return p;
|
|
6605
6608
|
}
|
|
6606
6609
|
};
|
|
6607
|
-
|
|
6610
|
+
|
|
6611
|
+
// src/core-open/scoring/dependency-drift-v3.ts
|
|
6612
|
+
var POINTS_PER_LIBYEAR = 25;
|
|
6613
|
+
var TIME_WEIGHT = 0.55;
|
|
6614
|
+
var VERSION_WEIGHT = 0.45;
|
|
6615
|
+
var UNSUPPORTED_FLOOR = 70;
|
|
6616
|
+
var ABANDONED_FLOOR = 50;
|
|
6617
|
+
var AGG_MEAN_WEIGHT = 0.5;
|
|
6618
|
+
var AGG_P95_WEIGHT = 0.3;
|
|
6619
|
+
var AGG_UNSUPPORTED_SHARE_WEIGHT = 0.2;
|
|
6620
|
+
var WEIGHT_DIRECT_PROD = 1;
|
|
6621
|
+
var WEIGHT_DIRECT_DEV = 0.5;
|
|
6622
|
+
var WEIGHT_TRANSITIVE = 0.4;
|
|
6623
|
+
var CANARY_MAJOR_THRESHOLD = 900;
|
|
6624
|
+
var SCHEME_JUMP_MAX_MAJORS = 20;
|
|
6625
|
+
var HIGH_CADENCE_TIME_CAP = 50;
|
|
6626
|
+
var PLACEHOLDER_STUBS = /* @__PURE__ */ new Set([
|
|
6627
|
+
"fs",
|
|
6628
|
+
"crypto",
|
|
6629
|
+
"path",
|
|
6630
|
+
"util",
|
|
6631
|
+
"os",
|
|
6632
|
+
"events",
|
|
6633
|
+
"stream",
|
|
6634
|
+
"http",
|
|
6635
|
+
"https",
|
|
6636
|
+
"assert",
|
|
6637
|
+
"buffer",
|
|
6638
|
+
"punycode",
|
|
6639
|
+
"querystring",
|
|
6640
|
+
"url",
|
|
6641
|
+
"zlib",
|
|
6642
|
+
"domain"
|
|
6643
|
+
]);
|
|
6644
|
+
var HIGH_CADENCE_PREFIXES = [
|
|
6645
|
+
"@aws-sdk/",
|
|
6646
|
+
"aws-sdk",
|
|
6647
|
+
"@google-cloud/",
|
|
6648
|
+
"@azure/"
|
|
6649
|
+
];
|
|
6650
|
+
function clamp(v, min, max) {
|
|
6651
|
+
return Math.min(max, Math.max(min, v));
|
|
6652
|
+
}
|
|
6653
|
+
function majorOf(version) {
|
|
6654
|
+
if (!version) return null;
|
|
6655
|
+
const m = /^\D*(\d+)/.exec(version);
|
|
6656
|
+
return m ? Number(m[1]) : null;
|
|
6657
|
+
}
|
|
6658
|
+
function isHighCadence(pkg) {
|
|
6659
|
+
return HIGH_CADENCE_PREFIXES.some((p) => pkg === p || pkg.startsWith(p));
|
|
6660
|
+
}
|
|
6661
|
+
function versionDriftPoints(dep) {
|
|
6662
|
+
const mb = dep.majorsBehind;
|
|
6663
|
+
if (mb === null || mb === void 0) return 0;
|
|
6664
|
+
if (mb <= 0) {
|
|
6665
|
+
return dep.drift === "current" ? 0 : 15;
|
|
6666
|
+
}
|
|
6667
|
+
if (mb === 1) return 45;
|
|
6668
|
+
if (mb === 2) return 70;
|
|
6669
|
+
if (mb === 3) return 85;
|
|
6670
|
+
return 100;
|
|
6671
|
+
}
|
|
6672
|
+
function timeDriftPoints(libyears) {
|
|
6673
|
+
if (libyears === null || libyears === void 0 || Number.isNaN(libyears)) return null;
|
|
6674
|
+
return clamp(libyears * POINTS_PER_LIBYEAR, 0, 100);
|
|
6675
|
+
}
|
|
6676
|
+
function perDependencyDrift(dep, ctx = {}) {
|
|
6677
|
+
const flags = [];
|
|
6678
|
+
if (PLACEHOLDER_STUBS.has(dep.package)) {
|
|
6679
|
+
return {
|
|
6680
|
+
package: dep.package,
|
|
6681
|
+
drift: 0,
|
|
6682
|
+
mode: "estimated",
|
|
6683
|
+
unsupported: false,
|
|
6684
|
+
weight: 0,
|
|
6685
|
+
flags: ["placeholder-stub"],
|
|
6686
|
+
excluded: true
|
|
6687
|
+
};
|
|
6688
|
+
}
|
|
6689
|
+
const latestMajor = majorOf(dep.latestStable);
|
|
6690
|
+
let versionReliable = true;
|
|
6691
|
+
if (latestMajor !== null && latestMajor >= CANARY_MAJOR_THRESHOLD) {
|
|
6692
|
+
versionReliable = false;
|
|
6693
|
+
flags.push("canary-latest");
|
|
6694
|
+
}
|
|
6695
|
+
if (dep.majorsBehind !== null && dep.majorsBehind !== void 0 && dep.majorsBehind > SCHEME_JUMP_MAX_MAJORS) {
|
|
6696
|
+
versionReliable = false;
|
|
6697
|
+
flags.push("scheme-jump");
|
|
6698
|
+
}
|
|
6699
|
+
const highCadence = isHighCadence(dep.package);
|
|
6700
|
+
if (highCadence) flags.push("high-cadence-damped");
|
|
6701
|
+
const V = versionReliable ? versionDriftPoints(dep) : 0;
|
|
6702
|
+
let T = timeDriftPoints(dep.libyears);
|
|
6703
|
+
if (T !== null && highCadence) T = Math.min(T, HIGH_CADENCE_TIME_CAP);
|
|
6704
|
+
let base;
|
|
6705
|
+
let mode;
|
|
6706
|
+
if (T !== null) {
|
|
6707
|
+
mode = "verified";
|
|
6708
|
+
base = versionReliable ? TIME_WEIGHT * T + VERSION_WEIGHT * V : T;
|
|
6709
|
+
} else {
|
|
6710
|
+
mode = "estimated";
|
|
6711
|
+
base = V;
|
|
6712
|
+
}
|
|
6713
|
+
const unsupported = ctx.unsupported === true;
|
|
6714
|
+
if (unsupported) {
|
|
6715
|
+
base = Math.max(base, UNSUPPORTED_FLOOR);
|
|
6716
|
+
flags.push("unsupported-floor");
|
|
6717
|
+
}
|
|
6718
|
+
if (ctx.abandoned === true) {
|
|
6719
|
+
base = Math.max(base, ABANDONED_FLOOR);
|
|
6720
|
+
flags.push("abandoned-floor");
|
|
6721
|
+
}
|
|
6722
|
+
const weight = ctx.transitive === true ? WEIGHT_TRANSITIVE : dep.section === "devDependencies" ? WEIGHT_DIRECT_DEV : WEIGHT_DIRECT_PROD;
|
|
6723
|
+
return {
|
|
6724
|
+
package: dep.package,
|
|
6725
|
+
drift: clamp(Math.round(base), 0, 100),
|
|
6726
|
+
mode,
|
|
6727
|
+
unsupported,
|
|
6728
|
+
weight,
|
|
6729
|
+
flags,
|
|
6730
|
+
excluded: false
|
|
6731
|
+
};
|
|
6732
|
+
}
|
|
6733
|
+
function percentile(values, p) {
|
|
6734
|
+
if (values.length === 0) return 0;
|
|
6735
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
6736
|
+
const rank2 = Math.ceil(p * sorted.length);
|
|
6737
|
+
return sorted[clamp(rank2 - 1, 0, sorted.length - 1)];
|
|
6738
|
+
}
|
|
6739
|
+
function aggregateDependencyDrift(deps, ctxOf) {
|
|
6740
|
+
const results = deps.map((d) => perDependencyDrift(d, ctxOf?.(d))).filter((r) => !r.excluded);
|
|
6741
|
+
const excluded = deps.length - results.length;
|
|
6742
|
+
if (results.length === 0) return null;
|
|
6743
|
+
const weightSum = results.reduce((s, r) => s + r.weight, 0) || 1;
|
|
6744
|
+
const weightedMean = results.reduce((s, r) => s + r.drift * r.weight, 0) / weightSum;
|
|
6745
|
+
const p95 = percentile(results.map((r) => r.drift), 0.95);
|
|
6746
|
+
const unsupportedShare = results.filter((r) => r.unsupported).length / results.length;
|
|
6747
|
+
const verified = results.filter((r) => r.mode === "verified").length;
|
|
6748
|
+
const drift = clamp(
|
|
6749
|
+
Math.round(
|
|
6750
|
+
AGG_MEAN_WEIGHT * weightedMean + AGG_P95_WEIGHT * p95 + AGG_UNSUPPORTED_SHARE_WEIGHT * (unsupportedShare * 100)
|
|
6751
|
+
),
|
|
6752
|
+
0,
|
|
6753
|
+
100
|
|
6754
|
+
);
|
|
6755
|
+
return {
|
|
6756
|
+
drift,
|
|
6757
|
+
mean: Math.round(weightedMean),
|
|
6758
|
+
p95,
|
|
6759
|
+
unsupportedShare,
|
|
6760
|
+
mode: verified > 0 ? "verified" : "estimated",
|
|
6761
|
+
scored: results.length,
|
|
6762
|
+
excluded,
|
|
6763
|
+
coverage: Math.round(verified / results.length * 100) / 100,
|
|
6764
|
+
top: [...results].sort((a, b) => b.drift - a.drift).slice(0, 10)
|
|
6765
|
+
};
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6768
|
+
// src/core-open/scoring/drift-score.ts
|
|
6769
|
+
var DRIFT_SCORE_METHODOLOGY_VERSION = "driftscore-3.0";
|
|
6608
6770
|
var DEFAULT_THRESHOLDS = {
|
|
6609
6771
|
failOnError: {
|
|
6610
6772
|
eolDays: 180,
|
|
@@ -6616,7 +6778,7 @@ var DEFAULT_THRESHOLDS = {
|
|
|
6616
6778
|
dependencyTwoPlusPercent: 30
|
|
6617
6779
|
}
|
|
6618
6780
|
};
|
|
6619
|
-
function
|
|
6781
|
+
function clamp2(val, min, max) {
|
|
6620
6782
|
return Math.min(max, Math.max(min, val));
|
|
6621
6783
|
}
|
|
6622
6784
|
function runtimeScore(projects) {
|
|
@@ -6639,23 +6801,7 @@ function frameworkScore(projects) {
|
|
|
6639
6801
|
const avgLag = lags.reduce((a, b) => a + b, 0) / lags.length;
|
|
6640
6802
|
const maxPenalty = Math.min(maxLag * 20, 100);
|
|
6641
6803
|
const avgPenalty = Math.min(avgLag * 15, 100);
|
|
6642
|
-
return
|
|
6643
|
-
}
|
|
6644
|
-
function dependencyScore(projects) {
|
|
6645
|
-
let totalCurrent = 0;
|
|
6646
|
-
let totalOne = 0;
|
|
6647
|
-
let totalTwo = 0;
|
|
6648
|
-
for (const p of projects) {
|
|
6649
|
-
totalCurrent += p.dependencyAgeBuckets.current;
|
|
6650
|
-
totalOne += p.dependencyAgeBuckets.oneBehind;
|
|
6651
|
-
totalTwo += p.dependencyAgeBuckets.twoPlusBehind;
|
|
6652
|
-
}
|
|
6653
|
-
const total = totalCurrent + totalOne + totalTwo;
|
|
6654
|
-
if (total === 0) return null;
|
|
6655
|
-
const currentPct = totalCurrent / total;
|
|
6656
|
-
const onePct = totalOne / total;
|
|
6657
|
-
const twoPct = totalTwo / total;
|
|
6658
|
-
return clamp(Math.round(currentPct * 100 - onePct * 10 - twoPct * 40), 0, 100);
|
|
6804
|
+
return clamp2(100 - (maxPenalty * 0.6 + avgPenalty * 0.4), 0, 100);
|
|
6659
6805
|
}
|
|
6660
6806
|
var MONTH_MS = 1e3 * 60 * 60 * 24 * 30;
|
|
6661
6807
|
function eolScore(projects) {
|
|
@@ -6703,15 +6849,6 @@ function eolScore(projects) {
|
|
|
6703
6849
|
}
|
|
6704
6850
|
return score;
|
|
6705
6851
|
}
|
|
6706
|
-
function freshnessScore(projects) {
|
|
6707
|
-
const aggs = projects.map((p) => p.libyears).filter((a) => !!a);
|
|
6708
|
-
if (aggs.length === 0) return null;
|
|
6709
|
-
const total = aggs.reduce((s, a) => s + a.total, 0);
|
|
6710
|
-
const measured = aggs.reduce((s, a) => s + a.measured, 0);
|
|
6711
|
-
const max = aggs.reduce((m, a) => Math.max(m, a.max), 0);
|
|
6712
|
-
if (measured === 0) return null;
|
|
6713
|
-
return freshnessScoreFromLibyears({ total, max, measured });
|
|
6714
|
-
}
|
|
6715
6852
|
function coverageConfidence(projects) {
|
|
6716
6853
|
let known = 0;
|
|
6717
6854
|
let unknown = 0;
|
|
@@ -6724,17 +6861,24 @@ function coverageConfidence(projects) {
|
|
|
6724
6861
|
return Math.round(known / total * 100) / 100;
|
|
6725
6862
|
}
|
|
6726
6863
|
function computeDriftScore(projects) {
|
|
6864
|
+
const depAgg = aggregateDependencyDrift(
|
|
6865
|
+
projects.flatMap((p) => p.dependencies),
|
|
6866
|
+
// Per-dependency context for the v3 floors: an unsupported/deprecated major
|
|
6867
|
+
// floors drift at 70, an abandoned ("no pulse") package at 50. Threaded from
|
|
6868
|
+
// the row where the ecosystem scanner set it; absent → the floor doesn't
|
|
6869
|
+
// fire (spec §6.1). Transitive weighting still awaits the lockfile graph, so
|
|
6870
|
+
// manifest deps default to direct.
|
|
6871
|
+
(dep) => ({ unsupported: dep.unsupported === true, abandoned: dep.abandoned === true })
|
|
6872
|
+
);
|
|
6727
6873
|
const rs = runtimeScore(projects);
|
|
6728
6874
|
const fs9 = frameworkScore(projects);
|
|
6729
|
-
const ds =
|
|
6875
|
+
const ds = depAgg ? 100 - depAgg.drift : null;
|
|
6730
6876
|
const es = eolScore(projects);
|
|
6731
|
-
const frs = freshnessScore(projects);
|
|
6732
6877
|
const components = [
|
|
6733
6878
|
{ score: rs, weight: 0.25 },
|
|
6734
6879
|
{ score: fs9, weight: 0.25 },
|
|
6735
6880
|
{ score: ds, weight: 0.3 },
|
|
6736
|
-
{ score: es, weight: 0.2 }
|
|
6737
|
-
{ score: frs, weight: 0.15 }
|
|
6881
|
+
{ score: es, weight: 0.2 }
|
|
6738
6882
|
];
|
|
6739
6883
|
const confidence = coverageConfidence(projects) ?? void 0;
|
|
6740
6884
|
const toDrift = (health2) => 100 - health2;
|
|
@@ -6745,9 +6889,23 @@ function computeDriftScore(projects) {
|
|
|
6745
6889
|
dependencyScore: toDrift(Math.round(ds ?? 100)),
|
|
6746
6890
|
eolScore: toDrift(Math.round(es ?? 100))
|
|
6747
6891
|
};
|
|
6748
|
-
if (frs !== null) c.freshnessScore = toDrift(Math.round(frs));
|
|
6749
6892
|
return c;
|
|
6750
6893
|
};
|
|
6894
|
+
const envelope = depAgg ? {
|
|
6895
|
+
mode: depAgg.mode,
|
|
6896
|
+
dependencyDrift: {
|
|
6897
|
+
p95: depAgg.p95,
|
|
6898
|
+
unsupportedShare: depAgg.unsupportedShare,
|
|
6899
|
+
coverage: depAgg.coverage,
|
|
6900
|
+
top: depAgg.top.map((t) => ({
|
|
6901
|
+
package: t.package,
|
|
6902
|
+
drift: t.drift,
|
|
6903
|
+
mode: t.mode,
|
|
6904
|
+
unsupported: t.unsupported,
|
|
6905
|
+
flags: t.flags
|
|
6906
|
+
}))
|
|
6907
|
+
}
|
|
6908
|
+
} : {};
|
|
6751
6909
|
const active = components.filter((c) => c.score !== null);
|
|
6752
6910
|
if (active.length === 0) {
|
|
6753
6911
|
return {
|
|
@@ -6755,7 +6913,8 @@ function computeDriftScore(projects) {
|
|
|
6755
6913
|
riskLevel: "low",
|
|
6756
6914
|
components: buildComponents(),
|
|
6757
6915
|
methodologyVersion: DRIFT_SCORE_METHODOLOGY_VERSION,
|
|
6758
|
-
...confidence !== void 0 ? { confidence } : {}
|
|
6916
|
+
...confidence !== void 0 ? { confidence } : {},
|
|
6917
|
+
...envelope
|
|
6759
6918
|
};
|
|
6760
6919
|
}
|
|
6761
6920
|
const totalActiveWeight = active.reduce((sum, c) => sum + c.weight, 0);
|
|
@@ -6773,14 +6932,14 @@ function computeDriftScore(projects) {
|
|
|
6773
6932
|
if (fs9 !== null) measured.push("framework");
|
|
6774
6933
|
if (ds !== null) measured.push("dependency");
|
|
6775
6934
|
if (es !== null) measured.push("eol");
|
|
6776
|
-
if (frs !== null) measured.push("freshness");
|
|
6777
6935
|
return {
|
|
6778
6936
|
score,
|
|
6779
6937
|
riskLevel,
|
|
6780
6938
|
components: buildComponents(),
|
|
6781
6939
|
measured,
|
|
6782
6940
|
methodologyVersion: DRIFT_SCORE_METHODOLOGY_VERSION,
|
|
6783
|
-
...confidence !== void 0 ? { confidence } : {}
|
|
6941
|
+
...confidence !== void 0 ? { confidence } : {},
|
|
6942
|
+
...envelope
|
|
6784
6943
|
};
|
|
6785
6944
|
}
|
|
6786
6945
|
function generateFindings(projects, config) {
|
|
@@ -7345,6 +7504,26 @@ function formatExtended(ext) {
|
|
|
7345
7504
|
}
|
|
7346
7505
|
lines.push("");
|
|
7347
7506
|
}
|
|
7507
|
+
if (ext.databaseSchema) {
|
|
7508
|
+
const ds = ext.databaseSchema;
|
|
7509
|
+
lines.push(chalk3.bold.underline(" Database Schema"));
|
|
7510
|
+
const dsHead = [];
|
|
7511
|
+
if (ds.providers.length > 0) dsHead.push(ds.providers.join(", "));
|
|
7512
|
+
dsHead.push(`${ds.models.length} model${ds.models.length !== 1 ? "s" : ""}`);
|
|
7513
|
+
dsHead.push(`${ds.enums.length} enum${ds.enums.length !== 1 ? "s" : ""}`);
|
|
7514
|
+
lines.push(` ${dsHead.join(" \xB7 ")}`);
|
|
7515
|
+
const bySource = /* @__PURE__ */ new Map();
|
|
7516
|
+
for (const m of ds.models) bySource.set(m.source, (bySource.get(m.source) ?? 0) + 1);
|
|
7517
|
+
if (bySource.size > 1) {
|
|
7518
|
+
const sourceSummary = [...bySource.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([s, n]) => `${s}: ${n}`).join(", ");
|
|
7519
|
+
lines.push(` Sources: ${sourceSummary}`);
|
|
7520
|
+
}
|
|
7521
|
+
if (ds.models.length > 0) {
|
|
7522
|
+
const preview = ds.models.slice(0, 5).map((m) => m.name).join(", ");
|
|
7523
|
+
lines.push(` Models: ${chalk3.white(preview)}${ds.models.length > 5 ? chalk3.dim(` (+${ds.models.length - 5} more)`) : ""}`);
|
|
7524
|
+
}
|
|
7525
|
+
lines.push("");
|
|
7526
|
+
}
|
|
7348
7527
|
if (ext.dependencyGraph) {
|
|
7349
7528
|
const dg = ext.dependencyGraph;
|
|
7350
7529
|
if (dg.lockfileType) {
|
|
@@ -11143,6 +11322,20 @@ function dedupeRoutes(routes) {
|
|
|
11143
11322
|
}
|
|
11144
11323
|
var gzip2 = promisify(zlib.gzip);
|
|
11145
11324
|
var MAX_ITEMS = 50;
|
|
11325
|
+
var MAX_DB_MODELS = 300;
|
|
11326
|
+
var MAX_DB_FIELDS_PER_MODEL = 100;
|
|
11327
|
+
var MAX_DB_MODEL_FILES = 5;
|
|
11328
|
+
var MAX_DB_FILES_SCANNED = 500;
|
|
11329
|
+
var DB_UPLOAD_HARD_CEILING = {
|
|
11330
|
+
maxModels: 2e3,
|
|
11331
|
+
maxFieldsPerModel: 500,
|
|
11332
|
+
maxFilesPerModel: 20,
|
|
11333
|
+
maxFilesScanned: 5e3
|
|
11334
|
+
};
|
|
11335
|
+
function clampCap(configured, fallback, ceiling) {
|
|
11336
|
+
if (typeof configured !== "number" || !Number.isFinite(configured) || configured <= 0) return fallback;
|
|
11337
|
+
return Math.min(Math.floor(configured), ceiling);
|
|
11338
|
+
}
|
|
11146
11339
|
function extractName(entry) {
|
|
11147
11340
|
const match = entry.match(/^(.+?)\s*\(/);
|
|
11148
11341
|
return match ? match[1].trim() : entry.trim();
|
|
@@ -11208,7 +11401,29 @@ function compactAssetBranding(result) {
|
|
|
11208
11401
|
// Don't include logos
|
|
11209
11402
|
};
|
|
11210
11403
|
}
|
|
11211
|
-
function
|
|
11404
|
+
function compactDatabaseSchema(result, caps) {
|
|
11405
|
+
const maxModels = clampCap(caps?.maxModels, MAX_DB_MODELS, DB_UPLOAD_HARD_CEILING.maxModels);
|
|
11406
|
+
const maxFieldsPerModel = clampCap(caps?.maxFieldsPerModel, MAX_DB_FIELDS_PER_MODEL, DB_UPLOAD_HARD_CEILING.maxFieldsPerModel);
|
|
11407
|
+
const maxFilesPerModel = clampCap(caps?.maxFilesPerModel, MAX_DB_MODEL_FILES, DB_UPLOAD_HARD_CEILING.maxFilesPerModel);
|
|
11408
|
+
const maxFilesScanned = clampCap(caps?.maxFilesScanned, MAX_DB_FILES_SCANNED, DB_UPLOAD_HARD_CEILING.maxFilesScanned);
|
|
11409
|
+
return {
|
|
11410
|
+
providers: result.providers.slice(0, MAX_ITEMS),
|
|
11411
|
+
models: result.models.slice(0, maxModels).map((model) => ({
|
|
11412
|
+
...model,
|
|
11413
|
+
fields: model.fields.slice(0, maxFieldsPerModel),
|
|
11414
|
+
files: model.files.slice(0, maxFilesPerModel)
|
|
11415
|
+
})),
|
|
11416
|
+
enums: result.enums.slice(0, MAX_ITEMS),
|
|
11417
|
+
filesScanned: result.filesScanned.slice(0, maxFilesScanned),
|
|
11418
|
+
projects: result.projects.slice(0, MAX_ITEMS).map((project) => ({
|
|
11419
|
+
project: project.project,
|
|
11420
|
+
filesScanned: project.filesScanned.slice(0, MAX_ITEMS),
|
|
11421
|
+
models: project.models.slice(0, MAX_ITEMS),
|
|
11422
|
+
enums: project.enums.slice(0, MAX_ITEMS)
|
|
11423
|
+
}))
|
|
11424
|
+
};
|
|
11425
|
+
}
|
|
11426
|
+
function prepareArtifactForUpload(artifact, opts) {
|
|
11212
11427
|
const compacted = { ...artifact };
|
|
11213
11428
|
if (compacted.extended) {
|
|
11214
11429
|
const ext = { ...compacted.extended };
|
|
@@ -11284,6 +11499,9 @@ function prepareArtifactForUpload(artifact) {
|
|
|
11284
11499
|
duplicatedPackages: ext.dependencyGraph.duplicatedPackages.slice(0, MAX_ITEMS)
|
|
11285
11500
|
};
|
|
11286
11501
|
}
|
|
11502
|
+
if (ext.databaseSchema) {
|
|
11503
|
+
ext.databaseSchema = compactDatabaseSchema(ext.databaseSchema, opts?.databaseSchemaCaps);
|
|
11504
|
+
}
|
|
11287
11505
|
compacted.extended = ext;
|
|
11288
11506
|
}
|
|
11289
11507
|
return compacted;
|
|
@@ -11292,8 +11510,8 @@ async function compressArtifact(artifact) {
|
|
|
11292
11510
|
const json = JSON.stringify(artifact);
|
|
11293
11511
|
return gzip2(json, { level: 9 });
|
|
11294
11512
|
}
|
|
11295
|
-
async function prepareCompressedUpload(artifact) {
|
|
11296
|
-
const compacted = prepareArtifactForUpload(artifact);
|
|
11513
|
+
async function prepareCompressedUpload(artifact, opts) {
|
|
11514
|
+
const compacted = prepareArtifactForUpload(artifact, opts);
|
|
11297
11515
|
const compressed = await compressArtifact(compacted);
|
|
11298
11516
|
return { body: compressed, contentEncoding: "gzip" };
|
|
11299
11517
|
}
|
|
@@ -11467,6 +11685,6 @@ async function writeTextFile2(filePath, content) {
|
|
|
11467
11685
|
await fs2.writeFile(filePath, content, "utf8");
|
|
11468
11686
|
}
|
|
11469
11687
|
|
|
11470
|
-
export { PROJECT_TYPE_TO_OSV_ECOSYSTEM, VERSION, brandProgressBar, buildVersionTimelines, compactUiPurpose, computeDriftScore, computeRepoFingerprint, computeUpgradeImpact, detectVcs, driftBar, ensureDir2 as ensureDir, fetchRiskySymbols, fetchScanPreflight, findPackageAnyEcosystem, findPackageTimeline, findVersionCrossings, getChangelogSignals, gitHistoryAvailable, normalizeConstraint, parseDsn, pathExists2 as pathExists, prepareCompressedUpload, projectTypeToVulnEcosystem, readJsonFile2 as readJsonFile, resolveHead, resolveRepositoryName, runCoreScan, severityRank, titleBox, versionSatisfies, workingTreeDirty, writeDefaultConfig, writeJsonFile2 as writeJsonFile, writeTextFile2 as writeTextFile };
|
|
11471
|
-
//# sourceMappingURL=chunk-
|
|
11472
|
-
//# sourceMappingURL=chunk-
|
|
11688
|
+
export { PROJECT_TYPE_TO_OSV_ECOSYSTEM, VERSION, brandProgressBar, buildVersionTimelines, compactUiPurpose, computeDriftScore, computeRepoFingerprint, computeUpgradeImpact, detectVcs, driftBar, ensureDir2 as ensureDir, fetchRiskySymbols, fetchScanPreflight, findPackageAnyEcosystem, findPackageTimeline, findVersionCrossings, getChangelogSignals, gitHistoryAvailable, loadConfig, normalizeConstraint, parseDsn, pathExists2 as pathExists, prepareCompressedUpload, projectTypeToVulnEcosystem, readJsonFile2 as readJsonFile, resolveHead, resolveRepositoryName, runCoreScan, severityRank, titleBox, versionSatisfies, workingTreeDirty, writeDefaultConfig, writeJsonFile2 as writeJsonFile, writeTextFile2 as writeTextFile };
|
|
11689
|
+
//# sourceMappingURL=chunk-M62BGJMK.js.map
|
|
11690
|
+
//# sourceMappingURL=chunk-M62BGJMK.js.map
|