nulladrift 0.10.1 → 0.12.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/README.md +11 -0
- package/dist/index.js +165 -16
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -143,6 +143,17 @@ describes the new code. The same npm version arriving with different bytes is
|
|
|
143
143
|
`server.artifact.substituted`, which has no innocent explanation. `--no-provenance` skips the
|
|
144
144
|
registry lookups for an air-gapped run.
|
|
145
145
|
|
|
146
|
+
**Name an exact version in the config.** `npx -y @modelcontextprotocol/server-memory` and
|
|
147
|
+
`uvx mcp-server-fetch` run whatever was published last, so every upstream release is a different
|
|
148
|
+
artifact and fails `check` with nothing in the project changed. `init`, `check` and `push` say
|
|
149
|
+
which servers are written that way and give the spec for what runs now, such as
|
|
150
|
+
`@modelcontextprotocol/server-memory@2.2.1`, `mcp-server-fetch==2026.11.18` or an image by digest.
|
|
151
|
+
Written that way, an upgrade is a pull request that changes the version, and the drift it brings
|
|
152
|
+
is reviewed there. Editing the version in the command is reported as `server.transport.changed`
|
|
153
|
+
at low severity, for the pin and for every upgrade after it, since it names the same package;
|
|
154
|
+
accept it with `nulladrift review`. An image with a version tag is left alone, and the warning
|
|
155
|
+
never changes the exit code.
|
|
156
|
+
|
|
146
157
|
**What it leaves out: credentials, wherever a config puts them.** `env` and header values are
|
|
147
158
|
recorded by name only, and a URL loses its query string and `user:password`. A credential
|
|
148
159
|
written literally (`--api-key sk-...`, `-e GITHUB_TOKEN=ghp_...`, a connection string's password,
|
package/dist/index.js
CHANGED
|
@@ -100,11 +100,19 @@ function serversThatShippedNothing(changes) {
|
|
|
100
100
|
const versioned = /* @__PURE__ */ new Set();
|
|
101
101
|
for (const change2 of changes) {
|
|
102
102
|
const uncaptured = change2.kind === "server.removed" || change2.kind === "server.added" && change2.after === void 0;
|
|
103
|
-
|
|
104
|
-
if (
|
|
103
|
+
const relaunch = change2.kind === "server.transport.changed" && change2.severity === "low";
|
|
104
|
+
if (!uncaptured && !relaunch) moved.add(change2.server);
|
|
105
|
+
if (change2.kind === "server.identity.changed" || releaseMoved(change2)) versioned.add(change2.server);
|
|
105
106
|
}
|
|
106
107
|
return [...moved].filter((server2) => !versioned.has(server2)).sort();
|
|
107
108
|
}
|
|
109
|
+
function releaseMoved(change2) {
|
|
110
|
+
if (change2.kind !== "server.artifact.changed") return false;
|
|
111
|
+
const version = (side) => typeof side === "object" && side !== null && "version" in side && typeof side.version === "string" ? side.version : void 0;
|
|
112
|
+
const was = version(change2.before);
|
|
113
|
+
const now = version(change2.after);
|
|
114
|
+
return was !== void 0 && now !== void 0 && was !== now;
|
|
115
|
+
}
|
|
108
116
|
|
|
109
117
|
// ../core/src/lock/types.ts
|
|
110
118
|
var LOCKFILE_VERSION = 2;
|
|
@@ -1486,12 +1494,66 @@ function orderless(entry) {
|
|
|
1486
1494
|
prompts: digests(prompts)
|
|
1487
1495
|
});
|
|
1488
1496
|
}
|
|
1497
|
+
function unversioned(arg, ecosystem) {
|
|
1498
|
+
switch (ecosystem) {
|
|
1499
|
+
case "npm": {
|
|
1500
|
+
const at = arg.lastIndexOf("@");
|
|
1501
|
+
if (at <= 0) return { base: arg, name: arg, exact: false };
|
|
1502
|
+
const qualifier = arg.slice(at + 1);
|
|
1503
|
+
if (!/^[\w.^~<>=| *+-]+$/.test(qualifier)) return void 0;
|
|
1504
|
+
return { base: arg.slice(0, at), name: arg.slice(0, at), exact: /^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(qualifier) };
|
|
1505
|
+
}
|
|
1506
|
+
case "pypi": {
|
|
1507
|
+
const match = /^([A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?)(\[[^\]]*\])?(?:\s*(===?|>=|<=|~=|!=|>|<|@)\s*([^\s:/]+))?$/.exec(arg.trim());
|
|
1508
|
+
if (!match) return void 0;
|
|
1509
|
+
const [, name, extras, operator, value] = match;
|
|
1510
|
+
return {
|
|
1511
|
+
// PEP 503: case, `-`, `_` and `.` do not tell two packages apart. Extras stay in the base: they install more.
|
|
1512
|
+
base: `${name}${extras ?? ""}`,
|
|
1513
|
+
name: name.replace(/[-_.]+/g, "-").toLowerCase(),
|
|
1514
|
+
// `==` and uv's `@` name one release; every other operator names a set of them.
|
|
1515
|
+
exact: (operator === "==" || operator === "===" || operator === "@") && /^\d[\w.!+-]*$/.test(value ?? "")
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
case "oci": {
|
|
1519
|
+
const match = /^([^@\s]+?)(?::[\w][\w.-]{0,127})?(@sha256:[a-f0-9]{64})?$/.exec(arg);
|
|
1520
|
+
if (!match || match[1].includes("@")) return void 0;
|
|
1521
|
+
return { base: match[1], name: match[1], exact: match[2] !== void 0 };
|
|
1522
|
+
}
|
|
1523
|
+
case "file":
|
|
1524
|
+
return void 0;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function versionOnlyRelaunch(before, after) {
|
|
1528
|
+
const was = before.provenance;
|
|
1529
|
+
const now = after.provenance;
|
|
1530
|
+
if (!was || !now || was.ecosystem !== now.ecosystem || was.name !== now.name) return void 0;
|
|
1531
|
+
if (before.transport.type !== "stdio" || after.transport.type !== "stdio") return void 0;
|
|
1532
|
+
const wasArgs = before.transport.args ?? [];
|
|
1533
|
+
const nowArgs = after.transport.args ?? [];
|
|
1534
|
+
if (wasArgs.length !== nowArgs.length) return void 0;
|
|
1535
|
+
const differ = wasArgs.flatMap((arg, i) => arg === nowArgs[i] ? [] : [i]);
|
|
1536
|
+
if (differ.length !== 1) return void 0;
|
|
1537
|
+
const at = differ[0];
|
|
1538
|
+
const placeholder = (args) => args.map((arg, i) => i === at ? "" : arg);
|
|
1539
|
+
if (!same({ ...before.transport, args: placeholder(wasArgs) }, { ...after.transport, args: placeholder(nowArgs) })) return void 0;
|
|
1540
|
+
const wasSpec = unversioned(wasArgs[at], was.ecosystem);
|
|
1541
|
+
const nowSpec = unversioned(nowArgs[at], now.ecosystem);
|
|
1542
|
+
if (!wasSpec || !nowSpec || !nowSpec.exact || wasSpec.base !== nowSpec.base || nowSpec.name !== now.name) return void 0;
|
|
1543
|
+
return { was: wasArgs[at], now: nowArgs[at] };
|
|
1544
|
+
}
|
|
1489
1545
|
function compareServer(name, before, after) {
|
|
1490
1546
|
const provenance2 = compareProvenance(name, before, after);
|
|
1491
1547
|
if (before.digest === after.digest) return provenance2;
|
|
1492
1548
|
const changes = [...provenance2];
|
|
1493
1549
|
if (!same(before.transport, after.transport)) {
|
|
1494
|
-
|
|
1550
|
+
const relaunch = versionOnlyRelaunch(before, after);
|
|
1551
|
+
if (relaunch === void 0) {
|
|
1552
|
+
changes.push(change("server.transport.changed", name, "the server is reached differently than when it was pinned", { before: before.transport, after: after.transport }));
|
|
1553
|
+
} else {
|
|
1554
|
+
const summary = provenance2.length === 0 ? `the command now asks for ${relaunch.now} instead of ${relaunch.was}: the release that was already running, named exactly, so the next one published will not replace it` : `the command now asks for ${relaunch.now} instead of ${relaunch.was}: the same package, and what the release changed is reported beside this`;
|
|
1555
|
+
changes.push(change("server.transport.changed", name, summary, { severity: "low", before: before.transport, after: after.transport }));
|
|
1556
|
+
}
|
|
1495
1557
|
}
|
|
1496
1558
|
if (!same(before.serverInfo, after.serverInfo)) {
|
|
1497
1559
|
const from = before.serverInfo?.version ?? "unknown";
|
|
@@ -2441,7 +2503,7 @@ import { readFile as readFile3 } from "fs/promises";
|
|
|
2441
2503
|
import { isAbsolute as isAbsolute2, resolve as resolve3 } from "path";
|
|
2442
2504
|
|
|
2443
2505
|
// src/lib/version.ts
|
|
2444
|
-
var VERSION = "0.
|
|
2506
|
+
var VERSION = "0.12.0";
|
|
2445
2507
|
var USER_AGENT = `nulladrift/${VERSION} (+https://github.com/Nulladrift/nulladrift)`;
|
|
2446
2508
|
|
|
2447
2509
|
// src/lock/provenance.ts
|
|
@@ -2722,6 +2784,35 @@ function isExact(reference) {
|
|
|
2722
2784
|
return false;
|
|
2723
2785
|
}
|
|
2724
2786
|
}
|
|
2787
|
+
function floatingRequest(reference, provenance2) {
|
|
2788
|
+
const found = provenance2?.ecosystem === reference.ecosystem && provenance2.name === reference.name ? provenance2 : void 0;
|
|
2789
|
+
switch (reference.ecosystem) {
|
|
2790
|
+
case "npm":
|
|
2791
|
+
if (isExact(reference)) return void 0;
|
|
2792
|
+
return {
|
|
2793
|
+
ecosystem: "npm",
|
|
2794
|
+
name: reference.name,
|
|
2795
|
+
asked: reference.requested === void 0 ? reference.name : `${reference.name}@${reference.requested}`,
|
|
2796
|
+
...found?.version === void 0 ? {} : { exact: `${reference.name}@${found.version}` }
|
|
2797
|
+
};
|
|
2798
|
+
case "pypi": {
|
|
2799
|
+
if (isExact(reference)) return void 0;
|
|
2800
|
+
const asked = reference.requested === void 0 ? reference.name : /^[=<>~!]/.test(reference.requested) ? `${reference.name}${reference.requested}` : `${reference.name}@${reference.requested}`;
|
|
2801
|
+
return { ecosystem: "pypi", name: reference.name, asked, ...found?.version === void 0 ? {} : { exact: `${reference.name}==${found.version}` } };
|
|
2802
|
+
}
|
|
2803
|
+
case "oci":
|
|
2804
|
+
if (reference.digest !== void 0 || reference.requested !== "latest") return void 0;
|
|
2805
|
+
return {
|
|
2806
|
+
ecosystem: "oci",
|
|
2807
|
+
name: reference.name,
|
|
2808
|
+
asked: `${reference.name}:latest`,
|
|
2809
|
+
// By digest, the only name for an image that cannot be pointed somewhere else.
|
|
2810
|
+
...found?.integrity === void 0 ? {} : { exact: `${reference.name}@${found.integrity}` }
|
|
2811
|
+
};
|
|
2812
|
+
case "file":
|
|
2813
|
+
return void 0;
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2725
2816
|
var NPM_PUBLIC = "https://registry.npmjs.org";
|
|
2726
2817
|
function npmEnv(env, name) {
|
|
2727
2818
|
const wanted = name.toLowerCase();
|
|
@@ -2934,6 +3025,14 @@ function ancestors(start) {
|
|
|
2934
3025
|
function npmPrefix(start) {
|
|
2935
3026
|
return ancestors(start).find((dir) => existsSync(join2(dir, "package.json")) || existsSync(join2(dir, "node_modules"))) ?? resolve4(start);
|
|
2936
3027
|
}
|
|
3028
|
+
function installedCopy(transport2, reference, context) {
|
|
3029
|
+
const name = commandName(transport2.command);
|
|
3030
|
+
if (name === "pnpm" || name === "yarn" || name === "pnpx") return false;
|
|
3031
|
+
const bin = reference.name.split("/").pop();
|
|
3032
|
+
return ancestors(transport2.cwd ?? context.projectRoot).some(
|
|
3033
|
+
(dir) => existsSync(join2(dir, "node_modules", ...reference.name.split("/"), "package.json")) || existsSync(join2(dir, "node_modules", ".bin", bin))
|
|
3034
|
+
);
|
|
3035
|
+
}
|
|
2937
3036
|
function npmElsewhere(transport2, reference, context) {
|
|
2938
3037
|
const env = context.env ?? process.env;
|
|
2939
3038
|
const name = commandName(transport2.command);
|
|
@@ -2941,14 +3040,7 @@ function npmElsewhere(transport2, reference, context) {
|
|
|
2941
3040
|
const launcherEnv = { ...env, ...transport2.env };
|
|
2942
3041
|
const options = launcherOptions(afterSubcommand(name, transport2.args), NPM_VALUE_FLAGS, ["-p", "--package"]);
|
|
2943
3042
|
const prefix = npmPrefix(base);
|
|
2944
|
-
if (
|
|
2945
|
-
const bin = reference.name.split("/").pop();
|
|
2946
|
-
for (const dir of ancestors(base)) {
|
|
2947
|
-
if (existsSync(join2(dir, "node_modules", ...reference.name.split("/"), "package.json")) || existsSync(join2(dir, "node_modules", ".bin", bin))) {
|
|
2948
|
-
return "a copy installed in node_modules runs instead of the registry's";
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
|
-
}
|
|
3043
|
+
if (installedCopy(transport2, reference, context)) return "a copy installed in node_modules runs instead of the registry's";
|
|
2952
3044
|
const cli = new Map(options.filter(([flag]) => flag.startsWith("--")).map(([flag, value]) => [flag.slice(2), value ?? ""]));
|
|
2953
3045
|
const userconfig = cli.get("userconfig") ?? npmEnv(launcherEnv, "npm_config_userconfig");
|
|
2954
3046
|
const levels = [
|
|
@@ -3820,6 +3912,14 @@ async function provenanceOf(server2, options) {
|
|
|
3820
3912
|
const kept = carriedForward(previous, reference);
|
|
3821
3913
|
return { ...kept ? { provenance: kept } : {}, unverified: true };
|
|
3822
3914
|
}
|
|
3915
|
+
function floatingOf(server2, provenance2, projectRoot) {
|
|
3916
|
+
if (server2.transport.type !== "stdio") return void 0;
|
|
3917
|
+
const reference = referenceOf(server2.transport, projectRoot);
|
|
3918
|
+
if (!reference) return void 0;
|
|
3919
|
+
if (reference.ecosystem === "npm" && installedCopy(server2.transport, reference, { projectRoot })) return void 0;
|
|
3920
|
+
const floating = floatingRequest(reference, provenance2);
|
|
3921
|
+
return floating ? { server: server2.name, ...floating } : void 0;
|
|
3922
|
+
}
|
|
3823
3923
|
async function mapWithLimit(items, limit, worker) {
|
|
3824
3924
|
const results = new Array(items.length);
|
|
3825
3925
|
let next = 0;
|
|
@@ -3838,19 +3938,21 @@ async function captureAll(options) {
|
|
|
3838
3938
|
const discovery = await discoverServers(options.projectRoot, options.configFiles, { userConfigs: options.userConfigs === true });
|
|
3839
3939
|
const captured = await mapWithLimit(discovery.servers, options.concurrency ?? 4, async (server2) => {
|
|
3840
3940
|
let established;
|
|
3941
|
+
let floating2;
|
|
3841
3942
|
try {
|
|
3842
3943
|
established = await provenanceOf(server2, options);
|
|
3944
|
+
floating2 = floatingOf(server2, established.provenance, options.projectRoot);
|
|
3843
3945
|
const { provenance: provenance2, unverified: unverified2, displaced: displaced2 } = established;
|
|
3844
3946
|
const pinned = server2.transport.type === "stdio" ? launchPinned(server2.transport, provenance2) : void 0;
|
|
3845
3947
|
const surface = await captureSurface(pinned ? { ...server2, transport: pinned } : server2, options.timeoutMs ?? DEFAULT_TIMEOUT_MS2);
|
|
3846
3948
|
const entry = buildLockedServer(server2, surface, options.policy);
|
|
3847
3949
|
options.onServerDone?.(server2.name, "captured");
|
|
3848
|
-
return { name: server2.name, entry: provenance2 ? { ...entry, provenance: provenance2 } : entry, unverified: unverified2, displaced: displaced2 };
|
|
3950
|
+
return { name: server2.name, entry: provenance2 ? { ...entry, provenance: provenance2 } : entry, unverified: unverified2, displaced: displaced2, floating: floating2 };
|
|
3849
3951
|
} catch (error) {
|
|
3850
3952
|
options.onServerDone?.(server2.name, "failed");
|
|
3851
3953
|
const reason = boundReason(withoutSecrets(error instanceof UnreachableServerError ? error.message : error.message, server2));
|
|
3852
3954
|
const kind = authFailureKind(error) ?? "unreachable";
|
|
3853
|
-
return { name: server2.name, failure: { server: server2.name, reason, kind }, provenance: established?.provenance, displaced: established?.displaced };
|
|
3955
|
+
return { name: server2.name, failure: { server: server2.name, reason, kind }, provenance: established?.provenance, displaced: established?.displaced, floating: floating2 };
|
|
3854
3956
|
}
|
|
3855
3957
|
});
|
|
3856
3958
|
const subjects = {};
|
|
@@ -3859,8 +3961,10 @@ async function captureAll(options) {
|
|
|
3859
3961
|
const displaced = [];
|
|
3860
3962
|
const unaudited = {};
|
|
3861
3963
|
const unauditedProvenance = {};
|
|
3964
|
+
const floating = [];
|
|
3862
3965
|
const configured = new Map(discovery.servers.map((server2) => [server2.name, server2]));
|
|
3863
3966
|
for (const result of captured) {
|
|
3967
|
+
if (result.floating) floating.push(result.floating);
|
|
3864
3968
|
if ("entry" in result && result.entry) {
|
|
3865
3969
|
setOwn(subjects, result.name, result.entry);
|
|
3866
3970
|
if (result.unverified) unverified.push(result.name);
|
|
@@ -3901,7 +4005,8 @@ async function captureAll(options) {
|
|
|
3901
4005
|
unaudited,
|
|
3902
4006
|
unauditedProvenance,
|
|
3903
4007
|
conflicted: discovery.conflicts.map((conflict) => conflict.name),
|
|
3904
|
-
partial: Object.entries(subjects).filter(([, entry]) => entry.coverage !== void 0).map(([server2, entry]) => ({ server: server2, reasons: entry.coverage.reasons })).sort((a, b) => a.server.localeCompare(b.server))
|
|
4008
|
+
partial: Object.entries(subjects).filter(([, entry]) => entry.coverage !== void 0).map(([server2, entry]) => ({ server: server2, reasons: entry.coverage.reasons })).sort((a, b) => a.server.localeCompare(b.server)),
|
|
4009
|
+
floating: floating.sort((a, b) => a.server.localeCompare(b.server))
|
|
3905
4010
|
};
|
|
3906
4011
|
}
|
|
3907
4012
|
function acknowledged(committed, name, now) {
|
|
@@ -4384,6 +4489,17 @@ function resolveExitCode(options) {
|
|
|
4384
4489
|
return EXIT_CLEAN;
|
|
4385
4490
|
}
|
|
4386
4491
|
|
|
4492
|
+
// src/report/floating.ts
|
|
4493
|
+
function floatingLine(entry) {
|
|
4494
|
+
const instead = entry.exact !== void 0 ? `Write it as ${entry.exact}, which is what runs now.` : entry.ecosystem === "oci" ? `Write it by digest, as ${entry.name}@sha256:<digest>.` : `Write it with an exact version, as ${entry.name}${entry.ecosystem === "pypi" ? "==" : "@"}<version>.`;
|
|
4495
|
+
return visibleControls(
|
|
4496
|
+
`${entry.asked} runs whatever version was published last, so a new release can show up as drift, and fail the build, with no change to the config. ${instead}`
|
|
4497
|
+
);
|
|
4498
|
+
}
|
|
4499
|
+
function floatingNotes(floating) {
|
|
4500
|
+
return floating.map((entry) => `${visibleControls(entry.server)}: ${floatingLine(entry)}`);
|
|
4501
|
+
}
|
|
4502
|
+
|
|
4387
4503
|
// src/report/human.ts
|
|
4388
4504
|
var MARK = {
|
|
4389
4505
|
high: red,
|
|
@@ -4478,6 +4594,12 @@ function renderHumanReport(report) {
|
|
|
4478
4594
|
""
|
|
4479
4595
|
);
|
|
4480
4596
|
}
|
|
4597
|
+
const floating = report.floating ?? [];
|
|
4598
|
+
if (floating.length > 0) {
|
|
4599
|
+
lines.push(yellow(`${floating.length} server(s) name no exact version:`));
|
|
4600
|
+
for (const entry of floating) lines.push(` ${bold(visibleControls(entry.server))}`, ` ${floatingLine(entry)}`);
|
|
4601
|
+
lines.push(dim(" This did not change the verdict."), "");
|
|
4602
|
+
}
|
|
4481
4603
|
const partial = report.partial ?? [];
|
|
4482
4604
|
if (partial.length > 0) {
|
|
4483
4605
|
lines.push(yellow(`Could not read ${partial.length} server(s) in full:`));
|
|
@@ -4618,6 +4740,7 @@ var STEERING_RULE = "steering.passage.arrived";
|
|
|
4618
4740
|
var UNVERIFIED_RULE = "server.artifact.unverified";
|
|
4619
4741
|
var PARTIAL_RULE = "server.surface.partial";
|
|
4620
4742
|
var UNREAD_RULE = "server.surface.unread";
|
|
4743
|
+
var FLOATING_RULE = "server.artifact.floating";
|
|
4621
4744
|
var RULE_HELP = {
|
|
4622
4745
|
"tool.capability.gained": "A tool gained a capability it did not declare before, derived from its name, its argument names and the shape of its schema. The severity is the capability's, not the schema change's: gaining a `command` argument is not the same finding as gaining an optional string.",
|
|
4623
4746
|
"tool.description.changed": "A tool description is injected into the model's context. A change here can carry instructions to the agent and should be read in full, not skimmed.",
|
|
@@ -4625,7 +4748,7 @@ var RULE_HELP = {
|
|
|
4625
4748
|
"tool.behavior.escalated": "The tool now claims a power it did not claim when it was pinned. Annotation defaults are not neutral: removing readOnlyHint is an escalation.",
|
|
4626
4749
|
"tool.input_schema.widened": "The tool accepts input it previously rejected, enlarging what the agent can be induced to send.",
|
|
4627
4750
|
"tool.header_params.changed": "x-mcp-header mirrors an argument's value into an HTTP header, where proxies and other intermediaries can read it.",
|
|
4628
|
-
"server.transport.changed": "The configured name now points at a different command or URL. This is a different server, not a changed one.",
|
|
4751
|
+
"server.transport.changed": "The configured name now points at a different command or URL. This is a different server, not a changed one. When the only difference is that the command now names an exact release of the same package, the result is a note, and what that release changed is reported beside it.",
|
|
4629
4752
|
"server.identity.changed": "The server reports a different identity or version than the one that was reviewed.",
|
|
4630
4753
|
"server.artifact.changed": "The package, image or file behind this server is a different release than the one pinned. When the declared surface did not change, nothing else in the report describes what the new code does; read the release, not just this diff.",
|
|
4631
4754
|
"server.artifact.substituted": "The same published version now has different contents. Registries treat a version as immutable, so this means a mirror, proxy or registry served different bytes, or an image tag was repointed. Treat it as a supply-chain incident until shown otherwise."
|
|
@@ -4646,6 +4769,7 @@ function renderSarifReport(report, options = {}) {
|
|
|
4646
4769
|
const unverified = report.unverified ?? [];
|
|
4647
4770
|
const partial = report.partial ?? [];
|
|
4648
4771
|
const unread = report.unreachable;
|
|
4772
|
+
const floating = report.floating ?? [];
|
|
4649
4773
|
const at = (name, qualified) => [
|
|
4650
4774
|
{
|
|
4651
4775
|
physicalLocation: { artifactLocation: { uri: sarifUri(report), uriBaseId: "%SRCROOT%" } },
|
|
@@ -4687,6 +4811,13 @@ function renderSarifReport(report, options = {}) {
|
|
|
4687
4811
|
shortDescription: { text: "What a server runs could not be checked" },
|
|
4688
4812
|
fullDescription: { text: "The server answered and its declared surface was compared, but the artifact behind it could not be established on this run: a registry that did not answer, or a launcher configured to fetch from somewhere the pin does not describe. It does not affect the exit code." },
|
|
4689
4813
|
defaultConfiguration: { level: "note" }
|
|
4814
|
+
}] : [],
|
|
4815
|
+
...floating.length > 0 ? [{
|
|
4816
|
+
id: FLOATING_RULE,
|
|
4817
|
+
name: "ServerArtifactFloating",
|
|
4818
|
+
shortDescription: { text: "A server configured with no exact version" },
|
|
4819
|
+
fullDescription: { text: "The configuration names a package with no version, a dist-tag or a range, or an image with no tag or the latest tag, so the server runs whatever was published last and a new release shows up as drift with no change to the configuration. Name an exact version, or an image digest. It does not affect the exit code." },
|
|
4820
|
+
defaultConfiguration: { level: "note" }
|
|
4690
4821
|
}] : []
|
|
4691
4822
|
];
|
|
4692
4823
|
const document = {
|
|
@@ -4756,6 +4887,13 @@ function renderSarifReport(report, options = {}) {
|
|
|
4756
4887
|
message: { text: `${server2}: what this server runs could not be checked on this run` },
|
|
4757
4888
|
locations: at(server2, server2),
|
|
4758
4889
|
partialFingerprints: { "mcpAuditChange/v1": `${server2}/unverified` }
|
|
4890
|
+
})),
|
|
4891
|
+
...floating.map((entry) => ({
|
|
4892
|
+
ruleId: FLOATING_RULE,
|
|
4893
|
+
level: "note",
|
|
4894
|
+
message: { text: `${entry.server}: ${floatingLine(entry)}` },
|
|
4895
|
+
locations: at(entry.server, entry.server),
|
|
4896
|
+
partialFingerprints: { "mcpAuditChange/v1": `${entry.server}/floating` }
|
|
4759
4897
|
}))
|
|
4760
4898
|
]
|
|
4761
4899
|
}
|
|
@@ -5095,6 +5233,8 @@ async function buildReport(options) {
|
|
|
5095
5233
|
unreachable: result.unreachable,
|
|
5096
5234
|
// Reported beside the verdict and never part of it; see `AuditReport.unverified`.
|
|
5097
5235
|
unverified: result.unverified,
|
|
5236
|
+
// Advice beside the verdict, like `unverified`: why the drift keeps coming, not more of it.
|
|
5237
|
+
floating: result.floating,
|
|
5098
5238
|
partial: result.partial,
|
|
5099
5239
|
serversChecked: Object.keys(result.lock.subjects).length,
|
|
5100
5240
|
lockPath: options.lockPath,
|
|
@@ -5294,6 +5434,11 @@ async function runInit(options) {
|
|
|
5294
5434
|
const unaudited = options.allowUnreachable ? unauditedToRecord(result) : void 0;
|
|
5295
5435
|
if (pinnedSomething) await writeLockfile(options.lockPath, unaudited ? { ...result.lock, unaudited } : result.lock);
|
|
5296
5436
|
const lines = pinnedSomething ? ["", bold(`Pinned ${names.length} server(s) to ${options.lockPath}:`), ""] : ["", bold("Pinned nothing: no server answered."), ""];
|
|
5437
|
+
const floating = new Map(result.floating.map((entry) => [entry.server, entry]));
|
|
5438
|
+
const floatingNote = (name) => {
|
|
5439
|
+
const entry = floating.get(name);
|
|
5440
|
+
return entry ? [` ${yellow(floatingLine(entry))}`] : [];
|
|
5441
|
+
};
|
|
5297
5442
|
for (const name of names) {
|
|
5298
5443
|
const entry = result.lock.subjects[name];
|
|
5299
5444
|
const counts = [
|
|
@@ -5307,6 +5452,7 @@ async function runInit(options) {
|
|
|
5307
5452
|
lines.push(` ${dim(visibleControls(`${entry?.protocol.era}/${entry?.protocol.version} \xB7 from ${entry?.source.file}${deprecated}`))}`);
|
|
5308
5453
|
const redacted = entry ? countRedacted(entry.transport) : 0;
|
|
5309
5454
|
if (redacted > 0) lines.push(` ${yellow(redactedLine(redacted))}`);
|
|
5455
|
+
lines.push(...floatingNote(name));
|
|
5310
5456
|
const tools = entry?.tools ?? [];
|
|
5311
5457
|
const capabilities = surfaceCapabilities(tools);
|
|
5312
5458
|
if (capabilities.length > 0) {
|
|
@@ -5341,6 +5487,7 @@ async function runInit(options) {
|
|
|
5341
5487
|
}
|
|
5342
5488
|
for (const failure of result.unreachable) {
|
|
5343
5489
|
lines.push(` ${red("\u2717")} ${bold(visibleControls(failure.server))} ${dim("not pinned")}`, ` ${visibleLines(failure.reason, " ")}`);
|
|
5490
|
+
lines.push(...floatingNote(failure.server));
|
|
5344
5491
|
}
|
|
5345
5492
|
const unagreeable = Object.keys(result.unaudited).filter((name) => options.allowUnreachable && !Object.hasOwn(unaudited ?? {}, name));
|
|
5346
5493
|
if (unagreeable.length > 0) {
|
|
@@ -5835,6 +5982,8 @@ async function runPush(options) {
|
|
|
5835
5982
|
userConfigs: options.userConfigs
|
|
5836
5983
|
});
|
|
5837
5984
|
for (const note of redactedNotes(result.lock)) process.stderr.write(`${yellow("note:")} ${note}
|
|
5985
|
+
`);
|
|
5986
|
+
for (const note of floatingNotes(result.floating)) process.stderr.write(`${yellow("note:")} ${note}
|
|
5838
5987
|
`);
|
|
5839
5988
|
if (Object.keys(result.lock.subjects).length === 0 && result.unreachable.length === 0) {
|
|
5840
5989
|
const looked = result.discovery.filesRead.length > 0 ? result.discovery.filesRead.join(", ") : "no client config files exist for this project";
|