loopctl-mcp-server 2.27.0 → 2.29.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.
Files changed (2) hide show
  1. package/index.js +55 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1151,6 +1151,18 @@ async function knowledgeAnalyticsTop({ limit, offset, since_days, access_type }
1151
1151
  return toContent(result);
1152
1152
  }
1153
1153
 
1154
+ async function knowledgeRetrievalMetrics({ limit, offset } = {}) {
1155
+ const params = new URLSearchParams();
1156
+ if (limit != null) params.set("limit", String(limit));
1157
+ if (offset != null) params.set("offset", String(offset));
1158
+ const qs = params.toString();
1159
+ const path = qs
1160
+ ? `/api/v1/knowledge/analytics/retrieval-metrics?${qs}`
1161
+ : "/api/v1/knowledge/analytics/retrieval-metrics";
1162
+ const result = await apiCall("GET", path, null, process.env.LOOPCTL_ORCH_KEY);
1163
+ return toContent(result);
1164
+ }
1165
+
1154
1166
  async function knowledgeArticleStats({ article_id }) {
1155
1167
  const result = await apiCall(
1156
1168
  "GET",
@@ -2467,7 +2479,9 @@ const TOOLS = [
2467
2479
  "a keyword and a semantic sub-search, each capped at 100, so up to ~200), or filtered_set " +
2468
2480
  "(list mode: the full set). Do NOT use a relevance-mode total_count to size the wiki — use " +
2469
2481
  "list mode or knowledge_stats. " +
2470
- "Pass story_id when working on a loopctl story so reads attribute correctly.",
2482
+ "Pass story_id when working on a loopctl story so reads attribute correctly. " +
2483
+ "When you knowledge_get a result and it carries `potential_conflicts`, resolve it if it's " +
2484
+ "material to your task (see knowledge_get / the conflict-resolution wiki playbook).",
2471
2485
  inputSchema: {
2472
2486
  type: "object",
2473
2487
  properties: {
@@ -2520,7 +2534,12 @@ const TOOLS = [
2520
2534
  name: "knowledge_get",
2521
2535
  description:
2522
2536
  "Get full article content by ID. Use after search to read an article in detail. " +
2523
- "Pass story_id when working on a loopctl story so reads attribute correctly.",
2537
+ "Pass story_id when working on a loopctl story so reads attribute correctly. " +
2538
+ "If the response carries a non-empty `potential_conflicts` array AND the conflict is " +
2539
+ "material to your current task, act on it: read the peer, judge redundant/complementary/" +
2540
+ "contradictory against the live system, and knowledge_resolve_conflict (dismiss a false " +
2541
+ "positive, supersede when one clearly wins, merge when both should combine). If you can't " +
2542
+ "tell which is right, leave it. See the 'Resolving knowledge conflicts' wiki playbook.",
2524
2543
  inputSchema: {
2525
2544
  type: "object",
2526
2545
  properties: {
@@ -2957,7 +2976,9 @@ const TOOLS = [
2957
2976
  "the two don't actually conflict; drops out of the queue immediately); 'supersede' " +
2958
2977
  "(one article wins — pass authoritative_article_id, the winner; the nightly executor " +
2959
2978
  "creates a supersedes link and retires the loser, but ONLY at confidence:\"high\" — " +
2960
- "reversible and audited); 'merge' (recorded for the later merge step). Non-destructive " +
2979
+ "reversible and audited); 'merge' (at confidence:\"high\" the nightly executor has an LLM " +
2980
+ "synthesize the two into ONE new DRAFT — both sources preserved, never auto-published, " +
2981
+ "for you/a human to review and publish). Non-destructive " +
2961
2982
  "at agent role — you record intent; the privileged nightly job executes it. " +
2962
2983
  "Last-write-wins per pair, so re-recording with fresher ground truth overrides. " +
2963
2984
  "Resolve only conflicts material to your current task; adjudicate against the actual " +
@@ -2979,7 +3000,8 @@ const TOOLS = [
2979
3000
  enum: ["dismiss", "supersede", "merge"],
2980
3001
  description:
2981
3002
  "dismiss = false positive; supersede = one wins (set authoritative_article_id); " +
2982
- "merge = combine (recorded for the later merge step).",
3003
+ "merge = combine both into one new DRAFT (LLM-synthesized by the nightly executor " +
3004
+ "at high confidence; sources preserved, never auto-published).",
2983
3005
  },
2984
3006
  authoritative_article_id: {
2985
3007
  type: "string",
@@ -3244,6 +3266,32 @@ const TOOLS = [
3244
3266
  },
3245
3267
 
3246
3268
  // Knowledge Analytics Tools (orchestrator key)
3269
+ {
3270
+ name: "knowledge_retrieval_metrics",
3271
+ description:
3272
+ "Return the daily retrieval-PRECISION time series (agents' KB #3): for each day, the " +
3273
+ "share of search results the agent then opened (search → get/context within a window). " +
3274
+ "A proxy for whether retrieval is improving — watch it trend up as the corpus is " +
3275
+ "de-duplicated, better navigated (MOCs), and conflict-resolved. Most recent day first. " +
3276
+ "Requires orchestrator role.",
3277
+ inputSchema: {
3278
+ type: "object",
3279
+ properties: {
3280
+ limit: {
3281
+ type: "integer",
3282
+ description: "Days per page (default 30, max 365). Clamped, never rejected.",
3283
+ minimum: 1,
3284
+ maximum: 365,
3285
+ },
3286
+ offset: {
3287
+ type: "integer",
3288
+ description: "Days to skip. Default 0.",
3289
+ minimum: 0,
3290
+ },
3291
+ },
3292
+ required: [],
3293
+ },
3294
+ },
3247
3295
  {
3248
3296
  name: "knowledge_analytics_top",
3249
3297
  description:
@@ -3660,6 +3708,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
3660
3708
  return await knowledgeIngestionJobs();
3661
3709
 
3662
3710
  // Knowledge Analytics Tools
3711
+ case "knowledge_retrieval_metrics":
3712
+ return await knowledgeRetrievalMetrics(args);
3713
+
3663
3714
  case "knowledge_analytics_top":
3664
3715
  return await knowledgeAnalyticsTop(args);
3665
3716
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopctl-mcp-server",
3
- "version": "2.27.0",
3
+ "version": "2.29.0",
4
4
  "description": "MCP server for loopctl — structural trust for AI development loops",
5
5
  "type": "module",
6
6
  "main": "index.js",