@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
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Calculate test scores from judge verdicts.
3
+ *
4
+ * Pure math — no LLM, no I/O. Computes recall, precision, and scope
5
+ * compliance from the judge's finding and expectation reviews.
6
+ */
7
+ export function calculateScores(judgeResult) {
8
+ const { findings_review, expectations_review } = judgeResult;
9
+ // Finding counts by verdict
10
+ const total_findings = findings_review.length;
11
+ const correct = findings_review.filter((f) => f.verdict === "correct").length;
12
+ const out_of_scope = findings_review.filter((f) => f.verdict === "out_of_scope").length;
13
+ const incorrect_severity = findings_review.filter((f) => f.verdict === "incorrect_severity").length;
14
+ // Expectation counts by verdict
15
+ const total_expectations = expectations_review.length;
16
+ const expectations_found = expectations_review.filter((e) => e.verdict === "found").length;
17
+ const expectations_missed = expectations_review.filter((e) => e.verdict === "missed").length;
18
+ // Derived ratios (default to 1.0 when denominator is zero)
19
+ const recall = total_expectations > 0 ? expectations_found / total_expectations : 1.0;
20
+ const precision = total_findings > 0 ? correct / total_findings : 1.0;
21
+ const scope_compliance = total_findings > 0 ? (total_findings - out_of_scope) / total_findings : 1.0;
22
+ return {
23
+ total_findings,
24
+ correct,
25
+ out_of_scope,
26
+ incorrect_severity,
27
+ total_expectations,
28
+ expectations_found,
29
+ expectations_missed,
30
+ recall,
31
+ precision,
32
+ scope_compliance,
33
+ };
34
+ }
35
+ //# sourceMappingURL=TestScorerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestScorerService.js","sourceRoot":"","sources":["../../../src/services/testing/TestScorerService.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,WAAwB;IACtD,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,WAAW,CAAC;IAE7D,4BAA4B;IAC5B,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC;IAC9C,M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ACN,SAAS;QACT,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { TestCase, TestCaseResult, TestRun, TestSuiteStatus } from "../../types/testing.js";
2
+ /**
3
+ * Persists test runs to .deskcheck/test-runs/ using atomic writes.
4
+ *
5
+ * Each test run lives in a timestamped directory containing a single
6
+ * results.json file. Uses write-to-tmp + rename for atomic updates.
7
+ * No file locking needed since test runs execute sequentially.
8
+ */
9
+ export declare class TestStorageService {
10
+ private readonly storageDir;
11
+ constructor(storageDir: string);
12
+ /**
13
+ * Create a new test run with all test cases initialized as "pending".
14
+ *
15
+ * Creates a timestamped directory and writes an initial results.json.
16
+ */
17
+ createRun(testCases: TestCase[]): TestRun;
18
+ /** Read the results.json for a given run ID. */
19
+ getRun(runId: string): TestRun;
20
+ /**
21
+ * Return the most recent run directory name, or null if no runs exist.
22
+ */
23
+ getLatestRunId(): string | null;
24
+ /**
25
+ * Update a specific test case in results.json.
26
+ *
27
+ * Reads the current run, applies the partial update to the specified
28
+ * test case, and writes back atomically.
29
+ */
30
+ updateTestCase(runId: string, criterionId: string, testName: string, update: Partial<TestCaseResult>): void;
31
+ /** Update a suite's status. */
32
+ updateSuiteStatus(runId: string, criterionId: string, status: TestSuiteStatus): void;
33
+ /** Mark the run as complete with a completion timestamp. */
34
+ completeRun(runId: string): void;
35
+ private resultsPath;
36
+ /** Atomic write: write to .tmp then rename. */
37
+ private writeRun;
38
+ }
39
+ //# sourceMappingURL=TestStorageService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestStorageService.d.ts","sourceRoot":"","sources":["../../../src/services/testing/TestStorageService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,OAAO,EACP,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAmBhC;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,UAAU,EAAE,MAAM;IAI9B;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO;IA8CzC,gDAAgD;IAChD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAM9B;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAsB/B;;;;;OAKG;IACH,cAAc,CACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,GAC9B,IAAI;IAiBP,+BAA+B;IAC/B,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI;IAYpF,4DAA4D;IAC5D,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWhC,OAAO,CAAC,WAAW;IAInB,+CAA+C;IAC/C,OAAO,CAAC,QAAQ;CAMjB"}
@@ -0,0 +1,144 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ // =============================================================================
4
+ // Helpers
5
+ // =============================================================================
6
+ /** Format a Date as YYYY-MM-DD_HHmmss for use as a run ID / directory name. */
7
+ function formatTimestamp(date) {
8
+ const pad2 = (n) => String(n).padStart(2, "0");
9
+ return (`${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}` +
10
+ `_${pad2(date.getHours())}${pad2(date.getMinutes())}${pad2(date.getSeconds())}`);
11
+ }
12
+ // =============================================================================
13
+ // TestStorageService
14
+ // =============================================================================
15
+ /**
16
+ * Persists test runs to .deskcheck/test-runs/ using atomic writes.
17
+ *
18
+ * Each test run lives in a timestamped directory containing a single
19
+ * results.json file. Uses write-to-tmp + rename for atomic updates.
20
+ * No file locking needed since test runs execute sequentially.
21
+ */
22
+ export class TestStorageService {
23
+ storageDir;
24
+ constructor(storageDir) {
25
+ this.storageDir = storageDir;
26
+ }
27
+ /**
28
+ * Create a new test run with all test cases initialized as "pending".
29
+ *
30
+ * Creates a timestamped directory and writes an initial results.json.
31
+ */
32
+ createRun(testCases) {
33
+ const now = new Date();
34
+ const runId = formatTimestamp(now);
35
+ const runDir = path.join(this.storageDir, runId);
36
+ fs.mkdirSync(runDir, { recursive: true });
37
+ // Group test cases by criterionId to build suites
38
+ const suites = {};
39
+ for (const testCase of testCases) {
40
+ if (!suites[testCase.criterionId]) {
41
+ suites[testCase.criterionId] = {
42
+ status: "pending",
43
+ criterion_file: testCase.criterionFile,
44
+ tests: {},
45
+ };
46
+ }
47
+ const initialResult = {
48
+ status: "pending",
49
+ fixture_file: testCase.fixtureFile,
50
+ expected_file: testCase.expectedFile,
51
+ findings: null,
52
+ judge: null,
53
+ scores: null,
54
+ error: null,
55
+ executor_usage: null,
56
+ judge_usage: null,
57
+ };
58
+ suites[testCase.criterionId].tests[testCase.name] = initialResult;
59
+ }
60
+ const run = {
61
+ run_id: runId,
62
+ status: "running",
63
+ started_at: now.toISOString(),
64
+ completed_at: null,
65
+ suites,
66
+ };
67
+ this.writeRun(runId, run);
68
+ return run;
69
+ }
70
+ /** Read the results.json for a given run ID. */
71
+ getRun(runId) {
72
+ const resultsPath = this.resultsPath(runId);
73
+ const raw = fs.readFileSync(resultsPath, "utf-8");
74
+ return JSON.parse(raw);
75
+ }
76
+ /**
77
+ * Return the most recent run directory name, or null if no runs exist.
78
+ */
79
+ getLatestRunId() {
80
+ if (!fs.existsSync(this.storageDir)) {
81
+ return null;
82
+ }
83
+ const entries = fs.readdirSync(this.storageDir, { withFileTypes: true });
84
+ const runDirs = entries
85
+ .filter((entry) => entry.isDirectory() &&
86
+ fs.existsSync(path.join(this.storageDir, entry.name, "results.json")))
87
+ .map((entry) => entry.name)
88
+ .sort();
89
+ if (runDirs.length === 0) {
90
+ return null;
91
+ }
92
+ return runDirs[runDirs.length - 1];
93
+ }
94
+ /**
95
+ * Update a specific test case in results.json.
96
+ *
97
+ * Reads the current run, applies the partial update to the specified
98
+ * test case, and writes back atomically.
99
+ */
100
+ updateTestCase(runId, criterionId, testName, update) {
101
+ const run = this.getRun(runId);
102
+ const suite = run.suites[criterionId];
103
+ if (!suite) {
104
+ throw new Error(`Suite "${criterionId}" not found in run "${runId}"`);
105
+ }
106
+ const testCase = suite.tests[testName];
107
+ if (!testCase) {
108
+ throw new Error(`Test "${testName}" not found in suite "${criterionId}" of run "${runId}"`);
109
+ }
110
+ Object.assign(testCase, update);
111
+ this.writeRun(runId, run);
112
+ }
113
+ /** Update a suite's status. */
114
+ updateSuiteStatus(runId, criterionId, status) {
115
+ const run = this.getRun(runId);
116
+ const suite = run.suites[criterionId];
117
+ if (!suite) {
118
+ throw new Error(`Suite "${criterionId}" not found in run "${runId}"`);
119
+ }
120
+ suite.status = status;
121
+ this.writeRun(runId, run);
122
+ }
123
+ /** Mark the run as complete with a completion timestamp. */
124
+ completeRun(runId) {
125
+ const run = this.getRun(runId);
126
+ run.status = "complete";
127
+ run.completed_at = new Date().toISOString();
128
+ this.writeRun(runId, run);
129
+ }
130
+ // ---------------------------------------------------------------------------
131
+ // Private Helpers
132
+ // ---------------------------------------------------------------------------
133
+ resultsPath(runId) {
134
+ return path.join(this.storageDir, runId, "results.json");
135
+ }
136
+ /** Atomic write: write to .tmp then rename. */
137
+ writeRun(runId, run) {
138
+ const target = this.resultsPath(runId);
139
+ const tmp = target + ".tmp";
140
+ fs.writeFileSync(tmp, JSON.stringify(run, null, 2) + "\n");
141
+ fs.renameSync(tmp, target);
142
+ }
143
+ }
144
+ //# sourceMappingURL=TestStorageService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestStorageService.js","sourceRoot":"","sources":["../../../src/services/testing/TestStorageService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,+EAA+E;AAC/E,SAAS,eAAe,CAAC,IAAU;IACjC,MAAM,IAA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ity level assigned to a criterion (how important it is). */
2
+ export type ModuleSeverity = "critical" | "high" | "medium" | "low";
3
+ /** Claude model tier used for agent execution. */
4
+ export type AgentModel = "haiku" | "sonnet" | "opus";
5
+ /** A criterion parsed from a markdown file in the criteria directory. */
6
+ export interface ReviewModule {
7
+ /** Unique identifier, e.g. "architecture/dto-enforcement". */
8
+ id: string;
9
+ /** Relative file path, e.g. "deskcheck/criteria/architecture/dto-enforcement.md". */
10
+ file: string;
11
+ /** Human-readable description from frontmatter. */
12
+ description: string;
13
+ /** How important this criterion's findings are. */
14
+ severity: ModuleSeverity;
15
+ /** File glob patterns that determine which files this criterion checks. */
16
+ globs: string[];
17
+ /** Natural language instruction for how to split files into tasks. */
18
+ mode: string;
19
+ /** Claude model tier to use for executor agents. */
20
+ model: AgentModel;
21
+ /** The detective prompt (markdown body of the criterion) given to executor agents. */
22
+ prompt: string;
23
+ }
24
+ //# sourceMappingURL=criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../src/types/criteria.ts"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEpE,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErD,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,cAAc,CAAC;IACzB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,EAAE,UAAU,CAAC;IAClB,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // Common Union Types
2
+ // Criterion Types (parsed from criterion markdown files)
3
3
  // =============================================================================
