@ddtcorex/dsh-maestro-review 0.3.2 → 0.4.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.
@@ -4,12 +4,18 @@ import { defineTool } from '@deepseek-ai/dsh-tools'
4
4
  export const name = 'maestro-review-findings-tool'
5
5
  export const inject = ['tools']
6
6
 
7
+ export type FindingSeverity = 'blocking' | 'major' | 'minor' | 'nit'
8
+
7
9
  export interface ReviewFinding {
8
10
  status: 'new' | 'reply'
9
11
  body: string
10
12
  path?: string
11
13
  line?: number
12
14
  discussionId?: string
15
+ /** Assigned by the reviewer; missing values are treated as `minor`. */
16
+ severity?: FindingSeverity
17
+ /** Optional area tag, e.g. security, correctness, perf, style. */
18
+ category?: string
13
19
  }
14
20
 
15
21
  export interface Config {
@@ -19,7 +25,7 @@ export interface Config {
19
25
  export function apply(ctx: Context, config: Config): void {
20
26
  ctx.tools.register(defineTool({
21
27
  name: 'report_review_findings',
22
- description: 'Submit your complete list of review findings exactly once, when done analyzing. Each finding is {status: "new", path, line, body} for a location with no existing thread, or {status: "reply", discussionId, body} to update an existing thread returned by gitlab_list_own_review_threads.',
28
+ description: 'Submit your complete list of review findings exactly once, when done analyzing. Each finding is {status: "new", path, line, body, severity, category?} for a location with no existing thread, or {status: "reply", discussionId, body, severity, category?} to update an existing thread returned by gitlab_list_own_review_threads (reply to a resolved thread reopens it — prefer reply over new when the substance matches). Severity (required in spirit, defaults to minor): blocking = must fix before merge (regression, data loss, real XSS/RCE); major = should fix (correctness bug, security hardening with a realistic path); minor = nice to fix (perf nit with impact, stale docs, fragile coupling); nit = style/micro with no behavior impact.',
23
29
  parameters: {
24
30
  findings: {
25
31
  type: 'array',
@@ -34,6 +40,8 @@ export function apply(ctx: Context, config: Config): void {
34
40
  path: { type: 'string' },
35
41
  line: { type: 'number' },
36
42
  discussionId: { type: 'string' },
43
+ severity: { type: 'string', enum: ['blocking', 'major', 'minor', 'nit'] },
44
+ category: { type: 'string' },
37
45
  },
38
46
  },
39
47
  },
@@ -81,6 +81,10 @@ export function routeGitlabReviewRequest(body: unknown, botUsername: string, opt
81
81
  if (value.object_kind !== 'note' || typeof attributes.note !== 'string' || !isMentioned(attributes.note, botUsername)) return undefined
82
82
  const scope = noteScope(attributes)
83
83
  if (scope === undefined) return undefined
84
- const mode: ReviewMode = /(?:^|\s)\/maestro\s+deep(?:\s|$)/i.test(attributes.note) ? 'deep' : 'quick'
84
+ // Deep runs the auditor (env + perf) and costs far more than quick, so the
85
+ // trigger stays explicit: the `/maestro deep` slash command or the natural
86
+ // phrase "deep review". A bare "deep" alone never triggers (too loose).
87
+ const note = attributes.note
88
+ const mode: ReviewMode = /(?:^|\s)\/maestro\s+deep(?:\s|$)/i.test(note) || /\bdeep\s+review\b/i.test(note) ? 'deep' : 'quick'
85
89
  return { ...payload, trigger: 'mention', mode, scope }
86
90
  }