mergestorm 0.3.18 → 0.3.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergestorm",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "Mergestorm CLI (mg) — local reviews & stacked PRs. MIT; build from source: https://github.com/marginsystems/mergestorm-cli",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/skill/SKILL.md CHANGED
@@ -13,17 +13,17 @@ Before opening a PR; after a large refactor; when the user says review, audit, s
13
13
 
14
14
  Not for merging, landing, or pushing. For a PR that is already open on GitHub, use the `mergestorm-pr-loop` skill instead.
15
15
 
16
- ## Install (Claude Code / Cursor)
16
+ ## Install (Claude Code / Cursor / Agents)
17
17
 
18
18
  ```bash
19
19
  mg skill install --claude
20
20
  mg skill install --cursor
21
- # or both: mg skill install --claude --cursor
21
+ # or all three: mg skill install --claude --cursor --agents
22
22
  ```
23
23
 
24
- That writes `.claude/skills/mergestorm-review/SKILL.md` and/or `.cursor/skills/mergestorm-review/SKILL.md` in the current repo.
24
+ That writes `.claude/skills/mergestorm-review/SKILL.md`, `.cursor/skills/mergestorm-review/SKILL.md`, and/or `.agents/skills/mergestorm-review/SKILL.md` in the current repo.
25
25
 
26
- Hand-copy still works: Claude Code project skill `.claude/skills/mergestorm-review/SKILL.md` (or `~/.claude/skills/mergestorm-review/SKILL.md`). Cursor: the same file under `.cursor/skills/mergestorm-review/SKILL.md`; otherwise a rule at `.cursor/rules/mergestorm-review.mdc` with this description and `alwaysApply: false`.
26
+ Hand-copy still works: Claude Code project skill `.claude/skills/mergestorm-review/SKILL.md` (or `~/.claude/skills/mergestorm-review/SKILL.md`). Cursor: the same file under `.cursor/skills/mergestorm-review/SKILL.md`; otherwise a rule at `.cursor/rules/mergestorm-review.mdc` with this description and `alwaysApply: false`. Agents: `.agents/skills/mergestorm-review/SKILL.md`.
27
27
 
28
28
  MCP server:
29
29
 
@@ -51,6 +51,8 @@ Cursor `~/.cursor/mcp.json`:
51
51
  1. Prefer the `mergestorm` MCP server. Call `whoami`. If MCP is missing, require `mg` on PATH with `mg whoami --json` exit 0. If neither is available, stop and print the install one-liner above.
52
52
  2. Call `credits` (or `mg credits --json`). If remaining standard credits are 0, say so and stop.
53
53
 
54
+ Ignored bot authors live in Settings → Vortex ("Ignore bot PR authors"), not Agents. Local `review_submit` is a manual review and is not an ignore-list skip.
55
+
54
56
  ## Hire policy
55
57
 
56
58
  Default: omit `router` (account setting).
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: mergestorm-bounce-watch
3
+ description: Watch stacks explicitly named by the human while Auto land is on, and patch the current blocker after a bounce. Use for an ongoing stack watch, without taking over Cyclone or landing the stack.
4
+ ---
5
+
6
+ # Mergestorm bounce watch
7
+
8
+ Use only these shipped Mergestorm MCP tools: `stack_wait`, `stack_status`, `queue_status`. Use local checkout, test, and Git operations to make the patch. Auto land owns landing.
9
+
10
+ ## Scope and enrollment
11
+
12
+ Watch only stacks the human named. If no unambiguous stack ID is available, ask the human to identify it; do not discover and enroll other stacks. Keep a separate cursor for each named stack.
13
+
14
+ Call `stack_status` with `stack_id`. Require that stack's `autoEnqueueWhenReady` is `true` (Auto land on). If Auto land is off, missing, or cannot be verified, stop and tell the human. Never enable it yourself. Recheck this condition between wait slices and before patching or pushing. Stop when the stack is archived or its PRs are all merged or closed.
15
+
16
+ ## Watch and patch
17
+
18
+ 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). The shipped tool accepts these selectors, not a nested cursor argument.
19
+ 2. Keep the same cursor across retries. Timeout `waiting` is not failure — call `stack_wait` again in 45s slices with the same cursor. Do the same for `in_progress`. 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, stop and report the reason.
20
+ 3. On `attention`, inspect the current `blocker`, `prNumber`, `headSha`, and `bounceKind`. 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.
21
+ 4. Fix the current blocker with the smallest patch on that PR's head branch, and run the relevant checks. CI-only fixes may run while Cyclone auto-patch is still on for the stack. 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.
22
+ 5. Recheck Auto land and the remote PR head immediately before pushing. Commit the patch and push the PR head with an ordinary push. If the remote head moved or the push is rejected because it moved, stop. Do not rebase and retry or force-push.
23
+ 6. After your successful push, start a new watch cycle for that named stack with `enrolled_head_sha` set to the SHA you pushed. If you handled a bounce, retain its `finishedAt` as `after_finished_at` so that attempt is not handled again. Keep these selectors unchanged across subsequent retries. Continue watching; do not enqueue or re-arm anything. If further progress requires re-arming, stop and tell the human.
24
+
25
+ ## Bounce kinds
26
+
27
+ The kind list is exactly `MERGE_QUEUE_BOUNCE_KINDS` from stack-dto:
28
+
29
+ - `ci_failure`
30
+ - `ci_timeout`
31
+ - `head_moved`
32
+ - `tempest_findings`
33
+ - `seam_findings`
34
+ - `restack_conflict`
35
+ - `pr_draft`
36
+ - `must_consolidate`
37
+ - `merge_failed`
38
+ - `gh_error`
39
+
40
+ A kind is context, not permission to mutate queue or stack policy. Diagnose the current blocker rather than blindly retrying its old bounce. A head-moved bounce requires stopping if another actor moved the PR head; a timeout alone does not justify a code change. If there is no concrete patch within this scope, report the blocker and stop.
41
+
42
+ ## Never
43
+
44
+ - Do not land, merge, enqueue, run `mg queue add`, `stack land`, or `land-unit`, or call `queue_enqueue` (not a shipped tool).
45
+ - Do not call `settings_set`, change account auto-patch settings, or turn account auto-patch off.
46
+ - Do not set `auto_patch: true` on a stack.
47
+ - Do not replace Cyclone or change stack auto-patch policy to take over its work.
48
+ - Do not auto re-arm Auto land or a bounced queue entry.
49
+ - Do not force-push (including force-with-lease), or rebase and retry after the remote head moved.
50
+ - Do not push any branch other than the current blocker's PR head.
@@ -9,10 +9,12 @@ Vortex already reviews every push to an open PR on a monitored repo; nothing her
9
9
 
