@muggleai/works 5.32.0-staging.285 → 5.32.0-staging.287
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/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/.mcp.json +1 -1
- package/dist/plugin/skills/_shared/ci-check-to-command.md +2 -2
- package/dist/plugin/skills/_shared/failure-mode-handling.md +12 -6
- package/dist/plugin/skills/_shared/telemetry-events/muggle-do-escalation.md +2 -2
- package/dist/plugin/skills/do/cleanup.md +2 -2
- package/dist/plugin/skills/do/e2e-repair.md +41 -15
- package/dist/plugin/skills/do/fix-ci.md +8 -4
- package/dist/plugin/skills/do/open-prs/forward.md +2 -2
- package/dist/plugin/skills/muggle-do/SKILL.md +2 -2
- package/dist/plugin/skills/muggle-pr-followup/contract.md +2 -1
- package/dist/plugin/skills/muggle-pr-followup/output-templates/blocked-reminder.md +8 -0
- package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +5 -0
- package/dist/release-manifest.json +3 -3
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-mcp.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/skills/_shared/ci-check-to-command.md +2 -2
- package/plugin/skills/_shared/failure-mode-handling.md +12 -6
- package/plugin/skills/_shared/telemetry-events/muggle-do-escalation.md +2 -2
- package/plugin/skills/do/cleanup.md +2 -2
- package/plugin/skills/do/e2e-repair.md +41 -15
- package/plugin/skills/do/fix-ci.md +8 -4
- package/plugin/skills/do/open-prs/forward.md +2 -2
- package/plugin/skills/muggle-do/SKILL.md +2 -2
- package/plugin/skills/muggle-pr-followup/contract.md +2 -1
- package/plugin/skills/muggle-pr-followup/output-templates/blocked-reminder.md +8 -0
- package/plugin/skills/muggle-pr-followup/state-schemas.md +5 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "muggleai",
|
|
10
10
|
"source": "./plugin",
|
|
11
11
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
12
|
-
"version": "5.32.0-staging.
|
|
12
|
+
"version": "5.32.0-staging.287"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
4
|
-
"version": "5.32.0-staging.
|
|
4
|
+
"version": "5.32.0-staging.287",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
|
-
"version": "5.32.0-staging.
|
|
3
|
+
"version": "5.32.0-staging.287",
|
|
4
4
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
5
|
-
"version": "5.32.0-staging.
|
|
5
|
+
"version": "5.32.0-staging.287",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
|
@@ -7,6 +7,6 @@ Map a red CI check to the local command that reproduces and fixes it. Repo-agnos
|
|
|
7
7
|
| lint / format | Run the repo's lint `--fix` / formatter; restage. |
|
|
8
8
|
| typecheck | Run the typecheck script; read the errors; edit the types. |
|
|
9
9
|
| unit / test | Run the suite; read the failures; fix the code or the test. |
|
|
10
|
-
| `muggle-walkthrough` — the Muggle E2E walkthrough check | In scope
|
|
10
|
+
| `muggle-walkthrough` — the Muggle E2E walkthrough check | In scope; its check-run summary picks the action. **"did not pass"** — the summary names each failed or inconclusive case with the failing step and a link to the run, and the walkthrough comment's hidden `muggle-e2e-result` record carries the same cases with their test case ids: run the E2E repair loop over them, re-run the **whole** suite, and settle the walkthrough comment with the new result — editing the comment re-runs the check. A comment settled by `NO_APP_LOGIC_CHANGE` over a failed run reads the same way: the skip carries the last full run beneath it and clears none of its failures. A case the loop cannot repair escalates as a decision for the user, never a silent block or a waiver. **"still empty"** — no walkthrough was ever posted: when this PR's E2E run is queued or running, wait for it; otherwise run the suite and post it, or — when the session holds no E2E plan or a `unit-only`/`skip` one — settle it with the verified skip code that holds. Never a code fix. A run in progress keeps the check pending, not red. Deterministic: it reads the comment, so re-running it unchanged returns the same verdict. |
|
|
11
11
|
| non-deterministic — an LLM-judged eval gate (e.g. `skill-routing-eval`, `skill-gate-eval`, `agent-gate-eval`) or another check whose verdict can flip with nothing changed | Re-run its failed jobs once per head, without a push: `gh run rerun <run-id> --failed` (GitLab: retry the failed job). The re-run counts as a fix attempt. Escalate only if it fails again on the same head. How long the check takes is never a reason to skip the re-run. |
|
|
12
|
-
| out of scope —
|
|
12
|
+
| out of scope — an E2E suite run inside CI other than `muggle-walkthrough`, build/deploy infra, or unknown | Do **not** attempt; record for escalation. |
|
|
@@ -45,6 +45,7 @@ When the subagent aggregates per-script results from sections B and C into one v
|
|
|
45
45
|
| `product-uxux` (regen) | C | **FAIL** |
|
|
46
46
|
| `agent-course` (regen) | C | **INCONCLUSIVE** (agent couldn't complete, not a PR defect) |
|
|
47
47
|
| `transient` (regen) | C | retry once; if still transient → **INCONCLUSIVE** |
|
|
48
|
+
| `test-precondition` (replay or regen) | B / C | **INCONCLUSIVE** (the test's starting state was never met, not a PR defect) |
|
|
48
49
|
|
|
49
50
|
A deliverable check ([`deliverable-categories.md`](deliverable-categories.md)) carries no bucket; its own `FAIL` or `INCONCLUSIVE` verdict counts as a test case's **FAIL** or **INCONCLUSIVE** here.
|
|
50
51
|
|
|
@@ -111,6 +112,7 @@ Triggered when `muggle-local-execute-replay` returns `status: "failed"` (or non-
|
|
|
111
112
|
| **infra** | Something is wrong inside Muggle Test itself (e.g., click didn't register on a clearly-clickable element, Electron crash, browser engine quirk). Not the user's fault and not a stale script. |
|
|
112
113
|
| **stale-script** | The test script no longer matches the live UI (selectors moved, label paths changed, page renamed). The product still works; the script is out of date. |
|
|
113
114
|
| **product-defect** | The script and infra are fine; the user's app actually misbehaved (assertion failure on previously-passing step, unexpected error, wrong page after action). This is the failure mode acceptance testing exists to catch. |
|
|
115
|
+
| **test-precondition** | The product behaves correctly for the data it has; the test asserts on state the test account never held. The asserted record, row, or value is missing because nothing in the test created it — stale or missing test data, a prerequisite the test case assumes but never sets up. Example: a test asserting a billing debit row shows token counts, on an account whose every debit predates the code that records counts. The test is wrong, not the product. |
|
|
114
116
|
|
|
115
117
|
### Where to read signals
|
|
116
118
|
|
|
@@ -126,6 +128,7 @@ Call `muggle-local-run-result-get` (local) or the remote equivalent and read **s
|
|
|
126
128
|
- **infra** signals: `electron-crash`, `chromium-error`, `click-no-effect-on-clickable-element`, `timeout-on-trivial-wait`, `internal-error-in-mcp-output`.
|
|
127
129
|
- **stale-script** signals: `element-not-found`, `selector-timeout`, `label-path-mismatch`, `nav-target-404`, `aria-label-changed`.
|
|
128
130
|
- **product-defect** signals: `assertion-failed-on-passing-step`, `unexpected-error-toast`, `wrong-page-after-action`, `network-500-from-app`, `form-validation-rejected-valid-input`.
|
|
131
|
+
- **test-precondition** signals: `asserted-record-absent`, `empty-state-where-rows-expected`, `fixture-predates-change`, `prerequisite-state-never-created`. The frames show the page rendering correctly for the data present — the list loads, the row that exists is right — and the asserted state is simply not in the account. Before settling on it, confirm the product produces that state when exercised: a page that cannot show token counts on a fresh debit is a **product-defect**.
|
|
129
132
|
- Studio verdict `bug_detected` (`**Studio Verdict:** Bug Detected (bug_detected)` on `muggle-local-run-result-get`) settles the bucket as **product-defect**, status `failed`: it is a product bug the run proved. Surface it to the user as a bug in their app; do not retry, regenerate, or debug the test.
|
|
130
133
|
|
|
131
134
|
If signals span multiple buckets, pick the most specific one and list all signals in telemetry — the user can override.
|
|
@@ -139,6 +142,7 @@ Present via `AskUserQuestion`. The first option is the AI's recommendation (labe
|
|
|
139
142
|
| **infra** | Report bug to Muggle AI → invoke `muggle-feedback` skill with `category: "muggle-infra"` (and run id / signals). | Retry; muggle-feedback (different category); Skip. |
|
|
140
143
|
| **stale-script** | Regenerate the script → call `muggle-local-execute-test-generation` (or remote equivalent) for this test case, then re-replay. | Retry as-is; muggle-feedback; Skip. |
|
|
141
144
|
| **product-defect** | Surface as a real defect — show the failing step + screenshot + one-line summary; offer to share via email/SMS/file ticket (see "Sharing real defects" below). | muggle-feedback (if the script's *expectation* was wrong); Retry; Skip. |
|
|
145
|
+
| **test-precondition** | Repair the test, not the product → update the test case (`muggle-remote-test-case-update`) so it creates the state it asserts on: a setup step that produces the record, a seeded precondition, or a prerequisite test case it chains after. Then regenerate the script and re-run. Never weaken the assertion to fit the data. | Retry; muggle-feedback; Skip. |
|
|
142
146
|
|
|
143
147
|
### Sharing real defects
|
|
144
148
|
|
|
@@ -160,8 +164,8 @@ Emit **two events per failure**: one when the AI classifies (before asking the u
|
|
|
160
164
|
{
|
|
161
165
|
"eventType": "replay-failure-classified",
|
|
162
166
|
"skillName": "<this skill>",
|
|
163
|
-
"aiClassification": "infra" | "stale-script" | "product-defect",
|
|
164
|
-
"aiSuggestion": "report-bug" | "regenerate" | "share-defect",
|
|
167
|
+
"aiClassification": "infra" | "stale-script" | "product-defect" | "test-precondition",
|
|
168
|
+
"aiSuggestion": "report-bug" | "regenerate" | "share-defect" | "repair-test",
|
|
165
169
|
"runId": "<local run id>",
|
|
166
170
|
"testCaseId": "<id>",
|
|
167
171
|
"projectId": "<id>",
|
|
@@ -176,7 +180,7 @@ Emit **two events per failure**: one when the AI classifies (before asking the u
|
|
|
176
180
|
"skillName": "<this skill>",
|
|
177
181
|
"aiClassification": "<same as above>",
|
|
178
182
|
"aiSuggestion": "<same as above>",
|
|
179
|
-
"userAction": "regenerate" | "report-bug" | "share-email" | "retry" | "muggle-feedback" | "skip",
|
|
183
|
+
"userAction": "regenerate" | "report-bug" | "share-email" | "repair-test" | "retry" | "muggle-feedback" | "skip",
|
|
180
184
|
"runId": "<local run id>",
|
|
181
185
|
"testCaseId": "<id>",
|
|
182
186
|
"projectId": "<id>"
|
|
@@ -199,6 +203,7 @@ Triggered when `muggle-local-execute-test-generation` (or the remote equivalent)
|
|
|
199
203
|
| **infra** | A Muggle Test bug stopped generation from progressing (handler crash, schema validation in our code, deterministic LLM-pipeline failure). |
|
|
200
204
|
| **agent-course** | The generation agent went down a wrong path (chose the wrong button, misread the goal, looped on a blocking modal). The product is fine and the test case is fine — the agent's *course* needs steering. |
|
|
201
205
|
| **product-uxux** | The product itself blocks the test (broken page, missing element, server error). Agent can't proceed because the feature doesn't actually work. |
|
|
206
|
+
| **test-precondition** | As in section B: the agent reached the assertion and the state it checks was never created in the test account. Same signals, same suggestion. |
|
|
202
207
|
|
|
203
208
|
### Where to read signals
|
|
204
209
|
|
|
@@ -229,17 +234,18 @@ Present via `AskUserQuestion`. **Always show the run summary first** so the user
|
|
|
229
234
|
| **infra** | Report bug to Muggle AI → `muggle-feedback` with `category: "muggle-infra"` (run id, signals, summary excerpt). | Retry; Skip. |
|
|
230
235
|
| **agent-course** | Steer the agent → invoke `muggle-feedback` skill so the user describes what should have happened; the workflow re-runs with the corrected course. | Retry; Edit test case; Skip. |
|
|
231
236
|
| **product-uxux** | Wait for fix — share the run summary + screenshot to the dev. Offer email / SMS / file ticket (see "Sharing real defects" in section B). | Retry once the fix lands; muggle-feedback; Skip. |
|
|
237
|
+
| **test-precondition** | Repair the test, per section B. | Retry; muggle-feedback; Skip. |
|
|
232
238
|
|
|
233
239
|
### Telemetry
|
|
234
240
|
|
|
235
|
-
Same two-event pattern as section B, with `eventType` values `regen-failure-classified` and `regen-failure-resolved`. `aiClassification` is one of the
|
|
241
|
+
Same two-event pattern as section B, with `eventType` values `regen-failure-classified` and `regen-failure-resolved`. `aiClassification` is one of the five bucket strings; `userAction` is the user's pick.
|
|
236
242
|
|
|
237
243
|
```json
|
|
238
244
|
{
|
|
239
245
|
"eventType": "regen-failure-classified",
|
|
240
246
|
"skillName": "<this skill>",
|
|
241
|
-
"aiClassification": "transient" | "infra" | "agent-course" | "product-uxux",
|
|
242
|
-
"aiSuggestion": "retry" | "report-bug" | "muggle-feedback" | "wait-and-share",
|
|
247
|
+
"aiClassification": "transient" | "infra" | "agent-course" | "product-uxux" | "test-precondition",
|
|
248
|
+
"aiSuggestion": "retry" | "report-bug" | "muggle-feedback" | "wait-and-share" | "repair-test",
|
|
243
249
|
"runId": "<local run id>",
|
|
244
250
|
"testCaseId": "<id>",
|
|
245
251
|
"projectId": "<id>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `muggle-do:escalation`
|
|
2
2
|
|
|
3
|
-
Zero or one per address-reviews invocation, plus zero or one per forward cycle that waives a failing E2E run. Fires when `/muggle-do` emits a terminal escalation message to the user.
|
|
3
|
+
Zero or one per address-reviews invocation, plus zero or one per forward cycle that waives a failing E2E run or leaves its decision open. Fires when `/muggle-do` emits a terminal escalation message to the user.
|
|
4
4
|
|
|
5
5
|
```json
|
|
6
6
|
{
|
|
@@ -20,4 +20,4 @@ Zero or one per address-reviews invocation, plus zero or one per forward cycle t
|
|
|
20
20
|
- `"ambiguous-review"` — one or more reviews classified ambiguous in this batch.
|
|
21
21
|
- `"design-adjustment"` — mid-cycle, the work surfaced a design-level conflict.
|
|
22
22
|
- `"rebase-conflict"` — an opt-in auto-rebase hit conflicts that couldn't be resolved and verified; the branch was restored to its pre-rebase SHA. `review_ids` may be empty.
|
|
23
|
-
- `"e2e-unrepairable"` — the E2E repair loop shipped with failures it could not fix: the user waived, an unattended run
|
|
23
|
+
- `"e2e-unrepairable"` — the E2E repair loop shipped with failures it could not fix: the user waived, or an unattended run or a spent iteration cap left the decision open for the user. `review_ids` is empty.
|
|
@@ -13,9 +13,9 @@ The facts [`next-step.md`](next-step.md) reports a finished PR from. Teardown de
|
|
|
13
13
|
- `pr` — `<owner>/<repo>#<n>` and URL, from `prs.json`.
|
|
14
14
|
- `state` — `merged` or `closed`, from `prs.json`.
|
|
15
15
|
- `title` — from the PR-metadata recipe of `prs.json`'s `provider` ([`github.md`](../_shared/vcs/github.md), [`gitlab.md`](../_shared/vcs/gitlab.md)); the slot does not store it.
|
|
16
|
-
- `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived E2E verdict.
|
|
16
|
+
- `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived or still-undecided E2E verdict.
|
|
17
17
|
- `escalatedReviewIds` — `result.md`'s `Escalated review ids`; empty on `none` or when `result.md` is absent.
|
|
18
|
-
- `waivers` — `state.md`'s waiver and Blocker lines, verbatim.
|
|
18
|
+
- `waivers` — `state.md`'s waiver and Blocker lines and any open `## E2E decision` block, verbatim.
|
|
19
19
|
- `teardown` — the note next-step prints, from this turn's teardown report: `cleaned up` when no row is `❌`, the first `❌` row's reason otherwise, `branch kept` when teardown did not run.
|
|
20
20
|
- `finishedAt` — ISO-8601, when step 6 ran.
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# E2E Repair Loop (Stage 7.5)
|
|
2
2
|
|
|
3
|
-
Runs between Stage 7's posted walkthrough and Stage 8's watcher dispatch. A failing acceptance run means the change is not ready for a reviewer, so this stage root-causes every failure and either repairs it in-pipeline or puts one decision in front of the user. The watcher is armed only once this stage clears.
|
|
3
|
+
Runs between Stage 7's posted walkthrough and Stage 8's watcher dispatch, and again whenever the watcher finds the PR's `muggle-walkthrough` check red on failed cases ([`fix-ci.md`](fix-ci.md) Step 2.5). A failing acceptance run means the change is not ready for a reviewer, so this stage root-causes every failure and either repairs it in-pipeline or puts one decision in front of the user. The watcher is armed only once this stage clears.
|
|
4
4
|
|
|
5
5
|
## Turn preamble
|
|
6
6
|
|
|
@@ -15,6 +15,8 @@ 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
|
+
Entered from fix-ci, the failing cases come from the red check instead of a Stage 6 report: the check run's summary (each failed or inconclusive case, its failing step, its run link) and the walkthrough comment's hidden `muggle-e2e-result` record (the same cases with their test case ids). The run-level verdict is `FAIL` when any case failed, else `INCONCLUSIVE`. A walkthrough settled by a `NO_APP_LOGIC_CHANGE` skip keeps the last full run beneath it, record included; those failures are this head's and enter the loop like any other.
|
|
19
|
+
|
|
18
20
|
## Wave cycles
|
|
19
21
|
|
|
20
22
|
`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.
|
|
@@ -48,11 +50,12 @@ Map each bucket to exactly one disposition. Buckets are defined in [`../_shared/
|
|
|
48
50
|
| `product-uxux` (regen) | `repair` | The product blocks the agent because the feature does not work. |
|
|
49
51
|
| `stale-script` (replay) | `regenerate` | Selectors moved; the product is fine. Regenerating is self-healing, not a code change. |
|
|
50
52
|
| `transient` (regen) | `retry` | Once, then re-bucket the second result. A twice-transient failure is `infra`. |
|
|
53
|
+
| `test-precondition` (either) | `repair-test` | The product is right for the data it has; the test asserts on state it never created. Repair the test case, never the product. |
|
|
51
54
|
| `infra` (either) | `ask` | A Muggle Test bug. Nothing in this repo fixes it. |
|
|
52
55
|
| `agent-course` (regen) | `ask` | The agent needs steering, which is the user's `muggle-feedback` call to make. |
|
|
53
56
|
| `unclassified` | `ask` | No bucket, no automatic action. |
|
|
54
57
|
|
|
55
|
-
A `repair` disposition requires a named defect: the failing step, expected-versus-actual, and the code path it implicates.
|
|
58
|
+
A `repair` disposition requires a named defect: the failing step, expected-versus-actual, and the code path it implicates. A `repair-test` disposition requires one too: the asserted state, the evidence the account lacks it (the frame, the record list), and the test-case change that would create it. Without one either is `ask`, whatever the bucket said.
|
|
56
59
|
|
|
57
60
|
**A failure the diff cannot explain may predate it.** When a `product-defect` or `product-uxux` failure names no code path the diff touched, replay the same test case against a checkout of the base before repairing anything: a worktree at the base tip's full SHA, with its own stack claim and services, under the same runSettings record. If that run fails the same way, its disposition is `baseline` — the defect is on the base, not this change's to fix — and the entry carries that run's id as `baselineRunId` into the walkthrough report ([`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). If it passes, the change caused the failure and the original disposition stands. A `baseline` entry is never re-run or waived; when every remaining failure is `baseline`, the loop clears.
|
|
58
61
|
|
|
@@ -64,50 +67,73 @@ An Inconclusive entry Stage 6 recorded as `primary failed` never executed either
|
|
|
64
67
|
|
|
65
68
|
## Step 3: Act
|
|
66
69
|
|
|
67
|
-
Process dispositions in order — `retry`, then `regenerate`, then `repair` — so cheap self-healing runs before any code change.
|
|
70
|
+
Process dispositions in order — `retry`, then `regenerate`, then `repair-test`, then `repair` — so cheap self-healing runs before any code change.
|
|
68
71
|
|
|
69
72
|
- **`retry`** — re-execute the case unchanged through the Stage 6 loop. Re-bucket the result and fold it back into Step 2.
|
|
70
73
|
- **`regenerate`** — regenerate the script for that test case, then re-replay. One regeneration per test case per iteration, matching Stage 6's own cap.
|
|
74
|
+
- **`repair-test`** — update the test case with `muggle-remote-test-case-update` so it produces the state it asserts on: a setup step that creates the record, a seeded precondition, or a prerequisite test case it chains after. Keep the assertion as written — an edit that stops checking the behavior is not a repair. Then regenerate its script and re-run. No product code changes, so nothing is pushed.
|
|
71
75
|
- **`repair`** — re-enter [`build.md`](build.md) with the named defects as this iteration's requirements amendment, then run [`unit-tests.md`](unit-tests.md) and refresh the PR through [`open-prs/update.md`](open-prs/update.md). Impact analysis does not re-run; the change is scoped to a known defect.
|
|
72
76
|
- **`ask`** — collect every `ask` failure and present **one** `AskUserQuestion` (Step 4). Never one picker per failure.
|
|
73
77
|
|
|
74
78
|
## Step 4: The user decision
|
|
75
79
|
|
|
76
|
-
One question, listing each unrepairable failure with its bucket, failing step, and dashboard link. Options:
|
|
80
|
+
One question, listing each unrepairable failure with its bucket, failing step, and dashboard link. Options — the same four in every form the decision takes:
|
|
77
81
|
|
|
78
82
|
1. **Repair anyway** — the user names what the fix should be; the loop treats it as a `repair` disposition and re-enters Step 3.
|
|
79
83
|
2. **Give feedback and rerun** — invoke `muggle-feedback` for the run, then re-execute in regen mode. The right answer for `agent-course`.
|
|
80
|
-
3. **Waive and ship** — record the
|
|
84
|
+
3. **Waive and ship** — record `E2E waived: <test case ids> — <the user's words>` in `state.md`, retitle the PR `[E2E FAILING]`, and clear to Stage 8. Only the user's own pick or words waive. The walkthrough check stays red on the posted run; merging past it is the user's call.
|
|
81
85
|
4. **Stop here** — leave the PR open and unwatched; the user takes it from there.
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
A case `state.md` already records as waived never reaches the question again.
|
|
88
|
+
|
|
89
|
+
**Unattended runs.** When the cycle was started autonomously there is nobody to ask, and nobody's waiver to record. Do not skip the loop — run Steps 1–3 in full, then leave a surviving `ask` as an **open decision**, never a waiver:
|
|
90
|
+
|
|
91
|
+
1. Write the decision into `state.md`, replacing any earlier one:
|
|
92
|
+
```
|
|
93
|
+
## E2E decision
|
|
94
|
+
- Head: <head sha>
|
|
95
|
+
- <test case name> (<test case id>) — <bucket> — step <n>: <what failed> — <run link>
|
|
96
|
+
- Options: repair with direction | feedback and rerun | waive | stop
|
|
97
|
+
```
|
|
98
|
+
2. Retitle the PR `[E2E FAILING]` and emit the escalation event.
|
|
99
|
+
3. End the turn's final message with the decision request — one line per case naming its bucket, then the four options.
|
|
100
|
+
4. Clear to Stage 8 as `decision-pending`. The armed watcher sees the walkthrough check red, fix-ci finds this decision for the head and escalates without repeating the repair, and the watcher's blocked reminder carries the cases and options until the user answers.
|
|
101
|
+
|
|
102
|
+
A readiness halt (Step 0) is not an `ask` and never becomes a decision. Silently arming the watcher on a red run, or waiving one nobody looked at, is the failure this stage exists to prevent.
|
|
103
|
+
|
|
104
|
+
Entered from fix-ci, Step 4 always takes the unattended form, and fix-ci's escalation ([`fix-ci.md`](fix-ci.md) Step 6) stands in for the Stage 8 clearance.
|
|
105
|
+
|
|
106
|
+
The user's answer — to the question, or to the decision request after it was printed — runs that option over the listed cases and removes the `## E2E decision` block.
|
|
84
107
|
|
|
85
108
|
## Step 5: Close the loop
|
|
86
109
|
|
|
87
|
-
After a `repair`, `regenerate`, or `retry` pass, re-run [`e2e-acceptance.md`](e2e-acceptance.md) over the affected test cases only, increment `repairIteration`, and return to Step 0. A change whose `state.md` records `E2E lane: background` re-runs through that lane ([`background-e2e.md`](background-e2e.md)), queued behind any local run in flight, with this PR's URL in the brief.
|
|
110
|
+
After a `repair`, `repair-test`, `regenerate`, or `retry` pass, re-run [`e2e-acceptance.md`](e2e-acceptance.md) over the affected test cases only, increment `repairIteration`, and return to Step 0. A change whose `state.md` records `E2E lane: background` re-runs through that lane ([`background-e2e.md`](background-e2e.md)), queued behind any local run in flight, with this PR's URL in the brief.
|
|
88
111
|
|
|
89
|
-
The loop is bounded at **3** repair iterations, the same bound the cycle guardrail already applies to E2E failures. On the third exhausted iteration,
|
|
112
|
+
The loop is bounded at **3** repair iterations, the same bound the cycle guardrail already applies to E2E failures. On the third exhausted iteration, the surviving failures go to Step 4 as `ask`, each with its last bucket — the question when attended, the open decision when not.
|
|
90
113
|
|
|
91
114
|
## Telemetry
|
|
92
115
|
|
|
93
|
-
Steps 1–3 emit the `*-classified` / `*-resolved` pair per [`../_shared/failure-mode-handling.md`](../_shared/failure-mode-handling.md) section D, with `userAction` set to the disposition this stage took (`repair`, `regenerate`, `retry`) rather than a human pick. A failure that reaches Step 4 records the user's actual choice.
|
|
116
|
+
Steps 1–3 emit the `*-classified` / `*-resolved` pair per [`../_shared/failure-mode-handling.md`](../_shared/failure-mode-handling.md) section D, with `userAction` set to the disposition this stage took (`repair`, `repair-test`, `regenerate`, `retry`) rather than a human pick. A failure that reaches Step 4 records the user's actual choice.
|
|
94
117
|
|
|
95
|
-
Every waive
|
|
118
|
+
Every waive the user picked, and every open decision left for them, also emits `muggle-do:escalation` with `kind: "e2e-unrepairable"` per [`../_shared/telemetry-events/muggle-do-escalation.md`](../_shared/telemetry-events/muggle-do-escalation.md).
|
|
96
119
|
|
|
97
120
|
## Output
|
|
98
121
|
|
|
99
122
|
**Verdict in:** `<Stage 6 verdict>`
|
|
100
123
|
**Repair iterations:** `<n>` of 3
|
|
101
124
|
**Repaired:** test case → root cause → commit subject
|
|
125
|
+
**Test repaired:** test case → missing precondition → test-case change
|
|
102
126
|
**Regenerated:** test case → new script id
|
|
103
|
-
**Waived:** test case → bucket →
|
|
127
|
+
**Waived:** test case → bucket → the user's words
|
|
128
|
+
**Decision pending:** test case → bucket → failing step
|
|
104
129
|
**Verdict out:** `<verdict after the final re-run>`
|
|
105
|
-
**Clearance:** `green` | `waived — <reason>` | `
|
|
130
|
+
**Clearance:** `green` | `waived — <reason>` | `decision-pending`
|
|
106
131
|
|
|
107
132
|
## Invariants
|
|
108
133
|
|
|
109
|
-
- Stage 8 is unreachable while clearance is unresolved — the only exits are green, waived, or
|
|
110
|
-
- No
|
|
134
|
+
- Stage 8 is unreachable while clearance is unresolved — the only exits are green, waived by the user, or decision-pending.
|
|
135
|
+
- No waiver without the user's own pick or words; an unattended run or a spent iteration budget leaves a decision, never a waiver.
|
|
136
|
+
- No bucket auto-repairs without a named defect; `repair-test` changes the test case, never product code.
|
|
111
137
|
- One `AskUserQuestion` per stage run, never one per failure.
|
|
112
138
|
- An unattended run still executes Steps 1–3; only Step 4 collapses.
|
|
113
|
-
- Re-runs are scoped to the affected test cases,
|
|
139
|
+
- Re-runs are scoped to the affected test cases, except when entered from fix-ci: the walkthrough is replaced wholesale, so that re-run covers the whole suite.
|
|
@@ -43,14 +43,17 @@ How long a check takes to run — a 45-minute eval included — is never a reaso
|
|
|
43
43
|
|
|
44
44
|
### Step 2.5 — Red E2E walkthrough check
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
The check run's summary says which red this is ([`../_shared/ci-check-to-command.md`](../_shared/ci-check-to-command.md)): **did not pass** — the walkthrough reports failed or inconclusive cases — takes items 1–5; **still empty** — no walkthrough posted — takes the empty-comment branch below. A walkthrough whose E2E run is in progress keeps the check pending, never red.
|
|
47
|
+
|
|
48
|
+
1. **Read why.** Fetch the check run's summary per [`../_shared/vcs/github/pr-checks.md`](../_shared/vcs/github/pr-checks.md) and record its `completed_at`. It names every failed or inconclusive case, its failing step, and its run. Take the test case ids from the walkthrough comment's hidden `<!-- muggle-e2e-result:v1 {…} -->` record — the newest comment carrying one. A comment settled by a `NO_APP_LOGIC_CHANGE` skip — a rebase or a minor cycle on this head — carries the last full run beneath it, and its failures stand: the skip clears nothing, so they take this same path. Drop every case `state.md` records as `E2E waived:`; if none remain, go to Step 6. If `state.md`'s `## E2E decision` names this head, the repair already ran on it and the user owes the answer: go to Step 6.
|
|
49
|
+
2. **Repair each case** per [`e2e-repair.md`](e2e-repair.md) Steps 1–3: root-cause to a bucket, then retry, regenerate, repair the test (`test-precondition`), or repair the code. This stage is unattended, so a case whose disposition is `ask` is recorded for Step 6 with its bucket and failing step — never a picker, never a waiver.
|
|
48
50
|
3. **Re-run the whole suite** through [`e2e-acceptance.md`](e2e-acceptance.md) — every test case the walkthrough listed, passing ones included. The walkthrough is replaced wholesale and the check judges all of it, so a re-run scoped to the failures would post a walkthrough that drops the cases that passed.
|
|
49
51
|
4. **Order the settle after the push.** If Step 2 changed code, run Steps 3–4 below first, so the new head carries the fix. Then settle the walkthrough comment with the re-run's report via [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A; editing the comment re-runs the check against the head. With no code change (only retries and regenerations) there is nothing to push — the comment edit alone re-runs the check.
|
|
50
52
|
5. **Wait for the fresh verdict** before Step 5's respawn: poll the check run until one completes later than the `completed_at` recorded in item 1, for up to 5 minutes. A watcher respawned sooner reads the stale red verdict and spends a fix attempt on a run already repaired. On timeout, respawn anyway — the per-SHA budget still bounds it.
|
|
51
53
|
|
|
52
54
|
An empty-comment failure (no run ever posted) skips items 1–2. Pick the branch from `state.md`:
|
|
53
55
|
|
|
56
|
+
- **This PR's E2E run queued or running** (`E2E dispatch: queued` or `running`) → wait: that run posts the walkthrough, and the Step 1 exception covers this cycle. Never run a second suite or write into the comment the walkthrough builder is about to fill.
|
|
54
57
|
- **`local-e2e` or `staging-replay`** → run the suite and settle the comment with its report.
|
|
55
58
|
- **`unit-only`, `skip`, or no `## Pre-flight answers` block at all** (a poll-only session — auto-track, or bootstrap on a PR it found no testable surface for) → settle it with the skip code that holds per [`e2e-acceptance.md`](e2e-acceptance.md): `NO_WEB_SURFACE` when the repo serves nothing to drive, `NO_APP_LOGIC_CHANGE` (detail opening with the PR's merge-base commit) when every path the PR changed is docs, tests, lint or CI config, else `NOT_APPLICABLE` with the reason no browser run can reach the change. Run `echo "MUGGLE_E2E_SKIP: <CODE>: <detail>"` from the PR's working tree. The write runs detached, so confirm it landed: run the foreground command the walkthrough gate's block names until it prints `{"settled":true}`, never a hand-written PATCH. Never `NO_PR`: the guardrail refutes it whenever the session handled a PR.
|
|
56
59
|
- **A poll-only PR whose change a browser run *can* reach** → no code holds, so do not cite one. Escalate per Step 6, naming the missing E2E decision; the owner chooses run, project or waive.
|
|
@@ -86,10 +89,10 @@ Respawn the watcher per [`respawn-watcher.md`](respawn-watcher.md). CI on the ne
|
|
|
86
89
|
|
|
87
90
|
### Step 6 — Escalate (budget spent or out of scope)
|
|
88
91
|
|
|
89
|
-
When the failing checks are all out of scope, a non-deterministic check is red again after its re-run on this head (Step 2.6), this is the head's third cycle (`ci_fix_attempts[red_sha]` reached 3 in Step 1) and it could not push a fix, or Step 1 found the budget already spent:
|
|
92
|
+
When the failing checks are all out of scope, a non-deterministic check is red again after its re-run on this head (Step 2.6), Step 2.5 left a walkthrough case it could not repair (an `ask`, an open decision on this head, or only waived cases), this is the head's third cycle (`ci_fix_attempts[red_sha]` reached 3 in Step 1) and it could not push a fix, or Step 1 found the budget already spent:
|
|
90
93
|
|
|
91
94
|
1. Add `red_sha` to `last_seen.ci_escalated_shas` so the SHA is not re-fixed. This cycle's Step 1 attempt is what makes the entry count.
|
|
92
|
-
2. Emit one terminal message naming the unresolved checks.
|
|
95
|
+
2. Emit one terminal message naming the unresolved checks. When `muggle-walkthrough` is among them with cases not waived, the message is the E2E decision request instead — per [`e2e-repair.md`](e2e-repair.md) Step 4's unattended form: each case with its bucket and failing step, then the four options (repair with direction, feedback and rerun, waive, stop). Write that decision to `state.md`'s `## E2E decision` block, and the same cases to `last_seen.e2e_decision` (`head_sha` plus one `{name, testCaseId, bucket, failedStep}` per case, whole-file rewrite) — the watcher's blocked reminder reads it to put the decision in front of the owner. Only waived cases left → `last_seen.e2e_decision` lists them with `waived: true`, and no question is asked again.
|
|
93
96
|
3. Emit the cycle event with `outcome: "ci-escalated"` (Step 7).
|
|
94
97
|
4. **Respawn the watcher** per [`respawn-watcher.md`](respawn-watcher.md). Escalation stops fix-ci from re-dispatching this SHA — but the poller must keep running: it reminds on the `ci_escalated` block and catches a new push, a new review, or the user's own fix. Skipping respawn here is the silent-stop bug the helper exists to prevent.
|
|
95
98
|
|
|
@@ -100,5 +103,6 @@ Emit one `muggle-do:cycle` event ([`../_shared/telemetry-events/muggle-do-cycle.
|
|
|
100
103
|
## Guardrails
|
|
101
104
|
|
|
102
105
|
- Max 3 fix attempts per SHA; out-of-scope checks escalate immediately rather than churn. A walkthrough repair or a re-run that pushes nothing keeps the head SHA, so the same budget bounds it.
|
|
106
|
+
- A red walkthrough never ends silent or self-waived: it is repaired, or it escalates with a decision request the watcher keeps in front of the owner. Only the user's own words waive a case.
|
|
103
107
|
- A non-deterministic check is re-run once per head before it escalates — never escalated on its first red, never re-run twice on one head.
|
|
104
108
|
- No PR replies; the fix commit is the response.
|
|
@@ -78,7 +78,7 @@ Runs once Stage 6 has recorded this change's verdict; a Stage 6 readiness halt n
|
|
|
78
78
|
|
|
79
79
|
## Stage 7.5 gate
|
|
80
80
|
|
|
81
|
-
The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `
|
|
81
|
+
The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `decision-pending` clearance — handing a red run to a watcher with no decision asked puts it in front of reviewers with nobody looking at the failures. When Stage 6 recorded `PASS` or `SKIPPED` the loop clears in its own Step 0 at no cost, so there is never a reason to skip it.
|
|
82
82
|
|
|
83
83
|
## Stage 8 handoff
|
|
84
84
|
|
|
@@ -109,7 +109,7 @@ If `prs.json` is empty, **do not arm** — record the reason in `result.md` and
|
|
|
109
109
|
**Skipped:** repo → reason (when `autoCreatePR` short-circuited)
|
|
110
110
|
**Tested head:** repo → `already the PR head` | `force-pushed <short-sha> (Stage 6 synced onto a moved base)`
|
|
111
111
|
**Overflow comments posted:** repo → PR #
|
|
112
|
-
**Stage 7.5:** `green` | `waived — <reason>` | `
|
|
112
|
+
**Stage 7.5:** `green` | `waived — <reason>` | `decision-pending`
|
|
113
113
|
**Stage 8:** `Watching <N> PR(s) — one watch loop per PR, armed per arm-watcher.md` | `No PRs to watch — stage 8 not armed`
|
|
114
114
|
**Errors:** repo → message
|
|
115
115
|
|
|
@@ -50,7 +50,7 @@ The pipeline table lists **pointers, not summaries**. Open each stage's file and
|
|
|
50
50
|
**Per stage:** read the file → execute it → append one marker line to `iterations/<NNN>.md`, always in the form `Stage <N> done — <evidence>`, citing the evidence that file requires (jest exit code, E2E verdict + `runId`, screenshot path). A stage is done only when its evidence is written, never on recollection.
|
|
51
51
|
|
|
52
52
|
### "Autonomous" / "without my intervention" collapses exactly one thing
|
|
53
|
-
Best-effort the Stage-1 questionnaire and don't ask. It does **not** license skipping telemetry, session artifacts, requirements, unit tests, E2E (`autoE2ETest` defaults to `always`), browser verification, the gate below, the Stage-7.5 repair loop, or the watcher hand-off. Stage 7.5 investigates and repairs unattended too; only its user decision
|
|
53
|
+
Best-effort the Stage-1 questionnaire and don't ask. It does **not** license skipping telemetry, session artifacts, requirements, unit tests, E2E (`autoE2ETest` defaults to `always`), browser verification, the gate below, the Stage-7.5 repair loop, or the watcher hand-off. Stage 7.5 investigates and repairs unattended too; only its user decision is deferred — left open for the user and carried by the watcher, never waived on their behalf. Run the whole pipeline silently — never a shortcut.
|
|
54
54
|
|
|
55
55
|
### Definition of Done — gates before Stages 5.5 and 7
|
|
56
56
|
Each line holds, or is waived by a one-line reason written into `state.md` (silence is not a waiver).
|
|
@@ -105,5 +105,5 @@ When invoked with the directive (PR URL + slug + review ids), routes to [`../do/
|
|
|
105
105
|
- Stage 1 and Stage 7.5's user decision are the only user-facing forward stages. Stages 2–7 don't ask mid-cycle; blocker → pre-flight bug.
|
|
106
106
|
- Same stage failing 3× → escalate.
|
|
107
107
|
- Each route's entry file declares the stage files every run of that route opens, and a Stop gate holds the turn until they are read. A turn that ends before its route's last stage — a readiness halt, an escalation, a pause for a background run — records why with `echo "MUGGLE_STAGE_SKIP: <reason>"`.
|
|
108
|
-
- 3 repair iterations reach E2E with failures →
|
|
108
|
+
- 3 repair iterations reach E2E with failures → put the surviving failures to the user (an open decision when unattended), ship with `[E2E FAILING]`, and hand to the watcher.
|
|
109
109
|
- Address-reviews escalation (ambiguous or design-adjustment) does not block the watcher; user resolves on GitHub.
|
|
@@ -172,6 +172,7 @@ Act on the verdict:
|
|
|
172
172
|
```
|
|
173
173
|
/muggle-do fix ci <check-1> <check-2> ... on <pr-url> slug=<slug>
|
|
174
174
|
```
|
|
175
|
+
A red `muggle-walkthrough` is named like any other red check — the executor reads its summary and decides between repairing failed E2E cases and posting a walkthrough still owed. The watcher never tells them apart, and never skips the dispatch because the only red check is the walkthrough.
|
|
175
176
|
4. Append a dispatching line to `followup.log`; emit a `tick` event with `checks_red: <count>`, `dispatched_ci_fix: true`.
|
|
176
177
|
5. Exit. The dev cycle owns the PR; its respawn restarts the watcher, whose next tick re-checks CI on the new head SHA — CI itself is the verify loop.
|
|
177
178
|
- `block-conflict-escalated`, `block-ci-escalated`, `block-reviews-escalated` → blocked pending a human (Step 7).
|
|
@@ -182,7 +183,7 @@ Act on the verdict:
|
|
|
182
183
|
Any tick that did not dispatch. The Step 6 verdict says **why** it idled. It is **blocked pending a human** on a `block-*` verdict, a durable block only the user can clear:
|
|
183
184
|
|
|
184
185
|
- `block-conflict-escalated` — a rebase `/muggle-do` attempted and gave up on (a semantic conflict, or `autoResolveConflicts=never`), reason `conflict_escalated`. This block clears on its own when the base moves: the new `base_tip_sha` yields a key the set does not contain, and the branch re-arms for a fresh rebase attempt;
|
|
185
|
-
- `block-ci-escalated` — CI the fix-ci stage gave up on, or a red head that spent all 3 fix-ci attempts, reason `ci_escalated
|
|
186
|
+
- `block-ci-escalated` — CI the fix-ci stage gave up on, or a red head that spent all 3 fix-ci attempts, reason `ci_escalated`. When `last_seen.e2e_decision` names this head, the block is an E2E decision the user owes, and the reminder carries its cases and options ([`output-templates/blocked-reminder.md`](output-templates/blocked-reminder.md));
|
|
186
187
|
- `block-reviews-escalated` — an ambiguous review in `last_seen.escalated_review_ids` awaiting the user's direction, with the actionable set empty, reason `reviews_escalated`;
|
|
187
188
|
- `block-rebase-budget-exhausted` — reason `rebase_budget_exhausted` (Step 6).
|
|
188
189
|
|
|
@@ -26,5 +26,13 @@ The watcher's one-line nudge to the loop owner, emitted every tick a PR sits blo
|
|
|
26
26
|
```
|
|
27
27
|
⏳ acme/widget#142 awaiting you (2h): the failing checks on <short-sha> need your call — fix and push, or advise here. → <pr-url>/checks
|
|
28
28
|
```
|
|
29
|
+
- **`ci_escalated` with `last_seen.e2e_decision` on this head** — E2E cases the repair loop could not fix. Name every case with its bucket and failing step, then the four options; never the generic CI line, which hides the decision:
|
|
30
|
+
```
|
|
31
|
+
⏳ acme/widget#142 awaiting you (2h): E2E on <short-sha> — Billing debit shows tokens (test-precondition, step 4), Checkout (infra, step 2) — reply: repair <direction> | feedback+rerun | waive | stop. → <pr-url>/checks
|
|
32
|
+
```
|
|
33
|
+
Every case `waived: true` → the user already decided; say so instead of asking again:
|
|
34
|
+
```
|
|
35
|
+
⏳ acme/widget#142 awaiting you (2h): muggle-walkthrough stays red on <short-sha> only for cases you waived (Checkout) — merge past it, or re-run E2E. → <pr-url>/checks
|
|
36
|
+
```
|
|
29
37
|
|
|
30
38
|
The reminder repeats every blocked tick (at the normal `1m` cadence) until the owner acts; the watcher stops it the moment the fingerprint moves (a push, a new review, or a CI/deploy change).
|
|
@@ -112,6 +112,10 @@ Keyed by `"<owner>/<repo>#<n>"`. One key per PR in the slot.
|
|
|
112
112
|
"conflict_escalated_keys": ["<head-sha>..<base-tip-sha>", ...],
|
|
113
113
|
"catch_up_rebases": <int>,
|
|
114
114
|
"rebase_budget_exhausted": <bool>,
|
|
115
|
+
"e2e_decision": {
|
|
116
|
+
"head_sha": "<sha>",
|
|
117
|
+
"cases": [{ "name": "<test case>", "testCaseId": "<id>", "bucket": "<bucket>", "failedStep": <int>, "waived": <bool> }]
|
|
118
|
+
},
|
|
115
119
|
"blocked": {
|
|
116
120
|
"reason": "conflict_escalated" | "ci_escalated" | "reviews_escalated",
|
|
117
121
|
"since": "<ISO-8601>",
|
|
@@ -140,6 +144,7 @@ Keyed by `"<owner>/<repo>#<n>"`. One key per PR in the slot.
|
|
|
140
144
|
- `conflict_escalated_keys`: `rebase_key`s whose rebase `/muggle-do` gave up on (attempts exhausted, or a conflict under `autoResolveConflicts=never`). Suppresses rebase dispatch **only while `conflict_resolve_attempts[key] >= 1`**; an entry with no attempt behind it is ignored and the rebase dispatches anyway.
|
|
141
145
|
- `catch_up_rebases`: how many rebases this PR has been dispatched for across its whole life. A plain counter, deliberately unkeyed: the two fields above key on `rebase_key`, which changes on every base advance and so hands an active base an unlimited supply of fresh budgets. Nothing resets this one, which makes it the only cap that binds. Capped by [`../muggle-preferences/preference-gates/maxCatchUpRebases.md`](../muggle-preferences/preference-gates/maxCatchUpRebases.md) — 20 by default, `never` for unbounded. Incremented by the rebase cycle on every push, whatever the outcome.
|
|
142
146
|
- `rebase_budget_exhausted`: set by the tick once `catch_up_rebases` reaches the cap, recording why the watch blocks with reason `rebase_budget_exhausted`. The verdict judges exhaustion from the counter and the cap, never from this flag, so raising the preference resumes rebases at once.
|
|
147
|
+
- `e2e_decision`: the walkthrough cases a fix-ci cycle could not repair on `head_sha`, each with its failure bucket and failing step — written alongside the `ci_escalated_shas` entry when `muggle-walkthrough` is among the escalated checks. `waived: true` marks a case the user already waived. The blocked reminder reads it for a `ci_escalated` block whose `head_sha` matches ([`output-templates/blocked-reminder.md`](output-templates/blocked-reminder.md)); one naming another head is stale and ignored. The verdict script never reads it.
|
|
143
148
|
|
|
144
149
|
The escalation sets and attempt counters are written by the `/muggle-do` cycles that ran, and only by them. The dispatch decision that reads them lives in [`../../scripts/pr-watch-verdict.mjs`](../../scripts/pr-watch-verdict.mjs) ([`contract.md`](contract.md) Step 6), not in prose.
|
|
145
150
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"release": "5.26.0",
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-11-
|
|
3
|
+
"buildId": "run-287-1",
|
|
4
|
+
"commitSha": "94d1ed6069a5df3123163ad6efd2a481c95cb735",
|
|
5
|
+
"buildTime": "2026-11-03T22:06:08Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muggleai/works",
|
|
3
3
|
"mcpName": "io.github.multiplex-ai/muggle",
|
|
4
|
-
"version": "5.32.0-staging.
|
|
4
|
+
"version": "5.32.0-staging.287",
|
|
5
5
|
"description": "13 years of Microsoft hyperscale engineering, packaged as a harness for your AI coding agent.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
4
|
-
"version": "5.32.0-staging.
|
|
4
|
+
"version": "5.32.0-staging.287",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
package/plugin/.codex-mcp.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
|
-
"version": "5.32.0-staging.
|
|
3
|
+
"version": "5.32.0-staging.287",
|
|
4
4
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
5
|
-
"version": "5.32.0-staging.
|
|
5
|
+
"version": "5.32.0-staging.287",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/plugin/.mcp.json
CHANGED
|
@@ -7,6 +7,6 @@ Map a red CI check to the local command that reproduces and fixes it. Repo-agnos
|
|
|
7
7
|
| lint / format | Run the repo's lint `--fix` / formatter; restage. |
|
|
8
8
|
| typecheck | Run the typecheck script; read the errors; edit the types. |
|
|
9
9
|
| unit / test | Run the suite; read the failures; fix the code or the test. |
|
|
10
|
-
| `muggle-walkthrough` — the Muggle E2E walkthrough check | In scope
|
|
10
|
+
| `muggle-walkthrough` — the Muggle E2E walkthrough check | In scope; its check-run summary picks the action. **"did not pass"** — the summary names each failed or inconclusive case with the failing step and a link to the run, and the walkthrough comment's hidden `muggle-e2e-result` record carries the same cases with their test case ids: run the E2E repair loop over them, re-run the **whole** suite, and settle the walkthrough comment with the new result — editing the comment re-runs the check. A comment settled by `NO_APP_LOGIC_CHANGE` over a failed run reads the same way: the skip carries the last full run beneath it and clears none of its failures. A case the loop cannot repair escalates as a decision for the user, never a silent block or a waiver. **"still empty"** — no walkthrough was ever posted: when this PR's E2E run is queued or running, wait for it; otherwise run the suite and post it, or — when the session holds no E2E plan or a `unit-only`/`skip` one — settle it with the verified skip code that holds. Never a code fix. A run in progress keeps the check pending, not red. Deterministic: it reads the comment, so re-running it unchanged returns the same verdict. |
|
|
11
11
|
| non-deterministic — an LLM-judged eval gate (e.g. `skill-routing-eval`, `skill-gate-eval`, `agent-gate-eval`) or another check whose verdict can flip with nothing changed | Re-run its failed jobs once per head, without a push: `gh run rerun <run-id> --failed` (GitLab: retry the failed job). The re-run counts as a fix attempt. Escalate only if it fails again on the same head. How long the check takes is never a reason to skip the re-run. |
|
|
12
|
-
| out of scope —
|
|
12
|
+
| out of scope — an E2E suite run inside CI other than `muggle-walkthrough`, build/deploy infra, or unknown | Do **not** attempt; record for escalation. |
|
|
@@ -45,6 +45,7 @@ When the subagent aggregates per-script results from sections B and C into one v
|
|
|
45
45
|
| `product-uxux` (regen) | C | **FAIL** |
|
|
46
46
|
| `agent-course` (regen) | C | **INCONCLUSIVE** (agent couldn't complete, not a PR defect) |
|
|
47
47
|
| `transient` (regen) | C | retry once; if still transient → **INCONCLUSIVE** |
|
|
48
|
+
| `test-precondition` (replay or regen) | B / C | **INCONCLUSIVE** (the test's starting state was never met, not a PR defect) |
|
|
48
49
|
|
|
49
50
|
A deliverable check ([`deliverable-categories.md`](deliverable-categories.md)) carries no bucket; its own `FAIL` or `INCONCLUSIVE` verdict counts as a test case's **FAIL** or **INCONCLUSIVE** here.
|
|
50
51
|
|
|
@@ -111,6 +112,7 @@ Triggered when `muggle-local-execute-replay` returns `status: "failed"` (or non-
|
|
|
111
112
|
| **infra** | Something is wrong inside Muggle Test itself (e.g., click didn't register on a clearly-clickable element, Electron crash, browser engine quirk). Not the user's fault and not a stale script. |
|
|
112
113
|
| **stale-script** | The test script no longer matches the live UI (selectors moved, label paths changed, page renamed). The product still works; the script is out of date. |
|
|
113
114
|
| **product-defect** | The script and infra are fine; the user's app actually misbehaved (assertion failure on previously-passing step, unexpected error, wrong page after action). This is the failure mode acceptance testing exists to catch. |
|
|
115
|
+
| **test-precondition** | The product behaves correctly for the data it has; the test asserts on state the test account never held. The asserted record, row, or value is missing because nothing in the test created it — stale or missing test data, a prerequisite the test case assumes but never sets up. Example: a test asserting a billing debit row shows token counts, on an account whose every debit predates the code that records counts. The test is wrong, not the product. |
|
|
114
116
|
|
|
115
117
|
### Where to read signals
|
|
116
118
|
|
|
@@ -126,6 +128,7 @@ Call `muggle-local-run-result-get` (local) or the remote equivalent and read **s
|
|
|
126
128
|
- **infra** signals: `electron-crash`, `chromium-error`, `click-no-effect-on-clickable-element`, `timeout-on-trivial-wait`, `internal-error-in-mcp-output`.
|
|
127
129
|
- **stale-script** signals: `element-not-found`, `selector-timeout`, `label-path-mismatch`, `nav-target-404`, `aria-label-changed`.
|
|
128
130
|
- **product-defect** signals: `assertion-failed-on-passing-step`, `unexpected-error-toast`, `wrong-page-after-action`, `network-500-from-app`, `form-validation-rejected-valid-input`.
|
|
131
|
+
- **test-precondition** signals: `asserted-record-absent`, `empty-state-where-rows-expected`, `fixture-predates-change`, `prerequisite-state-never-created`. The frames show the page rendering correctly for the data present — the list loads, the row that exists is right — and the asserted state is simply not in the account. Before settling on it, confirm the product produces that state when exercised: a page that cannot show token counts on a fresh debit is a **product-defect**.
|
|
129
132
|
- Studio verdict `bug_detected` (`**Studio Verdict:** Bug Detected (bug_detected)` on `muggle-local-run-result-get`) settles the bucket as **product-defect**, status `failed`: it is a product bug the run proved. Surface it to the user as a bug in their app; do not retry, regenerate, or debug the test.
|
|
130
133
|
|
|
131
134
|
If signals span multiple buckets, pick the most specific one and list all signals in telemetry — the user can override.
|
|
@@ -139,6 +142,7 @@ Present via `AskUserQuestion`. The first option is the AI's recommendation (labe
|
|
|
139
142
|
| **infra** | Report bug to Muggle AI → invoke `muggle-feedback` skill with `category: "muggle-infra"` (and run id / signals). | Retry; muggle-feedback (different category); Skip. |
|
|
140
143
|
| **stale-script** | Regenerate the script → call `muggle-local-execute-test-generation` (or remote equivalent) for this test case, then re-replay. | Retry as-is; muggle-feedback; Skip. |
|
|
141
144
|
| **product-defect** | Surface as a real defect — show the failing step + screenshot + one-line summary; offer to share via email/SMS/file ticket (see "Sharing real defects" below). | muggle-feedback (if the script's *expectation* was wrong); Retry; Skip. |
|
|
145
|
+
| **test-precondition** | Repair the test, not the product → update the test case (`muggle-remote-test-case-update`) so it creates the state it asserts on: a setup step that produces the record, a seeded precondition, or a prerequisite test case it chains after. Then regenerate the script and re-run. Never weaken the assertion to fit the data. | Retry; muggle-feedback; Skip. |
|
|
142
146
|
|
|
143
147
|
### Sharing real defects
|
|
144
148
|
|
|
@@ -160,8 +164,8 @@ Emit **two events per failure**: one when the AI classifies (before asking the u
|
|
|
160
164
|
{
|
|
161
165
|
"eventType": "replay-failure-classified",
|
|
162
166
|
"skillName": "<this skill>",
|
|
163
|
-
"aiClassification": "infra" | "stale-script" | "product-defect",
|
|
164
|
-
"aiSuggestion": "report-bug" | "regenerate" | "share-defect",
|
|
167
|
+
"aiClassification": "infra" | "stale-script" | "product-defect" | "test-precondition",
|
|
168
|
+
"aiSuggestion": "report-bug" | "regenerate" | "share-defect" | "repair-test",
|
|
165
169
|
"runId": "<local run id>",
|
|
166
170
|
"testCaseId": "<id>",
|
|
167
171
|
"projectId": "<id>",
|
|
@@ -176,7 +180,7 @@ Emit **two events per failure**: one when the AI classifies (before asking the u
|
|
|
176
180
|
"skillName": "<this skill>",
|
|
177
181
|
"aiClassification": "<same as above>",
|
|
178
182
|
"aiSuggestion": "<same as above>",
|
|
179
|
-
"userAction": "regenerate" | "report-bug" | "share-email" | "retry" | "muggle-feedback" | "skip",
|
|
183
|
+
"userAction": "regenerate" | "report-bug" | "share-email" | "repair-test" | "retry" | "muggle-feedback" | "skip",
|
|
180
184
|
"runId": "<local run id>",
|
|
181
185
|
"testCaseId": "<id>",
|
|
182
186
|
"projectId": "<id>"
|
|
@@ -199,6 +203,7 @@ Triggered when `muggle-local-execute-test-generation` (or the remote equivalent)
|
|
|
199
203
|
| **infra** | A Muggle Test bug stopped generation from progressing (handler crash, schema validation in our code, deterministic LLM-pipeline failure). |
|
|
200
204
|
| **agent-course** | The generation agent went down a wrong path (chose the wrong button, misread the goal, looped on a blocking modal). The product is fine and the test case is fine — the agent's *course* needs steering. |
|
|
201
205
|
| **product-uxux** | The product itself blocks the test (broken page, missing element, server error). Agent can't proceed because the feature doesn't actually work. |
|
|
206
|
+
| **test-precondition** | As in section B: the agent reached the assertion and the state it checks was never created in the test account. Same signals, same suggestion. |
|
|
202
207
|
|
|
203
208
|
### Where to read signals
|
|
204
209
|
|
|
@@ -229,17 +234,18 @@ Present via `AskUserQuestion`. **Always show the run summary first** so the user
|
|
|
229
234
|
| **infra** | Report bug to Muggle AI → `muggle-feedback` with `category: "muggle-infra"` (run id, signals, summary excerpt). | Retry; Skip. |
|
|
230
235
|
| **agent-course** | Steer the agent → invoke `muggle-feedback` skill so the user describes what should have happened; the workflow re-runs with the corrected course. | Retry; Edit test case; Skip. |
|
|
231
236
|
| **product-uxux** | Wait for fix — share the run summary + screenshot to the dev. Offer email / SMS / file ticket (see "Sharing real defects" in section B). | Retry once the fix lands; muggle-feedback; Skip. |
|
|
237
|
+
| **test-precondition** | Repair the test, per section B. | Retry; muggle-feedback; Skip. |
|
|
232
238
|
|
|
233
239
|
### Telemetry
|
|
234
240
|
|
|
235
|
-
Same two-event pattern as section B, with `eventType` values `regen-failure-classified` and `regen-failure-resolved`. `aiClassification` is one of the
|
|
241
|
+
Same two-event pattern as section B, with `eventType` values `regen-failure-classified` and `regen-failure-resolved`. `aiClassification` is one of the five bucket strings; `userAction` is the user's pick.
|
|
236
242
|
|
|
237
243
|
```json
|
|
238
244
|
{
|
|
239
245
|
"eventType": "regen-failure-classified",
|
|
240
246
|
"skillName": "<this skill>",
|
|
241
|
-
"aiClassification": "transient" | "infra" | "agent-course" | "product-uxux",
|
|
242
|
-
"aiSuggestion": "retry" | "report-bug" | "muggle-feedback" | "wait-and-share",
|
|
247
|
+
"aiClassification": "transient" | "infra" | "agent-course" | "product-uxux" | "test-precondition",
|
|
248
|
+
"aiSuggestion": "retry" | "report-bug" | "muggle-feedback" | "wait-and-share" | "repair-test",
|
|
243
249
|
"runId": "<local run id>",
|
|
244
250
|
"testCaseId": "<id>",
|
|
245
251
|
"projectId": "<id>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `muggle-do:escalation`
|
|
2
2
|
|
|
3
|
-
Zero or one per address-reviews invocation, plus zero or one per forward cycle that waives a failing E2E run. Fires when `/muggle-do` emits a terminal escalation message to the user.
|
|
3
|
+
Zero or one per address-reviews invocation, plus zero or one per forward cycle that waives a failing E2E run or leaves its decision open. Fires when `/muggle-do` emits a terminal escalation message to the user.
|
|
4
4
|
|
|
5
5
|
```json
|
|
6
6
|
{
|
|
@@ -20,4 +20,4 @@ Zero or one per address-reviews invocation, plus zero or one per forward cycle t
|
|
|
20
20
|
- `"ambiguous-review"` — one or more reviews classified ambiguous in this batch.
|
|
21
21
|
- `"design-adjustment"` — mid-cycle, the work surfaced a design-level conflict.
|
|
22
22
|
- `"rebase-conflict"` — an opt-in auto-rebase hit conflicts that couldn't be resolved and verified; the branch was restored to its pre-rebase SHA. `review_ids` may be empty.
|
|
23
|
-
- `"e2e-unrepairable"` — the E2E repair loop shipped with failures it could not fix: the user waived, an unattended run
|
|
23
|
+
- `"e2e-unrepairable"` — the E2E repair loop shipped with failures it could not fix: the user waived, or an unattended run or a spent iteration cap left the decision open for the user. `review_ids` is empty.
|
|
@@ -13,9 +13,9 @@ The facts [`next-step.md`](next-step.md) reports a finished PR from. Teardown de
|
|
|
13
13
|
- `pr` — `<owner>/<repo>#<n>` and URL, from `prs.json`.
|
|
14
14
|
- `state` — `merged` or `closed`, from `prs.json`.
|
|
15
15
|
- `title` — from the PR-metadata recipe of `prs.json`'s `provider` ([`github.md`](../_shared/vcs/github.md), [`gitlab.md`](../_shared/vcs/gitlab.md)); the slot does not store it.
|
|
16
|
-
- `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived E2E verdict.
|
|
16
|
+
- `e2eFailing` — the title carries `[E2E FAILING]`: the PR shipped on a waived or still-undecided E2E verdict.
|
|
17
17
|
- `escalatedReviewIds` — `result.md`'s `Escalated review ids`; empty on `none` or when `result.md` is absent.
|
|
18
|
-
- `waivers` — `state.md`'s waiver and Blocker lines, verbatim.
|
|
18
|
+
- `waivers` — `state.md`'s waiver and Blocker lines and any open `## E2E decision` block, verbatim.
|
|
19
19
|
- `teardown` — the note next-step prints, from this turn's teardown report: `cleaned up` when no row is `❌`, the first `❌` row's reason otherwise, `branch kept` when teardown did not run.
|
|
20
20
|
- `finishedAt` — ISO-8601, when step 6 ran.
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# E2E Repair Loop (Stage 7.5)
|
|
2
2
|
|
|
3
|
-
Runs between Stage 7's posted walkthrough and Stage 8's watcher dispatch. A failing acceptance run means the change is not ready for a reviewer, so this stage root-causes every failure and either repairs it in-pipeline or puts one decision in front of the user. The watcher is armed only once this stage clears.
|
|
3
|
+
Runs between Stage 7's posted walkthrough and Stage 8's watcher dispatch, and again whenever the watcher finds the PR's `muggle-walkthrough` check red on failed cases ([`fix-ci.md`](fix-ci.md) Step 2.5). A failing acceptance run means the change is not ready for a reviewer, so this stage root-causes every failure and either repairs it in-pipeline or puts one decision in front of the user. The watcher is armed only once this stage clears.
|
|
4
4
|
|
|
5
5
|
## Turn preamble
|
|
6
6
|
|
|
@@ -15,6 +15,8 @@ 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
|
+
Entered from fix-ci, the failing cases come from the red check instead of a Stage 6 report: the check run's summary (each failed or inconclusive case, its failing step, its run link) and the walkthrough comment's hidden `muggle-e2e-result` record (the same cases with their test case ids). The run-level verdict is `FAIL` when any case failed, else `INCONCLUSIVE`. A walkthrough settled by a `NO_APP_LOGIC_CHANGE` skip keeps the last full run beneath it, record included; those failures are this head's and enter the loop like any other.
|
|
19
|
+
|
|
18
20
|
## Wave cycles
|
|
19
21
|
|
|
20
22
|
`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.
|
|
@@ -48,11 +50,12 @@ Map each bucket to exactly one disposition. Buckets are defined in [`../_shared/
|
|
|
48
50
|
| `product-uxux` (regen) | `repair` | The product blocks the agent because the feature does not work. |
|
|
49
51
|
| `stale-script` (replay) | `regenerate` | Selectors moved; the product is fine. Regenerating is self-healing, not a code change. |
|
|
50
52
|
| `transient` (regen) | `retry` | Once, then re-bucket the second result. A twice-transient failure is `infra`. |
|
|
53
|
+
| `test-precondition` (either) | `repair-test` | The product is right for the data it has; the test asserts on state it never created. Repair the test case, never the product. |
|
|
51
54
|
| `infra` (either) | `ask` | A Muggle Test bug. Nothing in this repo fixes it. |
|
|
52
55
|
| `agent-course` (regen) | `ask` | The agent needs steering, which is the user's `muggle-feedback` call to make. |
|
|
53
56
|
| `unclassified` | `ask` | No bucket, no automatic action. |
|
|
54
57
|
|
|
55
|
-
A `repair` disposition requires a named defect: the failing step, expected-versus-actual, and the code path it implicates.
|
|
58
|
+
A `repair` disposition requires a named defect: the failing step, expected-versus-actual, and the code path it implicates. A `repair-test` disposition requires one too: the asserted state, the evidence the account lacks it (the frame, the record list), and the test-case change that would create it. Without one either is `ask`, whatever the bucket said.
|
|
56
59
|
|
|
57
60
|
**A failure the diff cannot explain may predate it.** When a `product-defect` or `product-uxux` failure names no code path the diff touched, replay the same test case against a checkout of the base before repairing anything: a worktree at the base tip's full SHA, with its own stack claim and services, under the same runSettings record. If that run fails the same way, its disposition is `baseline` — the defect is on the base, not this change's to fix — and the entry carries that run's id as `baselineRunId` into the walkthrough report ([`../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). If it passes, the change caused the failure and the original disposition stands. A `baseline` entry is never re-run or waived; when every remaining failure is `baseline`, the loop clears.
|
|
58
61
|
|
|
@@ -64,50 +67,73 @@ An Inconclusive entry Stage 6 recorded as `primary failed` never executed either
|
|
|
64
67
|
|
|
65
68
|
## Step 3: Act
|
|
66
69
|
|
|
67
|
-
Process dispositions in order — `retry`, then `regenerate`, then `repair` — so cheap self-healing runs before any code change.
|
|
70
|
+
Process dispositions in order — `retry`, then `regenerate`, then `repair-test`, then `repair` — so cheap self-healing runs before any code change.
|
|
68
71
|
|
|
69
72
|
- **`retry`** — re-execute the case unchanged through the Stage 6 loop. Re-bucket the result and fold it back into Step 2.
|
|
70
73
|
- **`regenerate`** — regenerate the script for that test case, then re-replay. One regeneration per test case per iteration, matching Stage 6's own cap.
|
|
74
|
+
- **`repair-test`** — update the test case with `muggle-remote-test-case-update` so it produces the state it asserts on: a setup step that creates the record, a seeded precondition, or a prerequisite test case it chains after. Keep the assertion as written — an edit that stops checking the behavior is not a repair. Then regenerate its script and re-run. No product code changes, so nothing is pushed.
|
|
71
75
|
- **`repair`** — re-enter [`build.md`](build.md) with the named defects as this iteration's requirements amendment, then run [`unit-tests.md`](unit-tests.md) and refresh the PR through [`open-prs/update.md`](open-prs/update.md). Impact analysis does not re-run; the change is scoped to a known defect.
|
|
72
76
|
- **`ask`** — collect every `ask` failure and present **one** `AskUserQuestion` (Step 4). Never one picker per failure.
|
|
73
77
|
|
|
74
78
|
## Step 4: The user decision
|
|
75
79
|
|
|
76
|
-
One question, listing each unrepairable failure with its bucket, failing step, and dashboard link. Options:
|
|
80
|
+
One question, listing each unrepairable failure with its bucket, failing step, and dashboard link. Options — the same four in every form the decision takes:
|
|
77
81
|
|
|
78
82
|
1. **Repair anyway** — the user names what the fix should be; the loop treats it as a `repair` disposition and re-enters Step 3.
|
|
79
83
|
2. **Give feedback and rerun** — invoke `muggle-feedback` for the run, then re-execute in regen mode. The right answer for `agent-course`.
|
|
80
|
-
3. **Waive and ship** — record the
|
|
84
|
+
3. **Waive and ship** — record `E2E waived: <test case ids> — <the user's words>` in `state.md`, retitle the PR `[E2E FAILING]`, and clear to Stage 8. Only the user's own pick or words waive. The walkthrough check stays red on the posted run; merging past it is the user's call.
|
|
81
85
|
4. **Stop here** — leave the PR open and unwatched; the user takes it from there.
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
A case `state.md` already records as waived never reaches the question again.
|
|
88
|
+
|
|
89
|
+
**Unattended runs.** When the cycle was started autonomously there is nobody to ask, and nobody's waiver to record. Do not skip the loop — run Steps 1–3 in full, then leave a surviving `ask` as an **open decision**, never a waiver:
|
|
90
|
+
|
|
91
|
+
1. Write the decision into `state.md`, replacing any earlier one:
|
|
92
|
+
```
|
|
93
|
+
## E2E decision
|
|
94
|
+
- Head: <head sha>
|
|
95
|
+
- <test case name> (<test case id>) — <bucket> — step <n>: <what failed> — <run link>
|
|
96
|
+
- Options: repair with direction | feedback and rerun | waive | stop
|
|
97
|
+
```
|
|
98
|
+
2. Retitle the PR `[E2E FAILING]` and emit the escalation event.
|
|
99
|
+
3. End the turn's final message with the decision request — one line per case naming its bucket, then the four options.
|
|
100
|
+
4. Clear to Stage 8 as `decision-pending`. The armed watcher sees the walkthrough check red, fix-ci finds this decision for the head and escalates without repeating the repair, and the watcher's blocked reminder carries the cases and options until the user answers.
|
|
101
|
+
|
|
102
|
+
A readiness halt (Step 0) is not an `ask` and never becomes a decision. Silently arming the watcher on a red run, or waiving one nobody looked at, is the failure this stage exists to prevent.
|
|
103
|
+
|
|
104
|
+
Entered from fix-ci, Step 4 always takes the unattended form, and fix-ci's escalation ([`fix-ci.md`](fix-ci.md) Step 6) stands in for the Stage 8 clearance.
|
|
105
|
+
|
|
106
|
+
The user's answer — to the question, or to the decision request after it was printed — runs that option over the listed cases and removes the `## E2E decision` block.
|
|
84
107
|
|
|
85
108
|
## Step 5: Close the loop
|
|
86
109
|
|
|
87
|
-
After a `repair`, `regenerate`, or `retry` pass, re-run [`e2e-acceptance.md`](e2e-acceptance.md) over the affected test cases only, increment `repairIteration`, and return to Step 0. A change whose `state.md` records `E2E lane: background` re-runs through that lane ([`background-e2e.md`](background-e2e.md)), queued behind any local run in flight, with this PR's URL in the brief.
|
|
110
|
+
After a `repair`, `repair-test`, `regenerate`, or `retry` pass, re-run [`e2e-acceptance.md`](e2e-acceptance.md) over the affected test cases only, increment `repairIteration`, and return to Step 0. A change whose `state.md` records `E2E lane: background` re-runs through that lane ([`background-e2e.md`](background-e2e.md)), queued behind any local run in flight, with this PR's URL in the brief.
|
|
88
111
|
|
|
89
|
-
The loop is bounded at **3** repair iterations, the same bound the cycle guardrail already applies to E2E failures. On the third exhausted iteration,
|
|
112
|
+
The loop is bounded at **3** repair iterations, the same bound the cycle guardrail already applies to E2E failures. On the third exhausted iteration, the surviving failures go to Step 4 as `ask`, each with its last bucket — the question when attended, the open decision when not.
|
|
90
113
|
|
|
91
114
|
## Telemetry
|
|
92
115
|
|
|
93
|
-
Steps 1–3 emit the `*-classified` / `*-resolved` pair per [`../_shared/failure-mode-handling.md`](../_shared/failure-mode-handling.md) section D, with `userAction` set to the disposition this stage took (`repair`, `regenerate`, `retry`) rather than a human pick. A failure that reaches Step 4 records the user's actual choice.
|
|
116
|
+
Steps 1–3 emit the `*-classified` / `*-resolved` pair per [`../_shared/failure-mode-handling.md`](../_shared/failure-mode-handling.md) section D, with `userAction` set to the disposition this stage took (`repair`, `repair-test`, `regenerate`, `retry`) rather than a human pick. A failure that reaches Step 4 records the user's actual choice.
|
|
94
117
|
|
|
95
|
-
Every waive
|
|
118
|
+
Every waive the user picked, and every open decision left for them, also emits `muggle-do:escalation` with `kind: "e2e-unrepairable"` per [`../_shared/telemetry-events/muggle-do-escalation.md`](../_shared/telemetry-events/muggle-do-escalation.md).
|
|
96
119
|
|
|
97
120
|
## Output
|
|
98
121
|
|
|
99
122
|
**Verdict in:** `<Stage 6 verdict>`
|
|
100
123
|
**Repair iterations:** `<n>` of 3
|
|
101
124
|
**Repaired:** test case → root cause → commit subject
|
|
125
|
+
**Test repaired:** test case → missing precondition → test-case change
|
|
102
126
|
**Regenerated:** test case → new script id
|
|
103
|
-
**Waived:** test case → bucket →
|
|
127
|
+
**Waived:** test case → bucket → the user's words
|
|
128
|
+
**Decision pending:** test case → bucket → failing step
|
|
104
129
|
**Verdict out:** `<verdict after the final re-run>`
|
|
105
|
-
**Clearance:** `green` | `waived — <reason>` | `
|
|
130
|
+
**Clearance:** `green` | `waived — <reason>` | `decision-pending`
|
|
106
131
|
|
|
107
132
|
## Invariants
|
|
108
133
|
|
|
109
|
-
- Stage 8 is unreachable while clearance is unresolved — the only exits are green, waived, or
|
|
110
|
-
- No
|
|
134
|
+
- Stage 8 is unreachable while clearance is unresolved — the only exits are green, waived by the user, or decision-pending.
|
|
135
|
+
- No waiver without the user's own pick or words; an unattended run or a spent iteration budget leaves a decision, never a waiver.
|
|
136
|
+
- No bucket auto-repairs without a named defect; `repair-test` changes the test case, never product code.
|
|
111
137
|
- One `AskUserQuestion` per stage run, never one per failure.
|
|
112
138
|
- An unattended run still executes Steps 1–3; only Step 4 collapses.
|
|
113
|
-
- Re-runs are scoped to the affected test cases,
|
|
139
|
+
- Re-runs are scoped to the affected test cases, except when entered from fix-ci: the walkthrough is replaced wholesale, so that re-run covers the whole suite.
|
|
@@ -43,14 +43,17 @@ How long a check takes to run — a 45-minute eval included — is never a reaso
|
|
|
43
43
|
|
|
44
44
|
### Step 2.5 — Red E2E walkthrough check
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
The check run's summary says which red this is ([`../_shared/ci-check-to-command.md`](../_shared/ci-check-to-command.md)): **did not pass** — the walkthrough reports failed or inconclusive cases — takes items 1–5; **still empty** — no walkthrough posted — takes the empty-comment branch below. A walkthrough whose E2E run is in progress keeps the check pending, never red.
|
|
47
|
+
|
|
48
|
+
1. **Read why.** Fetch the check run's summary per [`../_shared/vcs/github/pr-checks.md`](../_shared/vcs/github/pr-checks.md) and record its `completed_at`. It names every failed or inconclusive case, its failing step, and its run. Take the test case ids from the walkthrough comment's hidden `<!-- muggle-e2e-result:v1 {…} -->` record — the newest comment carrying one. A comment settled by a `NO_APP_LOGIC_CHANGE` skip — a rebase or a minor cycle on this head — carries the last full run beneath it, and its failures stand: the skip clears nothing, so they take this same path. Drop every case `state.md` records as `E2E waived:`; if none remain, go to Step 6. If `state.md`'s `## E2E decision` names this head, the repair already ran on it and the user owes the answer: go to Step 6.
|
|
49
|
+
2. **Repair each case** per [`e2e-repair.md`](e2e-repair.md) Steps 1–3: root-cause to a bucket, then retry, regenerate, repair the test (`test-precondition`), or repair the code. This stage is unattended, so a case whose disposition is `ask` is recorded for Step 6 with its bucket and failing step — never a picker, never a waiver.
|
|
48
50
|
3. **Re-run the whole suite** through [`e2e-acceptance.md`](e2e-acceptance.md) — every test case the walkthrough listed, passing ones included. The walkthrough is replaced wholesale and the check judges all of it, so a re-run scoped to the failures would post a walkthrough that drops the cases that passed.
|
|
49
51
|
4. **Order the settle after the push.** If Step 2 changed code, run Steps 3–4 below first, so the new head carries the fix. Then settle the walkthrough comment with the re-run's report via [`../muggle-pr-visual-walkthrough/SKILL.md`](../muggle-pr-visual-walkthrough/SKILL.md) Mode A; editing the comment re-runs the check against the head. With no code change (only retries and regenerations) there is nothing to push — the comment edit alone re-runs the check.
|
|
50
52
|
5. **Wait for the fresh verdict** before Step 5's respawn: poll the check run until one completes later than the `completed_at` recorded in item 1, for up to 5 minutes. A watcher respawned sooner reads the stale red verdict and spends a fix attempt on a run already repaired. On timeout, respawn anyway — the per-SHA budget still bounds it.
|
|
51
53
|
|
|
52
54
|
An empty-comment failure (no run ever posted) skips items 1–2. Pick the branch from `state.md`:
|
|
53
55
|
|
|
56
|
+
- **This PR's E2E run queued or running** (`E2E dispatch: queued` or `running`) → wait: that run posts the walkthrough, and the Step 1 exception covers this cycle. Never run a second suite or write into the comment the walkthrough builder is about to fill.
|
|
54
57
|
- **`local-e2e` or `staging-replay`** → run the suite and settle the comment with its report.
|
|
55
58
|
- **`unit-only`, `skip`, or no `## Pre-flight answers` block at all** (a poll-only session — auto-track, or bootstrap on a PR it found no testable surface for) → settle it with the skip code that holds per [`e2e-acceptance.md`](e2e-acceptance.md): `NO_WEB_SURFACE` when the repo serves nothing to drive, `NO_APP_LOGIC_CHANGE` (detail opening with the PR's merge-base commit) when every path the PR changed is docs, tests, lint or CI config, else `NOT_APPLICABLE` with the reason no browser run can reach the change. Run `echo "MUGGLE_E2E_SKIP: <CODE>: <detail>"` from the PR's working tree. The write runs detached, so confirm it landed: run the foreground command the walkthrough gate's block names until it prints `{"settled":true}`, never a hand-written PATCH. Never `NO_PR`: the guardrail refutes it whenever the session handled a PR.
|
|
56
59
|
- **A poll-only PR whose change a browser run *can* reach** → no code holds, so do not cite one. Escalate per Step 6, naming the missing E2E decision; the owner chooses run, project or waive.
|
|
@@ -86,10 +89,10 @@ Respawn the watcher per [`respawn-watcher.md`](respawn-watcher.md). CI on the ne
|
|
|
86
89
|
|
|
87
90
|
### Step 6 — Escalate (budget spent or out of scope)
|
|
88
91
|
|
|
89
|
-
When the failing checks are all out of scope, a non-deterministic check is red again after its re-run on this head (Step 2.6), this is the head's third cycle (`ci_fix_attempts[red_sha]` reached 3 in Step 1) and it could not push a fix, or Step 1 found the budget already spent:
|
|
92
|
+
When the failing checks are all out of scope, a non-deterministic check is red again after its re-run on this head (Step 2.6), Step 2.5 left a walkthrough case it could not repair (an `ask`, an open decision on this head, or only waived cases), this is the head's third cycle (`ci_fix_attempts[red_sha]` reached 3 in Step 1) and it could not push a fix, or Step 1 found the budget already spent:
|
|
90
93
|
|
|
91
94
|
1. Add `red_sha` to `last_seen.ci_escalated_shas` so the SHA is not re-fixed. This cycle's Step 1 attempt is what makes the entry count.
|
|
92
|
-
2. Emit one terminal message naming the unresolved checks.
|
|
95
|
+
2. Emit one terminal message naming the unresolved checks. When `muggle-walkthrough` is among them with cases not waived, the message is the E2E decision request instead — per [`e2e-repair.md`](e2e-repair.md) Step 4's unattended form: each case with its bucket and failing step, then the four options (repair with direction, feedback and rerun, waive, stop). Write that decision to `state.md`'s `## E2E decision` block, and the same cases to `last_seen.e2e_decision` (`head_sha` plus one `{name, testCaseId, bucket, failedStep}` per case, whole-file rewrite) — the watcher's blocked reminder reads it to put the decision in front of the owner. Only waived cases left → `last_seen.e2e_decision` lists them with `waived: true`, and no question is asked again.
|
|
93
96
|
3. Emit the cycle event with `outcome: "ci-escalated"` (Step 7).
|
|
94
97
|
4. **Respawn the watcher** per [`respawn-watcher.md`](respawn-watcher.md). Escalation stops fix-ci from re-dispatching this SHA — but the poller must keep running: it reminds on the `ci_escalated` block and catches a new push, a new review, or the user's own fix. Skipping respawn here is the silent-stop bug the helper exists to prevent.
|
|
95
98
|
|
|
@@ -100,5 +103,6 @@ Emit one `muggle-do:cycle` event ([`../_shared/telemetry-events/muggle-do-cycle.
|
|
|
100
103
|
## Guardrails
|
|
101
104
|
|
|
102
105
|
- Max 3 fix attempts per SHA; out-of-scope checks escalate immediately rather than churn. A walkthrough repair or a re-run that pushes nothing keeps the head SHA, so the same budget bounds it.
|
|
106
|
+
- A red walkthrough never ends silent or self-waived: it is repaired, or it escalates with a decision request the watcher keeps in front of the owner. Only the user's own words waive a case.
|
|
103
107
|
- A non-deterministic check is re-run once per head before it escalates — never escalated on its first red, never re-run twice on one head.
|
|
104
108
|
- No PR replies; the fix commit is the response.
|
|
@@ -78,7 +78,7 @@ Runs once Stage 6 has recorded this change's verdict; a Stage 6 readiness halt n
|
|
|
78
78
|
|
|
79
79
|
## Stage 7.5 gate
|
|
80
80
|
|
|
81
|
-
The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `
|
|
81
|
+
The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 has settled the walkthrough, and before the handoff below. Proceed only on its `green`, `waived`, or `decision-pending` clearance — handing a red run to a watcher with no decision asked puts it in front of reviewers with nobody looking at the failures. When Stage 6 recorded `PASS` or `SKIPPED` the loop clears in its own Step 0 at no cost, so there is never a reason to skip it.
|
|
82
82
|
|
|
83
83
|
## Stage 8 handoff
|
|
84
84
|
|
|
@@ -109,7 +109,7 @@ If `prs.json` is empty, **do not arm** — record the reason in `result.md` and
|
|
|
109
109
|
**Skipped:** repo → reason (when `autoCreatePR` short-circuited)
|
|
110
110
|
**Tested head:** repo → `already the PR head` | `force-pushed <short-sha> (Stage 6 synced onto a moved base)`
|
|
111
111
|
**Overflow comments posted:** repo → PR #
|
|
112
|
-
**Stage 7.5:** `green` | `waived — <reason>` | `
|
|
112
|
+
**Stage 7.5:** `green` | `waived — <reason>` | `decision-pending`
|
|
113
113
|
**Stage 8:** `Watching <N> PR(s) — one watch loop per PR, armed per arm-watcher.md` | `No PRs to watch — stage 8 not armed`
|
|
114
114
|
**Errors:** repo → message
|
|
115
115
|
|
|
@@ -50,7 +50,7 @@ The pipeline table lists **pointers, not summaries**. Open each stage's file and
|
|
|
50
50
|
**Per stage:** read the file → execute it → append one marker line to `iterations/<NNN>.md`, always in the form `Stage <N> done — <evidence>`, citing the evidence that file requires (jest exit code, E2E verdict + `runId`, screenshot path). A stage is done only when its evidence is written, never on recollection.
|
|
51
51
|
|
|
52
52
|
### "Autonomous" / "without my intervention" collapses exactly one thing
|
|
53
|
-
Best-effort the Stage-1 questionnaire and don't ask. It does **not** license skipping telemetry, session artifacts, requirements, unit tests, E2E (`autoE2ETest` defaults to `always`), browser verification, the gate below, the Stage-7.5 repair loop, or the watcher hand-off. Stage 7.5 investigates and repairs unattended too; only its user decision
|
|
53
|
+
Best-effort the Stage-1 questionnaire and don't ask. It does **not** license skipping telemetry, session artifacts, requirements, unit tests, E2E (`autoE2ETest` defaults to `always`), browser verification, the gate below, the Stage-7.5 repair loop, or the watcher hand-off. Stage 7.5 investigates and repairs unattended too; only its user decision is deferred — left open for the user and carried by the watcher, never waived on their behalf. Run the whole pipeline silently — never a shortcut.
|
|
54
54
|
|
|
55
55
|
### Definition of Done — gates before Stages 5.5 and 7
|
|
56
56
|
Each line holds, or is waived by a one-line reason written into `state.md` (silence is not a waiver).
|
|
@@ -105,5 +105,5 @@ When invoked with the directive (PR URL + slug + review ids), routes to [`../do/
|
|
|
105
105
|
- Stage 1 and Stage 7.5's user decision are the only user-facing forward stages. Stages 2–7 don't ask mid-cycle; blocker → pre-flight bug.
|
|
106
106
|
- Same stage failing 3× → escalate.
|
|
107
107
|
- Each route's entry file declares the stage files every run of that route opens, and a Stop gate holds the turn until they are read. A turn that ends before its route's last stage — a readiness halt, an escalation, a pause for a background run — records why with `echo "MUGGLE_STAGE_SKIP: <reason>"`.
|
|
108
|
-
- 3 repair iterations reach E2E with failures →
|
|
108
|
+
- 3 repair iterations reach E2E with failures → put the surviving failures to the user (an open decision when unattended), ship with `[E2E FAILING]`, and hand to the watcher.
|
|
109
109
|
- Address-reviews escalation (ambiguous or design-adjustment) does not block the watcher; user resolves on GitHub.
|
|
@@ -172,6 +172,7 @@ Act on the verdict:
|
|
|
172
172
|
```
|
|
173
173
|
/muggle-do fix ci <check-1> <check-2> ... on <pr-url> slug=<slug>
|
|
174
174
|
```
|
|
175
|
+
A red `muggle-walkthrough` is named like any other red check — the executor reads its summary and decides between repairing failed E2E cases and posting a walkthrough still owed. The watcher never tells them apart, and never skips the dispatch because the only red check is the walkthrough.
|
|
175
176
|
4. Append a dispatching line to `followup.log`; emit a `tick` event with `checks_red: <count>`, `dispatched_ci_fix: true`.
|
|
176
177
|
5. Exit. The dev cycle owns the PR; its respawn restarts the watcher, whose next tick re-checks CI on the new head SHA — CI itself is the verify loop.
|
|
177
178
|
- `block-conflict-escalated`, `block-ci-escalated`, `block-reviews-escalated` → blocked pending a human (Step 7).
|
|
@@ -182,7 +183,7 @@ Act on the verdict:
|
|
|
182
183
|
Any tick that did not dispatch. The Step 6 verdict says **why** it idled. It is **blocked pending a human** on a `block-*` verdict, a durable block only the user can clear:
|
|
183
184
|
|
|
184
185
|
- `block-conflict-escalated` — a rebase `/muggle-do` attempted and gave up on (a semantic conflict, or `autoResolveConflicts=never`), reason `conflict_escalated`. This block clears on its own when the base moves: the new `base_tip_sha` yields a key the set does not contain, and the branch re-arms for a fresh rebase attempt;
|
|
185
|
-
- `block-ci-escalated` — CI the fix-ci stage gave up on, or a red head that spent all 3 fix-ci attempts, reason `ci_escalated
|
|
186
|
+
- `block-ci-escalated` — CI the fix-ci stage gave up on, or a red head that spent all 3 fix-ci attempts, reason `ci_escalated`. When `last_seen.e2e_decision` names this head, the block is an E2E decision the user owes, and the reminder carries its cases and options ([`output-templates/blocked-reminder.md`](output-templates/blocked-reminder.md));
|
|
186
187
|
- `block-reviews-escalated` — an ambiguous review in `last_seen.escalated_review_ids` awaiting the user's direction, with the actionable set empty, reason `reviews_escalated`;
|
|
187
188
|
- `block-rebase-budget-exhausted` — reason `rebase_budget_exhausted` (Step 6).
|
|
188
189
|
|
|
@@ -26,5 +26,13 @@ The watcher's one-line nudge to the loop owner, emitted every tick a PR sits blo
|
|
|
26
26
|
```
|
|
27
27
|
⏳ acme/widget#142 awaiting you (2h): the failing checks on <short-sha> need your call — fix and push, or advise here. → <pr-url>/checks
|
|
28
28
|
```
|
|
29
|
+
- **`ci_escalated` with `last_seen.e2e_decision` on this head** — E2E cases the repair loop could not fix. Name every case with its bucket and failing step, then the four options; never the generic CI line, which hides the decision:
|
|
30
|
+
```
|
|
31
|
+
⏳ acme/widget#142 awaiting you (2h): E2E on <short-sha> — Billing debit shows tokens (test-precondition, step 4), Checkout (infra, step 2) — reply: repair <direction> | feedback+rerun | waive | stop. → <pr-url>/checks
|
|
32
|
+
```
|
|
33
|
+
Every case `waived: true` → the user already decided; say so instead of asking again:
|
|
34
|
+
```
|
|
35
|
+
⏳ acme/widget#142 awaiting you (2h): muggle-walkthrough stays red on <short-sha> only for cases you waived (Checkout) — merge past it, or re-run E2E. → <pr-url>/checks
|
|
36
|
+
```
|
|
29
37
|
|
|
30
38
|
The reminder repeats every blocked tick (at the normal `1m` cadence) until the owner acts; the watcher stops it the moment the fingerprint moves (a push, a new review, or a CI/deploy change).
|
|
@@ -112,6 +112,10 @@ Keyed by `"<owner>/<repo>#<n>"`. One key per PR in the slot.
|
|
|
112
112
|
"conflict_escalated_keys": ["<head-sha>..<base-tip-sha>", ...],
|
|
113
113
|
"catch_up_rebases": <int>,
|
|
114
114
|
"rebase_budget_exhausted": <bool>,
|
|
115
|
+
"e2e_decision": {
|
|
116
|
+
"head_sha": "<sha>",
|
|
117
|
+
"cases": [{ "name": "<test case>", "testCaseId": "<id>", "bucket": "<bucket>", "failedStep": <int>, "waived": <bool> }]
|
|
118
|
+
},
|
|
115
119
|
"blocked": {
|
|
116
120
|
"reason": "conflict_escalated" | "ci_escalated" | "reviews_escalated",
|
|
117
121
|
"since": "<ISO-8601>",
|
|
@@ -140,6 +144,7 @@ Keyed by `"<owner>/<repo>#<n>"`. One key per PR in the slot.
|
|
|
140
144
|
- `conflict_escalated_keys`: `rebase_key`s whose rebase `/muggle-do` gave up on (attempts exhausted, or a conflict under `autoResolveConflicts=never`). Suppresses rebase dispatch **only while `conflict_resolve_attempts[key] >= 1`**; an entry with no attempt behind it is ignored and the rebase dispatches anyway.
|
|
141
145
|
- `catch_up_rebases`: how many rebases this PR has been dispatched for across its whole life. A plain counter, deliberately unkeyed: the two fields above key on `rebase_key`, which changes on every base advance and so hands an active base an unlimited supply of fresh budgets. Nothing resets this one, which makes it the only cap that binds. Capped by [`../muggle-preferences/preference-gates/maxCatchUpRebases.md`](../muggle-preferences/preference-gates/maxCatchUpRebases.md) — 20 by default, `never` for unbounded. Incremented by the rebase cycle on every push, whatever the outcome.
|
|
142
146
|
- `rebase_budget_exhausted`: set by the tick once `catch_up_rebases` reaches the cap, recording why the watch blocks with reason `rebase_budget_exhausted`. The verdict judges exhaustion from the counter and the cap, never from this flag, so raising the preference resumes rebases at once.
|
|
147
|
+
- `e2e_decision`: the walkthrough cases a fix-ci cycle could not repair on `head_sha`, each with its failure bucket and failing step — written alongside the `ci_escalated_shas` entry when `muggle-walkthrough` is among the escalated checks. `waived: true` marks a case the user already waived. The blocked reminder reads it for a `ci_escalated` block whose `head_sha` matches ([`output-templates/blocked-reminder.md`](output-templates/blocked-reminder.md)); one naming another head is stale and ignored. The verdict script never reads it.
|
|
143
148
|
|
|
144
149
|
The escalation sets and attempt counters are written by the `/muggle-do` cycles that ran, and only by them. The dispatch decision that reads them lives in [`../../scripts/pr-watch-verdict.mjs`](../../scripts/pr-watch-verdict.mjs) ([`contract.md`](contract.md) Step 6), not in prose.
|
|
145
150
|
|