@muggleai/works 5.32.0-staging.286 → 5.32.0-staging.288

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.
Files changed (44) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-TM6IZEKH.js → chunk-S3PUEFGM.js} +167 -84
  3. package/dist/cli.js +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  6. package/dist/plugin/.codex-mcp.json +1 -1
  7. package/dist/plugin/.codex-plugin/plugin.json +1 -1
  8. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  9. package/dist/plugin/.mcp.json +1 -1
  10. package/dist/plugin/skills/_shared/ci-check-to-command.md +2 -2
  11. package/dist/plugin/skills/_shared/dev-loop/publish.md +1 -1
  12. package/dist/plugin/skills/_shared/failure-mode-handling.md +12 -6
  13. package/dist/plugin/skills/_shared/telemetry-events/muggle-do-escalation.md +2 -2
  14. package/dist/plugin/skills/do/cleanup.md +2 -2
  15. package/dist/plugin/skills/do/e2e-acceptance.md +6 -3
  16. package/dist/plugin/skills/do/e2e-repair.md +41 -15
  17. package/dist/plugin/skills/do/fix-ci.md +8 -4
  18. package/dist/plugin/skills/do/open-prs/forward.md +2 -2
  19. package/dist/plugin/skills/muggle-do/SKILL.md +2 -2
  20. package/dist/plugin/skills/muggle-pr-followup/contract.md +2 -1
  21. package/dist/plugin/skills/muggle-pr-followup/output-templates/blocked-reminder.md +8 -0
  22. package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +5 -0
  23. package/dist/plugin/skills/muggle-pr-visual-walkthrough/e2e-report-assembly.md +11 -4
  24. package/dist/release-manifest.json +3 -3
  25. package/package.json +1 -1
  26. package/plugin/.claude-plugin/plugin.json +1 -1
  27. package/plugin/.codex-mcp.json +1 -1
  28. package/plugin/.codex-plugin/plugin.json +1 -1
  29. package/plugin/.cursor-plugin/plugin.json +1 -1
  30. package/plugin/.mcp.json +1 -1
  31. package/plugin/skills/_shared/ci-check-to-command.md +2 -2
  32. package/plugin/skills/_shared/dev-loop/publish.md +1 -1
  33. package/plugin/skills/_shared/failure-mode-handling.md +12 -6
  34. package/plugin/skills/_shared/telemetry-events/muggle-do-escalation.md +2 -2
  35. package/plugin/skills/do/cleanup.md +2 -2
  36. package/plugin/skills/do/e2e-acceptance.md +6 -3
  37. package/plugin/skills/do/e2e-repair.md +41 -15
  38. package/plugin/skills/do/fix-ci.md +8 -4
  39. package/plugin/skills/do/open-prs/forward.md +2 -2
  40. package/plugin/skills/muggle-do/SKILL.md +2 -2
  41. package/plugin/skills/muggle-pr-followup/contract.md +2 -1
  42. package/plugin/skills/muggle-pr-followup/output-templates/blocked-reminder.md +8 -0
  43. package/plugin/skills/muggle-pr-followup/state-schemas.md +5 -0
  44. package/plugin/skills/muggle-pr-visual-walkthrough/e2e-report-assembly.md +11 -4
@@ -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.286"
12
+ "version": "5.32.0-staging.288"
13
13
  }
14
14
  ]
15
15
  }
@@ -379,6 +379,104 @@ var PROGRESS_STATUS_LABELS = {
379
379
  ["passed" /* Passed */]: "\u2705 Passed",
380
380
  ["failed" /* Failed */]: "\u274C Failed"
381
381
  };