10
10
  Two worlds, never mixed: reviewing a local branch before a PR exists is the `mergestorm-review` skill. This skill is only for a PR that is already open on GitHub.
11
11
 
12
- ## Install (Claude Code / Cursor)
12
+ The account ignore list and check colors live on Settings; manage the list with `mg settings --ignore-bot add <login>|remove <login>|clear`. The ignore list does not change this loop or its rule against setting `auto_patch_enabled` with `settings_set`.
13
+
14
+ ## Install (Claude Code / Cursor / Agents)
13
15
 
14
16
  ```bash
15
- mg skill install --claude --cursor
17
+ mg skill install --claude --cursor --agents
16
18
  ```
17
19
 
18
20
  ## Preconditions (in order)
@@ -25,6 +27,7 @@ mg skill install --claude --cursor
25
27
  ## Loop (in order)
26
28
 
27
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 Cyclone GitHub App on the account; without it `stack_adopt` returns `cyclone_not_connected` — stop and tell the human, do not retry.
28
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.
29
32
  - Adoption does not fix installer ≠ key. After adoption, the same `cycloneOwnerMatch` refusal below still applies.
30
33
  - Read `cycloneOwnerMatch` on that stack. If it is missing, `lookup_failed`, or `different`: refuse the loop. Do not wait, patch, or push. Tell the human the API key and the Cyclone GitHub App install are different Mergestorm accounts (or the comparison could not be loaded). Cyclone still patches as the installer. Do not turn account auto-patch off, and do not set `auto_patch: false` to paper over this.
@@ -53,12 +56,13 @@ mg skill install --claude --cursor
53
56
 
54
57
  Map these to `mergestorm.pr_review/v1` envelope fields; do not invent statuses.
55
58
 
56
- - `finding_count` is 0 (empty inline and offDiff): stop. Tell the human the PR is clear and that Auto land owns landing. Never merge it yourself.
59
+ - `finding_count` is 0 (empty inline and offDiff): stop. A skipped GitHub review body (account Skip All-clear) is still a completed pass — do not wait for an Approve / All-clear comment. Tell the human the PR is clear and that Auto land owns landing. Never merge it yourself.
57
60
  - status is `rate_limited`, or `patch_policy.mode` is `"hold"`: surface the findings to the human and stop. Do not patch.
58
61
  - status is `failed`: report to the human. Do not keep pushing to retrigger.
59
62
  - 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`.
60
63
  - status is `in_progress` and the envelope has no `head_sha`: the wait timed out before Vortex wrote a pass for your SHA. 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. Do not push again to retrigger.
61
- - status is `skipped`, `stopped`, `trial_expired`, or `synced`: surface the status and reason to the human and stop. Do not patch or push.
64
+ - 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.
65
+ - status is `skipped`, `stopped`, or `synced`: surface the status and reason to the human and stop. Do not patch or push.
62
66
 
63
67
  ## Never
64
68