@prowi/deskcheck 0.1.0 → 0.3.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 (181) hide show
  1. package/README.md +67 -12
  2. package/build/cli.js +112 -24
  3. package/build/cli.js.map +1 -1
  4. package/build/{core/config.d.ts → config/loader.d.ts} +9 -1
  5. package/build/config/loader.d.ts.map +1 -0
  6. package/build/{core/config.js → config/loader.js} +4 -2
  7. package/build/config/loader.js.map +1 -0
  8. package/build/config/types.d.ts +45 -0
  9. package/build/config/types.d.ts.map +1 -0
  10. package/build/config/types.js +2 -0
  11. package/build/config/types.js.map +1 -0
  12. package/build/mcp/tools.d.ts +1 -1
  13. package/build/mcp/tools.d.ts.map +1 -1
  14. package/build/mcp/tools.js +35 -25
  15. package/build/mcp/tools.js.map +1 -1
  16. package/build/mcp-server.js +1 -1
  17. package/build/mcp-server.js.map +1 -1
  18. package/build/{agents/executor-prompt.d.ts → prompts/ExecutorPrompt.d.ts} +6 -2
  19. package/build/prompts/ExecutorPrompt.d.ts.map +1 -0
  20. package/build/prompts/ExecutorPrompt.js +111 -0
  21. package/build/prompts/ExecutorPrompt.js.map +1 -0
  22. package/build/prompts/JudgePrompt.d.ts +16 -0
  23. package/build/prompts/JudgePrompt.d.ts.map +1 -0
  24. package/build/prompts/JudgePrompt.js +57 -0
  25. package/build/prompts/JudgePrompt.js.map +1 -0
  26. package/build/prompts/PlannerPrompt.d.ts +12 -0
  27. package/build/prompts/PlannerPrompt.d.ts.map +1 -0
  28. package/build/prompts/PlannerPrompt.js +34 -0
  29. package/build/prompts/PlannerPrompt.js.map +1 -0
  30. package/build/renderers/{json.d.ts → review/JsonRenderer.d.ts} +2 -2
  31. package/build/renderers/review/JsonRenderer.d.ts.map +1 -0
  32. package/build/renderers/{json.js → review/JsonRenderer.js} +1 -1
  33. package/build/renderers/review/JsonRenderer.js.map +1 -0
  34. package/build/renderers/{markdown.d.ts → review/MarkdownRenderer.d.ts} +2 -2
  35. package/build/renderers/review/MarkdownRenderer.d.ts.map +1 -0
  36. package/build/renderers/review/MarkdownRenderer.js +52 -0
  37. package/build/renderers/review/MarkdownRenderer.js.map +1 -0
  38. package/build/renderers/{terminal.d.ts → review/TerminalRenderer.d.ts} +2 -2
  39. package/build/renderers/review/TerminalRenderer.d.ts.map +1 -0
  40. package/build/renderers/{terminal.js → review/TerminalRenderer.js} +36 -14
  41. package/build/renderers/review/TerminalRenderer.js.map +1 -0
  42. package/build/renderers/{watch.d.ts → review/WatchRenderer.d.ts} +2 -2
  43. package/build/renderers/review/WatchRenderer.d.ts.map +1 -0
  44. package/build/renderers/{watch.js → review/WatchRenderer.js} +3 -3
  45. package/build/renderers/review/WatchRenderer.js.map +1 -0
  46. package/build/renderers/shared.d.ts +11 -11
  47. package/build/renderers/shared.d.ts.map +1 -1
  48. package/build/renderers/shared.js +15 -15
  49. package/build/renderers/shared.js.map +1 -1
  50. package/build/renderers/test/TerminalRenderer.d.ts +14 -0
  51. package/build/renderers/test/TerminalRenderer.d.ts.map +1 -0
  52. package/build/renderers/test/TerminalRenderer.js +233 -0
  53. package/build/renderers/test/TerminalRenderer.js.map +1 -0
  54. package/build/server/controllers/ReviewController.d.ts +23 -0
  55. package/build/server/controllers/ReviewController.d.ts.map +1 -0
  56. package/build/server/controllers/ReviewController.js +90 -0
  57. package/build/server/controllers/ReviewController.js.map +1 -0
  58. package/build/server/controllers/TestController.d.ts +2 -0
  59. package/build/server/controllers/TestController.d.ts.map +1 -0
  60. package/build/server/controllers/TestController.js +3 -0
  61. package/build/server/controllers/TestController.js.map +1 -0
  62. package/build/server/middleware/cors.d.ts +9 -0
  63. package/build/server/middleware/cors.d.ts.map +1 -0
  64. package/build/server/middleware/cors.js +18 -0
  65. package/build/server/middleware/cors.js.map +1 -0
  66. package/build/{serve.d.ts → server/server.d.ts} +2 -2
  67. package/build/server/server.d.ts.map +1 -0
  68. package/build/server/server.js +102 -0
  69. package/build/server/server.js.map +1 -0
  70. package/build/server/sse/FileWatcherSSE.d.ts +10 -0
  71. package/build/server/sse/FileWatcherSSE.d.ts.map +1 -0
  72. package/build/server/sse/FileWatcherSSE.js +89 -0
  73. package/build/server/sse/FileWatcherSSE.js.map +1 -0
  74. package/build/services/ExecutorService.d.ts +51 -0
  75. package/build/services/ExecutorService.d.ts.map +1 -0
  76. package/build/services/ExecutorService.js +133 -0
  77. package/build/services/ExecutorService.js.map +1 -0
  78. package/build/services/FindingsParserService.d.ts +18 -0
  79. package/build/services/FindingsParserService.d.ts.map +1 -0
  80. package/build/services/FindingsParserService.js +119 -0
  81. package/build/services/FindingsParserService.js.map +1 -0
  82. package/build/services/criteria/CriteriaService.d.ts +10 -0
  83. package/build/services/criteria/CriteriaService.d.ts.map +1 -0
  84. package/build/services/criteria/CriteriaService.js +10 -0
  85. package/build/services/criteria/CriteriaService.js.map +1 -0
  86. package/build/{core → services/criteria}/glob-matcher.d.ts +1 -1
  87. package/build/services/criteria/glob-matcher.d.ts.map +1 -0
  88. package/build/services/criteria/glob-matcher.js.map +1 -0
  89. package/build/{core → services/criteria}/module-parser.d.ts +13 -1
  90. package/build/services/criteria/module-parser.d.ts.map +1 -0
  91. package/build/{core → services/criteria}/module-parser.js +38 -0
  92. package/build/services/criteria/module-parser.js.map +1 -0
  93. package/build/{core/context-extractor.d.ts → services/review/ReviewContextExtractorService.d.ts} +2 -2
  94. package/build/services/review/ReviewContextExtractorService.d.ts.map +1 -0
  95. package/build/{core/context-extractor.js → services/review/ReviewContextExtractorService.js} +1 -1
  96. package/build/services/review/ReviewContextExtractorService.js.map +1 -0
  97. package/build/{agents/orchestrator.d.ts → services/review/ReviewOrchestratorService.d.ts} +7 -5
  98. package/build/services/review/ReviewOrchestratorService.d.ts.map +1 -0
  99. package/build/services/review/ReviewOrchestratorService.js +187 -0
  100. package/build/services/review/ReviewOrchestratorService.js.map +1 -0
  101. package/build/{core/plan-builder.d.ts → services/review/ReviewPlanBuilderService.d.ts} +5 -4
  102. package/build/services/review/ReviewPlanBuilderService.d.ts.map +1 -0
  103. package/build/{core/plan-builder.js → services/review/ReviewPlanBuilderService.js} +2 -2
  104. package/build/services/review/ReviewPlanBuilderService.js.map +1 -0
  105. package/build/{agents/planner.d.ts → services/review/ReviewPlannerService.d.ts} +5 -4
  106. package/build/services/review/ReviewPlannerService.d.ts.map +1 -0
  107. package/build/{agents/planner.js → services/review/ReviewPlannerService.js} +13 -29
  108. package/build/services/review/ReviewPlannerService.js.map +1 -0
  109. package/build/{core/storage.d.ts → services/review/ReviewStorageService.d.ts} +4 -4
  110. package/build/services/review/ReviewStorageService.d.ts.map +1 -0
  111. package/build/{core/storage.js → services/review/ReviewStorageService.js} +42 -27
  112. package/build/services/review/ReviewStorageService.js.map +1 -0
  113. package/build/services/testing/JudgeService.d.ts +30 -0
  114. package/build/services/testing/JudgeService.d.ts.map +1 -0
  115. package/build/services/testing/JudgeService.js +95 -0
  116. package/build/services/testing/JudgeService.js.map +1 -0
  117. package/build/services/testing/TestDiscoveryService.d.ts +16 -0
  118. package/build/services/testing/TestDiscoveryService.d.ts.map +1 -0
  119. package/build/services/testing/TestDiscoveryService.js +66 -0
  120. package/build/services/testing/TestDiscoveryService.js.map +1 -0
  121. package/build/services/testing/TestRunnerService.d.ts +35 -0
  122. package/build/services/testing/TestRunnerService.d.ts.map +1 -0
  123. package/build/services/testing/TestRunnerService.js +140 -0
  124. package/build/services/testing/TestRunnerService.js.map +1 -0
  125. package/build/services/testing/TestScorerService.d.ts +9 -0
  126. package/build/services/testing/TestScorerService.d.ts.map +1 -0
  127. package/build/services/testing/TestScorerService.js +35 -0
  128. package/build/services/testing/TestScorerService.js.map +1 -0
  129. package/build/services/testing/TestStorageService.d.ts +39 -0
  130. package/build/services/testing/TestStorageService.d.ts.map +1 -0
  131. package/build/services/testing/TestStorageService.js +144 -0
  132. package/build/services/testing/TestStorageService.js.map +1 -0
  133. package/build/types/criteria.d.ts +24 -0
  134. package/build/types/criteria.d.ts.map +1 -0
  135. package/build/{core/types.js → types/criteria.js} +2 -2
  136. package/build/types/criteria.js.map +1 -0
  137. package/build/{core/types.d.ts → types/review.d.ts} +54 -88
  138. package/build/types/review.d.ts.map +1 -0
  139. package/build/types/review.js +2 -0
  140. package/build/types/review.js.map +1 -0
  141. package/build/types/testing.d.ts +109 -0
  142. package/build/types/testing.d.ts.map +1 -0
  143. package/build/types/testing.js +2 -0
  144. package/build/types/testing.js.map +1 -0
  145. package/package.json +1 -1
  146. package/ui/dist/index.html +34 -34
  147. package/build/agents/executor-prompt.d.ts.map +0 -1
  148. package/build/agents/executor-prompt.js +0 -65
  149. package/build/agents/executor-prompt.js.map +0 -1
  150. package/build/agents/orchestrator.d.ts.map +0 -1
  151. package/build/agents/orchestrator.js +0 -343
  152. package/build/agents/orchestrator.js.map +0 -1
  153. package/build/agents/planner.d.ts.map +0 -1
  154. package/build/agents/planner.js.map +0 -1
  155. package/build/core/config.d.ts.map +0 -1
  156. package/build/core/config.js.map +0 -1
  157. package/build/core/context-extractor.d.ts.map +0 -1
  158. package/build/core/context-extractor.js.map +0 -1
  159. package/build/core/glob-matcher.d.ts.map +0 -1
  160. package/build/core/glob-matcher.js.map +0 -1
  161. package/build/core/module-parser.d.ts.map +0 -1
  162. package/build/core/module-parser.js.map +0 -1
  163. package/build/core/plan-builder.d.ts.map +0 -1
  164. package/build/core/plan-builder.js.map +0 -1
  165. package/build/core/storage.d.ts.map +0 -1
  166. package/build/core/storage.js.map +0 -1
  167. package/build/core/types.d.ts.map +0 -1
  168. package/build/core/types.js.map +0 -1
  169. package/build/renderers/json.d.ts.map +0 -1
  170. package/build/renderers/json.js.map +0 -1
  171. package/build/renderers/markdown.d.ts.map +0 -1
  172. package/build/renderers/markdown.js +0 -36
  173. package/build/renderers/markdown.js.map +0 -1
  174. package/build/renderers/terminal.d.ts.map +0 -1
  175. package/build/renderers/terminal.js.map +0 -1
  176. package/build/renderers/watch.d.ts.map +0 -1
  177. package/build/renderers/watch.js.map +0 -1
  178. package/build/serve.d.ts.map +0 -1
  179. package/build/serve.js +0 -249
  180. package/build/serve.js.map +0 -1
  181. /package/build/{core → services/criteria}/glob-matcher.js +0 -0
