@vantageos/mcp-doctor 0.24.0 → 0.25.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 CHANGED
@@ -4,6 +4,13 @@ All notable changes to `@vantageos/mcp-doctor` are documented here.
4
4
  This project adheres to [Semantic Versioning](https://semver.org/).
5
5
  Unreleased changes live as one fragment per pull request in `changelog.d/`, folded in here at release time.
6
6
 
7
+ ## 0.25.0 — 2026-11-27
8
+
9
+ ### Fixed
10
+ - **S-28 judges a forwarded claim against the door that receives it, and no longer carries a hand-typed claim list.** The detector counted only `verifiedOrg` and `verifiedPerson` as forwarding, so a tool that forwards `verifiedActor` to a door that accepts only `verifiedActor` (vantage-peers `get_profile` to `profiles:getProfile`) was reported as forwarding no claim. A claim now counts when it is one the door accepts, read from the `verified<Name>` keys of that door's own argument validator. The same read ends a second false pass: a fetcher that added a claim cleared every door reached through it, so a fetcher adding `verifiedOrg` cleared `missions:list` (a door that takes no claim) and `memories:listMemories` (takes `verifiedActor`). Each call through a fetcher is now judged against its own door, and a door the fetcher's claim does not reach is reported with the claim the fetcher adds. Proven on verbatim vantage-peers copies at 85fe5d21 and c335c8a6 (MUST_PASS), and on a copy with the forwarded claim dropped for each kind (org, actor, person: MUST_BLOCK). (README: #states-and-exit-codes)
11
+ - **S-28 no longer exempts the agent claim from the refusal half of the rule.** An optional-helper site (the helper returns `{}` when the bearer holds no claim) was conform for `verifiedActor` on the assumption that every actor door refuses a claimless call itself; the vantage-peers doors `memories:listMemories` and `briefingNotes:update` accept `verifiedActor` and show no branch that refuses the claimless call. Such a site is now judged per door from the door's own source: conform only when the door refuses the claimless SERVICE-ACCOUNT call (the property backend-doctor R-54 measures): a `requireVerified<Name>FromServiceAccount(` call (the family, matched by pattern), or an `if` on the absence of a `verified…` claim whose block throws, read in the door and in the helpers of the tree it calls. `requireResolvedCaller` is not such a refusal: it returns early for the master the service account resolves as, so a door whose only guard is that call (vantage-peers `kbMutations:claimUpload`) is non-conforming. A door that shows neither refusal and calls a function whose body the scan cannot read and whose name says it resolves a caller (Verified, Actor, Caller or Profile) is could-not-judge, naming it (`profiles:getProfile` -> `resolveVerifiedProfileAgent`); a door region that cannot be read is could-not-judge, naming it. Proven on verbatim vantage-peers copies at edab6a79 (`githubRepoMapping:getRoute` and `issueStatsQueries:getLatest` MUST_PASS, `kbMutations:claimUpload` MUST_BLOCK), and on copies with the `requireVerified…FromServiceAccount` call removed and with the throw removed (MUST_BLOCK per form). (README: #states-and-exit-codes)
12
+ - **S-28 no longer reads a tool-side guard that admits the master as a refusal of the claimless service-account call.** A tool that called `unresolvedOrgDenial(...)` before its door call read conform, but that guard returns null for the master (`if (facts.isMaster || facts.hasClerkJwt) return null`), and the service account resolves as master, so the guard refuses nothing the rule is about. The recognised guard names were swept against their vantage-peers bodies: only `requireVerified<Name>FromServiceAccount(` and `requireClaim…(` (`requireClaimedCaller`, which throws for the claimless service account) remain. Proven on the whole `kbIngest.ts` of vantage-peers edab6a79: the `claim_upload` site (`kbMutations:claimUpload`) reads non-conforming. (README: #states-and-exit-codes)
13
+
7
14
  ## 0.24.0 — 2026-11-27
8
15
 
9
16
  ### Fixed
package/README.md CHANGED
@@ -340,7 +340,7 @@ Each detector maps one standard item and is proven **bipolar** on real material:
340
340
  | **D15** cache-coherence | Server Rule 15 — every tool-set mutation (RegisteredTool `.enable/.disable/.update/.remove`, `unregisterTool`) is correlated with a `notifications/tools/list_changed` emission | present / absent / non-conforming / could-not-judge |
341
341
  | **D16** version-observable | Server Rule 16 — `server/discover` (or an HTTP `/health` route) exposes a `version` field sourced from `package.json`, reachable pre-auth; an SDK v2 `new McpServer({ name, version })` carrying a `package.json`-derived version counts (pre-auth reach is the dynamic half) | present / absent / non-conforming / could-not-judge |
342
342
  | **DLocalIdentity** no-local-identity | No MCP server defines its own identity primitive: resolving a caller to a tenant or agent (local JWT verify, a populated allow-list attached to a bearer), asserting org membership or role, filtering rows by caller scope (`fromAllowList`, a name allow-list, a row's `orgId` or acting-name field such as `createdBy` / `assignedTo` compared to the caller's, by `===`, `==`, `Object.is` or after `toLowerCase()`), or validating a credential (local `timingSafeEqual`, a digest of a presented value, HMAC; a hash over a static literal, or over local content — file bytes, a directory listing, a digest of them, i.e. a content fingerprint of the built tree — is not a site). A call to a binding imported from `@vantageos/cloud-identity` is not a site. Minting/signing sites (`new SignJWT`, `jwt.sign`, a private-key import) are listed as `MINTING/SIGNING` and not counted; verification and claim reads stay violations whoever issued the token (no issuer carve-out). | present (0, or EXEMPT) / non-conforming (count > ceiling, default 0) / could-not-judge |
343
- | **S-28** claim-forwarded | Server complement S-28 (standard `bacc54a`) — a tool forwards the verified claim of its caller (`verifiedOrg` / `verifiedPerson`) to every backend door it calls and refuses when it holds none. Reads each `<client>.query\|mutation\|action` call, the helpers it spreads, the refusal before it, and the backend source's door list (`--backend=<convex-dir>`, else the nearest `convex/` above the tree). A door that is service-account-only or declared `fleet-wide:` needs no claim; no backend found, an unknown door, a computed door name are could-not-judge. | present / non-conforming / could-not-judge / absent (no Convex client imported) |
343
+ | **S-28** claim-forwarded | Server complement S-28 (standard `bacc54a`) — a tool forwards the verified claim of its caller (`verifiedOrg` / `verifiedPerson`) to every backend door it calls and refuses when it holds none. Reads each `<client>.query\|mutation\|action` call, the helpers it spreads, the refusal before it, and the backend source's door list (`--backend=<convex-dir>`, else the nearest `convex/` above the tree). An optional-helper site with no refusal in the tool is conform only when the door refuses the claimless service-account call (`requireVerified<Name>FromServiceAccount(`, or a throw on the absence of a claim; `requireResolvedCaller` does not count); a door showing neither is non-conforming, or could-not-judge naming an unreadable caller-resolving helper. A door that is service-account-only or declared `fleet-wide:` needs no claim; no backend found, an unknown door, a computed door name are could-not-judge. | present / non-conforming / could-not-judge / absent (no Convex client imported) |
344
344
 
345
345
  ### Detectors without a row in the release tables (back-filled)
346
346
 
package/dist/doctor.js CHANGED
@@ -25998,11 +25998,98 @@ function importsConvex(m, raw) {
25998
25998
 
25999
25999
  // src/detectors/s28-claim-forwarded.ts
26000
26000
  var PIN11 = STANDARD_PIN;
26001
- var CLAIM_TOKEN = /\bverified(?:Org|Person)\b/;
26002
- var ANY_CLAIM = /\bverified(?:Actor|Org|Person)\b/g;
26001
+ var CLAIM_NAME = /\bverified[A-Z][a-z]+\b/g;
26002
+ var CLAIM_KEY = /\b(verified[A-Z][a-z]+)\s*\??\s*:\s*(?:v\s*\.\s*optional\s*\(\s*)?(v\s*\.\s*(?:string|number|float64|boolean|int64|bigint|literal|id|null|bytes|array)\b)?/g;
26003
+ function claimsIn(text) {
26004
+ return new Set(text.match(CLAIM_NAME) ?? []);
26005
+ }
26003
26006
  var CALL_RE2 = /\b([A-Za-z_$][\w$]*)\s*\.\s*(query|mutation|action)\s*\(/g;
26004
- var GUARD_RE = /\b(?:unresolved\w*Denial|requireVerified\w+|requireClaim\w*)\s*\(|verified-org-unresolved/;
26007
+ var GUARD_RE = /\b(?:requireVerified[A-Z][A-Za-z]*FromServiceAccount|requireClaim\w*)\s*\(/;
26005
26008
  var FLEET_WIDE = /fleet-wide:\s*\S[^\n]{7,}/;
26009
+ var REFUSAL_CALL = /\brequireVerified[A-Z][A-Za-z]*FromServiceAccount\s*\(/;
26010
+ var CLAIM_ABSENT_IF = /\bif\s*\(\s*(?:!\s*(?:\w+\s*\.\s*)?verified[A-Z][a-z]+\b|(?:\w+\s*\.\s*)?verified[A-Z][a-z]+\s*(?:===|==)\s*(?:undefined|null)\b)\s*\)/g;
26011
+ var HELPER_NAME_SHAPE = /Verified|Actor|Caller|Profile/;
26012
+ var NOT_A_CALL = /* @__PURE__ */ new Set([
26013
+ "if",
26014
+ "for",
26015
+ "while",
26016
+ "switch",
26017
+ "catch",
26018
+ "function",
26019
+ "return",
26020
+ "typeof",
26021
+ "await",
26022
+ "new",
26023
+ "super",
26024
+ "query",
26025
+ "mutation",
26026
+ "action",
26027
+ "v"
26028
+ ]);
26029
+ function refusesIn(region) {
26030
+ if (REFUSAL_CALL.test(region)) return true;
26031
+ for (const hit of region.matchAll(CLAIM_ABSENT_IF)) {
26032
+ const after = hit.index + hit[0].length;
26033
+ const rest = region.slice(after);
26034
+ const brace = /^\s*\{/.exec(rest);
26035
+ const body = brace ? region.slice(after, matchClose2(region, after + brace[0].length - 1) + 1) : rest.slice(0, rest.indexOf(";") + 1);
26036
+ if (/\bthrow\b/.test(body)) return true;
26037
+ }
26038
+ return false;
26039
+ }
26040
+ function functionBodies(m) {
26041
+ const out = /* @__PURE__ */ new Map();
26042
+ const add = (name, body) => out.set(name, [...out.get(name) ?? [], body]);
26043
+ for (const hit of m.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/g)) {
26044
+ const open = hit.index + hit[0].length - 1;
26045
+ const close2 = matchClose2(m, open);
26046
+ if (close2 < 0) continue;
26047
+ let i = close2 + 1;
26048
+ let angle = 0;
26049
+ for (; i < m.length; i++) {
26050
+ const ch = m[i];
26051
+ if (ch === "<") angle++;
26052
+ else if (ch === ">") angle--;
26053
+ else if (ch === "{" && angle <= 0) break;
26054
+ else if (ch === ";" && angle <= 0) {
26055
+ i = m.length;
26056
+ break;
26057
+ }
26058
+ }
26059
+ const end = i < m.length ? matchClose2(m, i) : -1;
26060
+ if (end > 0) add(hit[1], m.slice(close2 + 1, end + 1));
26061
+ }
26062
+ for (const hit of m.matchAll(
26063
+ /\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]*)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]*?)?=>\s*/g
26064
+ )) {
26065
+ const at = hit.index + hit[0].length;
26066
+ if (m[at] === "{") {
26067
+ const end = matchClose2(m, at);
26068
+ if (end > 0) add(hit[1], m.slice(at, end + 1));
26069
+ } else add(hit[1], m.slice(at, m.indexOf(";", at) < 0 ? m.length : m.indexOf(";", at)));
26070
+ }
26071
+ return out;
26072
+ }
26073
+ function judgeRefusal(mRegion, defs) {
26074
+ const unfollowed = /* @__PURE__ */ new Set();
26075
+ const seen = /* @__PURE__ */ new Set();
26076
+ let refuses = false;
26077
+ const visit = (region, depth) => {
26078
+ if (refusesIn(region)) refuses = true;
26079
+ for (const c of region.matchAll(/(?<![.\w$])([A-Za-z_$][\w$]*)\s*\(/g)) {
26080
+ const name = c[1];
26081
+ if (NOT_A_CALL.has(name) || seen.has(name)) continue;
26082
+ seen.add(name);
26083
+ const bodies = defs.get(name);
26084
+ if (bodies === void 0) {
26085
+ if (depth === 0 && HELPER_NAME_SHAPE.test(name)) unfollowed.add(name);
26086
+ } else if (depth < 6) for (const b of bodies) visit(b, depth + 1);
26087
+ else if (depth === 0) unfollowed.add(name);
26088
+ }
26089
+ };
26090
+ visit(mRegion, 0);
26091
+ return { refuses, unfollowed: [...unfollowed].sort() };
26092
+ }
26006
26093
  var SCOPE_MARKERS = /\bwithOrgScope\b|\brequireAuthenticatedCaller\b|\bresolveInboxReader\b|\bresolveVerified\w*\b|\brequireScope\b|\bgetUserIdentity\b|\bisMaster\b|\bscope\b/;
26007
26094
  var ACTOR_SET_RE = /\bconst\s+(VERIFIED_\w*DOORS)\b[^=]*=\s*new\s+Set\s*(?:<[^>]*>)?\s*\(\s*\[([\s\S]*?)\]\s*\)/;
26008
26095
  function masked(file) {
@@ -26098,6 +26185,8 @@ function discoverBackend(root) {
26098
26185
  }
26099
26186
  function readDoors(backendRoot, unread2) {
26100
26187
  const doors = /* @__PURE__ */ new Map();
26188
+ const read = [];
26189
+ const defs = /* @__PURE__ */ new Map();
26101
26190
  for (const path of listTs(backendRoot, unread2)) {
26102
26191
  let text;
26103
26192
  try {
@@ -26112,12 +26201,22 @@ function readDoors(backendRoot, unread2) {
26112
26201
  lines: text.split("\n").map((raw, i) => ({ n: i + 1, raw, comment: false }))
26113
26202
  };
26114
26203
  const m = masked(file);
26204
+ read.push({ path, text, m });
26205
+ for (const [name, bodies] of functionBodies(m))
26206
+ defs.set(name, [...defs.get(name) ?? [], ...bodies]);
26207
+ }
26208
+ for (const { path, text, m } of read) {
26115
26209
  const module = relative15(backendRoot, path).replace(/\.ts$/, "").split("\\").join("/");
26116
26210
  const re = /\bexport\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*(?:query|mutation|action)\s*\(/g;
26117
26211
  for (let hit = re.exec(m); hit; hit = re.exec(m)) {
26118
26212
  const open = hit.index + hit[0].length - 1;
26119
26213
  const close2 = matchClose2(m, open);
26120
- if (close2 < 0) continue;
26214
+ if (close2 < 0) {
26215
+ unread2.push(
26216
+ `${path}: the region of door ${hit[1]} could not be read (unbalanced delimiters)`
26217
+ );
26218
+ continue;
26219
+ }
26121
26220
  let start = hit.index;
26122
26221
  const lines2 = text.slice(0, start).split("\n");
26123
26222
  let k = lines2.length - 2;
@@ -26131,7 +26230,7 @@ function readDoors(backendRoot, unread2) {
26131
26230
  if (am) {
26132
26231
  const at = hit.index + am.index + am[0].length;
26133
26232
  let argsText = "";
26134
- if (m[at] === "{") argsText = text.slice(at, matchClose2(m, at) + 1);
26233
+ if (m[at] === "{") argsText = m.slice(at, matchClose2(m, at) + 1);
26135
26234
  else {
26136
26235
  const id = /^[A-Za-z_$][\w$]*/.exec(m.slice(at));
26137
26236
  if (id) {
@@ -26139,11 +26238,12 @@ function readDoors(backendRoot, unread2) {
26139
26238
  if (dm) {
26140
26239
  let p = dm.index + dm[0].length;
26141
26240
  if (m.slice(p).startsWith("v.object(")) p += "v.object(".length;
26142
- if (m[p] === "{") argsText = text.slice(p, matchClose2(m, p) + 1);
26241
+ if (m[p] === "{") argsText = m.slice(p, matchClose2(m, p) + 1);
26143
26242
  }
26144
26243
  }
26145
26244
  }
26146
- for (const c of argsText.match(ANY_CLAIM) ?? []) if (!claims.includes(c)) claims.push(c);
26245
+ for (const c of argsText.matchAll(CLAIM_KEY))
26246
+ if (c[2] === void 0 && !claims.includes(c[1])) claims.push(c[1]);
26147
26247
  }
26148
26248
  let exit;
26149
26249
  if (/\brequireServiceAccount\b/.test(mRegion))
@@ -26156,10 +26256,13 @@ function readDoors(backendRoot, unread2) {
26156
26256
  const fw = FLEET_WIDE.exec(region);
26157
26257
  if (fw) exit = `fleet-wide declaration (${fw[0].slice(11).trim().slice(0, 80)})`;
26158
26258
  }
26259
+ const refusal = judgeRefusal(mRegion, defs);
26159
26260
  doors.set(`${module}:${hit[1]}`, {
26160
26261
  claims,
26161
26262
  exit,
26162
- resolvesCaller: SCOPE_MARKERS.test(mRegion)
26263
+ resolvesCaller: SCOPE_MARKERS.test(mRegion),
26264
+ refusesClaimless: refusal.refuses,
26265
+ unfollowed: refusal.unfollowed
26163
26266
  });
26164
26267
  }
26165
26268
  }
@@ -26190,22 +26293,16 @@ function definitionOf(name, files) {
26190
26293
  return void 0;
26191
26294
  }
26192
26295
  function readHelper(name, files, seen = /* @__PURE__ */ new Set(), depth = 0) {
26193
- if (seen.has(name) || depth > 3) return { forwards: false, optional: false };
26296
+ const none = () => ({ claims: /* @__PURE__ */ new Set(), optional: false });
26297
+ if (seen.has(name) || depth > 3) return none();
26194
26298
  seen.add(name);
26195
26299
  const def = definitionOf(name, files);
26196
- if (!def) return { forwards: false, optional: false };
26197
- let forwards = CLAIM_TOKEN.test(def.mask);
26300
+ if (!def) return none();
26301
+ const claims = claimsIn(def.mask);
26198
26302
  const optional = /:\s*\{\s*\}|return\s*\{\s*\}|\?\?\s*\{\s*\}/.test(def.mask);
26199
- if (!forwards) {
26200
- for (const c of def.mask.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)) {
26201
- const sub = readHelper(c[1], files, seen, depth + 1);
26202
- if (sub.forwards) {
26203
- forwards = true;
26204
- break;
26205
- }
26206
- }
26207
- }
26208
- return { forwards, optional };
26303
+ for (const c of def.mask.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g))
26304
+ for (const k of readHelper(c[1], files, seen, depth + 1).claims) claims.add(k);
26305
+ return { claims, optional };
26209
26306
  }
26210
26307
  var IDENT4 = /^\s*([A-Za-z_$][\w$]*)\s*(?:as\s+[\w$.<>[\]]+\s*)?$/;
26211
26308
  function esc6(name) {
@@ -26342,20 +26439,15 @@ function readFetchers(files, scan, onCall) {
26342
26439
  continue;
26343
26440
  }
26344
26441
  const argText2 = parts[1] ? fr.m.slice(parts[1][0], parts[1][1]) : "";
26345
- let wrapperClaim = CLAIM_TOKEN.test(argText2);
26346
- if (!wrapperClaim) {
26347
- for (const h of argText2.matchAll(/(?:\.\.\.\s*|\b)([A-Za-z_$][\w$]*)\s*(?:\(\s*\))?/g))
26348
- if (h[1] !== first[1] && readHelper(h[1], files).forwards) {
26349
- wrapperClaim = true;
26350
- break;
26351
- }
26352
- }
26442
+ const wrapperClaims = claimsIn(argText2);
26443
+ for (const h of argText2.matchAll(/(?:\.\.\.\s*|\b)([A-Za-z_$][\w$]*)\s*(?:\(\s*\))?/g))
26444
+ if (h[1] !== first[1]) for (const k of readHelper(h[1], files).claims) wrapperClaims.add(k);
26353
26445
  const label2 = toolNameBefore(fr.text, hit.index).name;
26354
26446
  const before = fr.m.slice(Math.max(0, fn.open - 240), fn.open);
26355
26447
  const named = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]*)?=\s*(?:async\s*)?$/.exec(before) ?? /\bfunction\s*\*?\s*([A-Za-z_$][\w$]*)\s*(?:<[^<>]*>)?\s*$/.exec(before);
26356
26448
  const where = `${fr.f.rel}:${lineAt2(fr.text, fn.open)}`;
26357
26449
  const name = named ? named[1] : "(anonymous)";
26358
- const via = { name, where, label: label2, wrapperClaim };
26450
+ const via = { name, where, label: label2, wrapperClaims };
26359
26451
  const cnj = (at, offset, note) => scan.cnj.push({
26360
26452
  file: at.f.rel,
26361
26453
  line: lineAt2(at.text, offset),
@@ -26498,11 +26590,15 @@ function scanS28(tree) {
26498
26590
  const hit = ACTOR_SET_RE.exec(text);
26499
26591
  if (hit) for (const s of hit[2].matchAll(/["'`]([\w/]+:[\w]+)["'`]/g)) actorDoors.add(s[1]);
26500
26592
  }
26593
+ const acceptedBy = (door, forwarded) => {
26594
+ const info = doors?.get(door);
26595
+ return [...forwarded].filter((c) => info === void 0 || info.claims.includes(c));
26596
+ };
26501
26597
  const judge2 = (text, m, at, door, argText2, tool, site) => {
26502
26598
  const region = m.slice(tool.start, at);
26503
26599
  const regionRaw = text.slice(tool.start, at);
26504
26600
  const guard = GUARD_RE.test(region) || GUARD_RE.test(regionRaw);
26505
- let direct = CLAIM_TOKEN.test(argText2);
26601
+ let direct = acceptedBy(door, claimsIn(argText2)).length > 0;
26506
26602
  let viaHelper;
26507
26603
  let virtual = argText2;
26508
26604
  const bare = /^\s*([A-Za-z_$][\w$]*)\s*$/.exec(argText2);
@@ -26514,7 +26610,7 @@ function scanS28(tree) {
26514
26610
  const c = matchClose2(region, region.lastIndexOf("(", o));
26515
26611
  pieces.push(region.slice(o, c < 0 ? o + 400 : c));
26516
26612
  }
26517
- for (const a of region.matchAll(new RegExp(`\\b${v}\\.verified(?:Org|Person|Actor)\\b`, "g")))
26613
+ for (const a of region.matchAll(new RegExp(`\\b${v}\\.verified[A-Z][a-z]+\\b`, "g")))
26518
26614
  pieces.push(a[0]);
26519
26615
  const decl = new RegExp(`\\b(?:const|let)\\s+${v}\\b[^=]*=\\s*\\{`).exec(region);
26520
26616
  if (decl) {
@@ -26523,21 +26619,23 @@ function scanS28(tree) {
26523
26619
  pieces.push(region.slice(o, c < 0 ? o + 600 : c + 1));
26524
26620
  }
26525
26621
  virtual = pieces.join("\n");
26526
- direct = CLAIM_TOKEN.test(virtual);
26622
+ direct = acceptedBy(door, claimsIn(virtual)).length > 0;
26527
26623
  }
26528
26624
  if (!direct) {
26529
26625
  for (const sp of virtual.matchAll(/\.\.\.\s*([A-Za-z_$][\w$]*)/g)) {
26530
26626
  const h = readHelper(sp[1], files);
26531
- if (h.forwards) {
26532
- viaHelper = h;
26627
+ const matched = acceptedBy(door, h.claims);
26628
+ if (matched.length > 0) {
26629
+ viaHelper = { ...h, matched };
26533
26630
  break;
26534
26631
  }
26535
26632
  }
26536
26633
  if (!viaHelper) {
26537
26634
  for (const sp of virtual.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(\s*\)/g)) {
26538
26635
  const h = readHelper(sp[1], files);
26539
- if (h.forwards) {
26540
- viaHelper = h;
26636
+ const matched = acceptedBy(door, h.claims);
26637
+ if (matched.length > 0) {
26638
+ viaHelper = { ...h, matched };
26541
26639
  break;
26542
26640
  }
26543
26641
  }
@@ -26549,11 +26647,32 @@ function scanS28(tree) {
26549
26647
  }
26550
26648
  if (viaHelper) {
26551
26649
  if (viaHelper.optional && !guard) {
26552
- scan.violate.push(
26553
- site(
26554
- "forwards its claim through an optional helper (it returns {} when the bearer holds none) and no refusal precedes the call in the handler: a bearer with no resolvable organisation is sent claimless"
26555
- )
26556
- );
26650
+ const info2 = doors?.get(door);
26651
+ if (!doors || !info2) {
26652
+ scan.cnj.push(
26653
+ site(
26654
+ `forwards its claim through an optional helper with no refusal before the call, and the source of the door ${door} is not available to show whether it refuses a call without the claim (${doors ? `not defined in the supplied backend (${backendRoot})${unreadNote}` : "no backend source found"})`
26655
+ )
26656
+ );
26657
+ } else if (info2.refusesClaimless) {
26658
+ scan.conform.push(
26659
+ site(
26660
+ "forwards the verified claim through an optional helper and the door's own source refuses a call that carries none"
26661
+ )
26662
+ );
26663
+ } else if (info2.unfollowed.length > 0) {
26664
+ scan.cnj.push(
26665
+ site(
26666
+ `forwards its claim through an optional helper with no refusal before the call; the door ${door} shows no refusal of a claimless service-account call in the source this scan read, and it calls ${info2.unfollowed.join(", ")}, which this scan does not read and which could hold the refusal`
26667
+ )
26668
+ );
26669
+ } else {
26670
+ scan.violate.push(
26671
+ site(
26672
+ "forwards its claim through an optional helper (it returns {} when the bearer holds none), no refusal precedes the call in the handler, and the door's own source shows no branch that refuses a call without the claim: a bearer with no resolvable claim is sent claimless and served"
26673
+ )
26674
+ );
26675
+ }
26557
26676
  } else {
26558
26677
  scan.conform.push(
26559
26678
  site(
@@ -26607,13 +26726,17 @@ function scanS28(tree) {
26607
26726
  tool: tool.name ?? via.label,
26608
26727
  note: note + where
26609
26728
  });
26610
- if (via.wrapperClaim) {
26729
+ const added = acceptedBy(door, via.wrapperClaims);
26730
+ if (added.length > 0) {
26611
26731
  scan.conform.push(
26612
- site(`forwards the verified claim: the fetcher ${via.name} adds it to every call`)
26732
+ site(
26733
+ `forwards the verified claim: the fetcher ${via.name} adds ${added.join(", ")}, which this door accepts`
26734
+ )
26613
26735
  );
26614
26736
  return;
26615
26737
  }
26616
- judge2(fr.text, fr.m, at, door, argText2, tool, site);
26738
+ const addedNone = via.wrapperClaims.size > 0 ? `; the fetcher ${via.name} adds ${[...via.wrapperClaims].join(", ")}, none of which this door accepts` : "";
26739
+ judge2(fr.text, fr.m, at, door, argText2, tool, (note) => site(note + addedNone));
26617
26740
  });
26618
26741
  for (const { f, text, m } of files) {
26619
26742
  for (let hit = CALL_RE2.exec(m); hit; hit = CALL_RE2.exec(m)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vantageos/mcp-doctor",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Static MCP conformance checker: audits an MCP server source tree against the MCP 2026-07-28 standard and emits a conformance-diff table (file:line | present | absent | non-conforming | verdict).",
5
5
  "type": "module",
6
6
  "main": "./dist/doctor.js",