mergestorm 0.3.36 → 0.3.38
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/README.md +1 -1
- package/dist/automation-catalog.d.ts +13 -2
- package/dist/automation-catalog.js +2 -0
- package/dist/commands/browse.d.ts +1 -1
- package/dist/commands/registry.js +2 -0
- package/dist/commands/settings.d.ts +1 -1
- package/dist/commands/settings.js +7 -6
- package/dist/stack-blockers.d.ts +12 -0
- package/dist/stack-blockers.js +120 -10
- package/dist/ui/banner.js +6 -0
- package/package.json +1 -1
- package/skill/mergestorm-bounce-watch/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ On a TTY, bare `mergestorm` (or `mergestorm shell`) opens a branded REPL: a comp
|
|
|
45
45
|
|
|
46
46
|
```
|
|
47
47
|
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
48
|
-
│ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.
|
|
48
|
+
│ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.38 │
|
|
49
49
|
│ ▀▀▀▀▀▀▀▀▀ ● msk_live_… · maelstrom │
|
|
50
50
|
│ ▀▀▀▀▀▀ [████████░░░░░░░░░░░░░░░░░░░░░░] 25% used │
|
|
51
51
|
│ ▝▀▀▀▀▀ local reviews + stacked PRs · mergestorm.ai │
|
|
@@ -49,6 +49,17 @@ export declare const BEARER_SETTINGS: readonly [{
|
|
|
49
49
|
readonly kind: "seconds";
|
|
50
50
|
readonly min: 15;
|
|
51
51
|
readonly max: 300;
|
|
52
|
+
}, {
|
|
53
|
+
readonly key: "merge_queue_batch_enabled";
|
|
54
|
+
readonly flag: "--merge-queue-batch";
|
|
55
|
+
readonly label: "Merge queue batching";
|
|
56
|
+
}, {
|
|
57
|
+
readonly key: "merge_queue_batch_size";
|
|
58
|
+
readonly flag: "--merge-queue-batch-size";
|
|
59
|
+
readonly label: "Merge queue batch size (pull requests)";
|
|
60
|
+
readonly kind: "count";
|
|
61
|
+
readonly min: 2;
|
|
62
|
+
readonly max: 8;
|
|
52
63
|
}, {
|
|
53
64
|
readonly key: "ignored_bot_logins";
|
|
54
65
|
readonly flag: "--ignore-bot";
|
|
@@ -82,9 +93,9 @@ export type BearerSettingsValues = {
|
|
|
82
93
|
[Row in (typeof BEARER_SETTINGS)[number] as Row["key"]]: Row extends {
|
|
83
94
|
kind: "logins";
|
|
84
95
|
} ? string[] : Row extends {
|
|
85
|
-
kind: "seconds";
|
|
96
|
+
kind: "seconds" | "count";
|
|
86
97
|
} ? number : Row extends {
|
|
87
98
|
values: readonly (infer Value)[];
|
|
88
99
|
} ? Value : boolean;
|
|
89
100
|
};
|
|
90
|
-
export declare const BEARER_BOOLEAN_SETTINGS_KEYS: ("auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check")[];
|
|
101
|
+
export declare const BEARER_BOOLEAN_SETTINGS_KEYS: ("auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "merge_queue_batch_enabled" | "merge_queue_batch_size" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check")[];
|
|
@@ -11,6 +11,8 @@ export const BEARER_SETTINGS = [
|
|
|
11
11
|
{ key: "vortex_seam_specialist_enabled", flag: "--vortex-seam", label: "Vortex seam specialist" },
|
|
12
12
|
{ key: "auto_land_default", flag: "--auto-land", label: "Auto land (new stacks)" },
|
|
13
13
|
{ key: "auto_land_settle_seconds", flag: "--auto-land-settle", label: "Auto land settle (seconds)", kind: "seconds", min: 15, max: 300 },
|
|
14
|
+
{ key: "merge_queue_batch_enabled", flag: "--merge-queue-batch", label: "Merge queue batching" },
|
|
15
|
+
{ key: "merge_queue_batch_size", flag: "--merge-queue-batch-size", label: "Merge queue batch size (pull requests)", kind: "count", min: 2, max: 8 },
|
|
14
16
|
{ key: "ignored_bot_logins", flag: "--ignore-bot", label: "Ignored bot logins", kind: "logins" },
|
|
15
17
|
{ key: "vortex_bot_skip_check", flag: "--vortex-skip-check", label: "Vortex bot skip check", kind: "enum", values: ["none", "neutral"] },
|
|
16
18
|
{ key: "vortex_findings_check", flag: "--vortex-findings", label: "Vortex findings check", kind: "enum", values: ["failure", "neutral", "success"] },
|
|
@@ -27,7 +27,7 @@ export declare function buildStatusTabLines(input: StatusTabInput): string[];
|
|
|
27
27
|
/** In-place job detail for the Jobs tab (same envelope as `status <id>`). */
|
|
28
28
|
export declare function formatJobDetailLines(row: ReviewJobRow): string[];
|
|
29
29
|
/** Human labels for the Config tab and the static `settings` printout. */
|
|
30
|
-
export declare const SETTINGS_LABELS: Record<"auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check", string>;
|
|
30
|
+
export declare const SETTINGS_LABELS: Record<"auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "merge_queue_batch_enabled" | "merge_queue_batch_size" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check", string>;
|
|
31
31
|
/** Config rows in a stable order: writable toggles, then connected flags. */
|
|
32
32
|
export declare function buildConfigRows(settings: SettingsResponse): TabsConfigRow[];
|
|
33
33
|
/**
|
|
@@ -186,6 +186,8 @@ export const COMMAND_REGISTRY = [
|
|
|
186
186
|
" [--vortex-seam on|off] [--vortex-skip-all-clear on|off]",
|
|
187
187
|
" [--auto-land on|off] Auto land default for new stacks",
|
|
188
188
|
" [--auto-land-settle <seconds>] How long Auto land waits before queueing (15-300, default 60)",
|
|
189
|
+
" [--merge-queue-batch on|off] Test several queued pull requests on one CI run",
|
|
190
|
+
" [--merge-queue-batch-size <n>] Most pull requests per batch (2-8, default 4)",
|
|
189
191
|
" [--ignore-bot add <login>|remove <login>|clear]",
|
|
190
192
|
" [--vortex-skip-check none|neutral] [--vortex-findings failure|neutral|success]",
|
|
191
193
|
" [--cyclone-fail-check failure|neutral]",
|
|
@@ -3,7 +3,7 @@ import { type SettingsPatch, type SettingsResponse } from "../api.js";
|
|
|
3
3
|
* CLI flag → Bearer settings key. Boolean flags take on|off. The connected flags are
|
|
4
4
|
* read-only on the API and deliberately have no flag here.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SETTINGS_FLAGS: Record<string, "auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check">;
|
|
6
|
+
export declare const SETTINGS_FLAGS: Record<string, "auto_review_enabled" | "auto_patch_enabled" | "vortex_show_thinking_traces" | "repo_overview_enabled" | "review_unit_land_prs_enabled" | "cyclone_skip_ci_enabled" | "cyclone_patch_unverified_languages" | "vortex_auto_overflow_enabled" | "vortex_skip_all_clear_comments" | "vortex_seam_specialist_enabled" | "auto_land_default" | "auto_land_settle_seconds" | "merge_queue_batch_enabled" | "merge_queue_batch_size" | "ignored_bot_logins" | "vortex_bot_skip_check" | "vortex_findings_check" | "cyclone_patch_failure_check">;
|
|
7
7
|
type IgnoreBotOperation = {
|
|
8
8
|
action: "add" | "remove";
|
|
9
9
|
login: string;
|
|
@@ -46,12 +46,13 @@ export function parseSettingsArgs(args) {
|
|
|
46
46
|
}
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
|
-
if ("kind" in row && row.kind === "seconds") {
|
|
50
|
-
const
|
|
51
|
-
if (!Number.isInteger(
|
|
52
|
-
|
|
49
|
+
if ("kind" in row && (row.kind === "seconds" || row.kind === "count")) {
|
|
50
|
+
const amount = value !== undefined && /^\d+$/.test(value) ? Number(value) : Number.NaN;
|
|
51
|
+
if (!Number.isInteger(amount) || amount < row.min || amount > row.max) {
|
|
52
|
+
const unit = row.kind === "seconds" ? " of seconds" : "";
|
|
53
|
+
throw new CommandError(`${flag} takes a whole number${unit} from ${row.min} through ${row.max}.`, 2, "usage");
|
|
53
54
|
}
|
|
54
|
-
Object.assign(patch, { [key]:
|
|
55
|
+
Object.assign(patch, { [key]: amount });
|
|
55
56
|
continue;
|
|
56
57
|
}
|
|
57
58
|
if ("kind" in row && row.kind === "enum") {
|
|
@@ -85,7 +86,7 @@ export function formatSettingsLines(settings) {
|
|
|
85
86
|
: typeof row.value === "string"
|
|
86
87
|
? row.value
|
|
87
88
|
: typeof row.value === "number"
|
|
88
|
-
? `${row.value}s`
|
|
89
|
+
? "kind" in row && row.kind === "seconds" ? `${row.value}s` : String(row.value)
|
|
89
90
|
: row.writable
|
|
90
91
|
? row.value
|
|
91
92
|
? "on"
|
package/dist/stack-blockers.d.ts
CHANGED
|
@@ -104,6 +104,14 @@ export type StackRepairHint = {
|
|
|
104
104
|
branch: string;
|
|
105
105
|
since: string;
|
|
106
106
|
steps: string;
|
|
107
|
+
} | {
|
|
108
|
+
kind: "ci_unreadable" | "auto_land_waiting";
|
|
109
|
+
prNumber: number;
|
|
110
|
+
headSha: string | null;
|
|
111
|
+
branch: string;
|
|
112
|
+
since: string;
|
|
113
|
+
reason: string;
|
|
114
|
+
steps: string;
|
|
107
115
|
} | {
|
|
108
116
|
kind: "queue_stalled";
|
|
109
117
|
prNumber: number;
|
|
@@ -156,6 +164,9 @@ export declare const AUTO_LAND_CI_PENDING_ATTENTION_MS: number;
|
|
|
156
164
|
export declare const AUTO_LAND_VORTEX_WAIT_ATTENTION_MS: number;
|
|
157
165
|
export declare const AUTO_LAND_PROMOTE_FAILED_ATTEMPTS = 3;
|
|
158
166
|
export declare const AUTO_LAND_CI_FAILED_BLOCKER = "CI failed \u2014 Auto land reads a failing check on GitHub at this head";
|
|
167
|
+
export declare const AUTO_LAND_WAIT_ATTENTION_MS: number;
|
|
168
|
+
export declare const AUTO_LAND_CI_UNREADABLE_ATTENTION_MS: number;
|
|
169
|
+
export declare function autoLandWaitLayer(stack: StackDto): StackLayerDto | undefined;
|
|
159
170
|
export declare function autoLandWaitBlocker(stack: StackDto, layer: StackLayerDto, nowMs: number): string | null;
|
|
160
171
|
export declare const MERGE_QUEUE_STALL_ATTENTION_MS: number;
|
|
161
172
|
export type StackQueueWait = {
|
|
@@ -168,6 +179,7 @@ export type StackQueueWait = {
|
|
|
168
179
|
export type MergeQueueWait = {
|
|
169
180
|
text: string;
|
|
170
181
|
stalled: boolean;
|
|
182
|
+
notPickedUp?: boolean;
|
|
171
183
|
since: string | null;
|
|
172
184
|
waitReason: string | null;
|
|
173
185
|
aheadStackId: string | null;
|
package/dist/stack-blockers.js
CHANGED
|
@@ -119,7 +119,7 @@ function vortexSkippedSteps(stack, layer, skipReason) {
|
|
|
119
119
|
const head = layer.headSha ?? "its live head";
|
|
120
120
|
const mention = `comment @mergestorm-vortex review on #${layer.prNumber}`;
|
|
121
121
|
if (skipReason === "auto_review_off") {
|
|
122
|
-
return `Vortex auto-review is off for ${stack.owner}/${stack.repo} or for this stack, so it skipped #${layer.prNumber} at ${head} and Auto land waits for a review that will not come. Do not patch or push for this. Tell the human:
|
|
122
|
+
return `Vortex auto-review is off for ${stack.owner}/${stack.repo} or for this stack, so it skipped #${layer.prNumber} at ${head} and Auto land waits for a review that will not come. Do not patch or push for this. Tell the human: turning auto-review on (mg stack set ${stack.id} --auto-review on, or the account setting in the dashboard) queues a review of this head by itself. To review only this head and leave auto-review off, ${mention}.`;
|
|
123
123
|
}
|
|
124
124
|
if (skipReason === "incomplete") {
|
|
125
125
|
return `Vortex reviewed only some of the files in #${layer.prNumber} at ${head} and left the rest unreviewed, so Auto land waits for full coverage. Do not patch or push for this. To review the remaining files, ${mention} (the Continue button on the stack is unrelated), or tell the human to do it; turning on automatic overflow reviews in the dashboard settings covers this for later heads.`;
|
|
@@ -271,17 +271,81 @@ export const AUTO_LAND_CI_FAILED_BLOCKER = "CI failed — Auto land reads a fail
|
|
|
271
271
|
const AUTO_LAND_CI_PENDING_PREFIX = "CI pending for ";
|
|
272
272
|
const AUTO_LAND_VORTEX_WAIT_PREFIX = "No green Vortex review for ";
|
|
273
273
|
const AUTO_LAND_PROMOTE_FAILED_PREFIX = "Promote failed ";
|
|
274
|
+
export const AUTO_LAND_WAIT_ATTENTION_MS = 45 * 60_000;
|
|
275
|
+
export const AUTO_LAND_CI_UNREADABLE_ATTENTION_MS = 10 * 60_000;
|
|
276
|
+
const AUTO_LAND_CI_UNREADABLE_PREFIX = "Mergestorm cannot read ";
|
|
277
|
+
const AUTO_LAND_WAITED_PREFIX = "Auto land has waited ";
|
|
278
|
+
const CI_UNREADABLE_WHAT = {
|
|
279
|
+
check_runs_unreadable: "the check runs",
|
|
280
|
+
commit_statuses_unreadable: "the commit statuses",
|
|
281
|
+
ci_unreadable: "the check runs and commit statuses",
|
|
282
|
+
};
|
|
283
|
+
const CI_UNREADABLE_PERMISSION = {
|
|
284
|
+
check_runs_unreadable: "Checks: read",
|
|
285
|
+
commit_statuses_unreadable: "Commit statuses: read",
|
|
286
|
+
ci_unreadable: "Checks: read and Commit statuses: read",
|
|
287
|
+
};
|
|
288
|
+
const AUTO_LAND_WAIT_WORDS = {
|
|
289
|
+
mergeability_unknown: "GitHub has not said whether this PR can merge into its base",
|
|
290
|
+
tempest_pending: "Tempest's review of this head has not started",
|
|
291
|
+
tempest_running: "Tempest's review of this head has not finished",
|
|
292
|
+
tempest_trigger_failed: "Tempest's review of this head could not be started",
|
|
293
|
+
tempest_stopped: "Tempest's review of this head was stopped",
|
|
294
|
+
tempest_failed: "Tempest's review of this head broke without a result",
|
|
295
|
+
tempest_findings: "Tempest reported findings on this head",
|
|
296
|
+
cyclone_failed: "Cyclone's patch run failed on this head",
|
|
297
|
+
stack_dirty: "this layer is not clean (it has a conflict or needs a restack)",
|
|
298
|
+
must_consolidate: "this PR's base is not the stack's land target, and the stack has no review unit to promote it into",
|
|
299
|
+
missing_head: "GitHub returned no head commit for this PR",
|
|
300
|
+
pr_draft: "this PR is a draft",
|
|
301
|
+
trunk_in_land_target_without_land_pr: "the stack's commits are already in the land target, but no merged land PR was found",
|
|
302
|
+
conflict_unchanged: "the merge queue bounced this PR for a conflict, and neither the PR nor its base has changed since",
|
|
303
|
+
land_pr_unavailable: "the land PR cannot be opened or found",
|
|
304
|
+
github_unreadable: "Mergestorm cannot read this PR from GitHub",
|
|
305
|
+
land_gate_failed: "the check before landing keeps failing with an error",
|
|
306
|
+
readiness_check_failed: "the readiness check for this PR keeps failing with an error",
|
|
307
|
+
layer_without_pr: "a layer of this stack has no pull request",
|
|
308
|
+
parked_base: "this PR's base is a parked branch (mg-park-*) and has not been moved back",
|
|
309
|
+
pr_not_open: "GitHub shows this PR merged or closed, but the stack still lists it as open",
|
|
310
|
+
stack_without_unit: "the stack has more than one open layer but no review unit to promote them into",
|
|
311
|
+
ci_error: "CI reported an error on this head",
|
|
312
|
+
ci_unknown: "CI on this head is in a state Mergestorm cannot read",
|
|
313
|
+
ci_missing: "no CI run exists for this head",
|
|
314
|
+
};
|
|
315
|
+
function autoLandWaitWords(reason) {
|
|
316
|
+
return AUTO_LAND_WAIT_WORDS[reason] ?? reason.replaceAll("_", " ");
|
|
317
|
+
}
|
|
318
|
+
function ciUnreadableForGood(wait) {
|
|
319
|
+
return /\bHTTP 40[34]\b/.test(wait.detail ?? "");
|
|
320
|
+
}
|
|
274
321
|
function waitedMs(since, nowMs) {
|
|
275
322
|
const sinceMs = Date.parse(since);
|
|
276
323
|
return Number.isFinite(sinceMs) ? Math.max(0, nowMs - sinceMs) : null;
|
|
277
324
|
}
|
|
278
|
-
function
|
|
325
|
+
function armedAutoLandWait(stack) {
|
|
279
326
|
const wait = stack.autoLandWait;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
327
|
+
return wait && !stack.archivedAt && stack.autoEnqueueWhenReady === true ? wait : null;
|
|
328
|
+
}
|
|
329
|
+
function lastPrLayer(stack) {
|
|
330
|
+
const land = stack.unit?.landPr;
|
|
331
|
+
if (land && land.prNumber > 0)
|
|
332
|
+
return land;
|
|
333
|
+
return stack.layers.filter((layer) => layer.prNumber > 0).sort((a, b) => b.position - a.position)[0];
|
|
334
|
+
}
|
|
335
|
+
export function autoLandWaitLayer(stack) {
|
|
336
|
+
const wait = armedAutoLandWait(stack);
|
|
337
|
+
if (!wait)
|
|
338
|
+
return undefined;
|
|
339
|
+
const candidate = currentLayer(stack);
|
|
340
|
+
if (wait.prNumber == null)
|
|
341
|
+
return candidate ?? lastPrLayer(stack);
|
|
342
|
+
const named = candidate?.prNumber === wait.prNumber
|
|
343
|
+
? candidate
|
|
344
|
+
: stack.layers.find((layer) => layer.prNumber === wait.prNumber && !isTerminalLayer(layer));
|
|
345
|
+
return named && (!wait.headSha || sameHead(wait.headSha, named.headSha)) ? named : undefined;
|
|
346
|
+
}
|
|
347
|
+
function autoLandWaitOn(stack, layer) {
|
|
348
|
+
return autoLandWaitLayer(stack)?.prNumber === layer.prNumber ? armedAutoLandWait(stack) : null;
|
|
285
349
|
}
|
|
286
350
|
export function autoLandWaitBlocker(stack, layer, nowMs) {
|
|
287
351
|
const wait = autoLandWaitOn(stack, layer);
|
|
@@ -307,8 +371,17 @@ export function autoLandWaitBlocker(stack, layer, nowMs) {
|
|
|
307
371
|
? `${AUTO_LAND_PROMOTE_FAILED_PREFIX}${wait.attempts} times (merge_failed) — Auto land stopped retrying this head${wait.detail ? `: ${wait.detail}` : ""}`
|
|
308
372
|
: null;
|
|
309
373
|
default:
|
|
310
|
-
|
|
374
|
+
break;
|
|
311
375
|
}
|
|
376
|
+
const unreadable = CI_UNREADABLE_WHAT[wait.reason];
|
|
377
|
+
if (unreadable) {
|
|
378
|
+
return ciUnreadableForGood(wait) || waited >= AUTO_LAND_CI_UNREADABLE_ATTENTION_MS
|
|
379
|
+
? `${AUTO_LAND_CI_UNREADABLE_PREFIX}${unreadable} on this head${wait.detail ? ` (${wait.detail})` : ""} — Auto land cannot tell whether CI passed`
|
|
380
|
+
: null;
|
|
381
|
+
}
|
|
382
|
+
return waited >= AUTO_LAND_WAIT_ATTENTION_MS
|
|
383
|
+
? `${AUTO_LAND_WAITED_PREFIX}${minutes}m: ${autoLandWaitWords(wait.reason)}`
|
|
384
|
+
: null;
|
|
312
385
|
}
|
|
313
386
|
export const MERGE_QUEUE_STALL_ATTENTION_MS = 45 * 60_000;
|
|
314
387
|
const MERGE_QUEUE_STALLED_PREFIX = "Merge queue stuck: ";
|
|
@@ -322,12 +395,14 @@ export function mergeQueueWait(queue, nowMs) {
|
|
|
322
395
|
return null;
|
|
323
396
|
const reason = entry.waitReason?.trim() || null;
|
|
324
397
|
if (entry.state === "queued") {
|
|
325
|
-
const
|
|
398
|
+
const queuedMs = waitedMs(entry.enqueuedAt, nowMs);
|
|
399
|
+
const queuedFor = minutesOf(queuedMs);
|
|
326
400
|
const ahead = entry.aheadInRepo;
|
|
327
401
|
if (!ahead) {
|
|
328
402
|
return {
|
|
329
403
|
text: `Queued ${queuedFor}m in the merge queue, not picked up yet${reason ? ` (last note: ${reason})` : ""}`,
|
|
330
|
-
stalled:
|
|
404
|
+
stalled: queuedMs != null && queuedMs >= MERGE_QUEUE_STALL_ATTENTION_MS,
|
|
405
|
+
notPickedUp: true,
|
|
331
406
|
since: entry.enqueuedAt, waitReason: reason, aheadStackId: null, aheadOther: false,
|
|
332
407
|
};
|
|
333
408
|
}
|
|
@@ -357,6 +432,9 @@ function queueStalledSteps(stack, layer, wait) {
|
|
|
357
432
|
: "That entry belongs to another Mergestorm user, so you cannot fix it from here.";
|
|
358
433
|
return `#${layer.prNumber} is waiting in the merge queue behind another entry in ${stack.owner}/${stack.repo} that has made no progress since ${wait.since ?? "it was claimed"}. Nothing on ${layer.branch} needs a change. ${ahead} If it stays stuck, tell the human: the queue for this repo is held by that entry.`;
|
|
359
434
|
}
|
|
435
|
+
if (wait.notPickedUp) {
|
|
436
|
+
return `#${layer.prNumber} has been queued in the merge queue for ${stack.owner}/${stack.repo} since ${wait.since ?? "it was enqueued"} and nothing is working on it or on an entry ahead of it${wait.waitReason ? `; its last note is: ${wait.waitReason}` : ""}. Nothing on ${layer.branch} needs a change: do not patch or push for this. If the note says the base branch keeps moving, the queue is waiting for a quiet moment on it and continues by itself once pushes to that branch pause. Otherwise tell the human: the merge queue is not picking this entry up; they can take the stack out of the queue and enqueue it again (mg queue rm ${stack.id}, then mg queue add ${stack.id}). Do not retarget the PR base.`;
|
|
437
|
+
}
|
|
360
438
|
return `The merge queue has held #${layer.prNumber} at ${layer.headSha ?? "its head"} since ${wait.since ?? "it was claimed"} without landing or bouncing it${wait.waitReason ? `; its last note is: ${wait.waitReason}` : ", and it recorded no reason"}. If the note names a failing check or a conflict on ${layer.branch}, fix that with an ordinary push. If it waits on CI, list the head's checks (gh run list --branch ${layer.branch}) and re-run the one that never finished (gh run rerun <run-id>). If nothing moves after that, tell the human: they can take the stack out of the queue and enqueue it again (mg queue rm ${stack.id}, then mg queue add ${stack.id}). Do not retarget the PR base.`;
|
|
361
439
|
}
|
|
362
440
|
function isTerminalLayer(layer) {
|
|
@@ -561,6 +639,30 @@ export function stackRepair(stack, attention, layer, bounce, queueWait = null) {
|
|
|
561
639
|
steps: `Auto land has waited since ${wait.since} for an approving Vortex review of ${layer.branch} at ${layer.headSha ?? "its head"}, and no Vortex run is working on it. Read the PR's latest Vortex review (gh api repos/${stack.owner}/${stack.repo}/pulls/${layer.prNumber}/reviews). If it has findings, verify and fix the real ones on ${layer.branch} with an ordinary push, or record a wrong one with mg dismiss as mergestorm-pr-loop describes. If no review exists at this head, or it failed or was skipped, tell the human: nothing re-reviews this head until they re-run the review or push a new head.`,
|
|
562
640
|
};
|
|
563
641
|
}
|
|
642
|
+
if (wait && attention.blocker.startsWith(AUTO_LAND_CI_UNREADABLE_PREFIX)) {
|
|
643
|
+
const what = CI_UNREADABLE_WHAT[wait.reason] ?? "the checks";
|
|
644
|
+
const permission = CI_UNREADABLE_PERMISSION[wait.reason] ?? "Checks: read and Commit statuses: read";
|
|
645
|
+
return {
|
|
646
|
+
kind: "ci_unreadable",
|
|
647
|
+
prNumber: layer.prNumber,
|
|
648
|
+
headSha: layer.headSha ?? null,
|
|
649
|
+
branch: layer.branch,
|
|
650
|
+
since: wait.since,
|
|
651
|
+
reason: wait.reason,
|
|
652
|
+
steps: `GitHub has not let Mergestorm read ${what} for #${layer.prNumber} at ${layer.headSha ?? "its head"} since ${wait.since}${wait.detail ? ` (${wait.detail})` : ""}, so Auto land cannot tell whether CI passed and will not move this PR. Nothing on ${layer.branch} needs a change: do not patch or push for this. Tell the human: the Mergestorm GitHub App needs the permission ${permission} on ${stack.owner}/${stack.repo}. They open the app's installation on GitHub (Settings, then GitHub Apps or Installed GitHub Apps), accept the pending permission request, and check that ${stack.repo} is in the app's repository access. Auto land continues by itself once the read works. If GitHub itself is having an outage, the wait clears when it ends.`,
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
if (wait && attention.blocker.startsWith(AUTO_LAND_WAITED_PREFIX)) {
|
|
656
|
+
return {
|
|
657
|
+
kind: "auto_land_waiting",
|
|
658
|
+
prNumber: layer.prNumber,
|
|
659
|
+
headSha: layer.headSha ?? null,
|
|
660
|
+
branch: layer.branch,
|
|
661
|
+
since: wait.since,
|
|
662
|
+
reason: wait.reason,
|
|
663
|
+
steps: `Auto land has been waiting on this stack since ${wait.since} because ${autoLandWaitWords(wait.reason)} (reason ${wait.reason}${wait.detail ? `: ${wait.detail}` : ""}), and nothing has changed that in the meantime. Run mg stack status ${stack.id} and read what it shows for #${layer.prNumber}. If it names something on ${layer.branch} that a commit fixes, fix it there with an ordinary push. Otherwise do not patch or push: tell the human what Auto land is waiting for and since when. Do not retarget the PR base.`,
|
|
664
|
+
};
|
|
665
|
+
}
|
|
564
666
|
if (wait && attention.blocker.startsWith(AUTO_LAND_PROMOTE_FAILED_PREFIX)) {
|
|
565
667
|
const attempts = wait.attempts ?? AUTO_LAND_PROMOTE_FAILED_ATTEMPTS;
|
|
566
668
|
return {
|
|
@@ -660,6 +762,14 @@ export function stackBlockers(stack, entries = [], cursor = {}, nowMs = Date.now
|
|
|
660
762
|
else if (!candidate || layer.position > candidate.position)
|
|
661
763
|
issues.push(issue);
|
|
662
764
|
}
|
|
765
|
+
if (!attention) {
|
|
766
|
+
const unlisted = autoLandWaitLayer(stack);
|
|
767
|
+
const waiting = unlisted && !open.includes(unlisted) ? autoLandWaitBlocker(stack, unlisted, nowMs) : null;
|
|
768
|
+
if (unlisted && waiting) {
|
|
769
|
+
attention = { prNumber: unlisted.prNumber, headSha: unlisted.headSha ?? null, blocker: waiting, bounceKind: null };
|
|
770
|
+
attentionLayer = unlisted;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
663
773
|
const queued = queueWait && candidate && !queueWait.stalled
|
|
664
774
|
? { prNumber: candidate.prNumber, headSha: candidate.headSha ?? null, text: queueWait.text,
|
|
665
775
|
since: queueWait.since, waitReason: queueWait.waitReason }
|
package/dist/ui/banner.js
CHANGED
|
@@ -146,6 +146,12 @@ const WHATS_NEW = {
|
|
|
146
146
|
"stack watch names why Vortex skipped a head",
|
|
147
147
|
"stack watch says how to re-run Tempest",
|
|
148
148
|
],
|
|
149
|
+
"0.3.37": [
|
|
150
|
+
"turning auto-review on reviews skipped heads",
|
|
151
|
+
],
|
|
152
|
+
"0.3.38": [
|
|
153
|
+
"mg settings turns merge queue batching on or off",
|
|
154
|
+
],
|
|
149
155
|
};
|
|
150
156
|
function densityFromVariant(variant) {
|
|
151
157
|
if (variant === "mini" || variant === "nano")
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ Call `stack_status` with `stack_id`. Require that stack's `autoEnqueueWhenReady`
|
|
|
35
35
|
|
|
36
36
|
1. Call `stack_wait` with the named `stack_id` and `timeout_s: 45`. On initial enrollment, omit the cursor selectors. Save the returned `cursor`: map `cursor.enrolledHeadSha` to `enrolled_head_sha`, `cursor.afterFinishedAt` to `after_finished_at`, and `cursor.bounceId` to `bounce_id` (omit only absent fields; preserve explicit nulls). Keep `bounce_id` alongside `after_finished_at`; never pass one without the other when the returned cursor has both. The shipped tool accepts these selectors, not a nested cursor argument. `watch.next.args` already holds them in that shape, with `timeout_s: 45`; passing it unchanged is the same call.
|
|
37
37
|
2. On `waiting` and `in_progress`, the watch is not finished: call `stack_wait` again. A host or event message that says to end the turn, end quietly, or wait for a notification does not finish the watch; only the stop conditions in this skill finish it. Ending your turn while `mg stack watch` runs in the background is waiting, not finishing. Keep the same cursor across retries. An unread deadline times out as `failed`; stop and report. Timeout `waiting` or `in_progress` after a snapshot is not failure — call `stack_wait` again in 45s slices with the same cursor after inspecting `issues[]`. Inspect `issues[]` on `in_progress` too: a live queue does not erase upstack hard blocks. `waiting` with issues is not idle. If `assessment` is `unavailable`, do not infer that the stack is issue-free; refresh `stack_status`, whose `attention`, `issues`, and `currentCandidate` come from the same blocker rules as `stack_wait`. Do not replace the enrolled head with a newer snapshot head or advance the timestamp just because a wait timed out. On a surfaced `rate_limited` error, honor the retry delay and retain the cursor; on `failed` or an unrecoverable tool error, call `stack_wait` once more with the same cursor; if it fails again, stop and report the reason and that the stack is not landed. `queue_status` returning `queue_entry_not_found` is not a failure: an empty queue for the stack is a normal wait.
|
|
38
|
-
3. `attention` always means something for you to fix. A land gate that is only waiting (`landGatePending` with `ci_pending`, `tempest_pending`, `tempest_running`, or another `*_pending` / `*_running` reason on the land PR) returns `in_progress`, not `attention`: keep watching. On `attention`, read `repair` when present: it names the blocked PR's `branch` and the concrete fix. For `restack_conflict` and `merge_conflict` it gives `liveParent` (the sibling PR head, or `mg-stack-N` once the lower layers are merged or promoted, or the land PR's base such as `main` when the blocked PR is the land PR, never `mg-park-*`) and the conflicted `files`; a null `liveParent` means stop and tell the human. For `ci_failure` it names the failing check. For `tempest_findings` on the land PR it names the land PR, its `branch` (`mg-stack-N`), and where the Tempest report is (`findings`). A stack whose `autoLandOff.reason` is `bounced` (a `merge_failed`, `gh_error`, or `ci_timeout` bounce turned Auto land off and nobody took the stack back since) returns `attention` with the blocker `Auto land off after <kind> bounce`, the bounce in `issues[]`, and a `repair` of kind `auto_land_off`; handle it as "Re-arm after a bounce" describes. A stack whose review unit was abandoned because a human moved its bottom PR off `mg-stack-N` returns `attention` with the blocker `Review unit abandoned: based on <base>` and a `repair` of kind `unit_abandoned`: do not patch or retarget anything. Ask the human whether to re-root it: if at least two PRs remain open, tell them that `mg stack adopt owner/repo#<bottom PR>` re-roots it on a new review unit; with only one open PR, re-adopting will not create a review unit, so tell them to close and resubmit it to create a fresh stack, then stop. Auto land records why it is waiting in the stack's `autoLandWait` (`reason`, `prNumber`, `headSha`, `since`), and the watch returns `attention` on that PR when the wait cannot clear on its own: a failing check Auto land reads live on GitHub while the ledger may still show CI green (blocker `CI failed — Auto land reads a failing check on GitHub at this head`, `repair` kind `ci_failure`); a check pending for 45 minutes (`repair` kind `ci_pending`: find the check that never finished and re-run it, or tell the human when no workflow reports it); no approving Vortex review for 30 minutes with no Vortex run working (`repair` kind `vortex_not_green`: fix or dismiss the findings, or tell the human when no review exists at the head); and a promote GitHub refused 3 times with `merge_failed`, after which Auto land stops retrying that head (`repair` kind `promote_failed`: fix the cause on the PR and push a new head, or tell the human when the cause is outside the PR; never toggle Auto land yourself for it). A layer whose live head has a Vortex verdict that requests changes after Cyclone left those findings for a person (a hold directive, the Vortex patch cap, auto-patch off, no billing, a batch it gave up on, or a PR state it could not read) returns `attention` with the blocker `Vortex findings need a person` and a `repair` of kind `vortex_findings` naming the Cyclone reason (`handoff`) and where the review is (`findings`): verify each finding against the checkout, fix the real ones with the smallest patch and an ordinary push, and tell the human about the ones you judge wrong. `repair` does not replace the checks below. On `attention`, fix the named PR: `prNumber` and `headSha` identify the blocked PR, while `currentCandidate` identifies the promote candidate. The gate covers the bottom and its direct child only when the child has current-head DIRTY on the live bottom branch. A GitHub DIRTY whose `parentBranch` starts with `mg-park-` is not that gate. Refresh `stack_status`; use `queue_status` with the same `stack_id` when bounce details are needed. Verify the blocker still applies to the current PR head. Never treat `verifyHeadSha` as the current head: it is a queue verification SHA and can be stale or synthetic. Compare the live PR branch head, the current stack layer head, and the checkout before editing. Read the live PR head with `git ls-remote origin refs/heads/<branch>` or `gh api repos/OWNER/REPO/pulls/N --jq .head.sha`. If you need CI logs, use `gh run list --branch <branch>`, `gh run view <run-id> --log-failed`, or `gh api repos/OWNER/REPO/commits/SHA/check-runs`. Read GitHub only through git and these REST calls; do not use other `gh pr` subcommands. Restack `clean` does not mean mergeable or CI-green. Attention is a diagnosis, not permission to mutate stack or queue policy; the only policy change you make is the re-arm in "Re-arm after a bounce". A bounce is the reason to look, not the moment to commit. `stack_wait` and `stack_status` hold the blocked PR's attention themselves while Vortex or Cyclone is still working on that PR, whatever the blocker (a red CI failure, a merge conflict, a bounce, Draft, a failed restack or review): they return `in_progress` instead of `attention`, with `busy[]` naming the PR (`prNumber`, `headSha`), the `blocker`, and the `agent` (`vortex` or `cyclone`), and `agents` carrying that PR's `vortexStatus`, `cycloneStatus`, `vortexReview`, and `busy` flags. `in_progress` with a nonempty `busy[]` means do not patch yet: keep calling `stack_wait` with the same cursor until that work has finished and the watch returns `attention`, then make the follow-up commit. You do not need an extra `stack_status` refresh each slice for this check. A nonempty `busy[]` reports still-working agents on that PR's current head. Vortex holds when `vortexReview` is `reviewing` at the head, an unfinished vortex `agentRuns` row at the head is `reviewing`, or an unfinished vortex run at the head is `queued` and started within the last 15 minutes (with no `agentRuns` or `vortexReview` on the layer, `vortexStatus` `reviewing` holds). Cyclone holds when `cycloneStatus` is `patching`, an unfinished cyclone `agentRuns` row is `patching`, or the server sees a live Cyclone patch lease or an open Cyclone check run on the head. `seam_pending` alone, and a `queued` run older than 15 minutes, are not treated as work in progress. `all_clear`, `findings`, `skipped`, `failed`, `throttled`, `awaiting_fix`, and a null status are finished. A queued Vortex run holds for at most 15 minutes; reviewing and patching hold until the run finishes or its lease or check run is cleared. A blocker no Vortex or Cyclone run can clear is not hidden by the hold: a merge conflict vs the live parent, a restack `Conflict` or `Restack failed` (a parked freeze included), a Draft PR, `Seam review pending, no review running`, or `Review skipped, out of review quota`. For those the envelope stays `in_progress` but names the blocker in the top-level `blocker`, `prNumber`, `headSha`, and `issues[]`, with `actAfter: "agents_idle"`, `waitingOn` listing the busy agents, and `repair` when there is one. Plan the fix from it, but do not patch, merge, or push while `actAfter` is set: keep calling `stack_wait` with the same cursor, and act when a snapshot after the agents finish returns `attention`; a Cyclone push can change or clear the blocker, so re-read it then. Blockers the agents can change (a red CI failure, a failed review or Tempest run, seam findings, a bounce) keep the plain hold: `blocker` is null, `actAfter` is null, and only `busy[]` names them. If a hold looks stuck, refresh `stack_status` and tell the human. Do not turn Cyclone off or Auto land off, and do not turn Auto land on to end the wait; turn it on only as "Re-arm after a bounce" allows. If the remote head moves while you wait, stop and tell the human.
|
|
38
|
+
3. `attention` always means something for you to fix. A land gate that is only waiting (`landGatePending` with `ci_pending`, `tempest_pending`, `tempest_running`, or another `*_pending` / `*_running` reason on the land PR) returns `in_progress`, not `attention`: keep watching. On `attention`, read `repair` when present: it names the blocked PR's `branch` and the concrete fix. For `restack_conflict` and `merge_conflict` it gives `liveParent` (the sibling PR head, or `mg-stack-N` once the lower layers are merged or promoted, or the land PR's base such as `main` when the blocked PR is the land PR, never `mg-park-*`) and the conflicted `files`; a null `liveParent` means stop and tell the human. For `ci_failure` it names the failing check. For `tempest_findings` on the land PR it names the land PR, its `branch` (`mg-stack-N`), and where the Tempest report is (`findings`). A stack whose `autoLandOff.reason` is `bounced` (a `merge_failed`, `gh_error`, or `ci_timeout` bounce turned Auto land off and nobody took the stack back since) returns `attention` with the blocker `Auto land off after <kind> bounce`, the bounce in `issues[]`, and a `repair` of kind `auto_land_off`; handle it as "Re-arm after a bounce" describes. A stack whose review unit was abandoned because a human moved its bottom PR off `mg-stack-N` returns `attention` with the blocker `Review unit abandoned: based on <base>` and a `repair` of kind `unit_abandoned`: do not patch or retarget anything. Ask the human whether to re-root it: if at least two PRs remain open, tell them that `mg stack adopt owner/repo#<bottom PR>` re-roots it on a new review unit; with only one open PR, re-adopting will not create a review unit, so tell them to close and resubmit it to create a fresh stack, then stop. Auto land records why it is waiting in the stack's `autoLandWait` (`reason`, `prNumber`, `headSha`, `since`), and the watch returns `attention` on that PR when the wait cannot clear on its own: a failing check Auto land reads live on GitHub while the ledger may still show CI green (blocker `CI failed — Auto land reads a failing check on GitHub at this head`, `repair` kind `ci_failure`); a check pending for 45 minutes (`repair` kind `ci_pending`: find the check that never finished and re-run it, or tell the human when no workflow reports it); no approving Vortex review for 30 minutes with no Vortex run working (`repair` kind `vortex_not_green`: fix or dismiss the findings, or tell the human when no review exists at the head); and a promote GitHub refused 3 times with `merge_failed`, after which Auto land stops retrying that head (`repair` kind `promote_failed`: fix the cause on the PR and push a new head, or tell the human when the cause is outside the PR; never toggle Auto land yourself for it). The watch also returns `attention` when GitHub refuses to let Mergestorm read the head's check runs or commit statuses (blocker `Mergestorm cannot read ... on this head`, `repair` kind `ci_unreadable`: do not patch or push; tell the human to grant the Mergestorm GitHub App the permission the repair names), and when any other wait reason has held for 45 minutes, a land gate left pending or running on the land PR included (blocker `Auto land has waited <N>m: <reason in plain words>`, `repair` kind `auto_land_waiting`: read `stack_status`, fix what a commit on the named branch can fix, otherwise tell the human what Auto land waits for and since when). A merge queue entry that has sat queued for 45 minutes with nothing working on it or ahead of it returns `attention` with the blocker `Merge queue stuck: ...` and a `repair` whose kind is queue_stalled: do not patch or push; tell the human. A layer whose live head has a Vortex verdict that requests changes after Cyclone left those findings for a person (a hold directive, the Vortex patch cap, auto-patch off, no billing, a batch it gave up on, or a PR state it could not read) returns `attention` with the blocker `Vortex findings need a person` and a `repair` of kind `vortex_findings` naming the Cyclone reason (`handoff`) and where the review is (`findings`): verify each finding against the checkout, fix the real ones with the smallest patch and an ordinary push, and tell the human about the ones you judge wrong. `repair` does not replace the checks below. On `attention`, fix the named PR: `prNumber` and `headSha` identify the blocked PR, while `currentCandidate` identifies the promote candidate. The gate covers the bottom and its direct child only when the child has current-head DIRTY on the live bottom branch. A GitHub DIRTY whose `parentBranch` starts with `mg-park-` is not that gate. Refresh `stack_status`; use `queue_status` with the same `stack_id` when bounce details are needed. Verify the blocker still applies to the current PR head. Never treat `verifyHeadSha` as the current head: it is a queue verification SHA and can be stale or synthetic. Compare the live PR branch head, the current stack layer head, and the checkout before editing. Read the live PR head with `git ls-remote origin refs/heads/<branch>` or `gh api repos/OWNER/REPO/pulls/N --jq .head.sha`. If you need CI logs, use `gh run list --branch <branch>`, `gh run view <run-id> --log-failed`, or `gh api repos/OWNER/REPO/commits/SHA/check-runs`. Read GitHub only through git and these REST calls; do not use other `gh pr` subcommands. Restack `clean` does not mean mergeable or CI-green. Attention is a diagnosis, not permission to mutate stack or queue policy; the only policy change you make is the re-arm in "Re-arm after a bounce". A bounce is the reason to look, not the moment to commit. `stack_wait` and `stack_status` hold the blocked PR's attention themselves while Vortex or Cyclone is still working on that PR, whatever the blocker (a red CI failure, a merge conflict, a bounce, Draft, a failed restack or review): they return `in_progress` instead of `attention`, with `busy[]` naming the PR (`prNumber`, `headSha`), the `blocker`, and the `agent` (`vortex` or `cyclone`), and `agents` carrying that PR's `vortexStatus`, `cycloneStatus`, `vortexReview`, and `busy` flags. `in_progress` with a nonempty `busy[]` means do not patch yet: keep calling `stack_wait` with the same cursor until that work has finished and the watch returns `attention`, then make the follow-up commit. You do not need an extra `stack_status` refresh each slice for this check. A nonempty `busy[]` reports still-working agents on that PR's current head. Vortex holds when `vortexReview` is `reviewing` at the head, an unfinished vortex `agentRuns` row at the head is `reviewing`, or an unfinished vortex run at the head is `queued` and started within the last 15 minutes (with no `agentRuns` or `vortexReview` on the layer, `vortexStatus` `reviewing` holds). Cyclone holds when `cycloneStatus` is `patching`, an unfinished cyclone `agentRuns` row is `patching`, or the server sees a live Cyclone patch lease or an open Cyclone check run on the head. `seam_pending` alone, and a `queued` run older than 15 minutes, are not treated as work in progress. `all_clear`, `findings`, `skipped`, `failed`, `throttled`, `awaiting_fix`, and a null status are finished. A queued Vortex run holds for at most 15 minutes; reviewing and patching hold until the run finishes or its lease or check run is cleared. A blocker no Vortex or Cyclone run can clear is not hidden by the hold: a merge conflict vs the live parent, a restack `Conflict` or `Restack failed` (a parked freeze included), a Draft PR, `Seam review pending, no review running`, or `Review skipped, out of review quota`. For those the envelope stays `in_progress` but names the blocker in the top-level `blocker`, `prNumber`, `headSha`, and `issues[]`, with `actAfter: "agents_idle"`, `waitingOn` listing the busy agents, and `repair` when there is one. Plan the fix from it, but do not patch, merge, or push while `actAfter` is set: keep calling `stack_wait` with the same cursor, and act when a snapshot after the agents finish returns `attention`; a Cyclone push can change or clear the blocker, so re-read it then. Blockers the agents can change (a red CI failure, a failed review or Tempest run, seam findings, a bounce) keep the plain hold: `blocker` is null, `actAfter` is null, and only `busy[]` names them. If a hold looks stuck, refresh `stack_status` and tell the human. Do not turn Cyclone off or Auto land off, and do not turn Auto land on to end the wait; turn it on only as "Re-arm after a bounce" allows. If the remote head moves while you wait, stop and tell the human.
|
|
39
39
|
4. Use a clean worktree on that named PR's head branch and record the remote starting SHA. Fix the current blocker with the smallest patch, and run the relevant checks. For conflicts, the live parent is the sibling PR head or the unit branch (`mg-stack-N`, Mergestorm's owned trunk, not an alias for main) — not the DTO `parentBranch` when that field starts with `mg-park-*`. If `parentBranch` is `mg-park-*`, never merge or rebase onto it; if the real live parent is unknown, stop. The land PR is the one PR whose head is `mg-stack-N`: its live parent is its base (`main`), and merging that base into `mg-stack-N` with an ordinary push is its conflict repair, the same as for any other layer. Tempest never patches: Cyclone patches a land PR when auto-patch is on for that stack, otherwise you do. On `tempest_findings` on the land PR, when `busy[]` shows no Cyclone run on it, read the Tempest report, verify each finding against the checkout as for Vortex findings, fix the real ones with the smallest patch on `mg-stack-N`, and push with an ordinary push, never a force push; while Cyclone is patching it the envelope stays `in_progress` with `busy[]`, so wait. Otherwise prefer merging that live parent into the PR branch, resolving locally, then an ordinary push. Never use Dashboard Continue. When the live parent is a sibling, never rebase onto trunk or `mg-stack-N` instead. Parked-freeze DIRTY alone needs no conflict patch. Leave GitHub bases as Mergestorm set them: the bottom of a 2+ PR stack is based on `mg-stack-N`, layer 2 on layer 1, PR3+ on `mg-park-*`.
|
|
40
40
|
5. CI-only fixes may run while Cyclone auto-patch is still on for the stack. Auto-patch may stay on, and you still wait until the current Vortex run and the current Cyclone run on that PR have finished before the follow-up commit. When the gate is clean, inspect `issues[]` and fix a live upstack CI failure one PR at a time, refreshing the gate before the next PR. Do not use higher-layer bounce history as a patch target. Do not fight Cyclone: if the remote head moved, stop and tell the human. Do not take over Cyclone's review-finding work while it is active; if the blocker requires that or a policy/queue action rather than a concrete patch, stop and explain what needs human attention. On a `Seam findings` blocker, read that PR's seam finding, the Vortex review "Integration review — U<n> seam" (`gh api repos/OWNER/REPO/pulls/N/reviews` and `gh api repos/OWNER/REPO/pulls/N/comments`), and patch its concrete findings on that PR's head; a "Decision required" seam finding needs a human, so tell them and do not guess. A seam finding you verified is wrong is recorded with `mg dismiss` (the audited dismissal in `mergestorm-pr-loop`) at that PR's live head and that seam review's id; a `mergestorm-loop: dismiss` comment alone does not clear the seam gate. On `Seam review failed`, do not patch; tell the human, unless a new push already has a seam re-review held in `busy[]`. On `Seam review pending, no review running`, do not patch; tell the human: the seam review was skipped (usually because the monthly review limit is reached) and nothing re-runs it until they raise the limit and click Continue on the stack, or push a new head. On `Seam review stuck in reviewing, no review running`, `Seam re-review pending, no review running`, or `Seam verdict is for an older head, no review running` (repair kind `seam_review_stuck`), do not patch or push; tell the human: no seam review is queued or running for that PR's live head, and clicking Continue on the stack re-queues it (a new pushed head also does). On `Review skipped, out of review quota`, do not patch; tell the human: the review credit limit for the period is reached and nothing re-reviews that head until they raise the limit and push a new head or re-run the review.
|
|
41
41
|
6. Recheck Auto land (off is expected only after a disarming bounce you are handling) and the remote PR head (`git ls-remote origin refs/heads/<branch>`) immediately before pushing. Commit the patch and push the PR head with an ordinary push. A rebase onto that same live parent followed by force-with-lease is allowed only if the remote is still exactly the SHA you started from and Cyclone did not move it; use an explicit lease bound to that starting SHA. This exception never permits rebasing onto a parked freeze or substituting trunk / the unit for a sibling parent. If the remote head moved or the push is rejected because it moved, stop; do not rebase and retry.
|