@catladder/cli 0.0.0-main-124a4578 → 0.0.0-main-db6ec1ef
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.
|
@@ -6060,15 +6060,18 @@ exports.createJobsForAgentContext = createJobsForAgentContext;
|
|
|
6060
6060
|
|
|
6061
6061
|
"use strict";
|
|
6062
6062
|
|
|
6063
|
-
// prompts.ts — MCP-only, DRY, review-first-then-push, CI diagnosis (no retries),
|
|
6064
|
-
// conversations-aware
|
|
6065
|
-
//
|
|
6063
|
+
// prompts.ts — MCP-only, DRY, review-first-then-push, CI diagnosis (no retries),
|
|
6064
|
+
// self-mention guard, conversations-aware (issues & MRs), inline replies, de-duplication.
|
|
6065
|
+
// Review-on-demand: resolves MR pipeline and triggers manual "agent-review" when present.
|
|
6066
|
+
// Single-runner guard: cancels running "agent-review" on the MR pipeline before acting.
|
|
6067
|
+
// Stdout summaries included for both event and MR flows.
|
|
6066
6068
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6067
6069
|
exports.getMergeRequestPrompt = exports.getEventPrompt = void 0;
|
|
6068
6070
|
/* ---------- Shared blocks ---------- */
|
|
6069
6071
|
const header = () => `
|
|
6070
6072
|
Project ID: $CI_PROJECT_ID
|
|
6071
6073
|
GitLab Host: $CI_SERVER_URL
|
|
6074
|
+
Default Branch: $CI_DEFAULT_BRANCH
|
|
6072
6075
|
`;
|
|
6073
6076
|
const identity = ({ agentUserName }) => `
|
|
6074
6077
|
## Identity
|
|
@@ -6085,87 +6088,64 @@ const goldenRules = ({ agentUserName }) => `
|
|
|
6085
6088
|
- Keep actions minimal and idempotent. Avoid duplicate comments or duplicate MRs.
|
|
6086
6089
|
- Use ONE stable \`source_branch\` per run; do not regenerate its name later.
|
|
6087
6090
|
`;
|
|
6088
|
-
/* ----------
|
|
6091
|
+
/* ---------- Conversations + threading ---------- */
|
|
6089
6092
|
const conversationsIntake = ({ agentUserName }) => `
|
|
6090
6093
|
## Conversations Intake & Threading (MANDATORY before acting)
|
|
6091
6094
|
Always load and reason about the current conversation to avoid duplicates and to respond in the right place.
|
|
6092
6095
|
|
|
6093
|
-
|
|
6094
|
-
- **
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
2) **De-duplication**:
|
|
6102
|
-
- If your most recent message is the **last message overall** and **no one else replied** since, prefer **updating your last note** instead of posting a new one:
|
|
6103
|
-
- Use \`update_merge_request_note\` or \`update_issue_note\` accordingly.
|
|
6104
|
-
3) **Reply placement**:
|
|
6105
|
-
- For MR code discussions: reply **inline in the same discussion** (preserve thread context).
|
|
6106
|
-
- For general/MR overview threads: add a single consolidated reply (avoid multiple scattered notes).
|
|
6107
|
-
4) **Sanitize before write**:
|
|
6108
|
-
- Apply the Self-mention Guard, then post.
|
|
6109
|
-
5) **If conversations list is unavailable**:
|
|
6110
|
-
- Post one short note: that you cannot fetch the full conversation due to missing MCP capability, then proceed minimally (no spam).
|
|
6096
|
+
- **MRs**: Use \`mr_discussions({ projectId: $CI_PROJECT_ID, mergeRequestIid })\`.
|
|
6097
|
+
- **Issues**: Use issue discussions if available; if not, rely on event payload and note IDs.
|
|
6098
|
+
|
|
6099
|
+
Rules:
|
|
6100
|
+
1) Detect latest human note (exclude "${agentUserName}"). If it replies to you or is in a discussion you started, reply **in the same thread**.
|
|
6101
|
+
2) If your last message is still the latest and no one else replied, prefer **update_note** instead of creating a new one.
|
|
6102
|
+
3) For MR code discussions: reply inline in the same discussion.
|
|
6103
|
+
4) Always sanitize (see Self-mention Guard) before writing.
|
|
6111
6104
|
`;
|
|
6112
6105
|
const selfMentionGuard = ({ agentUserName }) => `
|
|
6113
|
-
## Self-mention Guard
|
|
6114
|
-
Before ANY
|
|
6115
|
-
|
|
6116
|
-
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
- Do NOT replace with another token; simply remove the self @-mention.
|
|
6120
|
-
- If after sanitization the body becomes empty/meaningless, skip the write.
|
|
6121
|
-
|
|
6122
|
-
Additionally:
|
|
6123
|
-
- If the last actor/author of the target item is you ("${agentUserName}"), **do not** post an acknowledgement comment (avoid loops on your own events).
|
|
6124
|
-
- To assign yourself, use the MCP assignee field(s). Do **not** mention yourself in the body to indicate assignment.
|
|
6106
|
+
## Self-mention Guard
|
|
6107
|
+
Before ANY write (comment/MR/issue/commit message):
|
|
6108
|
+
- Remove all occurrences of "@${agentUserName}" (case-insensitive).
|
|
6109
|
+
- If the text becomes empty, skip the write.
|
|
6110
|
+
- If the last actor is you, skip acknowledgement comments.
|
|
6111
|
+
- To assign yourself, use assignee fields, not mentions.
|
|
6125
6112
|
`;
|
|
6126
6113
|
const commentGuidelines = () => `
|
|
6127
|
-
## Comment Guidelines
|
|
6114
|
+
## Comment Guidelines
|
|
6128
6115
|
- Professional, friendly, concise.
|
|
6129
6116
|
- Always @-mention the human author when replying; never mention yourself.
|
|
6130
|
-
-
|
|
6131
|
-
-
|
|
6132
|
-
- Q&A: answer directly first; add context/links only if useful.
|
|
6133
|
-
- Avoid repeating identical boilerplate across comments.
|
|
6117
|
+
- Acknowledge requests, answer questions directly, confirm fixes or updates.
|
|
6118
|
+
- Avoid repeating boilerplate.
|
|
6134
6119
|
`;
|
|
6135
|
-
/*
|
|
6120
|
+
/* ---------- gitlab-mcp tool usage ---------- */
|
|
6136
6121
|
const mcpOnly = () => `
|
|
6137
|
-
## gitlab-mcp Operations
|
|
6122
|
+
## gitlab-mcp Operations
|
|
6138
6123
|
|
|
6139
6124
|
- **Comments / Notes**
|
|
6140
|
-
- create_note({ projectId, targetType: "issue"|"merge_request", iid, body })
|
|
6141
6125
|
- create_issue_note({ projectId, issueIid, body })
|
|
6142
|
-
- create_merge_request_note({ projectId, mergeRequestIid, body })
|
|
6143
6126
|
- update_issue_note({ projectId, issueIid, noteId, body })
|
|
6127
|
+
- create_merge_request_note({ projectId, mergeRequestIid, body })
|
|
6144
6128
|
- update_merge_request_note({ projectId, mergeRequestIid, noteId, body })
|
|
6145
6129
|
- mr_discussions({ projectId, mergeRequestIid })
|
|
6146
6130
|
|
|
6147
6131
|
- **Issues**
|
|
6148
6132
|
- create_issue({ projectId, title, description, assigneeUsernames?: string[] })
|
|
6149
|
-
- list_issues({ projectId, state?: "opened"|"closed", scope?: "all"|... })
|
|
6150
6133
|
|
|
6151
6134
|
- **Branch & Files**
|
|
6152
6135
|
- create_branch({ projectId, branchName, ref })
|
|
6153
6136
|
- push_files({ projectId, branch, commitMessage, files: [{ filePath, content }] })
|
|
6154
6137
|
- create_or_update_file({ projectId, branch, filePath, content, commitMessage })
|
|
6155
|
-
- get_file_contents({ projectId, ref, path })
|
|
6156
6138
|
- get_branch_diffs({ projectId, from, to })
|
|
6157
6139
|
|
|
6158
6140
|
- **Merge Requests**
|
|
6159
6141
|
- create_merge_request({ projectId, sourceBranch, targetBranch, title, description, assigneeUsernames?: string[] })
|
|
6160
|
-
- get_merge_request({ projectId, mergeRequestIid
|
|
6161
|
-
- get_merge_request_diffs({ projectId, mergeRequestIid
|
|
6162
|
-
- list_merge_request_diffs({ projectId, mergeRequestIid
|
|
6163
|
-
- update_merge_request({ projectId, mergeRequestIid
|
|
6164
|
-
- merge_merge_request(...) // **Do NOT use** (never merge)
|
|
6142
|
+
- get_merge_request({ projectId, mergeRequestIid })
|
|
6143
|
+
- get_merge_request_diffs({ projectId, mergeRequestIid })
|
|
6144
|
+
- list_merge_request_diffs({ projectId, mergeRequestIid, page?, perPage? })
|
|
6145
|
+
- update_merge_request({ projectId, mergeRequestIid, title?, description?, draft?, assigneeUsernames? })
|
|
6165
6146
|
|
|
6166
|
-
- **Pipelines / Jobs**
|
|
6147
|
+
- **Pipelines / Jobs**
|
|
6167
6148
|
- list_pipelines({ projectId, ref?, sha?, status?, orderBy?, sort? })
|
|
6168
|
-
- get_pipeline({ projectId, pipelineId })
|
|
6169
6149
|
- list_pipeline_jobs({ projectId, pipelineId })
|
|
6170
6150
|
- get_pipeline_job_output({ projectId, pipelineId, jobId })
|
|
6171
6151
|
- play_pipeline_job({ projectId, jobId })
|
|
@@ -6177,166 +6157,124 @@ const outputDiscipline = ({ agentUserName }) => `
|
|
|
6177
6157
|
- Keep comments concise and professional.
|
|
6178
6158
|
- Never include "@${agentUserName}" in any body.
|
|
6179
6159
|
`;
|
|
6180
|
-
/* ---------- Event
|
|
6160
|
+
/* ---------- Event-specific helpers ---------- */
|
|
6181
6161
|
const eventSelfParse = () => `
|
|
6182
|
-
## Self-Parse
|
|
6162
|
+
## Self-Parse Raw Payload
|
|
6183
6163
|
From \`event_json\`, extract:
|
|
6184
6164
|
- kind: "issue" | "merge_request" | "note"
|
|
6185
|
-
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
-
|
|
6189
|
-
-
|
|
6190
|
-
- project id/path; detect default branch via \`get_merge_request\`/context as needed
|
|
6191
|
-
- If available: the discussion id / thread context of the note to enable inline replies.
|
|
6165
|
+
- iid from URL (/issues/<n>, /merge_requests/<n>)
|
|
6166
|
+
- note_id if present (#note_<id>)
|
|
6167
|
+
- description/body, state, author, timestamps
|
|
6168
|
+
- project id/path
|
|
6169
|
+
- discussion id if available for inline replies
|
|
6192
6170
|
`;
|
|
6193
|
-
/*
|
|
6171
|
+
/* Resolve MR pipeline from MR IID */
|
|
6194
6172
|
const resolveMrPipeline = () => `
|
|
6195
|
-
## Resolve MR Pipeline
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
2) Prefer **SHA-based** lookup:
|
|
6201
|
-
- \`list_pipelines({ projectId: $CI_PROJECT_ID, sha })\` ordered by most recent; pick the newest.
|
|
6202
|
-
3) Fallback to **ref-based** lookup if SHA not available:
|
|
6203
|
-
- \`list_pipelines({ projectId: $CI_PROJECT_ID, ref: sourceBranch, orderBy: "updated_at", sort: "desc" })\`; pick the newest.
|
|
6204
|
-
4) The chosen pipeline becomes \`mr_pipeline_id\`. Use it for all job queries/plays/cancels related to this MR.
|
|
6205
|
-
- If no pipeline is found, post a short MR note explaining that no pipeline was located for the current MR head and proceed with review actions without CI job control.
|
|
6173
|
+
## Resolve MR Pipeline
|
|
6174
|
+
1) get_merge_request({ projectId, mergeRequestIid }) → sourceBranch, sha
|
|
6175
|
+
2) Prefer: list_pipelines({ projectId, sha })
|
|
6176
|
+
3) Else: list_pipelines({ projectId, ref: sourceBranch, orderBy: "updated_at", sort: "desc" })
|
|
6177
|
+
4) Pick newest → mr_pipeline_id
|
|
6206
6178
|
`;
|
|
6179
|
+
/* Guard against double agent-review jobs */
|
|
6207
6180
|
const singleRunnerGuard = () => `
|
|
6208
|
-
## Single-Runner Guard
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
-
|
|
6212
|
-
|
|
6213
|
-
**Procedure (MCP-only):**
|
|
6214
|
-
1) Resolve the MR IID from the event (target URL or text) and run **Resolve MR Pipeline** to get \`mr_pipeline_id\`.
|
|
6215
|
-
2) If \`mr_pipeline_id\` is available:
|
|
6216
|
-
- \`list_pipeline_jobs({ projectId: $CI_PROJECT_ID, pipelineId: mr_pipeline_id })\`.
|
|
6217
|
-
- For any job with \`status\` in \`["running","pending"]\` and \`name\` ending with \`"agent-review"\`, call:
|
|
6218
|
-
- \`cancel_pipeline_job({ projectId: $CI_PROJECT_ID, jobId })\`.
|
|
6219
|
-
- Proceed immediately after issuing cancellations (do not wait).
|
|
6220
|
-
3) If the pipeline cannot be resolved:
|
|
6221
|
-
- Post a short MR note stating you are proceeding but **cannot verify/cancel** a running \`agent-review\` job due to missing pipeline context.
|
|
6222
|
-
- Proceed with review.
|
|
6223
|
-
|
|
6224
|
-
**Notes:**
|
|
6225
|
-
- Keep this guard **idempotent** (safe to run multiple times).
|
|
6226
|
-
- Only applies to **event-triggered** flows that act on an **existing MR**.
|
|
6181
|
+
## Single-Runner Guard
|
|
6182
|
+
- If mr_pipeline_id available:
|
|
6183
|
+
- list_pipeline_jobs({ projectId, pipelineId: mr_pipeline_id })
|
|
6184
|
+
- cancel_pipeline_job on any running/pending job ending with "agent-review"
|
|
6185
|
+
- If not available, note limitation and proceed
|
|
6227
6186
|
`;
|
|
6187
|
+
/* If user asks for review from an event, try manual agent-review job first on the MR's pipeline */
|
|
6228
6188
|
const reviewOnDemandFromEvents = () => `
|
|
6229
|
-
## Review-on-Demand
|
|
6230
|
-
If the
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
- \`!<iid>\` (e.g., \`!123\`)
|
|
6236
|
-
- \`/-/merge_requests/<iid>\` in a path or URL
|
|
6237
|
-
- full GitLab MR URL
|
|
6238
|
-
- If no MR can be resolved, reply with a brief comment asking the user to reference an MR (sanitize) and **stop**.
|
|
6239
|
-
|
|
6240
|
-
2) **Find the MR's pipeline** (do **not** use \`$CI_PIPELINE_ID\` from the event):
|
|
6241
|
-
- Execute **Resolve MR Pipeline** to obtain \`mr_pipeline_id\`.
|
|
6242
|
-
|
|
6243
|
-
3) **If a manual "agent-review" job exists on the MR pipeline, trigger it**
|
|
6244
|
-
- If \`mr_pipeline_id\` is available:
|
|
6245
|
-
- \`list_pipeline_jobs({ projectId: $CI_PROJECT_ID, pipelineId: mr_pipeline_id })\`.
|
|
6246
|
-
- If any job has \`status = "manual"\` **and** its \`name\` ends with "agent-review":
|
|
6247
|
-
- Trigger via \`play_pipeline_job({ projectId: $CI_PROJECT_ID, jobId })\`.
|
|
6248
|
-
- **Conversations Intake**: run the section above to determine **where** to post the confirmation (prefer replying in the same thread that requested review).
|
|
6249
|
-
- Post a short comment confirming you triggered the review job (sanitize).
|
|
6250
|
-
- **Stop** further review actions.
|
|
6251
|
-
|
|
6252
|
-
4) **Single-Runner Guard**
|
|
6253
|
-
- If no manual job was triggered, execute the **Single-Runner Guard** (it will cancel any running/pending \`agent-review\` jobs on the MR pipeline) before MR Review Mode.
|
|
6254
|
-
|
|
6255
|
-
5) **Enter MR Review Mode**: execute the **MR Review Bundle** below with the resolved \`mr_iid\`.
|
|
6189
|
+
## Review-on-Demand
|
|
6190
|
+
If the text asks for a review ("review", "please review", "PTAL", "needs review", "can you look at", "LGTM?"):
|
|
6191
|
+
1) Resolve MR IID (from target or text).
|
|
6192
|
+
2) Resolve MR pipeline (do NOT use the event pipeline).
|
|
6193
|
+
3) If a manual "agent-review" job exists, play it → confirm in-thread → STOP.
|
|
6194
|
+
4) Else run Single-Runner Guard, then enter MR Review Mode.
|
|
6256
6195
|
`;
|
|
6257
|
-
|
|
6196
|
+
/* ---------- Event workflow ---------- */
|
|
6258
6197
|
const eventWorkflow = ({ agentUserName }) => `
|
|
6259
|
-
##
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6198
|
+
## Event Workflow
|
|
6199
|
+
0) Conversations Intake first
|
|
6200
|
+
1) Acknowledge with note (unless last actor is you)
|
|
6201
|
+
2) Default branch: use \`$CI_DEFAULT_BRANCH\`
|
|
6202
|
+
3) Create branch from \`$CI_DEFAULT_BRANCH\`:
|
|
6203
|
+
create_branch({ projectId: $CI_PROJECT_ID, branchName: "<source_branch>", ref: $CI_DEFAULT_BRANCH })
|
|
6204
|
+
4) Write changes → commit → push:
|
|
6205
|
+
push_files({ projectId: $CI_PROJECT_ID, branch: "<source_branch>", commitMessage, files })
|
|
6206
|
+
5) Verify:
|
|
6207
|
+
get_branch_diffs({ projectId: $CI_PROJECT_ID, from: $CI_DEFAULT_BRANCH, to: "<source_branch>" })
|
|
6208
|
+
- Require non-empty diffs
|
|
6209
|
+
6) Create MR (if diffs exist):
|
|
6210
|
+
create_merge_request({
|
|
6211
|
+
projectId: $CI_PROJECT_ID,
|
|
6212
|
+
sourceBranch: "<source_branch>",
|
|
6213
|
+
targetBranch: $CI_DEFAULT_BRANCH,
|
|
6214
|
+
title,
|
|
6215
|
+
description, // include "Closes #<issue_iid>" when applicable
|
|
6216
|
+
assigneeUsernames: ["${agentUserName}"]
|
|
6217
|
+
})
|
|
6218
|
+
7) Follow-up note (in correct thread) with branch, short SHA if available, files-changed count, and MR link (unless last actor is you)
|
|
6219
|
+
8) If verification fails: comment error and STOP
|
|
6220
|
+
|
|
6221
|
+
## Stdout Summary (Event)
|
|
6222
|
+
Print a plain-text summary with:
|
|
6223
|
+
- action: "event"
|
|
6224
|
+
- source_branch
|
|
6225
|
+
- target_branch: $CI_DEFAULT_BRANCH
|
|
6226
|
+
- diff_count (from get_branch_diffs)
|
|
6227
|
+
- mr_iid and/or mr_url if created
|
|
6228
|
+
- any note ids created/updated
|
|
6229
|
+
- any limitations encountered (e.g., missing discussions tool)
|
|
6281
6230
|
`;
|
|
6282
|
-
/* ---------- MR-
|
|
6231
|
+
/* ---------- MR-specific ---------- */
|
|
6283
6232
|
const mrScope = ({ agentUserName }) => `
|
|
6284
|
-
##
|
|
6285
|
-
-
|
|
6286
|
-
-
|
|
6287
|
-
-
|
|
6288
|
-
- You must **never merge** the MR yourself.
|
|
6233
|
+
## MR Scope
|
|
6234
|
+
- You are reviewing a single MR
|
|
6235
|
+
- Never merge the MR yourself
|
|
6236
|
+
- Work only on the MR's source branch
|
|
6289
6237
|
`;
|
|
6290
6238
|
const mrWorkflow = () => `
|
|
6291
|
-
##
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
-
|
|
6297
|
-
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
- **Verify push landed** using \`get_branch_diffs({ from: "<target_branch>", to: "<source_branch>" })\` and ensure there are diffs.
|
|
6311
|
-
- Post a follow-up MR note summarizing what changed and why, **in the appropriate thread** (sanitize).
|
|
6239
|
+
## MR Workflow
|
|
6240
|
+
1) get_merge_request + get_merge_request_diffs + mr_discussions
|
|
6241
|
+
2) Conversations Intake
|
|
6242
|
+
3) Post review comments first via create_merge_request_note (sanitize)
|
|
6243
|
+
4) If will_push_changes = true:
|
|
6244
|
+
- push_files to source branch
|
|
6245
|
+
- verify with get_branch_diffs({ from: targetBranch || $CI_DEFAULT_BRANCH, to: sourceBranch })
|
|
6246
|
+
- follow-up note summarizing changes in the right thread (sanitize)
|
|
6247
|
+
|
|
6248
|
+
## Stdout Summary (MR)
|
|
6249
|
+
Print a plain-text summary with:
|
|
6250
|
+
- action: "mr"
|
|
6251
|
+
- mr_iid
|
|
6252
|
+
- source_branch and target_branch (fallback to $CI_DEFAULT_BRANCH)
|
|
6253
|
+
- will_push_changes: true|false
|
|
6254
|
+
- diff_count (post-push, if applicable)
|
|
6255
|
+
- discussions: number of notes added/updated
|
|
6256
|
+
- ci: whether mr_pipeline_id was resolved
|
|
6257
|
+
- blocking_failed_jobs (names+stages) if inspected
|
|
6312
6258
|
`;
|
|
6259
|
+
/* ---------- CI Inspection (shared) ---------- */
|
|
6313
6260
|
const ciInspection = () => `
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
2. Fetch job output via \`get_pipeline_job_output({ projectId: $CI_PROJECT_ID, pipelineId: mr_pipeline_id, jobId })\`.
|
|
6322
|
-
3. **Classify the failure**:
|
|
6323
|
-
- **Code-related:** compiler/type/lint/test/build script errors. Provide minimal fix in your review/changes. Do **not** retry.
|
|
6324
|
-
- **Likely transient / infra:** network/timeouts/cache/artifacts/5xx/429/runner issues. Do **not** retry here; note likely cause and suggest CI-level retry/backoff if appropriate.
|
|
6325
|
-
4. **Decision**:
|
|
6326
|
-
- If \`will_push_changes = true\`: do **not** retry; note that the new pipeline from your push will validate fixes.
|
|
6327
|
-
- If \`will_push_changes = false\`: do **not** retry; post diagnosis and next steps (or request human input for infra issues).
|
|
6328
|
-
- If \`mr_pipeline_id\` is not available, you may skip CI analysis or post a short note explaining the missing pipeline context.
|
|
6261
|
+
## CI Inspection (diagnose only)
|
|
6262
|
+
- Use mr_pipeline_id if available
|
|
6263
|
+
- list_pipeline_jobs → for each failed + allow_failure=false:
|
|
6264
|
+
- get_pipeline_job_output
|
|
6265
|
+
- classify: code vs infra
|
|
6266
|
+
- Do not retry; only report diagnosis in a note
|
|
6267
|
+
- If no mr_pipeline_id, note limitation
|
|
6329
6268
|
`;
|
|
6330
6269
|
const outputDisciplineMR = ({ agentUserName }) => `
|
|
6331
6270
|
## Output Discipline (MR)
|
|
6332
|
-
-
|
|
6333
|
-
-
|
|
6334
|
-
- Never
|
|
6271
|
+
- Only gitlab-mcp calls + final summary
|
|
6272
|
+
- Never merge MR
|
|
6273
|
+
- Never mention "@${agentUserName}"
|
|
6335
6274
|
`;
|
|
6336
|
-
/* ----------
|
|
6275
|
+
/* ---------- MR Review Bundle ---------- */
|
|
6337
6276
|
const mrReviewBundle = (ctx) => `
|
|
6338
|
-
## MR Review Mode
|
|
6339
|
-
Resolved MR IID: <set this to the resolved \`mr_iid\` before executing>
|
|
6277
|
+
## MR Review Mode
|
|
6340
6278
|
${mrScope(ctx)}
|
|
6341
6279
|
${mrWorkflow()}
|
|
6342
6280
|
${ciInspection()}
|
|
@@ -6354,12 +6292,12 @@ $(cat $TRIGGER_PAYLOAD)
|
|
|
6354
6292
|
${identity(ctx)}
|
|
6355
6293
|
${goldenRules(ctx)}
|
|
6356
6294
|
${selfMentionGuard(ctx)}
|
|
6357
|
-
${conversationsIntake(ctx)}
|
|
6295
|
+
${conversationsIntake(ctx)}
|
|
6358
6296
|
${eventSelfParse()}
|
|
6359
|
-
${resolveMrPipeline()}
|
|
6360
|
-
${singleRunnerGuard()}
|
|
6297
|
+
${resolveMrPipeline()}
|
|
6298
|
+
${singleRunnerGuard()}
|
|
6361
6299
|
${reviewOnDemandFromEvents()}
|
|
6362
|
-
${mrReviewBundle(ctx)}
|
|
6300
|
+
${mrReviewBundle(ctx)}
|
|
6363
6301
|
${eventWorkflow(ctx)}
|
|
6364
6302
|
${commentGuidelines()}
|
|
6365
6303
|
${mcpOnly()}
|
|
@@ -6379,7 +6317,7 @@ description: $CI_MERGE_REQUEST_DESCRIPTION
|
|
|
6379
6317
|
${mrScope(ctx)}
|
|
6380
6318
|
${goldenRules(ctx)}
|
|
6381
6319
|
${selfMentionGuard(ctx)}
|
|
6382
|
-
${conversationsIntake(ctx)}
|
|
6320
|
+
${conversationsIntake(ctx)}
|
|
6383
6321
|
${mrWorkflow()}
|
|
6384
6322
|
${ciInspection()}
|
|
6385
6323
|
${commentGuidelines()}
|