@ddtcorex/dsh-maestro-review 0.3.1 → 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.
- package/lib/config-store.d.ts +0 -2
- package/lib/config-store.d.ts.map +1 -1
- package/lib/config-store.js.map +1 -1
- package/lib/gitlab-client.d.ts +57 -0
- package/lib/gitlab-client.d.ts.map +1 -1
- package/lib/gitlab-client.js +118 -16
- package/lib/gitlab-client.js.map +1 -1
- package/lib/govard-audit-lint-tool.d.ts +81 -0
- package/lib/govard-audit-lint-tool.d.ts.map +1 -1
- package/lib/govard-audit-lint-tool.js +121 -36
- package/lib/govard-audit-lint-tool.js.map +1 -1
- package/lib/govard-tool.js +1 -1
- package/lib/govard-tool.js.map +1 -1
- package/lib/orchestrator.d.ts +86 -1
- package/lib/orchestrator.d.ts.map +1 -1
- package/lib/orchestrator.js +239 -12
- package/lib/orchestrator.js.map +1 -1
- package/lib/review-findings-tool.d.ts +5 -0
- package/lib/review-findings-tool.d.ts.map +1 -1
- package/lib/review-findings-tool.js +3 -1
- package/lib/review-findings-tool.js.map +1 -1
- package/lib/review-intake.d.ts.map +1 -1
- package/lib/review-intake.js +5 -1
- package/lib/review-intake.js.map +1 -1
- package/lib/settings-rpc.d.ts.map +1 -1
- package/lib/settings-rpc.js +1 -10
- package/lib/settings-rpc.js.map +1 -1
- package/package.json +1 -1
- package/src/host/config-store.ts +0 -2
- package/src/host/gitlab-client.ts +140 -16
- package/src/host/govard-audit-lint-tool.ts +144 -31
- package/src/host/govard-tool.ts +1 -1
- package/src/host/orchestrator.ts +261 -14
- package/src/host/review-findings-tool.ts +9 -1
- package/src/host/review-intake.ts +5 -1
- package/src/host/settings-rpc.ts +1 -9
|
@@ -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
|
-
|
|
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
|
}
|
package/src/host/settings-rpc.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const inject = ['connection', 'maestroTunnel']
|
|
|
12
12
|
/** Keys the Settings card may persist; anything else is a rejected save. */
|
|
13
13
|
const SAVABLE_KEYS = new Set<keyof MaestroUserConfig>([
|
|
14
14
|
'gitlabBaseUrl', 'gitlabToken', 'botUsername', 'webhookSecret', 'webhookPort',
|
|
15
|
-
'projectMappings', 'reviewModel', '
|
|
15
|
+
'projectMappings', 'reviewModel', 'autoRereviewOnPush', 'agentTimeoutMs', 'reviewSessionRetentionDays',
|
|
16
16
|
'tunnelMode', 'quickTarget', 'tunnelId', 'tunnelCredentialsFile', 'tunnelHostname',
|
|
17
17
|
'proxyPort', 'proxyHost', 'lanPinEnabled', 'telegramBotToken', 'telegramChatId',
|
|
18
18
|
'telegramReviewNotifications',
|
|
@@ -86,14 +86,6 @@ function validateSavePayload(payload: unknown): { ok: true; patch: Partial<Maest
|
|
|
86
86
|
const err = validateReviewModel(value)
|
|
87
87
|
if (err !== null) return { ok: false, message: err }
|
|
88
88
|
}
|
|
89
|
-
if (key === 'supervisorModel') {
|
|
90
|
-
if (value === null) {
|
|
91
|
-
patch[key as keyof MaestroUserConfig] = undefined as never
|
|
92
|
-
continue
|
|
93
|
-
}
|
|
94
|
-
const err = validateReviewModel(value)
|
|
95
|
-
if (err !== null) return { ok: false, message: err.replace('reviewModel', 'supervisorModel') }
|
|
96
|
-
}
|
|
97
89
|
if (key === 'webhookPort' && value !== undefined && (typeof value !== 'number' || !Number.isInteger(value) || value < 1 || value > 65535)) {
|
|
98
90
|
return { ok: false, message: 'webhookPort must be an integer between 1 and 65535.' }
|
|
99
91
|
}
|