382
+ var StepSchema = z.object({
383
+ stepIndex: z.number().int().nonnegative(),
384
+ action: z.string().min(1),
385
+ description: z.string().min(1).optional(),
386
+ screenshotUrl: z.string().url(),
387
+ afterScreenshotUrl: z.string().url().optional()
388
+ });
389
+ var RunSummaryVerdictStatusEnum = /* @__PURE__ */ ((RunSummaryVerdictStatusEnum2) => {
390
+ RunSummaryVerdictStatusEnum2["Success"] = "success";
391
+ RunSummaryVerdictStatusEnum2["BugDetected"] = "bug_detected";
392
+ RunSummaryVerdictStatusEnum2["GoalUnachievable"] = "goal_unachievable";
393
+ return RunSummaryVerdictStatusEnum2;
394
+ })(RunSummaryVerdictStatusEnum || {});
395
+ var RecordedRunSummarySchema = z.object({
396
+ isRecorded: z.literal(true),
397
+ headline: z.string().min(1),
398
+ status: z.nativeEnum(RunSummaryVerdictStatusEnum).optional(),
399
+ verdict: z.string().min(1).optional(),
400
+ blockingIssues: z.string().min(1).optional(),
401
+ screenshotUrl: z.string().url().optional()
402
+ });
403
+ var MissingRunSummarySchema = z.object({
404
+ isRecorded: z.literal(false)
405
+ });
406
+ var RunSummarySchema = z.discriminatedUnion("isRecorded", [RecordedRunSummarySchema, MissingRunSummarySchema]);
407
+ var TEST_SHORT_ID_FIELDS = {
408
+ testCaseShortId: z.string().min(1).optional(),
409
+ replayShortId: z.string().min(1).optional()
410
+ };
411
+ var RUN_SETTINGS_FIELDS = {
412
+ runSettingsId: z.string().min(1).optional(),
413
+ resolutionLabel: z.string().min(1).optional()
414
+ };
415
+ var PassedTestSchema = z.object({
416
+ name: z.string().min(1),
417
+ testCaseId: z.string().min(1),
418
+ testScriptId: z.string().min(1).optional(),
419
+ ...TEST_SHORT_ID_FIELDS,
420
+ ...RUN_SETTINGS_FIELDS,
421
+ runId: z.string().min(1),
422
+ viewUrl: z.string().url(),
423
+ status: z.literal("passed"),
424
+ steps: z.array(StepSchema),
425
+ useCaseName: z.string().min(1).optional(),
426
+ description: z.string().min(1).optional(),
427
+ endingScreenshotUrl: z.string().url().optional(),
428
+ endingScreenshotCaption: z.string().min(1).optional(),
429
+ runSummary: RunSummarySchema.optional()
430
+ });
431
+ var FailedTestSchema = z.object({
432
+ name: z.string().min(1),
433
+ testCaseId: z.string().min(1),
434
+ testScriptId: z.string().min(1).optional(),
435
+ ...TEST_SHORT_ID_FIELDS,
436
+ ...RUN_SETTINGS_FIELDS,
437
+ runId: z.string().min(1),
438
+ viewUrl: z.string().url(),
439
+ status: z.literal("failed"),
440
+ steps: z.array(StepSchema),
441
+ failureStepIndex: z.number().int().nonnegative(),
442
+ error: z.string().min(1),
443
+ // A run of the same test case on the PR's base the author says failed too; build-pr-section verifies it before
444
+ // the walkthrough credits it.
445
+ baselineRunId: z.string().min(1).optional(),
446
+ artifactsDir: z.string().min(1).optional(),
447
+ useCaseName: z.string().min(1).optional(),
448
+ description: z.string().min(1).optional(),
449
+ endingScreenshotUrl: z.string().url().optional(),
450
+ endingScreenshotCaption: z.string().min(1).optional(),
451
+ runSummary: RunSummarySchema.optional()
452
+ });
453
+ var InconclusiveTestSchema = z.object({
454
+ name: z.string().min(1),
455
+ testCaseId: z.string().min(1),
456
+ testScriptId: z.string().min(1).optional(),
457
+ ...TEST_SHORT_ID_FIELDS,
458
+ ...RUN_SETTINGS_FIELDS,
459
+ runId: z.string().min(1),
460
+ viewUrl: z.string().url(),
461
+ status: z.literal("inconclusive"),
462
+ steps: z.array(StepSchema),
463
+ reason: z.string().min(1),
464
+ artifactsDir: z.string().min(1).optional(),
465
+ useCaseName: z.string().min(1).optional(),
466
+ description: z.string().min(1).optional(),
467
+ endingScreenshotUrl: z.string().url().optional(),
468
+ endingScreenshotCaption: z.string().min(1).optional(),
469
+ runSummary: RunSummarySchema.optional()
470
+ });
471
+ var TestResultSchema = z.discriminatedUnion("status", [
472
+ PassedTestSchema,
473
+ FailedTestSchema,
474
+ InconclusiveTestSchema
475
+ ]);
476
+ var E2eReportSchema = z.object({
477
+ projectId: z.string().min(1),
478
+ tests: z.array(TestResultSchema)
479
+ });
382
480
 