@@ -1,9 +1,9 @@
1
1
  import path from "node:path";
2
2
  import { z } from "zod";
3
- import { ReviewStorage } from "../core/storage.js";
4
- import { extractContext } from "../core/context-extractor.js";
5
- import { discoverModules, parseModule } from "../core/module-parser.js";
6
- import { findMatchingModules } from "../core/glob-matcher.js";
3
+ import { ReviewStorageService } from "../services/review/ReviewStorageService.js";
4
+ import { extractContext } from "../services/review/ReviewContextExtractorService.js";
5
+ import { discoverModules, parseModule } from "../services/criteria/module-parser.js";
6
+ import { findMatchingModules } from "../services/criteria/glob-matcher.js";
7
7
  /**
8
8
  * Register all review MCP tools on the given server.
9
9
  *
@@ -11,7 +11,7 @@ import { findMatchingModules } from "../core/glob-matcher.js";
11
11
  * and exposes it over the MCP protocol with Zod-validated input schemas.
12
12
  */
13
13
  export function registerReviewTools(server, config, projectRoot) {
14
- const storage = new ReviewStorage(path.resolve(projectRoot, config.storage_dir));
14
+ const storage = new ReviewStorageService(path.resolve(projectRoot, config.storage_dir));
15
15
  const modulesDir = path.resolve(projectRoot, config.modules_dir);
16
16
  // ---------------------------------------------------------------------------
17
17
  // 1. review_status — health check
@@ -266,40 +266,50 @@ export function registerReviewTools(server, config, projectRoot) {
266
266
  // 8. finish_review — complete a task with findings
267
267
  // ---------------------------------------------------------------------------
268
268
  server.registerTool("finish_review", {
269
- description: "Complete a review task by submitting findings. Updates both plan.json and results.json.",
269
+ description: "Complete a review task by submitting issues. Updates both plan.json and results.json.",
270
270
  inputSchema: {
271
271
  plan_id: z.string().describe("The plan ID"),
272
272
  task_id: z.string().describe("The task ID to complete"),
273
- findings: z
273
+ issues: z
274
274
  .array(z.object({
275
275
  severity: z
276
276
  .enum(["critical", "warning", "info"])
277
- .describe("Finding severity"),
278
- file: z.string().describe("File path where the issue was found"),
279
- line: z
280
- .number()
281
- .nullable()
282
- .optional()
283
- .describe("Line number, if applicable"),
277
+ .describe("Issue severity"),
284
278
  description: z.string().describe("Description of the issue"),
285
279
  suggestion: z
286
280
  .string()
287
281
  .nullable()
288
282
  .optional()
289
- .describe("Suggested fix, if applicable"),
283
+ .describe("High-level suggested fix, if applicable"),
284
+ references: z
285
+ .array(z.object({
286
+ file: z.string().describe("File path"),
287
+ symbol: z.string().nullable().optional().describe("Semantic symbol anchor, e.g. ClassName::method"),
288
+ line: z.number().nullable().optional().describe("Line number for navigation"),
289
+ code: z.string().nullable().optional().describe("Current code snippet"),
290
+ suggestedCode: z.string().nullable().optional().describe("Suggested replacement code"),
291
+ note: z.string().nullable().optional().describe("Why this reference is relevant"),
292
+ }))
293
+ .describe("Code locations where the issue manifests"),
290
294
  }))
291
- .describe("Array of findings from the review"),
295
+ .describe("Array of issues from the review"),
292
296
  },
293
- }, ({ plan_id, task_id, findings }) => {
297
+ }, ({ plan_id, task_id, issues }) => {
294
298
  try {
295
- const normalizedFindings = findings.map((f) => ({
296
- severity: f.severity,
297
- file: f.file,
298
- line: f.line ?? null,
299
- description: f.description,
300
- suggestion: f.suggestion ?? null,
299
+ const normalizedIssues = issues.map((i) => ({
300
+ severity: i.severity,
301
+ description: i.description,
302
+ suggestion: i.suggestion ?? null,
303
+ references: i.references.map((r) => ({
304
+ file: r.file,
305
+ symbol: r.symbol ?? null,
306
+ line: r.line ?? null,
307
+ code: r.code ?? null,
308
+ suggestedCode: r.suggestedCode ?? null,
309
+ note: r.note ?? null,
310
+ })),
301
311
  }));
302
- storage.completeTask(plan_id, task_id, normalizedFindings);
312
+ storage.completeTask(plan_id, task_id, normalizedIssues);
303
313
  const plan = storage.getPlan(plan_id);
304
314
  const task = plan.tasks[task_id];
305
315
  return {
@@ -309,7 +319,7 @@ export function registerReviewTools(server, config, projectRoot) {
309
319
  task_id: task.task_id,
310
320
  status: task.status,
311
321
  completed_at: task.completed_at,
312
- findings_count: normalizedFindings.length,
322
+ issues_count: normalizedIssues.length,
313
323
  plan_status: plan.status,
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QAAQ,CAAC,gCAAgC,CAAC;SAC/D;KACF,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAE5C,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC7E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACzE,CAAC;gBACF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { registerReviewTools } from "./mcp/tools.js";
5
- import { loadConfig } from "./core/config.js";
5
+ import { loadConfig } from "./config/loader.js";
6
6
  const projectRoot = process.cwd();
7
7
  const config = loadConfig(projectRoot);
8
8
  const server = new McpServer({
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAClC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAEvC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAEjD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAClC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAEvC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAEjD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -1,10 +1,14 @@
1
- import type { ReviewTask } from "../core/types.js";
1
+ import type { ReviewTask } from "../types/review.js";
2
2
  /**
3
3
  * Build the system prompt for an executor agent.
4
4
  *
5
5
  * The executor receives a single deskcheck task containing the detective prompt
6
6
  * (from the criterion), the files to check, and the extracted context
7
7
  * (diff, file content, or symbol). It outputs a JSON array of findings to stdout.
8
+ *
9
+ * CRITICAL DESIGN PRINCIPLE: The executor ONLY reports findings that the criterion
10
+ * explicitly asks it to check. It does NOT do a general code review. The criterion
11
+ * is the complete specification — nothing more, nothing less.
8
12
  */
9
13
  export declare function buildExecutorPrompt(task: ReviewTask): string;
10
- //# sourceMappingURL=executor-prompt.d.ts.map
14
+ //# sourceMappingURL=ExecutorPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutorPrompt.d.ts","sourceRoot":"","sources":["../../src/prompts/ExecutorPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAwC5D"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Build the system prompt for an executor agent.
3
+ *
4
+ * The executor receives a single deskcheck task containing the detective prompt
5
+ * (from the criterion), the files to check, and the extracted context
6
+ * (diff, file content, or symbol). It outputs a JSON array of findings to stdout.
7
+ *
8
+ * CRITICAL DESIGN PRINCIPLE: The executor ONLY reports findings that the criterion
9
+ * explicitly asks it to check. It does NOT do a general code review. The criterion
10
+ * is the complete specification — nothing more, nothing less.
11
+ */
12
+ export function buildExecutorPrompt(task) {
13
+ const sections = [];
14
+ sections.push(`You are a criteria-bound code review executor. You check code against ONE specific criterion and report ONLY what that criterion asks you to check.
15
+
16
+ ## CRITICAL CONSTRAINT
17
+
18
+ You MUST only report findings that are explicitly covered by the "What to Check" section of the criterion below. If something looks wrong but the criterion does not ask you to check for it, DO NOT report it. You are not doing a general code review. You are checking for specific, defined violations.
19
+
20
+ - If the criterion says "check for X and Y", you check for X and Y. Not Z.
21
+ - If the criterion has a "What NOT to Check" section, respect it absolutely.
22
+ - If the criterion defines severity levels, use those definitions — not your own.
23
+ - An empty findings array is a valid and good outcome. It means the code passes this criterion.
24
+ - Do NOT invent rules based on "consistency", "best practices", or patterns you see elsewhere in the file.`);
25
+ // Criterion instructions (the detective prompt from the criterion)
26
+ sections.push(`## Criterion Instructions\n\nThe following is the COMPLETE specification of what to check. Do not go beyond it.\n\n${task.prompt ?? "No instructions provided."}`);
27
+ // Files under review
28
+ const fileList = task.files.map((f) => `- ${f}`).join("\n");
29
+ sections.push(`## Files Under Review\n${fileList}`);
30
+ // Scope hint
31
+ if (task.hint) {
32
+ sections.push(`## Scope Hint\n${task.hint}`);
33
+ }
34
+ // Review context
35
+ const contextHeader = `## Review Context\n**Context Type:** ${task.context_type}`;
36
+ const symbolLine = task.symbol ? `\n**Symbol:** ${task.symbol}` : "";
37
+ const contextBody = task.context ?? "No context provided.";
38
+ sections.push(`${contextHeader}${symbolLine}\n\n${contextBody}`);
39
+ // Instructions based on context type
40
+ sections.push(buildContextTypeGuidance(task.context_type));
41
+ // Output format instructions
42
+ sections.push(buildOutputInstructions());
43
+ return sections.join("\n\n");
44
+ }
45
+ /** Guidance on how to review based on the context type. */
46
+ function buildContextTypeGuidance(contextType) {
47
+ const header = "## Context Type";
48
+ switch (contextType) {
49
+ case "diff":
50
+ return `${header}\nYou are reviewing a **diff**. The context shows what changed. Apply the criterion's checks to the changed code.`;
51
+ case "file":
52
+ return `${header}\nYou are reviewing **full file contents**. Apply the criterion's checks to the entire file.`;
53
+ case "symbol":
54
+ return `${header}\nYou are reviewing a **specific symbol** (function, class, or method). Apply the criterion's checks to the named symbol.`;
55
+ default:
56
+ return `${header}\nApply the criterion's checks to the provided context.`;
57
+ }
58
+ }
59
+ /** Instructions for the executor's output format. */
60
+ function buildOutputInstructions() {
61
+ return `## Your Task
62
+ 1. Read the review instructions carefully
63
+ 2. Analyze the code provided in the context
64
+ 3. Report issues as a JSON array to stdout
65
+
66
+ Output ONLY a JSON array of issues. Each issue has references pointing to one or more code locations:
67
+ \`\`\`json
68
+ {
69
+ "severity": "critical|warning|info",
70
+ "description": "What's wrong",
71
+ "suggestion": "How to fix it (high-level), or null",
72
+ "references": [
73
+ {
74
+ "file": "path/to/file",
75
+ "symbol": "ClassName::method or null",
76
+ "line": 42,
77
+ "code": "the current code snippet, or null",
78
+ "suggestedCode": "what it should look like, or null",
79
+ "note": "why this location is relevant, or null"
80
+ }
81
+ ]
82
+ }
83
+ \`\`\`
84
+
85
+ ### Field guide
86
+
87
+ - \`severity\`: Use the severity levels defined in the criterion above. If the criterion defines when something is "critical" vs "warning" vs "info", follow those definitions exactly.
88
+ - \`description\`: clear description of the issue — reference the specific check from the criterion
89
+ - \`suggestion\`: high-level fix suggestion, or null
90
+ - \`references\`: array of code locations where the issue manifests (at least one required)
91
+ - \`file\`: the file path
92
+ - \`symbol\`: semantic anchor like "ClassName::method" or "ClassName::$property" — stable across refactors. Use null if not applicable.
93
+ - \`line\`: line number for navigation, or null
94
+ - \`code\`: include the relevant code snippet so the reviewer can understand the issue without opening the file. Keep it focused (the relevant function/block, not the entire file).
95
+ - \`suggestedCode\`: when suggesting a fix, show what the code should look like. Use null when the fix is better described in the top-level \`suggestion\`.
96
+ - \`note\`: brief context for why this reference matters (e.g. "First occurrence", "Duplicated", "Missing return type"). Use null when obvious.
97
+
98
+ ### When to use multiple references
99
+
100
+ - **Cross-file issues**: duplicated patterns across files, missing consistency between related files
101
+ - **Single-file issues**: just use one reference
102
+
103
+ ### Code snippets
104
+
105
+ Include relevant code snippets in \`code\` so the reviewer can understand the issue without opening their editor. When suggesting a fix, include \`suggestedCode\` to show the before/after clearly.
106
+
107
+ If no issues found, output an empty array: []
108
+
109
+ Do NOT output any text outside the JSON array. No explanations, no markdown, no commentary — just the JSON array.`;
110
+ }
111
+ //# sourceMappingURL=ExecutorPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutorPrompt.js","sourceRoot":"","sources":["../../src/prompts/ExecutorPrompt.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,MAAM,Q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AAiB,CAAC;IAEjC,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,GAAG,MAAM,mHAAmH,CAAC;QACtI,KAAK,MAAM;YACT,OAAO,GAAG,MAAM,8FAA8F,CAAC;QACjH,KAAK,QAAQ;YACX,OAAO,GAAG,MAAM,2HAA2H,CAAC;QAC9I;YACE,OAAO,GAAG,MAAM,yDAAyD,CAAC;IAC9E,CAAC;AACH,CAAC;AAED,qDAAqD;AACrD,SAAS,uBAAuB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kHAgDyG,CAAC;AACnH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Finding } from "../types/review.js";
2
+ /**
3
+ * Build the system prompt for a judge agent.
4
+ *
5
+ * The judge evaluates executor findings against expected results from a test
6
+ * case. It determines whether each finding is correct, out of scope, or has
7
+ * wrong severity, and whether each expectation was found or missed.
8
+ *
9
+ * @param criterionBody - The criterion's detective prompt (what was checked).
10
+ * @param expectedContent - Content of expected.md (what should/shouldn't be found).
11
+ * @param findings - Findings produced by the executor agent.
12
+ * @param fixtureContent - Content of the fixture file that was reviewed.
13
+ * @returns The complete judge prompt as a string.
14
+ */
15
+ export declare function buildJudgePrompt(criterionBody: string, expectedContent: string, findings: Finding[], fixtureContent: string): string;
16
+ //# sourceMappingURL=JudgePrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JudgePrompt.d.ts","sourceRoot":"","sources":["../../src/prompts/JudgePrompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,OAAO,EAAE,EACnB,cAAc,EAAE,MAAM,GACrB,MAAM,CA6DR"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Build the system prompt for a judge agent.
3
+ *
4
+ * The judge evaluates executor findings against expected results from a test
5
+ * case. It determines whether each finding is correct, out of scope, or has
6
+ * wrong severity, and whether each expectation was found or missed.
7
+ *
8
+ * @param criterionBody - The criterion's detective prompt (what was checked).
9
+ * @param expectedContent - Content of expected.md (what should/shouldn't be found).
10
+ * @param findings - Findings produced by the executor agent.
11
+ * @param fixtureContent - Content of the fixture file that was reviewed.
12
+ * @returns The complete judge prompt as a string.
13
+ */
14
+ export function buildJudgePrompt(criterionBody, expectedContent, findings, fixtureContent) {
15
+ const sections = [];
16
+ sections.push(`You are a test judge for a code review criterion. Your job is to evaluate whether the executor's findings match the expectations.`);
17
+ sections.push(`## The Criterion Being Tested\n\n${criterionBody}`);
18
+ sections.push(`## The Fixture File\n\n\`\`\`\n${fixtureContent}\n\`\`\``);
19
+ sections.push(`## Expected Results\n\n${expectedContent}`);
20
+ sections.push(`## Actual Findings\n\n\`\`\`json\n${JSON.stringify(findings, null, 2)}\n\`\`\``);
21
+ sections.push(`## Your Task
22
+
23
+ For EACH finding the executor produced, determine:
24
+ - Is it "correct" — it matches something the criterion asks to check AND is described in the "Should Find" section of expected results?
25
+ - Is it "out_of_scope" — the finding is about something NOT in the criterion's checklist (freelancing)?
26
+ - Is it "incorrect_severity" — the finding is in scope but uses the wrong severity level per the criterion's severity table?
27
+
28
+ For EACH expectation in the "Should Find" section, determine:
29
+ - Was it "found" — does at least one finding match this expectation?
30
+ - Was it "missed" — no finding corresponds to this expectation?
31
+
32
+ Also check the "Should Not Find" section — if any finding matches something listed there, mark that finding as "out_of_scope".
33
+
34
+ Output ONLY a JSON object with this structure:
35
+ {
36
+ "findings_review": [
37
+ {
38
+ "finding": "description of the executor's finding",
39
+ "verdict": "correct" | "out_of_scope" | "incorrect_severity",
40
+ "criterion_check": "#N — check name" or null,
41
+ "comment": "brief explanation"
42
+ }
43
+ ],
44
+ "expectations_review": [
45
+ {
46
+ "expectation": "the expected item from expected.md",
47
+ "verdict": "found" | "missed",
48
+ "matched_finding": "description of matching finding" or null,
49
+ "comment": "brief explanation"
50
+ }
51
+ ]
52
+ }
53
+
54
+ Do NOT output any text outside the JSON object. No explanations, no markdown, just the JSON.`);
55
+ return sections.join("\n\n");
56
+ }
57
+ //# sourceMappingURL=JudgePrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JudgePrompt.js","sourceRoot":"","sources":["../../src/prompts/JudgePrompt.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAAqB,EACrB,eAAuB,EACvB,QAAmB,EACnB,cAAsB;IAEtB,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,QAAQ,CAAC,IAAI,CACX,mIAAmI,CACpI,CAAC;IAEF,QAAQ,CAAC,IAAI,CACX,oCAAoC,aAAa,EAAE,CACpD,CAAC;IAEF,QAAQ,CAAC,IAAI,CACX,kCAAkC,cAAc,UAAU,CAC3D,CAAC;IAEF,QAAQ,CAAC,IAAI,CACX,0BAA0B,eAAe,EAAE,CAC5C,CAAC;IAEF,QAAQ,CAAC,IAAI,CACX,qCAAqC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,CACjF,CAAC;IAEF,QAAQ,CAAC,IAAI,CACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6FAiCyF,CAC1F,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Build the system prompt for the planner agent.
3
+ *
4
+ * The planner agent interprets the user's natural language intent, uses
5
+ * git/filesystem tools to discover which files to review, and calls the
6
+ * create_plan MCP tool to create the plan.
7
+ *
8
+ * @param moduleDescriptions - Pre-formatted string listing available criteria.
9
+ * @returns The full system prompt for the planner agent.
10
+ */
11
+ export declare function buildPlannerPrompt(moduleDescriptions: string): string;
12
+ //# sourceMappingURL=PlannerPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlannerPrompt.d.ts","sourceRoot":"","sources":["../../src/prompts/PlannerPrompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAsBrE"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Build the system prompt for the planner agent.
3
+ *
4
+ * The planner agent interprets the user's natural language intent, uses
5
+ * git/filesystem tools to discover which files to review, and calls the
6
+ * create_plan MCP tool to create the plan.
7
+ *
8
+ * @param moduleDescriptions - Pre-formatted string listing available criteria.
9
+ * @returns The full system prompt for the planner agent.
10
+ */
11
+ export function buildPlannerPrompt(moduleDescriptions) {
12
+ return `You are a deskcheck planner. The user will tell you what they want to check. Your job is to figure out which files are involved and call the create_plan tool.
13
+
14
+ ## Available Criteria
15
+
16
+ ${moduleDescriptions}
17
+
18
+ ## How to Determine Files
19
+
20
+ - If the user mentions a **directory** (e.g., "everything in app/Services/"): use Bash to list all files recursively: \`find <path> -type f -name "*.php" -o -name "*.ts" -o -name "*.vue"\` or similar. Then pass ALL those file paths to create_plan.
21
+ - If the user mentions a **branch** or "changes" or "diff": run \`git diff <branch> --name-only\` to get changed files.
22
+ - If the user mentions a **specific file**: use that file path directly.
23
+ - If the user mentions a **function/method name** and a file: use the file path, set source_type to "symbol".
24
+ - If the user is vague: use Bash to explore the filesystem and figure out what files are relevant.
25
+
26
+ ## What to Do
27
+
28
+ 1. Figure out which files to check (use Bash to run commands like find, ls, git diff)
29
+ 2. Call the create_plan tool with the file list and appropriate source type (use "file" for directory/file reviews, "diff" for branch comparisons)
30
+ 3. Report what you created
31
+
32
+ You MUST call the create_plan tool. Do NOT review code yourself. Your only job is to determine the file list and call create_plan.`;
33
+ }
34
+ //# sourceMappingURL=PlannerPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlannerPrompt.js","sourceRoot":"","sources":["../../src/prompts/PlannerPrompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,kBAA0B;IAC3D,OAAO;;;;EAIP,kBAAkB;;;;;;;;;;;;;;;;mIAgB+G,CAAC;AACpI,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReviewResults } from "../core/types.js";
1
+ import type { ReviewResults } from "../../types/review.js";
2
2
  /** Render review results as formatted JSON. */
3
3
  export declare function renderJson(results: ReviewResults): string;
4
- //# sourceMappingURL=json.d.ts.map
4
+ //# sourceMappingURL=JsonRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRenderer.d.ts","sourceRoot":"","sources":["../../../src/renderers/review/JsonRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAEzD"}
@@ -2,4 +2,4 @@
2
2
  export function renderJson(results) {
3
3
  return JSON.stringify(results, null, 2);
4
4
  }
5
- //# sourceMappingURL=json.js.map
5
+ //# sourceMappingURL=JsonRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRenderer.js","sourceRoot":"","sources":["../../../src/renderers/review/JsonRenderer.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,MAAM,UAAU,UAAU,CAAC,OAAsB;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReviewPlan, ReviewResults } from "../core/types.js";
1
+ import type { ReviewPlan, ReviewResults } from "../../types/review.js";
2
2
  /** Render review results as markdown suitable for PR comments. */
3
3
  export declare function renderMarkdown(results: ReviewResults, plan?: ReviewPlan): string;
4
- //# sourceMappingURL=markdown.d.ts.map
4
+ //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/renderers/review/MarkdownRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAa,MAAM,uBAAuB,CAAC;AAGlF,kEAAkE;AAClE,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EACtB,IAAI,CAAC,EAAE,UAAU,GAChB,MAAM,CAsDR"}
@@ -0,0 +1,52 @@
1
+ import { groupIssuesBySeveritySection } from "../shared.js";
2
+ /** Render review results as markdown suitable for PR comments. */
3
+ export function renderMarkdown(results, plan) {
4
+ const lines = [];
5
+ // Header
6
+ const name = plan?.name ?? results.plan_id;
7
+ lines.push(`## Deskcheck: ${name}`);
8
+ lines.push("");
9
+ const { critical, warning, info, total } = results.summary;
10
+ const completed = results.completion.completed;
11
+ const totalTasks = results.completion.total;
12
+ lines.push(`**${total} issues** (${critical} critical, ${warning} warning, ${info} info) | ${completed}/${totalTasks} tasks`);
13
+ lines.push("");
14
+ // Issues grouped by severity
15
+ for (const section of groupIssuesBySeveritySection(results)) {
16
+ lines.push(`### ${section.label}`);
17
+ for (const { issue, reviewId } of section.issues) {
18
+ lines.push(`- ${issue.description} *(from ${reviewId})*`);
19
+ // Show references
20
+ for (const ref of issue.references) {
21
+ const location = formatRefLocation(ref);
22
+ lines.push(` - \`${location}\`${ref.note ? ` — ${ref.note}` : ""}`);
23
+ if (ref.code) {
24
+ lines.push(` \`\`\`\n ${ref.code.split("\n").join("\n ")}\n \`\`\``);
25
+ }
26
+ if (ref.suggestedCode) {
27
+ lines.push(` **Suggested:**`);
28
+ lines.push(` \`\`\`\n ${ref.suggestedCode.split("\n").join("\n ")}\n \`\`\``);
29
+ }
30
+ }
31
+ if (issue.suggestion) {
32
+ lines.push(` > ${issue.suggestion}`);
33
+ }
34
+ }
35
+ lines.push("");
36
+ }
37
+ // Coverage
38
+ if (plan) {
39
+ lines.push("### Coverage");
40
+ lines.push(`${plan.matched_files.length} files reviewed | ${plan.unmatched_files.length} files not covered by any criterion`);
41
+ lines.push("");
42
+ }
43
+ return lines.join("\n");
44
+ }
45
+ /** Format a reference's location string for markdown. */
46
+ function formatRefLocation(ref) {
47
+ if (ref.symbol) {
48
+ return ref.line ? `${ref.file} ${ref.symbol}:${ref.line}` : `${ref.file} ${ref.symbol}`;
49
+ }
50
+ return ref.line ? `${ref.file}:${ref.line}` : ref.file;
51
+ }
52
+ //# sourceMappingURL=MarkdownRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownRenderer.js","sourceRoot":"","sources":["../../../src/renderers/review/MarkdownRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAE5D,kEAAkE;AAClE,MAAM,UAAU,cAAc,CAC5B,OAAsB,EACtB,IAAiB;IAEjB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,SAAS;IACT,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAC3C,KAAK,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;IAC/C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;IAC5C,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,cAAc,QAAQ,cAAc,OAAO,aAAa,IAAI,YAAY,SAAS,IAAI,UAAU,QAAQ,CAClH,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,6BAA6B;IAC7B,KAAK,MAAM,OAAO,IAAI,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ACX,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CACR,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,qBAAqB,IAAI,CAAC,eAAe,CAAC,MAAM,qCAAqC,CAClH,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,yDAAyD;AACzD,SAAS,iBAAiB,CAAC,GAAc;IACvC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACf,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;IAC1F,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;AACzD,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReviewPlan, ReviewResults } from "../core/types.js";
1
+ import type { ReviewPlan, ReviewResults } from "../../types/review.js";
2
2
  /** Render review results as colored terminal output. */
3
3
  export declare function renderTerminal(results: ReviewResults, plan?: ReviewPlan): string;
4
- //# sourceMappingURL=terminal.d.ts.map
4
+ //# sourceMappingURL=TerminalRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerminalRenderer.d.ts","sourceRoot":"","sources":["../../../src/renderers/review/TerminalRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAA8B,MAAM,uBAAuB,CAAC;AA0BnG,wDAAwD;AACxD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EACtB,IAAI,CAAC,EAAE,UAAU,GAChB,MAAM,CA0FR"}
@@ -1,4 +1,4 @@
1
- import { groupFindingsBySeveritySection } from "./shared.js";
1
+ import { groupIssuesBySeveritySection } from "../shared.js";
2
2
  // ANSI color codes
3
3
  const RESET = "\x1b[0m";
4
4
  const BOLD = "\x1b[1m";
@@ -47,22 +47,37 @@ export function renderTerminal(results, plan) {
47
47
  lines.push(` ${summaryParts.join(`${DIM} │ ${RESET}`)}`);
48
48
  }
49
49
  lines.push("");
50
- // Findings grouped by severity
51
- const sections = groupFindingsBySeveritySection(results);
50
+ // Issues grouped by severity
51
+ const sections = groupIssuesBySeveritySection(results);
52
52
  for (const section of sections) {
53
53
  const color = SEVERITY_COLORS[section.severity];
54
54
  const icon = SEVERITY_ICONS[section.severity];
55
- lines.push(`${BOLD}${color} ${icon} ${section.label} (${section.findings.length})${RESET}`);
55
+ lines.push(`${BOLD}${color} ${icon} ${section.label} (${section.issues.length})${RESET}`);
56
56
  lines.push("");
57
- for (let i = 0; i < section.findings.length; i++) {
58
- const { finding, reviewId } = section.findings[i];
59
- const location = finding.line
60
- ? `${finding.file}:${finding.line}`
61
- : finding.file;
62
- lines.push(` ${color}${i + 1}.${RESET} ${finding.description}`);
63
- lines.push(` ${DIM}${location}${RESET} ${DIM}(${reviewId})${RESET}`);
64
- if (finding.suggestion) {
65
- lines.push(` ${CYAN}${finding.suggestion}${RESET}`);
57
+ for (let i = 0; i < section.issues.length; i++) {
58
+ const { issue, reviewId } = section.issues[i];
59
+ lines.push(` ${color}${i + 1}.${RESET} ${issue.description}`);
60
+ // Show references
61
+ for (const ref of issue.references) {
62
+ const location = formatRefLocation(ref);
63
+ lines.push(` ${DIM}${location}${RESET} ${DIM}(${reviewId})${RESET}`);
64
+ if (ref.note) {
65
+ lines.push(` ${DIM} ${ref.note}${RESET}`);
66
+ }
67
+ if (ref.code) {
68
+ for (const codeLine of ref.code.split("\n")) {
69
+ lines.push(` ${DIM} │ ${codeLine}${RESET}`);
70
+ }
71
+ }
72
+ if (ref.suggestedCode) {
73
+ lines.push(` ${CYAN} → suggested:${RESET}`);
74
+ for (const codeLine of ref.suggestedCode.split("\n")) {
75
+ lines.push(` ${CYAN} │ ${codeLine}${RESET}`);
76
+ }
77
+ }
78
+ }
79
+ if (issue.suggestion) {
80
+ lines.push(` ${CYAN}→ ${issue.suggestion}${RESET}`);
66
81
  }
67
82
  lines.push("");
68
83
  }
@@ -85,4 +100,11 @@ export function renderTerminal(results, plan) {
85
100
  }
86
101
  return lines.join("\n");
87
102
  }
88
- //# sourceMappingURL=terminal.js.map
103
+ /** Format a reference's location string: prefer symbol, fall back to file:line. */
104
+ function formatRefLocation(ref) {
105
+ if (ref.symbol) {
106
+ return ref.line ? `${ref.file} ${ref.symbol}:${ref.line}` : `${ref.file} ${ref.symbol}`;
107
+ }
108
+ return ref.line ? `${ref.file}:${ref.line}` : ref.file;
109
+ }
110
+ //# sourceMappingURL=TerminalRenderer.js.map