4
4
  export {};
5
- //# sourceMappingURL=types.js.map
5
+ //# sourceMappingURL=criteria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../src/types/criteria.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yDAAyD;AACzD,gFAAgF"}
@@ -1,9 +1,6 @@
1
- /** Severity level assigned to a criterion (how important it is). */
2
- export type ModuleSeverity = "critical" | "high" | "medium" | "low";
1
+ import type { AgentModel, ModuleSeverity } from "./criteria.js";
3
2
  /** Severity level assigned to an individual finding. */
4
3
  export type FindingSeverity = "critical" | "warning" | "info";
5
- /** Claude model tier used for agent execution. */
6
- export type AgentModel = "haiku" | "sonnet" | "opus";
7
4
  /** How the source content is provided to executors. */
8
5
  export type ContextType = "diff" | "file" | "symbol";
9
6
  /** Lifecycle status of a deskcheck plan. */
@@ -12,65 +9,6 @@ export type PlanStatus = "planning" | "ready" | "executing" | "complete";
12
9
  export type TaskStatus = "pending" | "in_progress" | "complete" | "error";
13
10
  /** Whether results cover all tasks or only a subset. */
14
11
  export type ResultsStatus = "partial" | "complete";
15
- /** A criterion parsed from a markdown file in the criteria directory. */
16
- export interface ReviewModule {
17
- /** Unique identifier, e.g. "architecture/dto-enforcement". */
18
- id: string;
19
- /** Relative file path, e.g. "deskcheck/criteria/architecture/dto-enforcement.md". */
20
- file: string;
21
- /** Human-readable description from frontmatter. */
22
- description: string;
23
- /** How important this criterion's findings are. */
24
- severity: ModuleSeverity;
25
- /** File glob patterns that determine which files this criterion checks. */
26
- globs: string[];
27
- /** Natural language instruction for how to split files into tasks. */
28
- mode: string;
29
- /** Claude model tier to use for executor agents. */
30
- model: AgentModel;
31
- /** The detective prompt (markdown body of the criterion) given to executor agents. */
32
- prompt: string;
33
- }
34
- /** MCP server configuration for agent tool access. */
35
- export interface McpServerConfig {
36
- /** Command to start the MCP server. */
37
- command: string;
38
- /** Command-line arguments. */
39
- args?: string[];
40
- /** Environment variables passed to the server process. */
41
- env?: Record<string, string>;
42
- }
43
- /** Per-role agent configuration (planner, executor, evaluator). */
44
- export interface AgentRoleConfig {
45
- /** Override the default model for this role. */
46
- model?: AgentModel;
47
- /** Additional tools beyond the shared set. */
48
- additional_tools?: string[];
49
- /** Additional MCP servers beyond the shared set. */
50
- additional_mcp_servers?: Record<string, McpServerConfig>;
51
- }
52
- /** Top-level deskcheck tool configuration from .deskcheck/config.json. */
53
- export interface ReviewConfig {
54
- /** Directory containing criterion markdown files. */
55
- modules_dir: string;
56
- /** Directory for storing deskcheck run results. */
57
- storage_dir: string;
58
- /** Port for the web UI server. Default: 3000. */
59
- serve_port: number;
60
- /** Shared configuration applied to all agent roles. */
61
- shared: {
62
- /** Tools available to all agents. */
63
- allowed_tools: string[];
64
- /** MCP servers available to all agents. */
65
- mcp_servers: Record<string, McpServerConfig>;
66
- };
67
- /** Per-role agent configuration. */
68
- agents: {
69
- planner: AgentRoleConfig;
70
- executor: AgentRoleConfig;
71
- evaluator: AgentRoleConfig;
72
- };
73
- }
74
12
  /** What is being reviewed — a diff, file, or symbol. */
