@thehammer/danx-dashboard-mcp 0.1.177 → 0.1.180

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/dist/lifecycle.js +39 -12
  2. package/package.json +1 -1
package/dist/lifecycle.js CHANGED
@@ -77,6 +77,7 @@ export function readLifecycleUrlsFromEnv() {
77
77
  slackRecoveryMessage: opt("DANXBOT_SLACK_RECOVERY_MESSAGE_URL"),
78
78
  slackRecoveryCreateOrLink: opt("DANXBOT_SLACK_RECOVERY_CREATE_OR_LINK_URL"),
79
79
  qualityGate: opt("DANXBOT_QUALITY_GATE_URL"),
80
+ requestCodeReview: opt("DANXBOT_REQUEST_CODE_REVIEW_URL"),
80
81
  evaluatorSummary: opt("DANXBOT_EVALUATOR_SUMMARY_URL"),
81
82
  saveTemplateApp: opt("DANXBOT_TEMPLATE_APP_SAVE_URL"),
82
83
  loadTemplateApp: opt("DANXBOT_TEMPLATE_APP_LOAD_URL"),
@@ -323,18 +324,27 @@ export function registerLifecycleTools(strictTool) {
323
324
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
324
325
  });
325
326
  // ---------------- quality_gate_complete (absorbs quality_gate_skip, DX-3394 problem 1682) ----------------
