vantage-peers-mcp 5.0.1 → 5.0.2

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
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.0.2] — 2026-11-24
6
+
7
+ A patch release. Tool inputs and outputs are unchanged. Each entry names the product it concerns.
8
+
9
+ ### Fixed
10
+
11
+ - Cloud and Self-host: `next_task` works for a master-scope caller. Such a caller got `RBAC_DENIED` (`claimless-service-account`) because it resolves no organisation and sent no claim. A master caller with a verified agent ID now sends that agent (`verifiedActor`), and the backend judges it as an agent of the operator organisation. An organisation seat still sends its organisation only and is still refused for another organisation's assignee. A Clerk session sends no claim. A master caller with no agent ID is still refused. `get_tool_usage` and `get_owner_tool_usage` are unchanged here: their backend doors do not yet accept an agent claim. ([Tool inputs and outputs](README.md#tool-inputs-and-outputs))
12
+ - Self-host: no backend change. The required backend contract stays 29 with 153 called functions. ([Backend compatibility check](README.md#backend-compatibility-check))
13
+
5
14
  ## [5.0.1] — 2026-11-24
6
15
 
7
16
  A patch release. Tool inputs are unchanged, and so are the outputs for a backend that answers its contract. Each entry names the product it concerns.
package/README.md CHANGED
@@ -407,6 +407,13 @@ So upgrade in this order: deploy the backend of the same release first, then upg
407
407
 
408
408
  ## Release notes
409
409
 
410
+ ### 5.0.2
411
+
412
+ _Applies to: Cloud and Self-host._ A patch release: tool inputs and outputs are unchanged.
413
+
414
+ - Cloud and Self-host: `next_task` serves a master-scope caller that has a verified agent ID. That caller now sends the agent as its claim; organisation seats are unchanged (see [Tool inputs and outputs](#tool-inputs-and-outputs)).
415
+ - Self-host: no backend change; contract 29, 153 called functions (see [Backend compatibility check](#backend-compatibility-check)).
416
+
410
417
  ### 5.0.1
411
418
 
412
419
  _Applies to: Cloud and Self-host._ A patch release: tool inputs are unchanged, and so are the outputs for a backend that answers its contract.
package/dist/src/auth.js CHANGED
@@ -421,7 +421,9 @@ export function resolveSeatOrg(ctx) {
421
421
  // (`oauth:getAccessTokenByHash`), never from an argument. Forwarded so the
422
422
  // Convex door keys the seat by ID, not by the reusable label. Only the token
423
423
  // path carries it; an agent-credential-only seat forwards the label alone.
424
- const orgClerkId = fromToken !== undefined && ctx.orgClerkId !== undefined && ctx.orgClerkId !== ""
424
+ const orgClerkId = fromToken !== undefined &&
425
+ ctx.orgClerkId !== undefined &&
426
+ ctx.orgClerkId !== ""
425
427
  ? ctx.orgClerkId
426
428
  : undefined;
427
429
  return {
@@ -277,7 +277,9 @@ async function checkPrClaims(text, deps, warn) {
277
277
  const matches = [];
278
278
  for (const line of text.split("\n")) {
279
279
  const explicit = [...line.matchAll(PR_CLAIM_RE)];
280
- matches.push(...(explicit.length > 0 ? explicit : [...line.matchAll(GH_PR_CMD_CLAIM_RE)]));
280
+ matches.push(...(explicit.length > 0
281
+ ? explicit
282
+ : [...line.matchAll(GH_PR_CMD_CLAIM_RE)]));
281
283
  }
282
284
  for (const m of matches) {
283
285
  const [, number, repoInClaim, typedStateRaw] = m;
@@ -436,13 +438,15 @@ export async function guardFreshState(content, deps) {
436
438
  return;
437
439
  if (OVERRIDE_RE.test(content))
438
440
  return;
439
- const warn = deps.warn ?? ((message) => console.warn(`[fresh-state-guard] ${message}`));
441
+ const warn = deps.warn ??
442
+ ((message) => console.warn(`[fresh-state-guard] ${message}`));
440
443
  const scope = evidenceScope(content);
441
444
  if (!scope.trim())
442
445
  return;
443
446
  // Bare-literal check, before any network call: a refusal that needs no
444
447
  // live read cannot be turned into a pass by an unreachable registry.
445
- const log = deps.log ?? ((message) => console.error(`[fresh-state-guard] ${message}`));
448
+ const log = deps.log ??
449
+ ((message) => console.error(`[fresh-state-guard] ${message}`));
446
450
  const lines = scope.split("\n");
447
451
  let firstBare;
448
452
  let any = false;
package/dist/src/tools.js CHANGED
@@ -5630,7 +5630,7 @@ options) {
5630
5630
  // ── next_task ───────────────────────────────────────────────────────────────
5631
5631
  defineTool(server, authCtx, {
5632
5632
  kind: "filtered",
5633
- reason: "tenant applied INSIDE the Convex read: doorScopeArgs() forwards verifiedOrg on every call to tasks:nextForAssignee and unresolvedOrgDenial() refuses a bearer with none; tasks:nextForAssignee receives verifiedOrg (always) and no verifiedActor (the door admits an actor only from the operator organisation), resolves the assignee in that organisation only and serves the caller's visible tasks; a bearer whose organisation cannot be resolved is refused before any read (task k176p84j83gac7reyycweacyb58jvtxg)",
5633
+ reason: "tenant applied INSIDE the Convex read: doorScopeArgs() forwards verifiedOrg on every call to tasks:nextForAssignee for a bearer that resolves an organisation, and unresolvedOrgDenial() refuses a non-master bearer with none; the fleet master, which resolves no organisation, is admitted by its verified agent ID instead: withVerifiedActor forwards verifiedActor (MASTER_ACTOR_CLAIM_DOORS) only for a master scope and only when no verifiedOrg rides the call, so the door judges it as an operator-organisation agent, and a master with no agent ID forwards no claim and is refused by the door (claimless-service-account); a client-organisation seat is never sent an actor; the door resolves the assignee in the claimed organisation only and serves the caller's visible tasks (tasks k176p84j83gac7reyycweacyb58jvtxg, k178q6x954qeh4mxh0b4x6sss98jtarn)",
5634
5634
  }, "next_task", "Get the one task an agent should take next: among its todo tasks you may see, the first in queue order (ranked tasks by rank, then unranked by priority and age) whose dependencies are all done. " +
5635
5635
  "Name the agent by assignedToAgentId (its agentId, as list_peers returns it) or by assignedTo (its name); one of the two is required. " +
5636
5636
  "Returns { found, task?{ _id, _creationTime, title, description?, status, priority, assignedTo, missionId?, queueRank? }, message? }: found is true with the task, or false with a message saying no task is pickable (an empty answer is stated, never silent). " +
@@ -5660,8 +5660,10 @@ options) {
5660
5660
  return mcpError("QUEUE_ASSIGNEE_REQUIRED: name the assignee: assignedTo (a name) or assignedToAgentId (an agent ID)");
5661
5661
  }
5662
5662
  // The organisation is forwarded on EVERY call (doorScopeArgs, verifiedOrg
5663
- // always): without it the backend would resolve the caller as the fleet
5664
- // master. A bearer with no resolvable organisation is refused here.
5663
+ // always for a bearer that resolves one): without it the backend would resolve
5664
+ // the caller as the fleet master. A non-master bearer with no resolvable
5665
+ // organisation is refused here; the master is claimed by its verified agent ID
5666
+ // (withVerifiedActor, MASTER_ACTOR_CLAIM_DOORS), never by a verifiedOrg.
5665
5667
  const orgDenied = unresolvedOrgDenial("next_task");
5666
5668
  if (orgDenied)
5667
5669
  return orgDenied;
@@ -17,13 +17,28 @@
17
17
  // Pattern: Estimated: N or Estimated N ... // allow-time-estimate: pattern-definition-file
18
18
  const ESTIMATE_PATTERNS = [
19
19
  { re: /estimated?\s*:?\s*[~\d]/i, idx: 0 }, // allow-time-estimate: pattern-definition-file
20
- { re: /\b\d+\s*[-à]\s*\d+\s*(jour|jours|heure|heures|h|min|mn|mins|minutes|heures?|hours?)\b/i, idx: 1 }, // allow-time-estimate: pattern-definition-file
21
- { re: /~\s*\d+\s*\.?\d*\s*(min|mn|mins|minute|minutes|h|hour|hours|jour|jours|heure|heures|day|days)\b/i, idx: 2 }, // allow-time-estimate: pattern-definition-file
22
- { re: /\b\d+\s*\.?\d*\s*(min|mn|h|jour|jours|heure|heures|hour|hours|day|days)\s+(max|env|environ|approx|approximately)\b/i, idx: 3 }, // allow-time-estimate: pattern-definition-file
20
+ {
21
+ re: /\b\d+\s*[-à]\s*\d+\s*(jour|jours|heure|heures|h|min|mn|mins|minutes|heures?|hours?)\b/i,
22
+ idx: 1,
23
+ }, // allow-time-estimate: pattern-definition-file
24
+ {
25
+ re: /~\s*\d+\s*\.?\d*\s*(min|mn|mins|minute|minutes|h|hour|hours|jour|jours|heure|heures|day|days)\b/i,
26
+ idx: 2,
27
+ }, // allow-time-estimate: pattern-definition-file
28
+ {
29
+ re: /\b\d+\s*\.?\d*\s*(min|mn|h|jour|jours|heure|heures|hour|hours|day|days)\s+(max|env|environ|approx|approximately)\b/i,
30
+ idx: 3,
31
+ }, // allow-time-estimate: pattern-definition-file
23
32
  { re: /\bETA\s*:?\s*\d/, idx: 4 }, // allow-time-estimate: pattern-definition-file (case-sensitive — Eta proper noun exempted)
24
- { re: /\b\d+\s*\.?\d*\s*(?:min|mn|h|jour|jours|heure|heures|hour|hours|day|days)\s+de\s+(dev|revue|review|test|debug|coding|recherche|research|investigation|setup|implem|impl|implementation)/i, idx: 5 }, // allow-time-estimate: pattern-definition-file
33
+ {
34
+ re: /\b\d+\s*\.?\d*\s*(?:min|mn|h|jour|jours|heure|heures|hour|hours|day|days)\s+de\s+(dev|revue|review|test|debug|coding|recherche|research|investigation|setup|implem|impl|implementation)/i,
35
+ idx: 5,
36
+ }, // allow-time-estimate: pattern-definition-file
25
37
  { re: /^#+\s*estimated?\s*$/im, idx: 6 }, // allow-time-estimate: pattern-definition-file
26
- { re: /\b(?:effort|temps|time|durée|duration)\s*(?:estimé?|estimated?|prévu?|expected?)\s*:?\s*[~\d]/i, idx: 7 }, // allow-time-estimate: pattern-definition-file
38
+ {
39
+ re: /\b(?:effort|temps|time|durée|duration)\s*(?:estimé?|estimated?|prévu?|expected?)\s*:?\s*[~\d]/i,
40
+ idx: 7,
41
+ }, // allow-time-estimate: pattern-definition-file
27
42
  ];
28
43
  // Backward-context exemption for range pattern (idx=1)
29
44
  const RANGE_BACKWARD_CONTEXT_RE = /\b(?:créneau|creneau|window|shift|meeting|réunion|reunion|call|appel|slot|interval|range|history|past|hier|aujourd'hui|today|yesterday|il\s+y\s+a|duré|a\s+pris|took|lasted|spent)\b/i;
@@ -80,7 +80,11 @@ function checkVerificationTests(description, acc) {
80
80
  // ─────────────────────────────────────────────────────────────────────────────
81
81
  // Axis: delegation triplet (hard-block when partial)
82
82
  // ─────────────────────────────────────────────────────────────────────────────
83
- const DELEGATION_KEYS = ["subagent_type", "run_in_background", "model"];
83
+ const DELEGATION_KEYS = [
84
+ "subagent_type",
85
+ "run_in_background",
86
+ "model",
87
+ ];
84
88
  function checkDelegationTriplet(description, acc) {
85
89
  // Skip if [META] tag present (orchestrator meta-tasks exempt from delegation rules)
86
90
  if (/\[META\]/i.test(description))
@@ -302,7 +306,8 @@ function dispatchCompleteTask(payload, acc) {
302
306
  if (noteOk) {
303
307
  checkFriction(note, acc);
304
308
  }
305
- else if (note.trim().length >= 40 && !acc.errors.some((e) => e.field === "completionNote.evidence")) {
309
+ else if (note.trim().length >= 40 &&
310
+ !acc.errors.some((e) => e.field === "completionNote.evidence")) {
306
311
  checkFriction(note, acc);
307
312
  }
308
313
  }
@@ -15,6 +15,18 @@ export declare const VERIFIED_ACTOR_DOORS: ReadonlySet<string>;
15
15
  * its own rows (task k17a388w6d0cxmyw8gfk5tryp18hvw2k).
16
16
  */
17
17
  export declare const MASTER_UNNARROWED_DOORS: ReadonlySet<string>;
18
+ /**
19
+ * Doors that admit a `verifiedActor` ONLY from the operator organisation
20
+ * (requireFleetAgentActor behind requireClaimedCaller) and take the organisation of
21
+ * every other caller as `verifiedOrg` (doorScope). The actor is the claim of the
22
+ * caller that has NO `verifiedOrg`: the fleet master, whose bearer resolves no
23
+ * organisation, so the door would otherwise refuse it as a claimless service account
24
+ * (RBAC_DENIED claimless-service-account). It is forwarded for a master scope only,
25
+ * and only when no `verifiedOrg` rides the call, so a client-organisation seat (served
26
+ * by verifiedOrg) is never sent an actor the door would refuse, and the two claims
27
+ * never travel together. Every door here is pinned in test/next-task-claim.test.ts.
28
+ */
29
+ export declare const MASTER_ACTOR_CLAIM_DOORS: ReadonlySet<string>;
18
30
  export type VerifiedActorArg = {
19
31
  agentId: string;
20
32
  orgSlug: string;
@@ -37,10 +37,7 @@ export const VERIFIED_ACTOR_DOORS = new Set([
37
37
  "tasks:checkout",
38
38
  "tasks:deleteTask",
39
39
  "tasks:blockTask",
40
- // The queue write door: the caller is judged by its verified agent ID. tasks:nextForAssignee is
41
- // deliberately NOT here: it admits a verifiedActor only as an agent of the operator
42
- // organisation (requireFleetAgentActor), so a client-organisation seat is served by
43
- // verifiedOrg alone (doorScope), never refused for carrying an actor.
40
+ // The queue write door: the caller is judged by its verified agent ID.
44
41
  "tasks:reorderQueue",
45
42
  "tasks:bulkComplete",
46
43
  // The briefing-note doors (module M10c): the author of a note, and the editor
@@ -127,6 +124,20 @@ export const VERIFIED_ACTOR_DOORS = new Set([
127
124
  export const MASTER_UNNARROWED_DOORS = new Set([
128
125
  "fixPatterns:get",
129
126
  ]);
127
+ /**
128
+ * Doors that admit a `verifiedActor` ONLY from the operator organisation
129
+ * (requireFleetAgentActor behind requireClaimedCaller) and take the organisation of
130
+ * every other caller as `verifiedOrg` (doorScope). The actor is the claim of the
131
+ * caller that has NO `verifiedOrg`: the fleet master, whose bearer resolves no
132
+ * organisation, so the door would otherwise refuse it as a claimless service account
133
+ * (RBAC_DENIED claimless-service-account). It is forwarded for a master scope only,
134
+ * and only when no `verifiedOrg` rides the call, so a client-organisation seat (served
135
+ * by verifiedOrg) is never sent an actor the door would refuse, and the two claims
136
+ * never travel together. Every door here is pinned in test/next-task-claim.test.ts.
137
+ */
138
+ export const MASTER_ACTOR_CLAIM_DOORS = new Set([
139
+ "tasks:nextForAssignee",
140
+ ]);
130
141
  /**
131
142
  * The acting agent's ID and org for this request, or undefined.
132
143
  *
@@ -163,7 +174,13 @@ export function withVerifiedActor(convex, ctx) {
163
174
  return convex;
164
175
  const master = isMasterScope(ctx);
165
176
  const forward = (name, args) => {
166
- if (!VERIFIED_ACTOR_DOORS.has(name) ||
177
+ const masterActorClaim = MASTER_ACTOR_CLAIM_DOORS.has(name);
178
+ if ((!VERIFIED_ACTOR_DOORS.has(name) && !masterActorClaim) ||
179
+ (masterActorClaim &&
180
+ (!master ||
181
+ typeof args !== "object" ||
182
+ args === null ||
183
+ args.verifiedOrg !== undefined)) ||
167
184
  (master && MASTER_UNNARROWED_DOORS.has(name)) ||
168
185
  typeof args !== "object" ||
169
186
  args === null) {
@@ -71,7 +71,11 @@ export function deriveOpaqueCallerId(ctx, env) {
71
71
  */
72
72
  export function resolveActingAgent(ctx, verified) {
73
73
  if (!ctx) {
74
- return { actor: null, agent_id: null, agent_unresolved_reason: "no-context" };
74
+ return {
75
+ actor: null,
76
+ agent_id: null,
77
+ agent_unresolved_reason: "no-context",
78
+ };
75
79
  }
76
80
  const seat = !ctx.actor && verified !== undefined
77
81
  ? {
@@ -117,7 +121,12 @@ export function resolveActingAgent(ctx, verified) {
117
121
  }
118
122
  export function resolveWhoamiIdentity(ctx, env) {
119
123
  if (!ctx) {
120
- return { caller_id: null, org_slug: null, role: "legacy", acting_name: null };
124
+ return {
125
+ caller_id: null,
126
+ org_slug: null,
127
+ role: "legacy",
128
+ acting_name: null,
129
+ };
121
130
  }
122
131
  let role;
123
132
  if (isMasterScope(ctx))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantage-peers-mcp",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "MCP server for multi-agent teams: persistent memory, agent messaging, time-tracked tasks, missions",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",