383
481
  // src/cli/pr-section/constants.ts
384
482
  var DETAIL_IMAGE_WIDTH = 720;
@@ -388,6 +486,13 @@ var STEP_LIST_HEAD_COUNT = 12;
388
486
  var STEP_LIST_TAIL_COUNT = 8;
389
487
  var STEP_ELEMENT_ID_SUFFIX = /\s*with element id (?:\[\d+\]|#\d+)/g;
390
488
  var STEP_SCREENSHOT_MARKER = "\u{1F4F7}";
489
+ var RUN_SUMMARY_MARKER = "\u{1F3C1}";
490
+ var RUN_SUMMARY_VERDICT_STATUS_LABELS = {
491
+ ["success" /* Success */]: "\u2705 Success",
492
+ ["bug_detected" /* BugDetected */]: "\u274C Bug detected",
493
+ ["goal_unachievable" /* GoalUnachievable */]: "\u26A0\uFE0F Goal unachievable"
494
+ };
495
+ var MISSING_RUN_SUMMARY_TEXT = "\u26A0\uFE0F **No summary step** \u2014 the run ended before it summarized its result; open the run on Muggle AI for its last state.";
391
496
  var TEST_DETAILS_DIVIDER = "---";
392
497
  var SHORT_ID_LABEL_SEPARATOR = " \xB7 ";
393
498
  var TEST_DETAILS_ANCHOR_PREFIX = "muggle-test-";
@@ -598,83 +703,6 @@ function buildE2eResultRecord(latestTests) {
598
703
  unpassed
599
704
  };
600
705
  }
