@muggleai/works 5.24.0-staging.164 → 5.24.0-staging.166
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/.claude-plugin/marketplace.json +1 -1
- package/dist/{chunk-YVR2MCR2.js → chunk-CUL7GQDB.js} +47 -10
- package/dist/{chunk-6AAGQQDL.js → chunk-OPJUT6PX.js} +34 -45
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/scripts/guardrails.mjs +132 -6
- package/dist/plugin/scripts/pr-watch-arm.sh +3 -3
- package/dist/plugin/scripts/pr-watch-fetch.sh +2 -2
- package/dist/plugin/scripts/pr-watch-loop.sh +2 -2
- package/dist/plugin/scripts/pr-watch-state.jq +8 -2
- package/dist/plugin/skills/_shared/pr-followup-helpers/classify.md +2 -0
- package/dist/plugin/skills/do/address-reviews.md +12 -8
- package/dist/plugin/skills/do/cycle-size.md +33 -0
- package/dist/plugin/skills/do/e2e-acceptance.md +7 -1
- package/dist/plugin/skills/do/e2e-repair.md +4 -0
- package/dist/plugin/skills/do/fix-ci.md +3 -3
- package/dist/plugin/skills/do/impact-analysis.md +11 -0
- package/dist/plugin/skills/do/open-prs/forward.md +4 -0
- package/dist/plugin/skills/do/open-prs/update.md +7 -4
- package/dist/plugin/skills/do/pre-flight.md +6 -3
- package/dist/plugin/skills/do/resolve-conflicts.md +2 -2
- package/dist/plugin/skills/do/wave-e2e.md +85 -0
- package/dist/plugin/skills/muggle-do/SKILL.md +4 -2
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +7 -0
- package/dist/release-manifest.json +3 -3
- package/dist/{src-OHWBRW4X.js → src-3I5BNAZ7.js} +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/scripts/guardrails.mjs +132 -6
- package/plugin/scripts/pr-watch-arm.sh +3 -3
- package/plugin/scripts/pr-watch-fetch.sh +2 -2
- package/plugin/scripts/pr-watch-loop.sh +2 -2
- package/plugin/scripts/pr-watch-state.jq +8 -2
- package/plugin/skills/_shared/pr-followup-helpers/classify.md +2 -0
- package/plugin/skills/do/address-reviews.md +12 -8
- package/plugin/skills/do/cycle-size.md +33 -0
- package/plugin/skills/do/e2e-acceptance.md +7 -1
- package/plugin/skills/do/e2e-repair.md +4 -0
- package/plugin/skills/do/fix-ci.md +3 -3
- package/plugin/skills/do/impact-analysis.md +11 -0
- package/plugin/skills/do/open-prs/forward.md +4 -0
- package/plugin/skills/do/open-prs/update.md +7 -4
- package/plugin/skills/do/pre-flight.md +6 -3
- package/plugin/skills/do/resolve-conflicts.md +2 -2
- package/plugin/skills/do/wave-e2e.md +85 -0
- package/plugin/skills/muggle-do/SKILL.md +4 -2
- package/plugin/skills/muggle-test-prepare/SKILL.md +7 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Cycle size (watcher-dispatched cycles)
|
|
2
|
+
|
|
3
|
+
Address-reviews, fix-ci, and rebase cycles each run a **minor** or a **full** tail. The diff the cycle produced picks it — never how a review was worded, how many comments asked, or which check was red.
|
|
4
|
+
|
|
5
|
+
## Starting commit
|
|
6
|
+
|
|
7
|
+
`pre_cycle_sha` is the PR head the cycle started from, read with `git rev-parse HEAD` in the PR's working tree before the cycle's first change: address-reviews right after its Step 0 sync, fix-ci's `red_sha`, rebase's `rebase_sha`.
|
|
8
|
+
|
|
9
|
+
## Size
|
|
10
|
+
|
|
11
|
+
Once the cycle's edits are in the working tree — or the rebase has replayed — run [`impact-analysis.md`](impact-analysis.md) with `pre_cycle_sha`. Its `cycleSize` is:
|
|
12
|
+
|
|
13
|
+
- **minor** — every path the cycle changed is docs, tests, lint/format config, or CI config, exactly as the `NO_APP_LOGIC_CHANGE` rule in [`e2e-acceptance.md`](e2e-acceptance.md) defines them.
|
|
14
|
+
- **full** — anything else, a comment-only or formatting-only edit in a source file included. The rule reads paths, not content, because a path rule is what the guardrail can verify.
|
|
15
|
+
|
|
16
|
+
A rebase compares trees, so app logic the base brought in makes the rebase full. An empty `cycleFiles` is neither size: the cycle changed nothing (every review was an answerable question), so it runs no tail — no unit run, no push, no declaration — and goes straight to the mode's replies.
|
|
17
|
+
|
|
18
|
+
## Full tail
|
|
19
|
+
|
|
20
|
+
Unit tests → E2E per [`e2e-acceptance.md`](e2e-acceptance.md) → push → walkthrough repost: fire [`postPRVisualWalkthrough`](../muggle-preferences/preference-gates/postPRVisualWalkthrough.md), then [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A → the mode's remaining steps.
|
|
21
|
+
|
|
22
|
+
## Minor tail
|
|
23
|
+
|
|
24
|
+
Unit tests → push → declare the skip → the mode's remaining steps. No E2E run, no walkthrough render.
|
|
25
|
+
|
|
26
|
+
Declare after the push, as one Bash call from the PR's working tree. Only then is local HEAD the head the PR carries: server-signed commits reach the local branch when the push syncs it, and a base sync during the push can rewrite the head.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
echo "MUGGLE_E2E_SKIP: NO_APP_LOGIC_CHANGE: <pre_cycle_sha> <what changed, e.g. README typo, test rename>"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- **Accepted** — Muggle rewrites the PR's designated walkthrough comment to "E2E skipped — no app-logic change in `<short-sha>`" with the stated reason, and keeps the last full run's walkthrough collapsed beneath it. The walkthrough check passes on the new head when that run passed. When it failed, the check stays red: commits that changed no app logic cannot have repaired a failing case, so that red is fix-ci's walkthrough repair, never a minor cycle's.
|
|
33
|
+
- **Rejected** — the reply names the paths that refuted it. The cycle is full after all: run E2E on the pushed head, repost the walkthrough, then continue.
|
|
@@ -23,7 +23,9 @@ This stage is **mode-driven by pre-flight**:
|
|
|
23
23
|
|
|
24
24
|
**Every SKIPPED exit from this stage** (Step 0 poll-only, Step 1 `unit-only`/`skip`, Step 1.5 placeholder branch) also runs `echo "MUGGLE_E2E_SKIP: <CODE>: <detail>"` as a single Bash call before exiting — it records the skip in guardrail session state so the Stop-hook E2E gate releases instead of blocking the turn.
|
|
25
25
|
|
|
26
|
-
`<CODE>` is one of `NO_WEB_SURFACE`, `DEV_SERVER_UNREACHABLE`, `EMPTY_DIFF`, `MUGGLE_AUTH_DOWN`, `NO_PR`, `USER_WAIVED`, and the guardrail verifies it
|
|
26
|
+
`<CODE>` is one of `NO_WEB_SURFACE`, `DEV_SERVER_UNREACHABLE`, `EMPTY_DIFF`, `MUGGLE_AUTH_DOWN`, `NO_PR`, `USER_WAIVED`, `NO_APP_LOGIC_CHANGE` — the one list of verified skip codes, which other files reference rather than restate — and the guardrail verifies it before the gate releases. Every code names a fact the guardrail checks for itself, about the environment or about which paths a commit range touched; none names a judgment about the change, so "static page", "layout only", "unit tests cover it" and "verified with another tool" have no way through — cite a code that holds, or run the tests. `USER_WAIVED` needs the user's own literal `SKIP E2E` in the transcript, never an inferred go-ahead. A rejected declaration is answered with the check that failed, and the turn stays blocked.
|
|
27
|
+
|
|
28
|
+
`NO_APP_LOGIC_CHANGE` belongs to a watcher cycle's minor tail ([`cycle-size.md`](cycle-size.md)), never to a Stage 6 exit. Its detail opens with the cycle's starting commit. Muggle diffs that commit against HEAD and accepts only when every changed path is docs (`*.md`, `*.markdown`, `*.rst`), tests (`*.test.*`, `*.spec.*`, `__tests__/`, `__snapshots__/`, `__mocks__/`, `test_*.py`, `*_test.py`, `*_test.go`, a root-level `test/` or `tests/`), lint/format config (ESLint, Prettier, Stylelint and markdownlint config or ignore files, `biome.json`, `.editorconfig`), or CI config (`.github/workflows/`, `.gitlab-ci.yml`). A commit it cannot resolve, an empty diff, or any other path — a comment-only edit in a source file included — fails.
|
|
27
29
|
- `staging-replay` is not executed in this stage path and should be surfaced as `INCONCLUSIVE` unless the caller has already routed to a dedicated staging runner.
|
|
28
30
|
|
|
29
31
|
For local runs, the tool boundaries are:
|
|
@@ -58,6 +60,10 @@ Otherwise the block was seeded by pre-flight or bootstrap per [`../_shared/resol
|
|
|
58
60
|
|
|
59
61
|
For a `local-e2e` block, use `localUrl`, `projectId`, and the working-tree path from `state.md`. Missing any → seeding bug; escalate with the session path and halt; do not ask the user.
|
|
60
62
|
|
|
63
|
+
### Step 0.4: Wave cycles
|
|
64
|
+
|
|
65
|
+
`state.md` records `Wave: on` → this stage runs **once for the whole wave**, not per repo, per [`wave-e2e.md`](wave-e2e.md): the wave stack starts from every member's worktree, test cases are selected against the union of diffs, each case runs once, and each failure names its `implicatedRepo`. The steps below apply with those changes.
|
|
66
|
+
|
|
61
67
|
### Step 0.5: Pre-flight verification probes
|
|
62
68
|
|
|
63
69
|
Before launching the local runner:
|
|
@@ -15,6 +15,10 @@ Runs between Stage 7's posted walkthrough and Stage 8's watcher dispatch. A fail
|
|
|
15
15
|
- The PR opened by [`open-prs/forward.md`](open-prs/forward.md) — repo and number, for the escalation event and the refresh path.
|
|
16
16
|
- `repairIteration` — how many times this stage has already run in this session, read from `iterations/<NNN>.md`.
|
|
17
17
|
|
|
18
|
+
## Wave cycles
|
|
19
|
+
|
|
20
|
+
`state.md` records `Wave: on` → the loop runs once for the wave per [`wave-e2e.md`](wave-e2e.md): repairs land in each failure's `implicatedRepo` (`unknown` is `ask`), re-runs use the wave stack, and every wave PR's walkthrough and title are refreshed after each pass.
|
|
21
|
+
|
|
18
22
|
## Step 0: Clearance check
|
|
19
23
|
|
|
20
24
|
Read the Stage 6 run-level verdict, defined in [`../_shared/failure-mode-handling.md`](../_shared/failure-mode-handling.md) section F.
|
|
@@ -20,7 +20,7 @@ From `~/.muggle-ai/muggle-do/sessions/<slug>/`: `prs.json` (PR + local checkout
|
|
|
20
20
|
|
|
21
21
|
### Step 1 — Re-attach
|
|
22
22
|
|
|
23
|
-
Check out the PR branch in the session's working tree (per `state.md`). Capture `red_sha = prs.json[0].head_sha
|
|
23
|
+
Check out the PR branch in the session's working tree (per `state.md`). Capture `red_sha = prs.json[0].head_sha` — this cycle's `pre_cycle_sha` ([`cycle-size.md`](cycle-size.md)).
|
|
24
24
|
|
|
25
25
|
### Step 2 — Map each failing check to a local command
|
|
26
26
|
|
|
@@ -39,13 +39,13 @@ An empty-comment failure (no run ever posted) skips items 1–2: run the suite a
|
|
|
39
39
|
### Step 3 — Verify before push
|
|
40
40
|
|
|
41
41
|
- Build (typecheck + lint on the changed surface) + unit suite must pass.
|
|
42
|
-
-
|
|
42
|
+
- Size the fix per [`cycle-size.md`](cycle-size.md) with `pre_cycle_sha = red_sha`. A full fix runs E2E before the push; a minor one skips it and declares `NO_APP_LOGIC_CHANGE` after Step 4's push. A lint or format fix that edits a source file is full. A Step 2.5 repair always runs the full suite.
|
|
43
43
|
|
|
44
44
|
A fix that can't be made green locally is not pushed → Step 6.
|
|
45
45
|
|
|
46
46
|
### Step 4 — Commit + push
|
|
47
47
|
|
|
48
|
-
Commit per the `fix(ci): <check> — <what>` convention ([`../_shared/pr-followup-helpers/reply-routing.md`](../_shared/pr-followup-helpers/reply-routing.md)). Push. Append the new SHA to `last_seen.pushed_shas`. **No PR replies** — the fix commit is the response.
|
|
48
|
+
Commit per the `fix(ci): <check> — <what>` convention ([`../_shared/pr-followup-helpers/reply-routing.md`](../_shared/pr-followup-helpers/reply-routing.md)). Push. Append the new SHA to `last_seen.pushed_shas`. Then finish the tail [`cycle-size.md`](cycle-size.md) picked: a full fix reposts the walkthrough (a Step 2.5 repair settles it there instead), a minor one declares the skip. **No PR replies** — the fix commit is the response.
|
|
49
49
|
|
|
50
50
|
### Step 5 — Update state + respawn
|
|
51
51
|
|
|
@@ -80,3 +80,14 @@ recommendation: SKIPPED — placeholder branch, no code under test
|
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
`do/e2e-acceptance.md` Step 1.5 reads this and exits the stage cleanly with a SKIPPED verdict — do not silently run tests against master.
|
|
83
|
+
|
|
84
|
+
## Output state — cycleSize (watcher-dispatched cycles)
|
|
85
|
+
|
|
86
|
+
When the caller passes `pre_cycle_sha` ([`cycle-size.md`](cycle-size.md)), also list the paths this cycle changed, committed or not: `git diff --name-only --no-renames <pre_cycle_sha>` for tracked files, plus `git ls-files --others --exclude-standard` for new ones. Emit:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
cycleFiles: [<path>, ...]
|
|
90
|
+
cycleSize: <minor | full>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`minor` only when every path in `cycleFiles` is in the `NO_APP_LOGIC_CHANGE` path set defined in [`e2e-acceptance.md`](e2e-acceptance.md); otherwise `full`. The rest of this stage still runs against the default branch, so a full cycle's E2E routes from `pathClassification` as in a forward run.
|
|
@@ -14,6 +14,10 @@ Forward pipeline's Stage 7. Invoked by `/muggle-do` after stages 1–6 of a fres
|
|
|
14
14
|
- Requirements: goal, acceptance criteria.
|
|
15
15
|
- **Optional** E2E acceptance report from stage 6. Produced by [`../e2e-acceptance.md`](../e2e-acceptance.md); schema in [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md).
|
|
16
16
|
|
|
17
|
+
## Wave cycles
|
|
18
|
+
|
|
19
|
+
`state.md` records `Wave: on` → follow the Stage 7 ordering in [`../wave-e2e.md`](../wave-e2e.md): open every wave PR before settling any walkthrough, add the `## Wave` section to each body, give every member the same title prefix, and settle each PR's walkthrough with the same report (Mode A, PR number + repo passed explicitly). The per-repo steps below run with those changes.
|
|
20
|
+
|
|
17
21
|
## Per repo
|
|
18
22
|
|
|
19
23
|
0. **`autoCreatePR` gate** — apply per [`../../muggle-preferences/preference-gates/autoCreatePR.md`](../../muggle-preferences/preference-gates/autoCreatePR.md). On skip, record the reason in `result.md` and move on.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Update PR — address-reviews mode
|
|
2
2
|
|
|
3
|
-
Invoked by `/muggle-do`'s address-reviews orchestrator after
|
|
3
|
+
Invoked by `/muggle-do`'s address-reviews orchestrator after build, impact analysis, unit tests, and — for a full cycle — E2E ran on the existing PR. The PR already exists; this stage pushes the branch, refreshes title/description if state changed, and settles the walkthrough comment.
|
|
4
4
|
|
|
5
5
|
Does **not** create a PR, seed session state, or dispatch a watcher (`/muggle-do` respawns the watcher at the end of its address-reviews cycle).
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ Does **not** create a PR, seed session state, or dispatch a watcher (`/muggle-do
|
|
|
15
15
|
- Per-repo: path, branch (head ref name).
|
|
16
16
|
- The existing PR URL + number from `~/.muggle-ai/muggle-do/sessions/<slug>/prs.json`.
|
|
17
17
|
- **Optional** E2E acceptance report from stage 6. Produced by [`../e2e-acceptance.md`](../e2e-acceptance.md); schema in [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md).
|
|
18
|
+
- The cycle size and `pre_cycle_sha` per [`../cycle-size.md`](../cycle-size.md).
|
|
18
19
|
|
|
19
20
|
## Procedure
|
|
20
21
|
|
|
@@ -40,7 +41,9 @@ Resolve the provider once per [`../../_shared/vcs/detect-vcs.md`](../../_shared/
|
|
|
40
41
|
|
|
41
42
|
4. **Refresh body when validation outcome changed** — only when the `## Validation` section's content differs from what's in the body. Use the `--body-file` form in [`../../_shared/vcs/github/pr-edit.md`](../../_shared/vcs/github/pr-edit.md). Preserve `## Goal` and `## Acceptance Criteria` verbatim. Re-stamp the signature: delete the existing block from the `<!-- muggle-works:signature -->` marker to the end, then append the editable-body signature (command `/muggle-do`) as the last thing in the body per [`../../_shared/vcs/post-signature.md`](../../_shared/vcs/post-signature.md) — this keeps exactly one signature across refreshes.
|
|
42
43
|
|
|
43
|
-
5. **Visual walkthrough comment
|
|
44
|
+
5. **Visual walkthrough comment.**
|
|
45
|
+
- **An E2E report exists** (a full cycle, or Step 0's verify gate ran E2E) — fire [`postPRVisualWalkthrough`](../../muggle-preferences/preference-gates/postPRVisualWalkthrough.md) (PR number from `prs.json`); on skip, record `skipped (gate)` and continue. Otherwise invoke [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) Mode A, which settles the PR's designated walkthrough comment in place — one walkthrough per PR, always reflecting the latest run.
|
|
46
|
+
- **No report, minor cycle** — declare the `NO_APP_LOGIC_CHANGE` skip per [`../cycle-size.md`](../cycle-size.md) Minor tail. Step 1's push has landed, so HEAD is what the PR carries; the accepted declaration settles the designated comment. A rejected one makes the cycle full: run [`../e2e-acceptance.md`](../e2e-acceptance.md) on the pushed head, then take the branch above.
|
|
44
47
|
|
|
45
48
|
6. **Overflow comment** — same rule as forward mode: post when the walkthrough skill returns non-null `comment`, via [`../../_shared/vcs/github/top-level-comment.md`](../../_shared/vcs/github/top-level-comment.md). End the posted body with the signature line (command `/muggle-do`) per [`../../_shared/vcs/post-signature.md`](../../_shared/vcs/post-signature.md).
|
|
46
49
|
|
|
@@ -50,7 +53,7 @@ Return control to `/muggle-do`'s address-reviews orchestrator. The orchestrator
|
|
|
50
53
|
|
|
51
54
|
## Invariants
|
|
52
55
|
|
|
53
|
-
- Branch synced with its base before the push, never after; push; new SHA appended to `pushed_shas`; title/body refreshed only on state change; walkthrough comment via Mode A.
|
|
56
|
+
- Branch synced with its base before the push, never after; push; new SHA appended to `pushed_shas`; title/body refreshed only on state change; walkthrough comment via Mode A, or via the `NO_APP_LOGIC_CHANGE` skip after the push for a minor cycle.
|
|
54
57
|
- No `gh pr create`, no `/loop` dispatch.
|
|
55
58
|
|
|
56
59
|
## Output
|
|
@@ -59,5 +62,5 @@ Return control to `/muggle-do`'s address-reviews orchestrator. The orchestrator
|
|
|
59
62
|
**PR updated:** URL (new SHA: `<short-sha>`)
|
|
60
63
|
**Title refreshed:** yes | no
|
|
61
64
|
**Body refreshed:** yes | no
|
|
62
|
-
**Walkthrough comment:** posted | skipped (no report) | skipped (gate)
|
|
65
|
+
**Walkthrough comment:** posted | settled as skipped (`NO_APP_LOGIC_CHANGE`) | skipped (no report) | skipped (gate)
|
|
63
66
|
**Overflow comment:** posted | skipped
|
|
@@ -36,14 +36,15 @@ Before asking anything, gather every fact you can resolve without the user:
|
|
|
36
36
|
- Is the current checkout already a worktree? `git -C <repo> rev-parse --is-inside-work-tree` plus `git -C <repo> worktree list`.
|
|
37
37
|
- How many commits behind `origin/<default>`? `git -C <repo> fetch origin && git -C <repo> rev-list --count "HEAD..origin/$(git -C <repo> symbolic-ref refs/remotes/origin/HEAD --short | sed 's|origin/||')"`.
|
|
38
38
|
10. **`autoE2ETest` preference.** Read the session-context preferences line. Unset → treat as `always` (this gate's default — opposite of the system-wide `ask` default). `ask` → surface in Q13. `always` → no question; stage 6 runs.
|
|
39
|
-
11. **
|
|
39
|
+
11. **Wave candidate?** Two or more candidate repos, one PR each, and validation leaning `local-e2e` → the cycle is a wave per [`wave-e2e.md`](wave-e2e.md): the repos' services start together from their branches and one E2E run covers every PR. Record each repo's worktree path for the `Wave members` block. Not a wave → note why.
|
|
40
|
+
12. **CI check present?** For each GitHub repo, whether `.github/workflows/muggle-walkthrough.yml` exists on its default branch. Missing and [`autoInstallCiWorkflow`](../muggle-preferences/preference-gates/autoInstallCiWorkflow.md) resolves to `ask` → surface in Q14.
|
|
40
41
|
|
|
41
42
|
## The consolidated questionnaire
|
|
42
43
|
|
|
43
44
|
Present **one `AskUserQuestion`** (or the platform's structured-selection equivalent) that collects every remaining decision. Use detected values as defaults whenever possible. Questions to include, in this order:
|
|
44
45
|
|
|
45
46
|
1. **Task scope clarification** — only if the task description is genuinely ambiguous. Offer 2–3 interpretations as options plus "Other — type a clarification." If the task is unambiguous, omit.
|
|
46
|
-
2. **Repo(s) to modify** — pre-selected with the best silent match. "Confirm <repo>" / "Change repo" / "Multi-repo (list them)".
|
|
47
|
+
2. **Repo(s) to modify** — pre-selected with the best silent match. "Confirm <repo>" / "Change repo" / "Multi-repo (list them)". When multi-repo with one PR per repo, state in the option that the PRs ship as a wave tested together in one E2E run ([`wave-e2e.md`](wave-e2e.md)) — no separate question.
|
|
47
48
|
3. **Branch name** — default: `users/<user>/<slug>` derived from the task. "Use default" / "Use different name (type)".
|
|
48
49
|
4. **Validation strategy** — the single most important question. Options:
|
|
49
50
|
- **Local E2E** (Muggle Test Electron against a running localhost) — default if a dev server was detected.
|
|
@@ -59,7 +60,7 @@ Present **one `AskUserQuestion`** (or the platform's structured-selection equiva
|
|
|
59
60
|
11. **Worktree for this change?** — gate: [`autoUseWorktree`](../muggle-preferences/preference-gates/autoUseWorktree.md). Options: create a dedicated worktree (per [`../_shared/use-worktrees.md`](../_shared/use-worktrees.md)), or work in the current checkout.
|
|
60
61
|
12. **Sync onto the base branch first?** — gate: [`autoRebase`](../muggle-preferences/preference-gates/autoRebase.md), only if `behind > 0`. The answer governs every sync this cycle, not just one: before the dev server / E2E, and again immediately before stage 7 pushes. Options: sync with the base, or run as-is.
|
|
61
62
|
13. **Run E2E at the end of every cycle?** — gate: [`autoE2ETest`](../muggle-preferences/preference-gates/autoE2ETest.md), only if step 10's silent detection resolved to `ask`. Options: always run stage 6, or ask each cycle.
|
|
62
|
-
14. **Add the Muggle E2E check to this repo's CI?** — gate: [`autoInstallCiWorkflow`](../muggle-preferences/preference-gates/autoInstallCiWorkflow.md), only if step
|
|
63
|
+
14. **Add the Muggle E2E check to this repo's CI?** — gate: [`autoInstallCiWorkflow`](../muggle-preferences/preference-gates/autoInstallCiWorkflow.md), only if step 12 found the workflow missing and the gate resolved to `ask`. Record the answer in `state.md` as `CI check: add | skip`; stage 7 acts on it.
|
|
63
64
|
|
|
64
65
|
If fewer than two of the above need the user, still gather them in a single turn — never open a second round.
|
|
65
66
|
|
|
@@ -78,6 +79,8 @@ After the user answers, write **`state.md`** with every resolved value, verbatim
|
|
|
78
79
|
|
|
79
80
|
- Task: <one-line goal>
|
|
80
81
|
- Repos: <repo1>, <repo2>
|
|
82
|
+
- Wave: <on | off — reason | N/A (single repo)>
|
|
83
|
+
- Wave members: <one line per repo when on — `<owner/repo> → <worktree path> (branch <branch>)`; see wave-e2e.md>
|
|
81
84
|
- Branch: <branch-name>
|
|
82
85
|
- Validation: <strategy>
|
|
83
86
|
- Local URL: <url or N/A>
|
|
@@ -33,11 +33,11 @@ Run the rebase from [`../_shared/sync-branch-with-base.md`](../_shared/sync-bran
|
|
|
33
33
|
|
|
34
34
|
### Step 3 — Verify the resolution
|
|
35
35
|
|
|
36
|
-
Build (typecheck + lint on the changed surface) + unit suite must pass.
|
|
36
|
+
Build (typecheck + lint on the changed surface) + unit suite must pass. Size the rebase per [`cycle-size.md`](cycle-size.md) with `pre_cycle_sha = rebase_sha` — the comparison spans everything the base brought in. A full rebase runs E2E per [`e2e-acceptance.md`](e2e-acceptance.md) before the push; a minor one skips it and declares `NO_APP_LOGIC_CHANGE` after Step 4's force-push. A rebase that does not verify is rolled back → escalate per Step 5. **Never push an unverified rebase.**
|
|
37
37
|
|
|
38
38
|
### Step 4 — Force-push + respawn
|
|
39
39
|
|
|
40
|
-
Force-push per [`../_shared/vcs/common/push-to-branch.md`](../_shared/vcs/common/push-to-branch.md) (tool-agnostic instruction; handles the signing gate for rebased commits and directs to provider-specific force-push paths). Use `git push --force-with-lease` for the force operation. Append the new SHA to `last_seen.pushed_shas`; increment `last_seen.conflict_resolve_attempts[rebase_key]` **and** `last_seen.catch_up_rebases` — all whole-file rewrites (Read → change field → Write) per [`../_shared/session-state-writes.md`](../_shared/session-state-writes.md), never the Edit tool. The second counter is unkeyed on purpose: `rebase_key` carries the base tip, so it mints a fresh budget every time the base moves and cannot bound a PR on an active base. Increment it on every push here, including one that later escalates, or a branch that fails the same way twenty times reads as having spent nothing.
|
|
40
|
+
Force-push per [`../_shared/vcs/common/push-to-branch.md`](../_shared/vcs/common/push-to-branch.md) (tool-agnostic instruction; handles the signing gate for rebased commits and directs to provider-specific force-push paths). Use `git push --force-with-lease` for the force operation. Append the new SHA to `last_seen.pushed_shas`; increment `last_seen.conflict_resolve_attempts[rebase_key]` **and** `last_seen.catch_up_rebases` — all whole-file rewrites (Read → change field → Write) per [`../_shared/session-state-writes.md`](../_shared/session-state-writes.md), never the Edit tool. The second counter is unkeyed on purpose: `rebase_key` carries the base tip, so it mints a fresh budget every time the base moves and cannot bound a PR on an active base. Increment it on every push here, including one that later escalates, or a branch that fails the same way twenty times reads as having spent nothing. Finish the tail [`cycle-size.md`](cycle-size.md) picked — a full rebase reposts the walkthrough, a minor one declares the skip — then respawn the watcher per [`respawn-watcher.md`](respawn-watcher.md). Its next tick re-checks the branch against its base on the new head — the rebase is its own verify loop, bounded by the per-SHA attempt budget.
|
|
41
41
|
|
|
42
42
|
### Step 5 — Escalate (can't resolve / budget spent)
|
|
43
43
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Wave E2E — one run across a multi-repo wave
|
|
2
|
+
|
|
3
|
+
A multi-repo task ships as a **wave**: one PR per repo, all carrying parts of the same change. Testing each PR alone against the other repos' default branches tests a stack that will never exist — the frontend PR runs against a backend that lacks its new endpoint, and both walkthroughs report failures neither PR will have once the wave lands.
|
|
4
|
+
|
|
5
|
+
So a wave is tested as one: start every repo's service from its wave branch, run **one** E2E pass against the combined stack, and post that single result to every PR in the wave.
|
|
6
|
+
|
|
7
|
+
## When a cycle is a wave
|
|
8
|
+
|
|
9
|
+
All of these hold, decided at pre-flight and recorded in `state.md`:
|
|
10
|
+
|
|
11
|
+
- Two or more repos carry changes this cycle.
|
|
12
|
+
- Each changed repo gets exactly **one** PR — no stacked PRs, no second PR in the same repo.
|
|
13
|
+
- Validation is `local-e2e`.
|
|
14
|
+
- Every wave repo that serves part of the stack can run locally. A repo that only ships a library or config consumed by another wave repo is still a wave member; it just contributes no service of its own.
|
|
15
|
+
|
|
16
|
+
Anything else is not a wave: each PR runs Stage 6 on its own, as before. Two PRs in one repo, or one repo whose service cannot start locally, fall back to per-PR runs — record the reason in `state.md` as `Wave: off — <reason>`.
|
|
17
|
+
|
|
18
|
+
## What pre-flight records
|
|
19
|
+
|
|
20
|
+
Under `## Pre-flight answers`, alongside `Repos:`:
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
- Wave: on
|
|
24
|
+
- Wave members:
|
|
25
|
+
- <owner/repo-a> → <worktree path a> (branch <branch>)
|
|
26
|
+
- <owner/repo-b> → <worktree path b> (branch <branch>)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Stage 7 appends each member's PR number to its line once the PRs exist.
|
|
30
|
+
|
|
31
|
+
The worktree path is where that repo's wave branch is checked out — the path its service must start from. Record it per repo; never derive it later from the branch name.
|
|
32
|
+
|
|
33
|
+
## Stage 6 — run once for the whole wave
|
|
34
|
+
|
|
35
|
+
Run [`e2e-acceptance.md`](e2e-acceptance.md) **once**, not once per repo, with these changes:
|
|
36
|
+
|
|
37
|
+
1. **Start the wave stack.** Invoke [`muggle-test-prepare`](../muggle-test-prepare/SKILL.md) with the wave members as `directoryOverrides` (repo → worktree path): every service whose repo is a wave member starts from that member's worktree path, not from the repo's usual checkout. Services from repos outside the wave start as the saved recipe says.
|
|
38
|
+
2. **Confirm each wave service runs the wave branch.** A port that answers is not enough — the process on it may be a dev server the user left running from the default checkout. Check the readiness table: every wave service must report its member's worktree as its directory. A service that doesn't → halt and escalate with the table; never test a wave against a service running another branch.
|
|
39
|
+
3. **Select test cases against the union of diffs.** Steps 1.5–3 read impact analysis for every wave repo. A test case is relevant when any member's change touches its flow. `EMPTY_DIFF` applies only when every member's diff is empty.
|
|
40
|
+
4. **Run each selected test case once** against the combined stack. Do not repeat a case per repo.
|
|
41
|
+
5. **Attribute failures.** For each Failed entry, name the member whose change the failing step implicates (`implicatedRepo: <owner/repo>`), or `unknown` when the evidence does not point at one. Stage 7.5 repairs in that repo.
|
|
42
|
+
|
|
43
|
+
The report carries one extra metadata block:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
**Wave:**
|
|
47
|
+
- <owner/repo-a> @ <head sha> → PR #<n> (filled in at Stage 7)
|
|
48
|
+
- <owner/repo-b> @ <head sha> → PR #<n>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The SHAs are what the run tested. A result is only valid for the PRs at those SHAs.
|
|
52
|
+
|
|
53
|
+
## Stage 7 — post the same result to every PR
|
|
54
|
+
|
|
55
|
+
[`open-prs/forward.md`](open-prs/forward.md) runs per repo as usual, with the wave ordering:
|
|
56
|
+
|
|
57
|
+
1. **Open every PR first**, before settling any walkthrough. Each PR's walkthrough names its siblings, so all PR numbers must exist before the first one is written.
|
|
58
|
+
2. **Body.** Add a `## Wave` section to each PR's body, after `## Validation`: one line per sibling PR (`owner/repo#n`), and the line `Tested together — merge all PRs in this wave together.`
|
|
59
|
+
3. **Title.** Every PR in the wave takes the same E2E prefix. A wave run with failures retitles every member `[E2E FAILING]`, not only the implicated one — the run tested them as one change.
|
|
60
|
+
4. **Walkthrough.** Settle each PR's designated walkthrough comment with the **same** E2E report through [`muggle-pr-visual-walkthrough`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A, passing that PR's number and repo explicitly — Mode A otherwise looks up the PR from the current branch, which in a multi-repo cycle is the wrong repo. The runs, screenshots, and dashboard links are identical on every PR; only the PR it is posted to differs.
|
|
61
|
+
5. **Record the PR numbers** on the `Wave members` lines in `state.md` (`… (branch <branch>) → PR #<n>`), so a later cycle on any one PR can find its siblings. Every slot a wave PR's watcher runs from gets the same `Wave` block.
|
|
62
|
+
|
|
63
|
+
## Stage 7.5 — repair across the wave
|
|
64
|
+
|
|
65
|
+
[`e2e-repair.md`](e2e-repair.md) runs once for the wave, not per PR:
|
|
66
|
+
|
|
67
|
+
- A `repair` disposition fixes the code in the failure's `implicatedRepo`. An `unknown` attribution is `ask`, never a guess at a repo.
|
|
68
|
+
- After any pass, re-run the wave E2E above (same stack, the touched member's service restarted on its new commit) over the affected test cases, then refresh **every** wave PR's walkthrough and title through [`open-prs/update.md`](open-prs/update.md) — the evidence changed for all of them, even the PRs whose code did not.
|
|
69
|
+
- Clearance holds for the wave as a whole. Stage 8 dispatches one watcher per wave PR only once the wave clears.
|
|
70
|
+
|
|
71
|
+
## Later cycles on one wave PR
|
|
72
|
+
|
|
73
|
+
When the watcher dispatches an address-reviews or fix-ci cycle on one PR whose `state.md` records `Wave: on`:
|
|
74
|
+
|
|
75
|
+
- A full cycle ([`cycle-size.md`](cycle-size.md)) re-runs the wave E2E in Stage 6, with every sibling's service started from its PR's current head — not from the default branch. Fetch each sibling's head into its recorded worktree first.
|
|
76
|
+
- Post the new result to the PR under review and refresh each sibling's walkthrough too, since the run tested them together and the earlier result on the siblings is now stale.
|
|
77
|
+
- A minor cycle runs no E2E. Its `NO_APP_LOGIC_CHANGE` skip settles only the PR under review, with the wave's last run kept beneath it, and the siblings' walkthroughs stay as they are: no app logic changed, so that run still describes the whole wave.
|
|
78
|
+
- A sibling already merged or closed leaves the wave: test against the base branch for that repo, and drop it from the `## Wave` section on the next refresh.
|
|
79
|
+
|
|
80
|
+
## Invariants
|
|
81
|
+
|
|
82
|
+
- One E2E run per full wave cycle, none for a minor one; never one per repo.
|
|
83
|
+
- Every wave service starts from its member's worktree, verified by process cwd — a listening port proves nothing about the branch.
|
|
84
|
+
- Every wave PR carries the same walkthrough, the same E2E title prefix, and a `## Wave` section naming its siblings.
|
|
85
|
+
- Not a wave → each PR runs Stage 6 alone, with the reason recorded.
|
|
@@ -25,6 +25,8 @@ Runs an autonomous dev cycle from requirements to PR. **Fire and review:** user
|
|
|
25
25
|
| 7.5 | E2E repair loop | [`../do/e2e-repair.md`](../do/e2e-repair.md) |
|
|
26
26
|
| 8 | Hand off to watcher | [`../muggle-pr-followup/SKILL.md`](../muggle-pr-followup/SKILL.md) |
|
|
27
27
|
|
|
28
|
+
**Multi-repo waves.** When a task spans several repos with one PR each, the PRs form a wave: every repo's service starts from its branch, Stage 6 runs **one** E2E pass against the combined stack, and that same result is posted to every PR in the wave. See [`../do/wave-e2e.md`](../do/wave-e2e.md); pre-flight decides whether a cycle is a wave.
|
|
29
|
+
|
|
28
30
|
Stage 7 dispatches one watcher per opened PR as its last action, gated on Stage 7.5's clearance — a cycle with unrepaired E2E failures never reaches a watcher.
|
|
29
31
|
|
|
30
32
|
## Execution protocol (non-negotiable)
|
|
@@ -47,14 +49,14 @@ Do not create or update a PR until each line holds, or is waived by a one-line r
|
|
|
47
49
|
- Build clean — typecheck + lint on changed files
|
|
48
50
|
- New/changed logic carries unit tests (authored in Stage 3; Stage 5 only runs the suite)
|
|
49
51
|
- Unit suite run, PASS recorded
|
|
50
|
-
- E2E verdict recorded with `runId` per `autoE2ETest` — or `[E2E FAILING]`, or `SKIPPED` citing
|
|
52
|
+
- E2E verdict recorded with `runId` per `autoE2ETest` — or `[E2E FAILING]`, or `SKIPPED` citing a verified skip code from [`../do/e2e-acceptance.md`](../do/e2e-acceptance.md), where each code's verification rule lives. Free-text reasons are rejected by the gate
|
|
51
53
|
- UI changes verified in a real browser with evidence (screenshot path or muggle `runId`); `curl` + `grep` is not verification
|
|
52
54
|
|
|
53
55
|
Opening a PR with an unchecked, unwaived line is a cycle failure.
|
|
54
56
|
|
|
55
57
|
## Address-reviews flow
|
|
56
58
|
|
|
57
|
-
When invoked with the directive (PR URL + slug + review ids), routes to [`../do/address-reviews.md`](../do/address-reviews.md). Shares stages 3–
|
|
59
|
+
When invoked with the directive (PR URL + slug + review ids), routes to [`../do/address-reviews.md`](../do/address-reviews.md). Shares stages 3–5 with the forward pipeline, then sizes the cycle from its diff per [`../do/cycle-size.md`](../do/cycle-size.md): a full cycle adds stage 6 and a fresh walkthrough, a minor one skips E2E under a verified `NO_APP_LOGIC_CHANGE`. Skips pre-flight, requirements, and PR creation. See the orchestrator for the cycle's exact step order, classification rules, and respawn logic.
|
|
58
60
|
|
|
59
61
|
## Input routing
|
|
60
62
|
|
|
@@ -126,6 +126,13 @@ Stopped 3 services:
|
|
|
126
126
|
|
|
127
127
|
After a test run, the caller can re-invoke for cleanup or leave services running for the next run.
|
|
128
128
|
|
|
129
|
+
**Directory overrides.** A caller testing changes that span several repos at once may pass `directoryOverrides`: a map from a service's repo (its usual directory, or `owner/repo`) to the checkout that service must start from this run — typically a worktree on a feature branch. Apply them to the resolved plan before execution:
|
|
130
|
+
|
|
131
|
+
- An overridden service starts from the override directory, with its recorded start command. Its install and env-file steps run there too.
|
|
132
|
+
- An overridden service already listening counts as running only when its process's working directory is inside the override directory (`lsof -p <pid> -a -d cwd` on POSIX). Otherwise it is the wrong checkout: stop it and start it from the override, under the same approval rules as any restart.
|
|
133
|
+
- Overrides are per-run. They never enter the saved recipe — a worktree path is not this stack's durable layout.
|
|
134
|
+
- The readiness table names the directory each service runs from, so the caller can confirm every override took.
|
|
135
|
+
|
|
129
136
|
## Guardrails
|
|
130
137
|
|
|
131
138
|
- **Never invent or default a host/port** — the dev-server URL is a recorded value, not a guess. Read it from the last-host cache via `muggle-local-last-host-get` (the [`autoSelectLocalHost`](../muggle-preferences/preference-gates/autoSelectLocalHost.md) cache) before probing ports; a framework default like `:3000` is never a fallback. The cache's own storage location belongs to that tool — don't restate it here. See [check-running](./steps/check-running.md).
|