@a-company/paradigm 5.3.3 → 5.5.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/dist/mcp.js CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ getDecisionSummary,
4
+ loadDecisions,
5
+ recordDecision
6
+ } from "./chunk-EZ3GOCYC.js";
2
7
  import {
3
8
  addStep,
4
9
  addToolBreadcrumb,
@@ -74,21 +79,18 @@ import {
74
79
  validateProtocol,
75
80
  validatePurposeFile,
76
81
  validateUniversityContent
77
- } from "./chunk-S6MZ2IEX.js";
82
+ } from "./chunk-SU3WDCRR.js";
83
+ import "./chunk-L27I3CPZ.js";
78
84
  import {
79
85
  getWorkLogSummary,
80
86
  loadWorkLogEntries,
81
87
  recordWorkLog
82
88
  } from "./chunk-TAIJOFOE.js";
83
- import {
84
- getDecisionSummary,
85
- loadDecisions,
86
- recordDecision
87
- } from "./chunk-EZ3GOCYC.js";
88
89
  import {
89
90
  getPluginUpdateNotice,
90
91
  schedulePluginUpdateCheck
91
92
  } from "./chunk-MP73YDXF.js";
93
+ import "./chunk-SDDCVUCV.js";
92
94
  import {
93
95
  completeTask,
94
96
  createTask,
@@ -115,6 +117,7 @@ import {
115
117
  emitAndProcess,
116
118
  engageNomination,
117
119
  filterContent,
120
+ getNeverlandMetrics,
118
121
  getNominationStats,
119
122
  init_data_policy_loader,
120
123
  init_event_stream,
@@ -130,15 +133,16 @@ import {
130
133
  queryEvents,
131
134
  resolveDebate,
132
135
  searchNotebooks
133
- } from "./chunk-GGMI6C2L.js";
136
+ } from "./chunk-B2RC3HEB.js";
134
137
  import {
135
138
  buildProfileEnrichment,
136
139
  init_agent_loader,
137
140
  loadAgentProfile,
138
141
  loadAllAgentProfiles,
139
142
  queryExpertise,
143
+ saveAgentProfile,
140
144
  verifyIntegrity
141
- } from "./chunk-A2L4TSLZ.js";
145
+ } from "./chunk-ITPJJIHG.js";
142
146
  import {
143
147
  getJournalStats,
144
148
  init_journal_loader,
@@ -154,7 +158,6 @@ import {
154
158
  TimelineBuilder,
155
159
  loadAllSeedPatterns
156
160
  } from "./chunk-ZDHLG5VP.js";
157
- import "./chunk-L27I3CPZ.js";
158
161
  import {
159
162
  __esm,
160
163
  __export,
@@ -2247,35 +2250,108 @@ paradigm_flows_affected({ symbol: "#tasks" })
2247
2250
  \`\`\``
2248
2251
  },
2249
2252
  "orchestration": {
2250
- description: "Multi-agent orchestration \u2014 team commands, agent suggestions, faceted/solo modes",
2251
- generate: () => `# Multi-Agent Orchestration
2253
+ description: "Maestro team orchestration \u2014 attributed responses, ambient context, learning loop, bench/activate, documentor agent",
2254
+ generate: () => `# Maestro Team Orchestration
2252
2255
 
2253
- Paradigm supports multi-agent orchestration via \`paradigm team\` commands.
2256
+ The Maestro model: the active Claude Code session orchestrates domain-specific subagents, makes their contributions visible as distinct attributed messages, and learns from feedback to improve agent performance over time.
2254
2257
 
2255
- ## Commands
2258
+ ## How Maestro Works
2256
2259
 
2257
- | Command | Description |
2258
- |---------|-------------|
2259
- | \`paradigm team spawn <agent> --task "..."\` | Spawn a single agent |
2260
- | \`paradigm team orchestrate "task"\` | AI orchestrator coordinates agents |
2261
- | \`paradigm team orchestrate "task" --solo\` | Single Claude mode (no splitting) |
2262
- | \`paradigm team orchestrate "task" --compare\` | A/B test solo vs faceted |
2263
- | \`paradigm team agents suggest "task"\` | Suggest agents based on task triggers |
2264
- | \`paradigm team providers\` | Show available providers |
2265
- | \`paradigm team models\` | View/configure agent model assignments |
2260
+ 1. **Evaluate expertise** \u2014 Which agents have the highest confidence scores on relevant symbols?
2261
+ 2. **Load ambient context** \u2014 Recent team decisions, journal insights, and pending nominations are injected into each agent's prompt via \`buildProfileEnrichment()\`.
2262
+ 3. **Spawn subagents** \u2014 Each agent receives its full profile: personality, expertise history, transferable patterns, notebook entries, and ambient context.
2263
+ 4. **Present attributed responses** \u2014 Each agent's response appears with a \`[role]\` or \`[nickname (role)]\` prefix. Do NOT synthesize \u2014 show distinct contributions.
2264
+ 5. **Record to Symphony** \u2014 Each contribution is written as a Symphony message to \`thr-orch-*\` thread for Conductor/Platform visibility.
2265
+ 6. **Learn from feedback** \u2014 At session end, Maestro reads the session work log and writes targeted journal entries per agent.
2266
2266
 
2267
- ## Agent Suggestions
2267
+ ## Attributed Responses
2268
2268
 
2269
- Before orchestrating, preview which agents will be involved:
2269
+ When presenting agent responses, use the \`attribution\` field from orchestration output:
2270
+ - \`[architect]\` \u2014 default format
2271
+ - \`[George (architect)]\` \u2014 if agent has a \`nickname\` in its profile
2270
2272
 
2271
- \`\`\`bash
2272
- paradigm team agents suggest "Add user authentication with JWT"
2273
- \`\`\`
2273
+ Do NOT combine or summarize multiple agents into one response. Each agent speaks for itself.
2274
2274
 
2275
- Or via MCP (returns \`suggestedAgents\` in plan mode):
2276
- \`\`\`
2277
- paradigm_orchestrate_inline({ task: "...", mode: "plan" })
2278
- \`\`\``
2275
+ ## Agent Roster
2276
+
2277
+ | Agent | Model | Role |
2278
+ |-------|-------|------|
2279
+ | architect | opus | Design, specifications, file plans |
2280
+ | builder | haiku | Implementation from specs |
2281
+ | security | opus | Auth, permissions, vulnerability review |
2282
+ | reviewer | sonnet | Code quality, patterns, conventions |
2283
+ | tester | haiku | Test coverage, assertions |
2284
+ | documentor | haiku | .purpose, portal.yaml, symbol updates (always final stage) |
2285
+
2286
+ ### Bench / Activate
2287
+
2288
+ Silence a noisy agent without deleting its profile:
2289
+ - \`paradigm agent bench security\` \u2014 Maestro and nomination engine skip this agent
2290
+ - \`paradigm agent activate security\` \u2014 restore to active orchestration
2291
+ - \`paradigm agent roster\` \u2014 see active vs benched with stats
2292
+
2293
+ ### Documentor Agent
2294
+
2295
+ The documentor always runs as the **final orchestration stage**. It:
2296
+ - Reviews what other agents changed
2297
+ - Updates .purpose files, portal.yaml, and symbol registrations
2298
+ - Uses only \`paradigm_purpose_*\` and \`paradigm_portal_*\` MCP tools
2299
+ - Runs \`paradigm_reindex\` when done
2300
+ - Never modifies source code
2301
+
2302
+ This relieves all other agents of Paradigm file maintenance.
2303
+
2304
+ ## Session Work Log
2305
+
2306
+ During a session, a running log captures:
2307
+ - **Agent contributions** \u2014 what each agent was asked to do (from orchestration)
2308
+ - **User verdicts** \u2014 accepted / dismissed / revised, with reason (from ambient engage)
2309
+
2310
+ Stored at \`.paradigm/events/session-log.jsonl\`. Read by Maestro at postflight.
2311
+
2312
+ ## Learning Loop
2313
+
2314
+ At session end (via postflight skill Step 8b):
2315
+
2316
+ 1. **Read session work log** \u2014 cross-reference contributions with verdicts
2317
+ 2. **Write journal entries** \u2014 targeted feedback per agent:
2318
+ - Accepted \u2192 \`human_feedback\` trigger, high confidence, extractable pattern
2319
+ - Dismissed \u2192 \`correction_received\` trigger, low confidence, explains what was wrong
2320
+ - Revised \u2192 \`correction_received\` trigger, medium confidence, includes delta
2321
+ 3. **Adjust thresholds** \u2014 \`paradigm_ambient_learn\` per agent
2322
+ 4. **Promote to notebooks** \u2014 \`paradigm_ambient_promote\` auto-promotes high-confidence journal entries
2323
+
2324
+ Journal entries with patterns flow through to notebooks, which appear in future \`buildProfileEnrichment()\` calls. This is how agents accumulate domain knowledge.
2325
+
2326
+ ## Training New Behaviors
2327
+
2328
+ To teach an agent a new skill (e.g., "documentor should also draft CHANGELOG entries"):
2329
+ 1. Tell the agent during the session \u2014 Maestro records the instruction
2330
+ 2. The postflight pass writes a \`human_feedback\` journal entry with the new behavior
2331
+ 3. On promotion, it becomes a notebook entry
2332
+ 4. Next session, \`buildProfileEnrichment()\` injects that knowledge into the agent's context
2333
+
2334
+ No configuration needed \u2014 the learning pipeline IS the training mechanism.
2335
+
2336
+ ## Neverland Validation
2337
+
2338
+ Track learning progress with \`paradigm_ambient_neverland\`:
2339
+ - Per-agent: acceptance rate, threshold, expertise count, notebook count
2340
+ - Aggregate: average accept rate, total expertise, total notebooks
2341
+ - Health status: cold-start \u2192 accumulating \u2192 calibrating \u2192 mature
2342
+ - Target: >80% routing accuracy by session 10, >70% acceptance rate
2343
+
2344
+ ## MCP Tools
2345
+
2346
+ | Tool | Purpose |
2347
+ |------|---------|
2348
+ | \`paradigm_orchestrate_inline\` | Plan (mode=plan) or execute (mode=execute) multi-agent orchestration |
2349
+ | \`paradigm_agent_prompt\` | Get enriched prompt for a single agent |
2350
+ | \`paradigm_agent_list\` | List all agents with expertise + bench status |
2351
+ | \`paradigm_agent_bench\` | Bench an agent |
2352
+ | \`paradigm_agent_activate\` | Activate a benched agent |
2353
+ | \`paradigm_ambient_neverland\` | Neverland validation metrics |
2354
+ | \`paradigm_context_compose\` | Compose full ambient context for an agent |`
2279
2355
  },
2280
2356
  "workspaces": {
2281
2357
  description: "Multi-project workspaces \u2014 setup, cross-project tools, reindexing",
@@ -5616,7 +5692,8 @@ var DEFAULT_MODELS = {
5616
5692
  security: "opus",
5617
5693
  reviewer: "sonnet",
5618
5694
  builder: "haiku",
5619
- tester: "haiku"
5695
+ tester: "haiku",
5696
+ documentor: "haiku"
5620
5697
  };
5621
5698
  var AGENT_TOKEN_ESTIMATES = {
5622
5699
  architect: { min: 5e3, max: 2e4 },
@@ -5780,7 +5857,35 @@ You flag issues but do NOT implement fixes - hand to Builder for that.
5780
5857
  ## What You DON'T Do
5781
5858
  - Implement security fixes yourself
5782
5859
  - Skip checking ^gate routes
5783
- - Approve code with known vulnerabilities`
5860
+ - Approve code with known vulnerabilities`,
5861
+ documentor: `You are the DOCUMENTOR agent.
5862
+
5863
+ ## Your Role
5864
+ You maintain Paradigm metadata files after other agents complete their work.
5865
+ You are the ONLY agent responsible for .purpose files, portal.yaml, and symbol registrations.
5866
+ Other agents focus on their domain \u2014 you handle all Paradigm compliance.
5867
+
5868
+ ## Key Responsibilities
5869
+ 1. Review what other agents changed (read git diff, session work log)
5870
+ 2. Update .purpose files for modified directories (paradigm_purpose_init, paradigm_purpose_add_component)
5871
+ 3. Update portal.yaml with new routes and gates (paradigm_portal_add_route, paradigm_portal_add_gate)
5872
+ 4. Register new signals, flows, and states (paradigm_purpose_add_signal, paradigm_purpose_add_flow)
5873
+ 5. Run paradigm_reindex when done to rebuild the symbol index
5874
+ 6. Ask peers via Symphony what symbols they touched if unclear
5875
+
5876
+ ## What You ONLY Use
5877
+ - paradigm_purpose_init / paradigm_purpose_add_component / paradigm_purpose_add_flow
5878
+ - paradigm_purpose_add_gate / paradigm_purpose_add_signal / paradigm_purpose_add_state
5879
+ - paradigm_portal_add_route / paradigm_portal_add_gate
5880
+ - paradigm_reindex
5881
+ - paradigm_search (to find existing symbols)
5882
+ - paradigm_ripple (to check impact)
5883
+
5884
+ ## What You NEVER Do
5885
+ - Modify source code (.ts, .js, .py, .rs files)
5886
+ - Write implementation code
5887
+ - Change application logic
5888
+ - Skip .purpose coverage for new code directories`
5784
5889
  };
5785
5890
  function getOrchestrationToolsList() {
5786
5891
  return [
@@ -5916,13 +6021,27 @@ async function handleOrchestrateInline(args, ctx) {
5916
6021
  }
5917
6022
  let agentProfiles = /* @__PURE__ */ new Map();
5918
6023
  try {
5919
- const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-SJPJJS33.js");
6024
+ const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-DBF4OARL.js");
6025
+ const { loadDecisions: loadDecisions3 } = await import("./decision-loader-WWCLIQPJ.js");
6026
+ const { loadJournalEntries: loadJournalEntries2 } = await import("./journal-loader-5EYSBFFY.js");
6027
+ const { loadNominations: loadNominations2 } = await import("./nomination-engine-LPLCCDW2.js");
6028
+ const recentDecisions = loadDecisions3(ctx.rootDir, { status: "active", limit: 5 }).map((d) => ({ title: d.title, decision: d.decision.slice(0, 150) }));
6029
+ const pendingNominations = loadNominations2(ctx.rootDir, { pending_only: true, limit: 10 }).map((n) => ({ urgency: n.urgency, brief: n.brief }));
5920
6030
  for (const stage of plan.stages) {
5921
6031
  for (const agentStep of stage.agents) {
5922
6032
  if (!agentProfiles.has(agentStep.name)) {
5923
6033
  const profile = loadAgentProfile2(ctx.rootDir, agentStep.name);
5924
6034
  if (profile) {
5925
- let enrichment = buildProfileEnrichment2(profile, symbols);
6035
+ if (profile.benched) continue;
6036
+ const journalInsights = loadJournalEntries2(agentStep.name, {
6037
+ transferable: true,
6038
+ limit: 5
6039
+ }).map((j) => ({ trigger: j.trigger, insight: j.insight.slice(0, 150) }));
6040
+ let enrichment = buildProfileEnrichment2(profile, symbols, void 0, {
6041
+ recentDecisions,
6042
+ journalInsights,
6043
+ pendingNominations
6044
+ });
5926
6045
  if (profile.permissions) {
5927
6046
  const constraints = ["\n## Permission Constraints"];
5928
6047
  if (profile.permissions.paths?.deny?.length) {
@@ -5940,7 +6059,10 @@ async function handleOrchestrateInline(args, ctx) {
5940
6059
  enrichment += "\n" + constraints.join("\n");
5941
6060
  }
5942
6061
  if (enrichment.trim()) {
5943
- agentProfiles.set(agentStep.name, { enrichment });
6062
+ agentProfiles.set(agentStep.name, {
6063
+ enrichment,
6064
+ nickname: profile.nickname
6065
+ });
5944
6066
  }
5945
6067
  }
5946
6068
  }
@@ -5960,7 +6082,8 @@ async function handleOrchestrateInline(args, ctx) {
5960
6082
  task: agentStep.task,
5961
6083
  symbols,
5962
6084
  dependsOn: agentStep.dependsOn,
5963
- profileEnrichment: profileData?.enrichment
6085
+ profileEnrichment: profileData?.enrichment,
6086
+ nickname: profileData?.nickname
5964
6087
  });
5965
6088
  agentPrompts.push(promptResult);
5966
6089
  }
@@ -5972,6 +6095,22 @@ async function handleOrchestrateInline(args, ctx) {
5972
6095
  }
5973
6096
  const orchestrationId = `orch-${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 6)}`;
5974
6097
  logOrchestration(ctx.rootDir, orchestrationId, task, plan);
6098
+ try {
6099
+ const { appendSessionWorkEntry } = await import("./session-work-log-KDOH4GER.js");
6100
+ for (const stage of stagePrompts) {
6101
+ for (const agent of stage.agents) {
6102
+ appendSessionWorkEntry(ctx.rootDir, {
6103
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6104
+ type: "agent-contribution",
6105
+ agent: agent.agent,
6106
+ contribution: agent.taskDescription?.slice(0, 200) || task.slice(0, 200),
6107
+ attribution: agent.attribution,
6108
+ symbols
6109
+ });
6110
+ }
6111
+ }
6112
+ } catch {
6113
+ }
5975
6114
  const result = {
5976
6115
  orchestrationId,
5977
6116
  task,
@@ -5984,7 +6123,9 @@ async function handleOrchestrateInline(args, ctx) {
5984
6123
  "Execute stages in order (stage 0, then stage 1, etc.)",
5985
6124
  "Agents within a stage can be run in parallel if your environment supports it",
5986
6125
  "Pass handoff context between stages",
5987
- "After each phase, summarize what was done before starting the next"
6126
+ 'Present each agent response as an attributed message using the attribution prefix (e.g., "[architect] Rate limiter should go before ^authenticated")',
6127
+ "Do NOT synthesize agent responses \u2014 show them as distinct contributions from each agent",
6128
+ "After all agents in a stage complete, reconcile their outputs before proceeding to the next stage"
5988
6129
  ],
5989
6130
  // Claude Code: Use Task tool for parallel agent spawning
5990
6131
  claudeCode: {
@@ -6010,6 +6151,24 @@ async function handleOrchestrateInline(args, ctx) {
6010
6151
  method: "paradigm team orchestrate",
6011
6152
  command: `paradigm team orchestrate "${task}"`,
6012
6153
  note: "Spawns independent agent processes \u2014 works from any terminal"
6154
+ },
6155
+ // Symphony: Record agent contributions as team thread messages
6156
+ symphony: {
6157
+ enabled: true,
6158
+ orchestrationThread: `thr-${orchestrationId}`,
6159
+ instructions: [
6160
+ "After each agent completes, call paradigm_symphony_send to record the contribution",
6161
+ 'Use intent "context" for analysis, "proposal" for recommendations, "decision" for decisions made',
6162
+ `Set threadRoot to "thr-${orchestrationId}" so all contributions are in one thread`,
6163
+ "Include the symbols array from the agent relay output",
6164
+ "This creates a visible team thread that Conductor and other sessions can observe"
6165
+ ],
6166
+ exampleCall: {
6167
+ intent: "context",
6168
+ text: "[architect] Rate limiter should be placed before ^authenticated gate to prevent unauthenticated flood",
6169
+ threadRoot: `thr-${orchestrationId}`,
6170
+ symbols: ["#rate-limiter", "^authenticated"]
6171
+ }
6013
6172
  }
6014
6173
  };
6015
6174
  const text = JSON.stringify(result, null, 2);
@@ -6033,11 +6192,23 @@ async function handleAgentPrompt(args, ctx) {
6033
6192
  };
6034
6193
  const symbols = extractSymbols(task);
6035
6194
  let profileEnrichment;
6195
+ let nickname;
6036
6196
  try {
6037
- const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-SJPJJS33.js");
6197
+ const { loadAgentProfile: loadAgentProfile2, buildProfileEnrichment: buildProfileEnrichment2 } = await import("./agent-loader-DBF4OARL.js");
6198
+ const { loadDecisions: loadDecisions3 } = await import("./decision-loader-WWCLIQPJ.js");
6199
+ const { loadJournalEntries: loadJournalEntries2 } = await import("./journal-loader-5EYSBFFY.js");
6200
+ const { loadNominations: loadNominations2 } = await import("./nomination-engine-LPLCCDW2.js");
6038
6201
  const profile = loadAgentProfile2(ctx.rootDir, agentName);
6039
6202
  if (profile) {
6040
- let enrichment = buildProfileEnrichment2(profile, symbols);
6203
+ nickname = profile.nickname;
6204
+ const recentDecisions = loadDecisions3(ctx.rootDir, { status: "active", limit: 5 }).map((d) => ({ title: d.title, decision: d.decision.slice(0, 150) }));
6205
+ const journalInsights = loadJournalEntries2(agentName, { transferable: true, limit: 5 }).map((j) => ({ trigger: j.trigger, insight: j.insight.slice(0, 150) }));
6206
+ const pendingNominations = loadNominations2(ctx.rootDir, { pending_only: true, limit: 10 }).map((n) => ({ urgency: n.urgency, brief: n.brief }));
6207
+ let enrichment = buildProfileEnrichment2(profile, symbols, void 0, {
6208
+ recentDecisions,
6209
+ journalInsights,
6210
+ pendingNominations
6211
+ });
6041
6212
  if (profile.permissions) {
6042
6213
  const constraints = ["\n## Permission Constraints"];
6043
6214
  if (profile.permissions.paths?.deny?.length) {
@@ -6064,12 +6235,14 @@ async function handleAgentPrompt(args, ctx) {
6064
6235
  symbols,
6065
6236
  handoffContext,
6066
6237
  previousAgent,
6067
- profileEnrichment
6238
+ profileEnrichment,
6239
+ nickname
6068
6240
  });
6069
6241
  const result = {
6070
6242
  agent: agentName,
6071
6243
  model: promptResult.model,
6072
6244
  prompt: promptResult.prompt,
6245
+ attribution: promptResult.attribution,
6073
6246
  taskToolParams: {
6074
6247
  description: promptResult.taskDescription,
6075
6248
  prompt: promptResult.prompt,
@@ -6077,7 +6250,7 @@ async function handleAgentPrompt(args, ctx) {
6077
6250
  model: promptResult.model
6078
6251
  },
6079
6252
  focusAreas: promptResult.focusAreas,
6080
- usage: "Use the Task tool with the taskToolParams to spawn this agent"
6253
+ usage: "Use the Task tool with the taskToolParams to spawn this agent. Present the response with the attribution prefix."
6081
6254
  };
6082
6255
  const text = JSON.stringify(result, null, 2);
6083
6256
  trackToolCall(text.length, "paradigm_agent_prompt");
@@ -6203,6 +6376,17 @@ function planAgentSequence(task, agents, agentOverride, classification) {
6203
6376
  canRunParallel: stageAgents.length > 1
6204
6377
  });
6205
6378
  }
6379
+ const lastStageNum = sortedStages.length > 0 ? sortedStages[sortedStages.length - 1] + 1 : 0;
6380
+ stages.push({
6381
+ stage: lastStageNum,
6382
+ agents: [{
6383
+ name: "documentor",
6384
+ task: "Review all changes made by previous agents. Update .purpose files, portal.yaml, and symbol registrations using only paradigm_purpose_* and paradigm_portal_* MCP tools. Run paradigm_reindex when done. Do NOT modify source code.",
6385
+ dependsOn: plannedAgents.map((a) => a.name),
6386
+ required: true
6387
+ }],
6388
+ canRunParallel: false
6389
+ });
6206
6390
  let minTokens = 0;
6207
6391
  let maxTokens = 0;
6208
6392
  for (const agent of plannedAgents) {
@@ -6210,12 +6394,15 @@ function planAgentSequence(task, agents, agentOverride, classification) {
6210
6394
  minTokens += estimate.min;
6211
6395
  maxTokens += estimate.max;
6212
6396
  }
6397
+ minTokens += 2e3;
6398
+ maxTokens += 8e3;
6213
6399
  return {
6214
6400
  task,
6215
6401
  mode: "faceted",
6216
6402
  stages,
6217
6403
  symbols,
6218
- estimatedAgents: plannedAgents.length,
6404
+ estimatedAgents: plannedAgents.length + 1,
6405
+ // +1 for documentor
6219
6406
  estimatedTokens: { min: minTokens, max: maxTokens }
6220
6407
  };
6221
6408
  }
@@ -6280,12 +6467,14 @@ handoff_context: |
6280
6467
  This structured output helps track progress and pass context between agents.`);
6281
6468
  const prompt = parts.join("\n");
6282
6469
  const model = agent.defaultModel || DEFAULT_MODELS[agent.name] || "sonnet";
6470
+ const attribution = options.nickname ? `[${options.nickname} (${agent.name})]` : `[${agent.name}]`;
6283
6471
  return {
6284
6472
  agent: agent.name,
6285
6473
  model,
6286
6474
  prompt,
6287
6475
  taskDescription: `${agent.name}: ${task.slice(0, 50)}${task.length > 50 ? "..." : ""}`,
6288
6476
  subagentType: "general-purpose",
6477
+ attribution,
6289
6478
  focusAreas: agent.focus
6290
6479
  };
6291
6480
  }
@@ -9913,7 +10102,7 @@ async function handleLoreTool(name, args, ctx) {
9913
10102
  try {
9914
10103
  const agentId = process.env.PARADIGM_AGENT_ID;
9915
10104
  if (agentId && symbols_touched && symbols_touched.length > 0) {
9916
- const { updateExpertiseFromLore } = await import("./agent-loader-SJPJJS33.js");
10105
+ const { updateExpertiseFromLore } = await import("./agent-loader-DBF4OARL.js");
9917
10106
  updateExpertiseFromLore(ctx.rootDir, agentId, {
9918
10107
  symbols_touched,
9919
10108
  confidence: confidence != null && confidence >= 0 && confidence <= 1 ? confidence : void 0
@@ -10084,7 +10273,7 @@ async function handleLoreTool(name, args, ctx) {
10084
10273
  try {
10085
10274
  const agentId = process.env.PARADIGM_AGENT_ID;
10086
10275
  if (agentId && success && entryToAssess.symbols_touched?.length) {
10087
- const { updateExpertiseFromAssessment } = await import("./agent-loader-SJPJJS33.js");
10276
+ const { updateExpertiseFromAssessment } = await import("./agent-loader-DBF4OARL.js");
10088
10277
  updateExpertiseFromAssessment(ctx.rootDir, agentId, {
10089
10278
  symbols_touched: entryToAssess.symbols_touched,
10090
10279
  verdict
@@ -17861,6 +18050,42 @@ function getAgentToolsList() {
17861
18050
  readOnlyHint: true,
17862
18051
  destructiveHint: false
17863
18052
  }
18053
+ },
18054
+ {
18055
+ name: "paradigm_agent_bench",
18056
+ description: "Bench an agent \u2014 Maestro will skip this agent during orchestration and nomination scoring. Use when an agent is noisy or unhelpful. ~50 tokens.",
18057
+ inputSchema: {
18058
+ type: "object",
18059
+ properties: {
18060
+ id: {
18061
+ type: "string",
18062
+ description: 'Agent ID to bench (e.g., "architect")'
18063
+ }
18064
+ },
18065
+ required: ["id"]
18066
+ },
18067
+ annotations: {
18068
+ readOnlyHint: false,
18069
+ destructiveHint: false
18070
+ }
18071
+ },
18072
+ {
18073
+ name: "paradigm_agent_activate",
18074
+ description: "Activate a benched agent \u2014 restore it to active Maestro orchestration. ~50 tokens.",
18075
+ inputSchema: {
18076
+ type: "object",
18077
+ properties: {
18078
+ id: {
18079
+ type: "string",
18080
+ description: 'Agent ID to activate (e.g., "architect")'
18081
+ }
18082
+ },
18083
+ required: ["id"]
18084
+ },
18085
+ annotations: {
18086
+ readOnlyHint: false,
18087
+ destructiveHint: false
18088
+ }
17864
18089
  }
17865
18090
  ];
17866
18091
  }
@@ -17885,6 +18110,8 @@ async function handleAgentTool(name, args, ctx) {
17885
18110
  agents: profiles.map((p) => ({
17886
18111
  id: p.id,
17887
18112
  role: p.role,
18113
+ nickname: p.nickname,
18114
+ benched: p.benched || false,
17888
18115
  personality: p.personality,
17889
18116
  topExpertise: (p.expertise || []).sort((a, b) => b.confidence - a.confidence).slice(0, 5).map((e) => ({
17890
18117
  symbol: e.symbol,
@@ -17892,7 +18119,8 @@ async function handleAgentTool(name, args, ctx) {
17892
18119
  sessions: e.sessions
17893
18120
  })),
17894
18121
  projectContexts: Object.keys(p.contexts || {}),
17895
- transferableCount: (p.transferable || []).length
18122
+ transferableCount: (p.transferable || []).length,
18123
+ ...p.attention?.threshold != null ? { threshold: p.attention.threshold } : {}
17896
18124
  }))
17897
18125
  }, null, 2)
17898
18126
  };
@@ -17972,6 +18200,48 @@ async function handleAgentTool(name, args, ctx) {
17972
18200
  }, null, 2)
17973
18201
  };
17974
18202
  }
18203
+ case "paradigm_agent_bench": {
18204
+ const benchId = args.id;
18205
+ const benchProfile = loadAgentProfile(ctx.rootDir, benchId);
18206
+ if (!benchProfile) {
18207
+ return {
18208
+ handled: true,
18209
+ text: JSON.stringify({ error: `Agent "${benchId}" not found` }, null, 2)
18210
+ };
18211
+ }
18212
+ benchProfile.benched = true;
18213
+ benchProfile.updated = (/* @__PURE__ */ new Date()).toISOString();
18214
+ saveAgentProfile(benchId, benchProfile, "global");
18215
+ return {
18216
+ handled: true,
18217
+ text: JSON.stringify({
18218
+ id: benchId,
18219
+ benched: true,
18220
+ note: `${benchId} is now benched. Maestro will skip this agent during orchestration.`
18221
+ }, null, 2)
18222
+ };
18223
+ }
18224
+ case "paradigm_agent_activate": {
18225
+ const activateId = args.id;
18226
+ const activateProfile = loadAgentProfile(ctx.rootDir, activateId);
18227
+ if (!activateProfile) {
18228
+ return {
18229
+ handled: true,
18230
+ text: JSON.stringify({ error: `Agent "${activateId}" not found` }, null, 2)
18231
+ };
18232
+ }
18233
+ activateProfile.benched = false;
18234
+ activateProfile.updated = (/* @__PURE__ */ new Date()).toISOString();
18235
+ saveAgentProfile(activateId, activateProfile, "global");
18236
+ return {
18237
+ handled: true,
18238
+ text: JSON.stringify({
18239
+ id: activateId,
18240
+ benched: false,
18241
+ note: `${activateId} is now active. Maestro will include this agent in orchestration.`
18242
+ }, null, 2)
18243
+ };
18244
+ }
17975
18245
  default:
17976
18246
  return { handled: false, text: "" };
17977
18247
  }
@@ -19430,7 +19700,7 @@ function getAmbientToolsList() {
19430
19700
  nomination_id: { type: "string", description: "Nomination ID to engage with" },
19431
19701
  response: { type: "string", enum: ["accepted", "dismissed", "deferred"], description: "How to respond" },
19432
19702
  resolve_debate: { type: "string", description: "Optional debate ID to resolve by choosing this nomination" },
19433
- reason: { type: "string", description: "Optional reason (used when resolving debates)" }
19703
+ reason: { type: "string", description: "Reason for response \u2014 stored on nomination for learning feedback. Especially valuable for dismissals." }
19434
19704
  },
19435
19705
  required: ["nomination_id", "response"]
19436
19706
  },
@@ -19490,6 +19760,18 @@ function getAmbientToolsList() {
19490
19760
  readOnlyHint: false,
19491
19761
  destructiveHint: false
19492
19762
  }
19763
+ },
19764
+ {
19765
+ name: "paradigm_ambient_neverland",
19766
+ description: "Neverland Validation \u2014 aggregate learning metrics across all agents. Shows acceptance rates, threshold drift, expertise growth, notebook counts, cross-project transfer, and overall health status (cold-start \u2192 accumulating \u2192 calibrating \u2192 mature). ~200 tokens.",
19767
+ inputSchema: {
19768
+ type: "object",
19769
+ properties: {}
19770
+ },
19771
+ annotations: {
19772
+ readOnlyHint: true,
19773
+ destructiveHint: false
19774
+ }
19493
19775
  }
19494
19776
  ];
19495
19777
  }
@@ -19601,7 +19883,24 @@ async function handleAmbientTool(name, args, ctx) {
19601
19883
  case "paradigm_ambient_engage": {
19602
19884
  const nominationId = args.nomination_id;
19603
19885
  const response = args.response;
19604
- const engaged = engageNomination(ctx.rootDir, nominationId, response);
19886
+ const reason = args.reason;
19887
+ const engaged = engageNomination(ctx.rootDir, nominationId, response, reason);
19888
+ if (engaged) {
19889
+ try {
19890
+ const { appendSessionWorkEntry } = await import("./session-work-log-KDOH4GER.js");
19891
+ const noms = loadNominations(ctx.rootDir, { limit: 500 });
19892
+ const nom = noms.find((n) => n.id === nominationId);
19893
+ appendSessionWorkEntry(ctx.rootDir, {
19894
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
19895
+ type: "user-verdict",
19896
+ agent: nom?.agent,
19897
+ nominationId,
19898
+ verdict: response,
19899
+ reason
19900
+ });
19901
+ } catch {
19902
+ }
19903
+ }
19605
19904
  let debateResolved = false;
19606
19905
  if (args.resolve_debate && engaged) {
19607
19906
  debateResolved = resolveDebate(
@@ -19731,6 +20030,13 @@ async function handleAmbientTool(name, args, ctx) {
19731
20030
  handled: true
19732
20031
  };
19733
20032
  }
20033
+ case "paradigm_ambient_neverland": {
20034
+ const metrics = getNeverlandMetrics(ctx.rootDir);
20035
+ return {
20036
+ text: json(metrics),
20037
+ handled: true
20038
+ };
20039
+ }
19734
20040
  default:
19735
20041
  return { text: `Unknown ambient tool: ${name}`, handled: false };
19736
20042
  }
@@ -20805,7 +21111,7 @@ Update command:
20805
21111
  trackToolCall(noWsText.length, name);
20806
21112
  return { content: [{ type: "text", text: noWsText }] };
20807
21113
  }
20808
- const { rebuildStaticFiles: rebuildStaticFiles2 } = await import("./reindex-HRA2AUS6.js");
21114
+ const { rebuildStaticFiles: rebuildStaticFiles2 } = await import("./reindex-J5SEDVTT.js");
20809
21115
  const memberResults = [];
20810
21116
  for (const member of ctx.workspace.config.members) {
20811
21117
  const memberAbsPath = path34.resolve(path34.dirname(ctx.workspace.workspacePath), member.path);
@@ -7,6 +7,7 @@ import {
7
7
  emitAndProcess,
8
8
  engageNomination,
9
9
  forwardNominationsToRelay,
10
+ getNeverlandMetrics,
10
11
  getNominationStats,
11
12
  init_nomination_engine,
12
13
  loadDebates,
@@ -16,8 +17,8 @@ import {
16
17
  processEvent,
17
18
  processPendingEvents,
18
19
  resolveDebate
19
- } from "./chunk-GGMI6C2L.js";
20
- import "./chunk-A2L4TSLZ.js";
20
+ } from "./chunk-B2RC3HEB.js";
21
+ import "./chunk-ITPJJIHG.js";
21
22
  import "./chunk-MCMOGQMU.js";
22
23
  import "./chunk-7N7GSU6K.js";
23
24
  init_nomination_engine();
@@ -29,6 +30,7 @@ export {
29
30
  emitAndProcess,
30
31
  engageNomination,
31
32
  forwardNominationsToRelay,
33
+ getNeverlandMetrics,
32
34
  getNominationStats,
33
35
  loadDebates,
34
36
  loadNominations,