601
- var StepSchema = z.object({
602
- stepIndex: z.number().int().nonnegative(),
603
- action: z.string().min(1),
604
- description: z.string().min(1).optional(),
605
- screenshotUrl: z.string().url(),
606
- afterScreenshotUrl: z.string().url().optional()
607
- });
608
- var TEST_SHORT_ID_FIELDS = {
609
- testCaseShortId: z.string().min(1).optional(),
610
- replayShortId: z.string().min(1).optional()
611
- };
612
- var RUN_SETTINGS_FIELDS = {
613
- runSettingsId: z.string().min(1).optional(),
614
- resolutionLabel: z.string().min(1).optional()
615
- };
616
- var PassedTestSchema = z.object({
617
- name: z.string().min(1),
618
- testCaseId: z.string().min(1),
619
- testScriptId: z.string().min(1).optional(),
620
- ...TEST_SHORT_ID_FIELDS,
621
- ...RUN_SETTINGS_FIELDS,
622
- runId: z.string().min(1),
623
- viewUrl: z.string().url(),
624
- status: z.literal("passed"),
625
- steps: z.array(StepSchema),
626
- useCaseName: z.string().min(1).optional(),
627
- description: z.string().min(1).optional(),
628
- endingScreenshotUrl: z.string().url().optional(),
629
- endingScreenshotCaption: z.string().min(1).optional()
630
- });
631
- var FailedTestSchema = z.object({
632
- name: z.string().min(1),
633
- testCaseId: z.string().min(1),
634
- testScriptId: z.string().min(1).optional(),
635
- ...TEST_SHORT_ID_FIELDS,
636
- ...RUN_SETTINGS_FIELDS,
637
- runId: z.string().min(1),
638
- viewUrl: z.string().url(),
639
- status: z.literal("failed"),
640
- steps: z.array(StepSchema),
641
- failureStepIndex: z.number().int().nonnegative(),
642
- error: z.string().min(1),
643
- // A run of the same test case on the PR's base the author says failed too; build-pr-section verifies it before
644
- // the walkthrough credits it.
645
- baselineRunId: z.string().min(1).optional(),
646
- artifactsDir: z.string().min(1).optional(),
647
- useCaseName: z.string().min(1).optional(),
648
- description: z.string().min(1).optional(),
649
- endingScreenshotUrl: z.string().url().optional(),
650
- endingScreenshotCaption: z.string().min(1).optional()
651
- });
652
- var InconclusiveTestSchema = z.object({
653
- name: z.string().min(1),
654
- testCaseId: z.string().min(1),
655
- testScriptId: z.string().min(1).optional(),
656
- ...TEST_SHORT_ID_FIELDS,
657
- ...RUN_SETTINGS_FIELDS,
658
- runId: z.string().min(1),
659
- viewUrl: z.string().url(),
660
- status: z.literal("inconclusive"),
661
- steps: z.array(StepSchema),
662
- reason: z.string().min(1),
663
- artifactsDir: z.string().min(1).optional(),
664
- useCaseName: z.string().min(1).optional(),
665
- description: z.string().min(1).optional(),
666
- endingScreenshotUrl: z.string().url().optional(),
667
- endingScreenshotCaption: z.string().min(1).optional()
668
- });
669
- var TestResultSchema = z.discriminatedUnion("status", [
670
- PassedTestSchema,
671
- FailedTestSchema,
672
- InconclusiveTestSchema
673
- ]);
674
- var E2eReportSchema = z.object({
675
- projectId: z.string().min(1),
676
- tests: z.array(TestResultSchema)
677
- });
678
706
 
679
707
  // src/cli/pr-section/render.ts