75
13
  export interface ReviewSource {
76
14
  /** The kind of content being reviewed. */
@@ -176,26 +114,54 @@ export interface TotalUsage {
176
114
  duration_api_ms: number;
177
115
  num_turns: number;
178
116
  }
179
- /** A single finding produced by an executor agent. */
180
- export interface Finding {
181
- /** How severe this finding is. */
182
- severity: FindingSeverity;
183
- /** File path where the issue was found. */
117
+ /** A code location referenced by an issue. */
118
+ export interface Reference {
119
+ /** File path where the issue manifests. */
184
120
  file: string;
185
- /** Line number where the issue occurs, if applicable. */
121
+ /** Semantic symbol anchor, e.g. "ClassName::method". Stable across refactors. */
122
+ symbol: string | null;
123
+ /** Line number for navigation, not the primary identifier. */
186
124
  line: number | null;
187
- /** Description of the issue. */
125
+ /** The current code at this location (for self-contained review). */
126
+ code: string | null;
127
+ /** Suggested replacement code (optional fix). */
128
+ suggestedCode: string | null;
129
+ /** Why this reference is relevant to the issue. */
130
+ note: string | null;
131
+ }
132
+ /** A single issue produced by an executor agent. */
133
+ export interface Issue {
134
+ /** Stable identity, stamped by recomputeAggregations as `${task_id}:${index}`. */
135
+ issue_id?: string;
136
+ /** How severe this issue is. */
137
+ severity: FindingSeverity;
138
+ /** Description of what's wrong. */
188
139
  description: string;
189
- /** Suggested fix or improvement, if applicable. */
140
+ /** High-level suggested fix or improvement, if applicable. */
190
141
  suggestion: string | null;
142
+ /** Where this issue manifests — one or more code locations. */
143
+ references: Reference[];
191
144
  }
192
- /** A finding enriched with its source module and task for by-file grouping. */
193
- export interface FileFinding extends Finding {
194
- /** Which criterion produced this finding. */
145
+ /** An issue enriched with its source module and task for by-file grouping. */
146
+ export interface FileIssue extends Issue {
147
+ /** Stable identity, always present on FileIssue (narrowed from optional). */
148
+ issue_id: string;
149
+ /** Which criterion produced this issue. */
195
150
  review_id: string;
196
- /** Which task produced this finding. */
151
+ /** Which task produced this issue. */
197
152
  task_id: string;
198
153
  }
154
+ /**
155
+ * Legacy Finding type for backwards compatibility with old executor output.
156
+ * @deprecated Use Issue instead.
157
+ */
158
+ export interface Finding {
159
+ severity: FindingSeverity;
160
+ file: string;
161
+ line: number | null;
162
+ description: string;
163
+ suggestion: string | null;
164
+ }
199
165
  /** Results from a single completed task. */
200
166
  export interface TaskResult {
201
167
  /** The task that produced these results. */
@@ -206,13 +172,13 @@ export interface TaskResult {
206
172
  files: string[];
207
173
  /** ISO 8601 timestamp when the task completed. */
208
174
  completed_at: string;
209
- /** Findings produced by the executor agent. */
210
- findings: Finding[];
175
+ /** Issues produced by the executor agent. */
176
+ issues: Issue[];
211
177
  /** Token usage and timing from the executor agent. Null for legacy results. */
212
178
  usage: TaskUsage | null;
213
179
  }
214
- /** Aggregated findings for a single criterion. */
215
- export interface ModuleFindings {
180
+ /** Aggregated issues for a single criterion. */
181
+ export interface ModuleIssues {
216
182
  /** Review module identifier. */
217
183
  review_id: string;
218
184
  /** Human-readable description. */
@@ -223,15 +189,15 @@ export interface ModuleFindings {
223
189
  task_count: number;
224
190
  /** Number of completed tasks. */
225
191
  completed: number;
226
- /** Aggregated finding counts by severity. */
192
+ /** Aggregated issue counts by severity. */
227
193
  counts: {
228
194
  critical: number;
229
195
  warning: number;
230
196
  info: number;
231
197
  total: number;
232
198
  };
233
- /** All findings from this module's tasks. */
234
- findings: Finding[];
199
+ /** All issues from this module's tasks. */
200
+ issues: Issue[];
235
201
  }
236
202
  /** The complete deskcheck results written to results.json. */
237
203
  export interface ReviewResults {
@@ -249,7 +215,7 @@ export interface ReviewResults {
249
215
  in_progress: number;
250
216
  errored: number;
251
217
  };
252
- /** Aggregated finding counts across all tasks. */
218
+ /** Aggregated issue counts across all tasks. */
253
219
  summary: {
254
220
  total: number;
255
221
  critical: number;
@@ -258,11 +224,11 @@ export interface ReviewResults {
258
224
  };
259
225
  /** Per-task results keyed by task_id. */
260
226
  task_results: Record<string, TaskResult>;
261
- /** Findings grouped by file path. */
262
- by_file: Record<string, FileFinding[]>;
263
- /** Findings grouped by criterion. */
264
- by_module: Record<string, ModuleFindings>;
227
+ /** Issues grouped by file path (an issue appears under each referenced file). */
228
+ by_file: Record<string, FileIssue[]>;
229
+ /** Issues grouped by criterion. */
230
+ by_module: Record<string, ModuleIssues>;
265
231
  /** Aggregated token usage across all completed tasks. */
266
232
  total_usage: TotalUsage;
267
233
  }
268
- //# sourceMappingURL=types.d.ts.map
234
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/types/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAMhE,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,u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,aAAa,CAAC;IACtB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,gDAAgD;IAChD,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACzC,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACrC,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACxC,yDAAyD;IACzD,WAAW,EAAE,UAAU,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/types/review.ts"],"names":[],"mappings":""}
@@ -0,0 +1,109 @@
1
+ import type { Finding, TaskUsage } from "./review.js";
2
+ /** Status of an individual test case. */
3
+ export type TestCaseStatus = "pending" | "executing" | "judging" | "complete" | "error";
4
+ /** Status of a test suite (all tests for one criterion). */
5
+ export type TestSuiteStatus = "pending" | "running" | "complete";
6
+ /** Status of the overall test run. */
7
+ export type TestRunStatus = "running" | "complete";
8
+ /** A discovered test case mapping a fixture file to expected results. */
9
+ export interface TestCase {
10
+ /** Criterion identifier, e.g. "backend/controller-conventions". */
11
+ criterionId: string;
12
+ /** Test case name (subdirectory name), e.g. "missing-return-types". */
13
+ name: string;
14
+ /** Path to the criterion .md file. */
15
+ criterionFile: string;
16
+ /** Path to the fixture file (code to be reviewed). */
17
+ fixtureFile: string;
18
+ /** Path to expected.md describing what should/shouldn't be found. */
19
+ expectedFile: string;
20
+ }
21
+ /** Judge's annotation of a single executor finding. */
22
+ export interface FindingReview {
23
+ /** The finding description from the executor. */
24
+ finding: string;
25
+ /** Whether the finding is correct, out of scope, or has wrong severity. */
26
+ verdict: "correct" | "out_of_scope" | "incorrect_severity";
27
+ /** Which check from the criterion this finding relates to, e.g. "#3 - Missing type hints". */
28
+ criterion_check: string | null;
29
+ /** Brief explanation of the verdict. */
30
+ comment: string;
31
+ }
32
+ /** Judge's annotation of a single expectation from expected.md. */
33
+ export interface ExpectationReview {
34
+ /** The expectation text from expected.md. */
35
+ expectation: string;
36
+ /** Whether a finding matched this expectation. */
37
+ verdict: "found" | "missed";
38
+ /** Which finding matched, if any. */
39
+ matched_finding: string | null;
40
+ /** Brief explanation of the verdict. */
41
+ comment: string;
42
+ }
43
+ /** Complete judge output for a test case. */
44
+ export interface JudgeResult {
45
+ /** Review of each finding the executor produced. */
46
+ findings_review: FindingReview[];
47
+ /** Review of each expectation from expected.md. */
48
+ expectations_review: ExpectationReview[];
49
+ }
50
+ /** Derived scores computed from judge verdicts. Pure math, no LLM involved. */
51
+ export interface TestScores {
52
+ total_findings: number;
53
+ correct: number;
54
+ out_of_scope: number;
55
+ incorrect_severity: number;
56
+ total_expectations: number;
57
+ expectations_found: number;
58
+ expectations_missed: number;
59
+ /** expectations_found / total_expectations (1.0 if no expectations). */
60
+ recall: number;
61
+ /** correct / total_findings (1.0 if no findings). */
62
+ precision: number;
63
+ /** (total_findings - out_of_scope) / total_findings (1.0 if no findings). */
64
+ scope_compliance: number;
65
+ }
66
+ /** Result of a single test case, persisted in the test run JSON. */
67
+ export interface TestCaseResult {
68
+ /** Current lifecycle status. */
69
+ status: TestCaseStatus;
70
+ /** Path to the fixture file that was reviewed. */
71
+ fixture_file: string;
72
+ /** Path to the expected.md file. */
73
+ expected_file: string;
74
+ /** Findings produced by the executor agent. */
75
+ findings: Finding[] | null;
76
+ /** Judge's evaluation of findings vs expectations. */
77
+ judge: JudgeResult | null;
78
+ /** Derived scores from judge verdicts. */
79
+ scores: TestScores | null;
80
+ /** Error message if the test case failed. */
81
+ error: string | null;
82
+ /** Token usage from the executor agent run. */
83
+ executor_usage: TaskUsage | null;
84
+ /** Token usage from the judge agent run. */
85
+ judge_usage: TaskUsage | null;
86
+ }
87
+ /** A test suite groups all test cases for one criterion. */
88
+ export interface TestSuite {
89
+ /** Current lifecycle status. */
90
+ status: TestSuiteStatus;
91
+ /** Path to the criterion .md file. */
92
+ criterion_file: string;
93
+ /** Test case results keyed by test name. */
94
+ tests: Record<string, TestCaseResult>;
95
+ }
96
+ /** The complete test run persisted to disk as results.json. */
97
+ export interface TestRun {
98
+ /** Unique run identifier (timestamped directory name). */
99
+ run_id: string;
100
+ /** Current lifecycle status. */
101
+ status: TestRunStatus;
102
+ /** ISO 8601 timestamp when the run started. */
103
+ started_at: string;
104
+ /** ISO 8601 timestamp when the run completed, or null if still running. */
105
+ completed_at: string | null;
106
+ /** Test suites keyed by criterionId. */
107
+ suites: Record<string, TestSuite>;
108
+ }
109
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/types/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMtD,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAExF,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEjE,sCAAsC;AACtC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAMnD,yEAAyE;AACzE,MAAM,WAAW,QAAQ;IACv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ceRoot":"","sources":["../../src/types/testing.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prowi/deskcheck",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Modular code review tool powered by Claude Agent SDK — define review criteria as markdown, run them against your codebase, get structured findings with a web dashboard.",
5
5
  "license": "MIT",
6
6
  "repository": {