326
- const qualityGateComplete = strictTool("quality_gate_complete", "Sign off a registered quality gate. Two flavors by the gate's PHASE: (PLAN, e.g. plan-architecture) — " +
327
- "runs as its own dispatch; this call is that dispatch's TERMINAL call: status='pass' releases the " +
328
- "dispatch (the picker launches the next gate or the work agent); status='fail' BLOCKS the card (your " +
329
- "message becomes the reason) and stops the dispatch (do NOT follow up with danxbot_complete); " +
330
- "status='retry' — the fixer loop: you edited the card into a sounder plan and want a fresh pass. " +
331
- "(CODE, e.g. code-quality) — runs INLINE in your WORK session: stamps the gate + stores findings and " +
332
- "does NOTHING else. You CONTINUE: fix any blocking findings, re-run to a pass, then finalize and " +
333
- "complete the card normally. status='skipped' — the gate is OBVIOUSLY UNNECESSARY for this diff " +
334
- "(a single-line / docs-only change, or nothing in this gate's lane): use `message` as the mandatory " +
335
- `justification (≥${QUALITY_GATE_SKIP_REASON_MIN_CHARS} chars, the permanent accountability record a ` +
336
- "reviewer will read) — never skip to dodge a real review. A skipped required gate does not block " +
337
- "transitioning the card to complete (through danxbot_api) and does not re-dispatch a PRE gate.", {
327
+ const qualityGateComplete = strictTool("quality_gate_complete", "Sign off a registered quality gate. NEVER visible to (or callable by) the WORK dispatch that authored " +
328
+ "the diff — DX-3741: every gate, PLAN or CODE, runs as its OWN independent gate-reviewer dispatch, so " +
329
+ "seeing this tool at all means you ARE that reviewer, not the author. Two flavors by the gate's PHASE: " +
330
+ "(PLAN, e.g. plan-architecture) — reviews the CARD's plan before any code exists; this call is your " +
331
+ "dispatch's TERMINAL call: status='pass' releases the dispatch (the picker launches the next gate or " +
332
+ "the work agent); status='fail' BLOCKS the card (your message becomes the reason) and stops the " +
333
+ "dispatch (do NOT follow up with danxbot_complete); status='retry' — the fixer loop: you edited the " +
334
+ "card into a sounder plan and want a fresh pass. (CODE, e.g. code-quality) — reviews `git diff " +
335
+ "origin/main...HEAD` on the author's `card/<id>` branch, already pushed to origin; this call is ALSO " +
336
+ "your dispatch's TERMINAL call: report every finding via `findings[]`; status='fail' releases the " +
337
+ "dispatch and — BELOW the per-gate review-pass cap — does NOT block the card: the author's WORK " +
338
+ "session, re-dispatched, reads your findings, fixes them, and calls request_code_review again, which " +
339
+ "re-dispatches every requested code gate fresh; AT the cap (3 review passes, the runaway backstop) a " +
340
+ "'fail' DOES block the card instead, exactly like a PLAN-phase fail — you are not told which round " +
341
+ "this is, so sign 'fail' on the findings alone and let the dispatcher enforce the cap; " +
342
+ "status='pass' releases the dispatch toward the next requested code gate or back to WORK to finalize; " +
343
+ "status='retry' is PLAN-phase only, refused here. status='skipped' — the gate is OBVIOUSLY " +
344
+ "UNNECESSARY for this diff (a single-line / docs-only change, or nothing in this gate's lane): use " +
345
+ `\`message\` as the mandatory justification (≥${QUALITY_GATE_SKIP_REASON_MIN_CHARS} chars, the ` +
346
+ "permanent accountability record a human will read) — never skip to dodge a real review. You never " +
347
+ "edit files and never transition the card yourself, on either phase.", {
338
348
  gate: z.string().describe("Registered gate name, e.g. 'plan-architecture' or 'code-quality'."),
339
349
  status: z.enum(["pass", "fail", "retry", "skipped"]),
340
350
  message: z
@@ -367,6 +377,21 @@ export function registerLifecycleTools(strictTool) {
367
377
  const result = await postWorkerRoute(url, body, "quality_gate_complete", agentBearer());
368
378
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
369
379
  });
380
+ // ---------------- request_code_review (DX-3741) ----------------
381
+ const requestCodeReview = strictTool("request_code_review", "TERMINAL for this dispatch — call it when your diff is done and its own tests are green, instead of " +
382
+ "danxbot_complete. Pushes your branch (card/<id> to origin/card/<id>), then dispatches every code " +
383
+ "gate this card carries as its OWN independent gate-reviewer dispatch (you never sign or review your " +
384
+ "own diff — DX-3741). Ends this dispatch 'completed' and releases the card to ToDo; when the card is " +
385
+ "re-dispatched to you, read its quality_gates (through danxbot_api): every code gate pass/skipped → " +
386
+ "run agent-finalize.sh and complete normally; any fail → fix its findings, then call " +
387
+ "request_code_review again (never sign or remove a code gate yourself — removal is refused, 409). " +
388
+ "Takes no arguments. A card with no code gates has nothing to request — finalize directly instead.", {}, async () => {
389
+ const url = readLifecycleUrlsFromEnv().requestCodeReview;
390
+ if (!url)
391
+ throw new Error("request_code_review called outside a work dispatch");
392
+ const result = await postWorkerRoute(url, {}, "request_code_review", agentBearer());
393
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
394
+ });
370
395
  // ---------------- danxbot_set_evaluator_summary ----------------
371
396
  const evaluatorSummary = strictTool("danxbot_set_evaluator_summary", "Write the root-cause summary for a 3-strike broken agent. ONLY the system-evaluator dispatch sees this " +
372
397
  "tool. Call exactly once at the END of the dispatch, immediately before danxbot_complete. A dispatch " +
@@ -424,6 +449,7 @@ export function registerLifecycleTools(strictTool) {
424
449
  slackRecoveryMessage,
425
450
  slackRecoveryCreateOrLink,
426
451
  qualityGateComplete,
452
+ requestCodeReview,
427
453
  evaluatorSummary,
428
454
  saveTemplateApp,
429
455
  loadTemplateApp,
@@ -453,6 +479,7 @@ export function applyLifecycleVisibility(tools, urls) {
453
479
  setVisible(tools.slackRecoveryMessage, !!urls.slackRecoveryMessage);
454
480
  setVisible(tools.slackRecoveryCreateOrLink, !!urls.slackRecoveryCreateOrLink);
455
481
  setVisible(tools.qualityGateComplete, !!urls.qualityGate);
482
+ setVisible(tools.requestCodeReview, !!urls.requestCodeReview);
456
483
  setVisible(tools.evaluatorSummary, !!urls.evaluatorSummary);
457
484
  setVisible(tools.saveTemplateApp, !!urls.saveTemplateApp);
458
485
  setVisible(tools.loadTemplateApp, !!urls.loadTemplateApp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.177",
3
+ "version": "0.1.180",
4
4
  "description": "Stdio MCP server fronting danxbot's dashboard API for agents (operator sessions and dispatched workers alike): the generic danxbot_api/danxbot_api_list/danxbot_api_spec tools reach any route the caller's credential may call, plus dedicated agent-specific tools (plan_connect, danxbot_complete, and other per-dispatch lifecycle callbacks) (DX-3465, PLN-11 R-25).",
5
5
  "license": "MIT",
6
6
  "type": "module",