mergestorm 0.3.38 → 0.3.40
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 +2 -2
- package/dist/api.d.ts +6 -1
- package/dist/api.js +61 -5
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/commands/browse.d.ts +5 -0
- package/dist/commands/browse.js +18 -1
- package/dist/commands/review-client.d.ts +8 -1
- package/dist/commands/review-client.js +18 -3
- package/dist/commands/review.d.ts +2 -1
- package/dist/commands/review.js +1 -0
- package/dist/commands/settings.js +2 -3
- package/dist/commands/stack.js +1 -2
- package/dist/errors.d.ts +4 -1
- package/dist/errors.js +9 -0
- package/dist/stack-blockers.d.ts +26 -16
- package/dist/stack-blockers.js +197 -117
- package/dist/stack-dto.d.ts +7 -8
- package/dist/stack-dto.js +0 -2
- package/dist/ui/banner.js +7 -1
- package/dist/ui/tabs.d.ts +5 -0
- package/dist/ui/tabs.js +5 -3
- package/package.json +1 -1
- package/skill/mergestorm-bounce-watch/SKILL.md +4 -3
- package/skill/mergestorm-pr-loop/SKILL.md +2 -2
package/dist/stack-dto.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type RestackError = {
|
|
|
9
9
|
branch: string;
|
|
10
10
|
oldSha: string;
|
|
11
11
|
};
|
|
12
|
+
droppedMergeCommit?: boolean;
|
|
12
13
|
};
|
|
13
14
|
export declare function restackAttemptsExhausted(error: Pick<RestackError, "attempts">): boolean;
|
|
14
15
|
export declare function pushRejectionIsRetryable(message: string): boolean;
|
|
@@ -69,8 +70,7 @@ export type StackCycloneHandoff = {
|
|
|
69
70
|
reason: string;
|
|
70
71
|
at: string | null;
|
|
71
72
|
};
|
|
72
|
-
export type
|
|
73
|
-
export type StackAgentName = "vortex" | "cyclone" | "tempest";
|
|
73
|
+
export type StackAgentName = "vortex" | "cyclone";
|
|
74
74
|
/**
|
|
75
75
|
* One live-or-resting agent run for a PR (#1119): a dumb projection of one
|
|
76
76
|
* ledger row (webhook job / lease / review-state / pr_reviews). Two live
|
|
@@ -197,8 +197,6 @@ export type StackLayerDto = {
|
|
|
197
197
|
vortexStatus: StackVortexStatus | null;
|
|
198
198
|
/** null on the fast list or when no Cyclone signal exists. */
|
|
199
199
|
cycloneStatus: StackCycloneStatus | null;
|
|
200
|
-
/** null when no Tempest signal exists. Fast list and enrich both paint this from pr_reviews (#876). */
|
|
201
|
-
tempestStatus: StackTempestStatus | null;
|
|
202
200
|
/**
|
|
203
201
|
* Ledger-backed agent runs, one per live row (#1119). Fast list and enrich
|
|
204
202
|
* both paint this from our tables only — never GitHub. The per-agent status
|
|
@@ -296,11 +294,10 @@ export type StackUnitDto = {
|
|
|
296
294
|
landTarget: string;
|
|
297
295
|
members: StackUnitMemberDto[];
|
|
298
296
|
landPrNumber: number | null;
|
|
299
|
-
tempestLandStatus: string | null;
|
|
300
297
|
landingBlockReason: string | null;
|
|
301
298
|
/**
|
|
302
299
|
* Land-PR chrome. Fast list hydrates last-known CI/title/mergeable/issues from
|
|
303
|
-
* `review_units` (#878 / #892)
|
|
300
|
+
* `review_units` (#878 / #892). Enrich
|
|
304
301
|
* refreshes GitHub and writes back. Null when the land PR is an open stack
|
|
305
302
|
* layer (chips live on `layers`) or the unit has no land PR.
|
|
306
303
|
*/
|
|
@@ -385,6 +382,8 @@ export type StackDto = {
|
|
|
385
382
|
*/
|
|
386
383
|
cycloneOwnerMatch?: CycloneOwnerMatch;
|
|
387
384
|
cyclonePatchOff?: CyclonePatchOffReason;
|
|
385
|
+
infrastructureInstallUserId?: string | null;
|
|
386
|
+
infrastructureOwnerMatch?: CycloneOwnerMatch;
|
|
388
387
|
layers: StackLayerDto[];
|
|
389
388
|
/** Present when a review-unit row exists for this stack. */
|
|
390
389
|
unit?: StackUnitDto;
|
|
@@ -392,9 +391,9 @@ export type StackDto = {
|
|
|
392
391
|
export type MergeQueueEntryState = "queued" | "running" | "waiting" | "landed" | "bounced" | "cancelled";
|
|
393
392
|
export type MergeQueueEnqueuedBy = "human" | "agent";
|
|
394
393
|
export type MergeQueueEnqueuedVia = "dashboard" | "cli" | "chat" | "api" | "mcp";
|
|
395
|
-
export type MergeQueueBounceKind = "ci_failure" | "ci_timeout" | "head_moved" | "
|
|
394
|
+
export type MergeQueueBounceKind = "ci_failure" | "ci_timeout" | "head_moved" | "seam_findings" | "restack_conflict" | "pr_draft" | "must_consolidate" | "merge_failed" | "gh_error";
|
|
396
395
|
/** Every bounce kind understood by the shared contract. */
|
|
397
|
-
export declare const MERGE_QUEUE_BOUNCE_KINDS: readonly ["ci_failure", "ci_timeout", "head_moved", "
|
|
396
|
+
export declare const MERGE_QUEUE_BOUNCE_KINDS: readonly ["ci_failure", "ci_timeout", "head_moved", "seam_findings", "restack_conflict", "pr_draft", "must_consolidate", "merge_failed", "gh_error"];
|
|
398
397
|
export declare const BOUNCE_KIND_LABELS: Readonly<Record<MergeQueueBounceKind, string>>;
|
|
399
398
|
export declare function mergeQueueBounceLabel(entry: MergeQueueEntryDto): string;
|
|
400
399
|
/** Structured bounce handoff — enough for the bar chip and the chat quote. */
|
package/dist/stack-dto.js
CHANGED
|
@@ -55,7 +55,6 @@ export const MERGE_QUEUE_BOUNCE_KINDS = [
|
|
|
55
55
|
"ci_failure",
|
|
56
56
|
"ci_timeout",
|
|
57
57
|
"head_moved",
|
|
58
|
-
"tempest_findings",
|
|
59
58
|
"seam_findings",
|
|
60
59
|
"restack_conflict",
|
|
61
60
|
"pr_draft",
|
|
@@ -67,7 +66,6 @@ export const BOUNCE_KIND_LABELS = {
|
|
|
67
66
|
ci_failure: "CI failed",
|
|
68
67
|
ci_timeout: "CI timed out",
|
|
69
68
|
head_moved: "head moved",
|
|
70
|
-
tempest_findings: "Tempest findings",
|
|
71
69
|
seam_findings: "seam review findings",
|
|
72
70
|
restack_conflict: "restack conflict",
|
|
73
71
|
pr_draft: "draft PR",
|
package/dist/ui/banner.js
CHANGED
|
@@ -144,7 +144,6 @@ const WHATS_NEW = {
|
|
|
144
144
|
"0.3.36": [
|
|
145
145
|
"stack watch names what the merge queue waits on",
|
|
146
146
|
"stack watch names why Vortex skipped a head",
|
|
147
|
-
"stack watch says how to re-run Tempest",
|
|
148
147
|
],
|
|
149
148
|
"0.3.37": [
|
|
150
149
|
"turning auto-review on reviews skipped heads",
|
|
@@ -152,6 +151,13 @@ const WHATS_NEW = {
|
|
|
152
151
|
"0.3.38": [
|
|
153
152
|
"mg settings turns merge queue batching on or off",
|
|
154
153
|
],
|
|
154
|
+
"0.3.39": [
|
|
155
|
+
"the watch names more waits and what to do",
|
|
156
|
+
],
|
|
157
|
+
"0.3.40": [
|
|
158
|
+
"refusals name Surge when it is the App to install",
|
|
159
|
+
"mg settings says whether stacks are ready",
|
|
160
|
+
],
|
|
155
161
|
};
|
|
156
162
|
function densityFromVariant(variant) {
|
|
157
163
|
if (variant === "mini" || variant === "nano")
|
package/dist/ui/tabs.d.ts
CHANGED
|
@@ -18,7 +18,12 @@ export type TabsConfigRow = {
|
|
|
18
18
|
label: string;
|
|
19
19
|
value: boolean;
|
|
20
20
|
writable: boolean;
|
|
21
|
+
readOnlyWords?: {
|
|
22
|
+
on: string;
|
|
23
|
+
off: string;
|
|
24
|
+
};
|
|
21
25
|
};
|
|
26
|
+
export declare function readOnlyRowWords(row: TabsConfigRow): string;
|
|
22
27
|
export type TabsData = {
|
|
23
28
|
/** Prebuilt whoami + credits lines for the Status tab. */
|
|
24
29
|
statusLines: string[];
|
package/dist/ui/tabs.js
CHANGED
|
@@ -12,6 +12,10 @@ const TAB_LABELS = {
|
|
|
12
12
|
jobs: "Jobs",
|
|
13
13
|
config: "Config",
|
|
14
14
|
};
|
|
15
|
+
export function readOnlyRowWords(row) {
|
|
16
|
+
const words = row.readOnlyWords ?? { on: "connected", off: "not connected" };
|
|
17
|
+
return row.value ? words.on : words.off;
|
|
18
|
+
}
|
|
15
19
|
export function initialTabsState(tab = "status") {
|
|
16
20
|
return {
|
|
17
21
|
tab,
|
|
@@ -180,9 +184,7 @@ function configBody(state, data, bodyRows, width, color) {
|
|
|
180
184
|
? row.value
|
|
181
185
|
? "on"
|
|
182
186
|
: "off"
|
|
183
|
-
: row
|
|
184
|
-
? "connected"
|
|
185
|
-
: "not connected";
|
|
187
|
+
: readOnlyRowWords(row);
|
|
186
188
|
const paintedValue = !color
|
|
187
189
|
? value
|
|
188
190
|
: row.writable
|
package/package.json
CHANGED
|
@@ -33,10 +33,12 @@ Call `stack_status` with `stack_id`. Require that stack's `autoEnqueueWhenReady`
|
|
|
33
33
|
|
|
34
34
|
## Watch and patch
|
|
35
35
|
|
|
36
|
+
A stack whose layers are all merged into `mg-stack-N` but has no open land PR returns attention with repair kind `land_pr_unavailable`: do not patch or push; tell the human to restore the branch from the closed land PR's head or close the stack.
|
|
37
|
+
|
|
36
38
|
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
39
|
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
|
|
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.
|
|
40
|
+
3. `attention` always means something for you to fix. A land gate that is only waiting (`landGatePending` with `ci_pending` 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. 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 Vortex review skipped because the PR author is on the ignored authors list, or because reviews are turned off for the repository, returns `attention` at once with a `repair` of kind `vortex_skipped`; a Vortex retry that is scheduled (`Vortex hit a temporary error on this head and will retry by itself`) is a wait listed in `issues[]`, never `attention`. `Review failed` carries a `repair` of kind `vortex_failed`: comment `@mergestorm-vortex review` on the PR or push a new commit, and tell the human if it fails again. A PR open on `mg-stack-N` that is not a layer of the stack returns `attention` at once with the blocker `The land PR cannot be queued: ...` and a `repair` of kind `members_remaining`: do not patch or push; close, retarget or adopt that PR (a draft or fork PR cannot be adopted). 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, 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.
|
|
41
|
+
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. Cyclone patches a land PR when auto-patch is on for that stack, otherwise you do: when `busy[]` shows no Cyclone run on it, fix its blocker 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. For a conflict, 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
42
|
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
43
|
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.
|
|
42
44
|
7. After your successful push, leave a clean worktree and keep watching the named stack. Start a new watch cycle with `enrolled_head_sha` set to the SHA you pushed (in the background: `mg stack watch <stack-id> --head <pushed-sha>`). If you handled a bounce, retain the returned `cursor.afterFinishedAt` as `after_finished_at` and `cursor.bounceId` as `bounce_id` so that attempt is not handled again. Keep these selectors unchanged across subsequent retries. Continue watching; do not enqueue anything. If the bounce you handled turned Auto land off, turn it back on as "Re-arm after a bounce" allows; if that section does not allow it, report and stop.
|
|
@@ -66,7 +68,6 @@ The kind list is exactly `MERGE_QUEUE_BOUNCE_KINDS` from stack-dto:
|
|
|
66
68
|
- `ci_failure`
|
|
67
69
|
- `ci_timeout`
|
|
68
70
|
- `head_moved`
|
|
69
|
-
- `tempest_findings`
|
|
70
71
|
- `seam_findings`
|
|
71
72
|
- `restack_conflict`
|
|
72
73
|
- `pr_draft`
|
|
@@ -27,7 +27,7 @@ mg skill install --claude --cursor --agents
|
|
|
27
27
|
## Loop (in order)
|
|
28
28
|
|
|
29
29
|
1. Find the PR's stack with `stack_list` (the stack whose `layers` contain this PR's `prNumber` for this owner/repo). If you already have its `stack_id`, `stack_status` is the same payload.
|
|
30
|
-
- Adoption needs the
|
|
30
|
+
- Adoption needs the infrastructure GitHub App on the repository: Mergestorm Surge, or Cyclone on accounts not yet moved to Surge. Stacks, the merge queue and Auto land run through that App; Cyclone is the auto-patch App. Without it `stack_adopt` returns `cyclone_not_connected` or `cyclone_not_installed`. The code keeps its name in both cases: the message, and a `reason` starting with `surge_` when Surge is the one to install, say which App is missing. Stop and tell the human what the message says, do not retry.
|
|
31
31
|
- If there is no stack and the human asked you to mute Cyclone or continue the loop: call `stack_adopt` with `{ owner, repo, pr_number, auto_patch: false }` (equivalent to `mg stack adopt … --auto-patch off`). Then call `stack_status` with the returned `result.stack.id`, confirm this PR is in the stack and `autoPatchOverride` is `false`. If adoption or verification fails, refuse the loop. Otherwise continue through the ownership check below and the remaining loop steps; do not stop and ask the human to adopt. Do not turn account auto-patch off.
|
|
32
32
|
- Adoption does not fix installer ≠ key. After adoption, the same `cycloneOwnerMatch` refusal below still applies.
|
|
33
33
|
- After adopting 2+ PRs the bottom PR's GitHub base is `mg-stack-<n>` and PR3+ sit on an `mg-park-*` freeze; a 1-PR stack stays on main. That is expected; leave every base as Mergestorm set it.
|
|
@@ -67,7 +67,7 @@ Map these to `mergestorm.pr_review/v1` envelope fields; do not invent statuses.
|
|
|
67
67
|
- status is `rate_limited`, or `patch_policy.mode` is `"hold"`: surface the findings to the human and stop. Do not patch.
|
|
68
68
|
- status is `failed`: report to the human. Do not keep pushing to retrigger.
|
|
69
69
|
- status is `in_progress` and the envelope has a `head_sha`: the pass is still running; call `review_wait_pr` again with the same `after_sha` and the same `after_pass`.
|
|
70
|
-
- status is `in_progress` and the envelope has no `head_sha
|
|
70
|
+
- status is `none` (from an older MCP server: status is `in_progress` and the envelope has no `head_sha`): the wait timed out and no Vortex pass exists for your SHA yet. Call `review_wait_pr` once more with the same `after_sha` and the same `after_pass`. If it comes back the same way a second time in a row, stop and tell the human that Vortex did not pick up the push, and that a comment `@mergestorm-vortex review` on the PR runs it. Do not push again to retrigger.
|
|
71
71
|
- status is `quota_exceeded` (or its legacy spelling `trial_expired`): the account's review credits are used up for this period; tell the human calmly and stop. It is not an error and not a lapsed trial. Do not patch or push.
|
|
72
72
|
- status is `skipped`, `stopped`, or `synced`: surface the status and reason to the human and stop. Do not patch or push.
|
|
73
73
|
|