680
708
  function walkthroughEntryKey(identity) {
@@ -758,9 +786,10 @@ function defaultEndingCaption(test) {
758
786
  return "Final page after the test completed";
759
787
  }
760
788
  function endingFrame(test) {
761
- if (test.endingScreenshotUrl) {
789
+ const explicitUrl = test.endingScreenshotUrl ?? recordedRunSummary(test.runSummary)?.screenshotUrl;
790
+ if (explicitUrl) {
762
791
  return {
763
- url: test.endingScreenshotUrl,
792
+ url: explicitUrl,
764
793
  caption: test.endingScreenshotCaption ?? defaultEndingCaption(test)
765
794
  };
766
795
  }
@@ -773,11 +802,17 @@ function endingFrame(test) {
773
802
  caption: test.endingScreenshotCaption ?? defaultEndingCaption(test)
774
803
  };
775
804
  }
805
+ function recordedRunSummary(runSummary) {
806
+ return runSummary?.isRecorded ? runSummary : null;
807
+ }
776
808
  function screenshotImage(url, displayWidth, alt) {
777
809
  return `<img src="${url}" width="${displayWidth}" alt="${escapeHtmlAttribute(alt)}">`;
778
810
  }
811
+ function singleLine(text) {
812
+ return text.replace(/\s*\n\s*/g, " ");
813
+ }
779
814
  function tableCell(s) {
780
- return s.replace(/\s*\n\s*/g, " ").replace(/\|/g, "\\|");
815
+ return singleLine(s).replace(/\|/g, "\\|");
781
816
  }
782
817
  function stepText(step) {
783
818
  return escapeHtml((step.description ?? step.action).replace(STEP_ELEMENT_ID_SUFFIX, ""));
@@ -884,7 +919,7 @@ function renderTestDetails(entry, testNumber, screenshotDetail = "before-and-aft
884
919
  const { test } = entry;
885
920
  const lines = [`<a name="${testAnchor(test)}"></a>`, "", `#### ${statusEmoji(test)} ${testNumber}. ${testLabel(test)}`, ""];
886
921
  if (test.description && !isSameText(test.description, test.name)) {
887
- lines.push(`_${test.description.replace(/\s*\n\s*/g, " ")}_`, "");
922
+ lines.push(`_${singleLine(test.description)}_`, "");
888
923
  }
889
924
  lines.push(...renderResultTable(entry));
890
925
  const steps = renderSteps(test, screenshotDetail);
@@ -905,6 +940,9 @@ function testAnchor(identity) {
905
940
  }
906
941
  function stepsToggleLabel(test, screenshotDetail) {
907
942
  const count = test.steps.length;
943
+ if (count === 0) {
944
+ return "<kbd>Show the run summary</kbd>";
945
+ }
908
946
  const stepCount = `${count} ${count === 1 ? "step" : "steps"}`;
909
947
  return screenshotDetail === "none" /* None */ ? `<kbd>Show ${stepCount}</kbd>` : `<kbd>Show ${stepCount} and screenshots</kbd>`;
910
948
  }
@@ -933,9 +971,43 @@ function renderStepScreenshots(step, position, screenshotDetail) {
933
971
  `| ${screenshotImage(step.screenshotUrl, STEP_PAIR_IMAGE_WIDTH, `Step ${position} before`)} | ${screenshotImage(step.afterScreenshotUrl, STEP_PAIR_IMAGE_WIDTH, `Step ${position} after`)} |`
934
972
  ];
935
973
  }
974
+ function runSummaryLabel(runSummary) {
975
+ const statusLabel = runSummary.status ? `${RUN_SUMMARY_VERDICT_STATUS_LABELS[runSummary.status]} \u2014 ` : "";
976
+ return `${RUN_SUMMARY_MARKER} Summary \xB7 ${statusLabel}${escapeHtml(singleLine(runSummary.headline))}`;
977
+ }
978
+ function runSummaryVerdictLines(runSummary) {
979
+ const labelledTexts = [
980
+ ["Verdict", runSummary.verdict],
981
+ ["Blocking issues", runSummary.blockingIssues]
982
+ ];
983
+ return labelledTexts.filter((labelled) => Boolean(labelled[1])).map(([label, text]) => `**${label}:** ${escapeHtml(singleLine(text))}`);
984
+ }
985
+ function renderRunSummaryRow(runSummary, screenshotDetail) {
986
+ if (!runSummary) {
987
+ return null;
988
+ }
989
+ const isTextOnly = screenshotDetail === "none" /* None */;
990
+ if (!runSummary.isRecorded) {
991
+ return isTextOnly ? `- ${MISSING_RUN_SUMMARY_TEXT}` : `
992
+ ${MISSING_RUN_SUMMARY_TEXT}`;
993
+ }
994
+ const verdictLines = runSummaryVerdictLines(runSummary);
995
+ if (isTextOnly) {
996
+ return [`- ${runSummaryLabel(runSummary)}`, ...verdictLines.map((line) => ` - ${line}`)].join("\n");
997
+ }
998
+ const blocks = runSummary.screenshotUrl ? [...verdictLines, screenshotImage(runSummary.screenshotUrl, STEP_IMAGE_WIDTH, "Run summary")] : verdictLines;
999
+ if (blocks.length === 0) {
1000
+ return `
1001
+ ${runSummaryLabel(runSummary)}`;
1002
+ }
1003
+ const body = blocks.flatMap((block, i) => i === 0 ? [block] : ["", block]);
1004
+ return [`<details><summary>${runSummaryLabel(runSummary)}</summary>`, ...indented(body), "</details>"].join("\n");
1005
+ }
936
1006
  function renderSteps(test, screenshotDetail) {
937
1007
  const { steps } = test;
938
- if (steps.length === 0) {
1008
+ const summaryRow = renderRunSummaryRow(test.runSummary, screenshotDetail);
1009
+ const summaryRows = summaryRow ? [summaryRow] : [];
1010
+ if (steps.length === 0 && summaryRows.length === 0) {
939
1011
  return null;
940
1012
  }
941
1013
  const isTextOnly = screenshotDetail === "none" /* None */;
@@ -946,7 +1018,7 @@ function renderSteps(test, screenshotDetail) {
946
1018
  ].join("\n");
947
1019
  const heading = isTextOnly ? ["**Steps**", ""] : ["**Steps** \u2014 click a step to see its screenshots", ""];
948
1020
  if (steps.length <= STEP_LIST_ELISION_THRESHOLD) {
949
- return [...heading, ...steps.map((step, i) => collapsible(step, i + 1))];
1021
+ return [...heading, ...steps.map((step, i) => collapsible(step, i + 1)), ...summaryRows];
950
1022
  }
951
1023
  const tailStart = steps.length - STEP_LIST_TAIL_COUNT;
952
1024
  const hidden = tailStart - STEP_LIST_HEAD_COUNT;
@@ -956,7 +1028,8 @@ function renderSteps(test, screenshotDetail) {
956
1028
  "",
957
1029
  `_\u2026 ${hidden} more ${hidden === 1 ? "step" : "steps"} \u2014 ${dashboardLink(test)}_`,
958
1030
  "",
959
- ...steps.slice(tailStart).map((step, i) => collapsible(step, tailStart + i + 1))
1031
+ ...steps.slice(tailStart).map((step, i) => collapsible(step, tailStart + i + 1)),
1032
+ ...summaryRows
960
1033
  ];
961
1034
  }
962
1035
  function renderResultTable(entry) {
@@ -1106,6 +1179,10 @@ function collectGsUrls(report) {
1106
1179
  if (test.endingScreenshotUrl && isGsUrl(test.endingScreenshotUrl)) {
1107
1180
  seen.add(test.endingScreenshotUrl);
1108
1181
  }
1182
+ const runSummaryScreenshotUrl = test.runSummary?.isRecorded ? test.runSummary.screenshotUrl : void 0;
1183
+ if (runSummaryScreenshotUrl && isGsUrl(runSummaryScreenshotUrl)) {
1184
+ seen.add(runSummaryScreenshotUrl);
1185
+ }
1109
1186
  }
1110
1187
  return Array.from(seen);
1111
1188
  }
@@ -1156,6 +1233,12 @@ function remapTest(test, urlMap) {
1156
1233
  remapped.endingScreenshotUrl = resolved;
1157
1234
  }
1158
1235
  }
1236
+ if (test.runSummary?.isRecorded && test.runSummary.screenshotUrl) {
1237
+ const resolved = urlMap.get(test.runSummary.screenshotUrl);
1238
+ if (resolved) {
1239
+ remapped.runSummary = { ...test.runSummary, screenshotUrl: resolved };
1240
+ }
1241
+ }
1159
1242
  return remapped;
1160
1243
  }
1161
1244
  async function resolveGsScreenshotUrls(report, opts) {
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-TM6IZEKH.js';
2
+ import { runCli } from './chunk-S3PUEFGM.js';
3
3
  import './chunk-AEJM2CBK.js';
4
4
 
5
5
  // src/cli/main.ts
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-TM6IZEKH.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-S3PUEFGM.js';
2
2
  export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-AEJM2CBK.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.286",
4
+ "version": "5.32.0-staging.288",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.32.0-staging.286",
7
+ "@muggleai/works@5.32.0-staging.288",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.32.0-staging.286",
3
+ "version": "5.32.0-staging.288",
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.286",
5
+ "version": "5.32.0-staging.288",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.32.0-staging.286",
7
+ "@muggleai/works@5.32.0-staging.288",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -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. Its check-run summary names each failed or inconclusive case with the failing step and a link to the run; the walkthrough comment's hidden `muggle-e2e-result` record carries the same cases with their test case ids. Repair each, re-run the **whole** E2E suite, and settle the walkthrough comment with the new result — editing the comment re-runs the check. A summary saying the comment is still empty means no run was ever posted: 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. Deterministic: it reads the comment, so re-running it unchanged returns the same verdict. |
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 — any other E2E-in-CI, build/deploy infra, or unknown | Do **not** attempt; record for escalation. |
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. |
@@ -6,4 +6,4 @@ The studio publishes every completed run — pass or fail — to the cloud durin
6
6
 
7
7
  ## Screenshots
8
8
 
9
- Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. `afterScreenshotUrl` is the page after the step acted: the next step's `operation.screenshotUrl` among steps that have one, and for the last such step the `summaryStep.operation.screenshotUrl` (rule and skipped operations in [`../../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
9
+ Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. `afterScreenshotUrl` is the page after the step acted: the next step's `operation.screenshotUrl` among steps that have one, and for the last such step the `summaryStep.operation.screenshotUrl` (rule and skipped operations in [`../../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. From the same response retain the run's closing halt step, `summaryStep`, as `runSummary` — or `{ isRecorded: false }` when the script has none — mapped per the `runSummary` rule in the same guide. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
@@ -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 four bucket strings; `userAction` is the user's pick.
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 had nobody to ask, or the iteration cap ran out. `review_ids` is empty.
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
 
@@ -168,7 +168,8 @@ For each test case:
168
168
  - testScriptId: `<id>`
169
169
  - runId: `<id>`
170
170
  - viewUrl: `<url>`
171
- - steps: `[{ stepIndex, action, description, screenshotUrl }, ...]`
171
+ - steps: `[{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }, ...]`
172
+ - runSummary: the run's closing halt step, `{ isRecorded: true, headline, status, verdict, blockingIssues, screenshotUrl }` or `{ isRecorded: false }` when the run has no `summaryStep` (mapping in `../muggle-pr-visual-walkthrough/e2e-report-assembly.md`)
172
173
 
173
174
  **Failed:** (count)
174
175
  - (test case name):
@@ -180,7 +181,8 @@ For each test case:
180
181
  - viewUrl: `<url>`
181
182
  - failureStepIndex: `<index>`
182
183
  - error: `<message>`
183
- - steps: `[{ stepIndex, action, description, screenshotUrl }, ...]`
184
+ - steps: `[{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }, ...]`
185
+ - runSummary: as for Passed
184
186
  - artifactsDir: `<path>` (for local debugging)
185
187
 
186
188
  **Inconclusive:** (count) — use for runs that couldn't yield a pass/fail signal: no replayable script, environment precondition unmet, prerequisites unmet (Step 3.5), infra error, agent stalled on auth/cookie banner before reaching the assertion, missing secrets. The product is **not** implicated — that's `failed`, not `inconclusive`.
@@ -191,7 +193,8 @@ For each test case:
191
193
  - runId: `<id>` (synthesize a UUID if no run started)
192
194
  - viewUrl: `<url>` (project-level run-results fallback when no specific run URL exists)
193
195
  - reason: `<one short sentence>`
194
- - steps: `[{ stepIndex, action, description, screenshotUrl }, ...]` (empty only when the run produced no steps)
196
+ - steps: `[{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }, ...]` (empty only when the run produced no steps)
197
+ - runSummary: as for Passed
195
198
 
196
199
  **Deliverables:** (count) — one entry per deliverable check from Step 5, in the report-entry shape of [`../_shared/deliverable-categories.md`](../_shared/deliverable-categories.md#report-entry). Omitted when the scope planned none.
197
200