@muggleai/works 5.36.0-staging.335 → 5.36.0-staging.337
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/AGENTS.md +1 -0
- package/README.md +2 -1
- package/dist/{chunk-KGTP3CED.js → chunk-HTCBHSL6.js} +132 -40
- package/dist/{chunk-5E46QHM6.js → chunk-OIFLV2QN.js} +499 -157
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-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/README.md +1 -0
- package/dist/plugin/commands/mbugreport.md +7 -0
- package/dist/plugin/hooks/README.md +1 -1
- package/dist/plugin/scripts/guardrail-watch-follow-through-gate.sh +22 -7
- package/dist/plugin/scripts/guardrails.mjs +21 -3
- package/dist/plugin/scripts/pr-watch-arm.sh +11 -6
- package/dist/plugin/scripts/pr-watch-loop.sh +3 -2
- package/dist/plugin/scripts/pr-watch-verdict.mjs +1 -0
- package/dist/plugin/skills/CLAUDE.md +1 -1
- package/dist/plugin/skills/_aliases.json +2 -1
- package/dist/plugin/skills/do/audit-trail.md +1 -1
- package/dist/plugin/skills/do/e2e-repair.md +1 -1
- package/dist/plugin/skills/do/open-prs/forward.md +17 -15
- package/dist/plugin/skills/do/open-prs.md +1 -1
- package/dist/plugin/skills/mbugreport/SKILL.md +9 -0
- package/dist/plugin/skills/mbugreport/agents/openai.yaml +7 -0
- package/dist/plugin/skills/muggle/SKILL.md +1 -0
- package/dist/plugin/skills/muggle-bug-report/SKILL.md +37 -0
- package/dist/plugin/skills/muggle-bug-report/ops/file.md +68 -0
- package/dist/plugin/skills/muggle-bug-report/ops/list.md +30 -0
- package/dist/plugin/skills/muggle-bug-report/ops/reply.md +38 -0
- package/dist/plugin/skills/muggle-bug-report/ops/status.md +45 -0
- package/dist/plugin/skills/muggle-pr-followup/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-pr-followup/arm-watcher.md +2 -2
- package/dist/plugin/skills/muggle-pr-followup/contract.md +6 -0
- package/dist/plugin/skills/muggle-pr-followup/reconcile.md +1 -1
- package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +8 -2
- package/dist/release-manifest.json +4 -4
- package/dist/{src-2OO6JDTQ.js → src-5Z6EIGHT.js} +1 -1
- 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/README.md +1 -0
- package/plugin/commands/mbugreport.md +7 -0
- package/plugin/hooks/README.md +1 -1
- package/plugin/scripts/guardrail-watch-follow-through-gate.sh +22 -7
- package/plugin/scripts/guardrails.mjs +21 -3
- package/plugin/scripts/pr-watch-arm.sh +11 -6
- package/plugin/scripts/pr-watch-loop.sh +3 -2
- package/plugin/scripts/pr-watch-verdict.mjs +1 -0
- package/plugin/skills/CLAUDE.md +1 -1
- package/plugin/skills/_aliases.json +2 -1
- package/plugin/skills/do/audit-trail.md +1 -1
- package/plugin/skills/do/e2e-repair.md +1 -1
- package/plugin/skills/do/open-prs/forward.md +17 -15
- package/plugin/skills/do/open-prs.md +1 -1
- package/plugin/skills/mbugreport/SKILL.md +9 -0
- package/plugin/skills/mbugreport/agents/openai.yaml +7 -0
- package/plugin/skills/muggle/SKILL.md +1 -0
- package/plugin/skills/muggle-bug-report/SKILL.md +37 -0
- package/plugin/skills/muggle-bug-report/ops/file.md +68 -0
- package/plugin/skills/muggle-bug-report/ops/list.md +30 -0
- package/plugin/skills/muggle-bug-report/ops/reply.md +38 -0
- package/plugin/skills/muggle-bug-report/ops/status.md +45 -0
- package/plugin/skills/muggle-pr-followup/SKILL.md +1 -1
- package/plugin/skills/muggle-pr-followup/arm-watcher.md +2 -2
- package/plugin/skills/muggle-pr-followup/contract.md +6 -0
- package/plugin/skills/muggle-pr-followup/reconcile.md +1 -1
- package/plugin/skills/muggle-pr-followup/state-schemas.md +8 -2
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-
|
|
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-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-HTCBHSL6.js';
|
|
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-OIFLV2QN.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
4
|
-
"version": "5.36.0-staging.
|
|
4
|
+
"version": "5.36.0-staging.337",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
5
|
-
"version": "5.36.0-staging.
|
|
5
|
+
"version": "5.36.0-staging.337",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
package/dist/plugin/README.md
CHANGED
|
@@ -49,6 +49,7 @@ Type `muggle` to discover the full command family.
|
|
|
49
49
|
| `/muggle:muggle-pr-visual-walkthrough` | `/mpr` | Post per-test-case dashboard links, step-by-step screenshots, and a pass/fail summary to a PR. |
|
|
50
50
|
| `/muggle:muggle-pr-followup` | `/mprfollowup` | Watch one PR's review thread and dispatch the work to address incoming feedback. |
|
|
51
51
|
| `/muggle:muggle-feedback` | `/mfeedback` | Flag a generated action script, or one step in it, as wrong so Muggle can analyze and regenerate affected scripts. |
|
|
52
|
+
| `/muggle:muggle-bug-report` | `/mbugreport` | Report a bug in Muggle AI itself to the Muggle team, with harness context you review first; list, check or reply to your reports. |
|
|
52
53
|
| `/muggle:muggle-preferences` | `/mprefs` | View, set, or reset the preferences that gate Muggle Test behavior. |
|
|
53
54
|
| `/muggle:muggle-status` | `/mstatus` | Health check for Electron browser test runner, MCP server, and authentication. |
|
|
54
55
|
| `/muggle:muggle-repair` | `/mrepair` | Diagnose and fix broken installation automatically. |
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: File, list, check, or reply to a Muggle AI bug report (alias for /muggle-bug-report)
|
|
3
|
+
argument-hint: [optional description of what went wrong, or list / status BUG-1234 / reply]
|
|
4
|
+
allowed-tools: [Skill]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Invoke the `muggle-bug-report` skill via the Skill tool. Forward `$ARGUMENTS` as the skill's `args`.
|
|
@@ -52,7 +52,7 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
52
52
|
| `Stop` | `guardrail-e2e-gate.sh` | **enforce** | unit tests passed this session, no E2E ran yet, and no skip was recorded | `autoE2ETest` | **block** the turn until E2E runs via `muggle-test` or a `MUGGLE_E2E_SKIP` marker records a legitimate skip (full message once, one-line reminders after; releases after 3 blocks, leaving the PR's walkthrough comment unsettled). Quiet while a background acceptance-tester is in flight |
|
|
53
53
|
| `Stop` | `guardrail-terminal-gate.sh` | **enforce** | a PR went terminal this session and the next-options offer hasn't run since — an AskUserQuestion, or, while the session owns an open PR's watch slot, a closing message that asks the user | — | **block** the turn until the post-merge handoff runs (full message once, one-line reminders after; releases after 3 blocks; nothing but the offer resets the counter) |
|
|
54
54
|
| `Stop` | `guardrail-watch-gate.sh` | **enforce** | a PR opened this session that is still open and has no live watch — no session slot for it is terminal, stopped by its owner, or carries a `watch-heartbeat` touched within 15 minutes; a slot that is only seeded does not count | `autoWatchPR` | **block** the turn until the watch is armed per `muggle-pr-followup`'s `arm-watcher.md` or a `MUGGLE_WATCH_SKIP` marker records a legitimate skip (releases after 3 blocks). A PR clears once the session sees it go terminal or a provider lookup reports it merged or closed — what lets a PR whose slot post-merge cleanup deleted through. The lookup runs in a detached scan queued at turn end; a PR it has not reached yet still blocks, and one it could not reach fails open |
|
|
55
|
-
| `Stop` | `guardrail-watch-follow-through-gate.sh` | **enforce** | a `muggle-pr-followup` watch this session owns (the slot's `owner.json`) recorded due work in `watch-due.env` — a branch behind or conflicting with its base, or a head whose checks settled red — and `last_seen.json` records no attempt for it: no `conflict_resolve_attempts` entry for the rebase key (enforced under `autoRebase=always` while catch-up budget is left), no `ci_fix_attempts` entry for the red head. An escalation entry with no attempt behind it counts for nothing, and re-arming the watch changes nothing | `autoRebase` | **block** the turn, naming each PR and its `/muggle-do rebase` or `fix ci` dispatch. No release after N blocks: only a recorded attempt, a newer head in the slot's `prs.json`, or the user's literal `HOLD WATCH #<pr-number>` clears it. The hold must come from a turn the user typed — never a tool result, a loaded skill, a hook's message, a task notification, a compaction summary, or the agent's own text — and is kept for the session once read. Reads local files only, never a provider: the pre-filter is a builtins glob for a non-empty `watch-due.env` whose `owner.json` names the session, so Node starts only when a slot has due work |
|
|
55
|
+
| `Stop` | `guardrail-watch-follow-through-gate.sh` | **enforce** | a `muggle-pr-followup` watch this session owns (the slot's `owner.json`) recorded due work in `watch-due.env` — a branch behind or conflicting with its base, or a head whose checks settled red — and `last_seen.json` records no attempt for it: no `conflict_resolve_attempts` entry for the rebase key (enforced under `autoRebase=always` while catch-up budget is left), no `ci_fix_attempts` entry for the red head. An escalation entry with no attempt behind it counts for nothing, and re-arming the watch changes nothing. Also fires when the slot holds a muggle watch service report the session was never woken for (`watch-service.queued.out`, or an `EVENT`/`TERMINAL` line in an exited service loop's `watch-service.out`). A PR whose `last_seen.json` sets `forward_stages_in_flight` owes nothing | `autoRebase` | **block** the turn, naming each PR and its `/muggle-do rebase` or `fix ci` dispatch, or for an undelivered report its `/muggle:muggle-pr-followup <slug> <n> --wake=follow-through` tick, which the re-arm it ends on clears. No release after N blocks: only a recorded attempt, a newer head in the slot's `prs.json`, or the user's literal `HOLD WATCH #<pr-number>` clears it. The hold must come from a turn the user typed — never a tool result, a loaded skill, a hook's message, a task notification, a compaction summary, or the agent's own text — and is kept for the session once read. Reads local files only, never a provider: the pre-filter is a builtins glob for a non-empty `watch-due.env` or an undelivered service report whose `owner.json` names the session, so Node starts only when a slot has due work |
|
|
56
56
|
| `Stop` | `guardrail-walkthrough-gate.sh` | **enforce** | an E2E acceptance run happened this session and a PR in play — opened this session or on the working branch — carries no walkthrough in its body or comments, or only one under a "new E2E run in progress" banner; or an E2E skip was accepted and a PR it covers still shows the empty placeholder instead of the skip's record | `postPRVisualWalkthrough` | **block** the turn until the walkthrough is posted via `muggle-pr-visual-walkthrough` or a `MUGGLE_WALKTHROUGH_SKIP` marker records a legitimate skip. For a PR an accepted E2E skip covers, the block hands over the foreground `settle-walkthrough-skipped <pr> <session>` command, which prints `{"settled":true}` once the PR reads back the skip, and re-queues the detached write; a PR the skip does not cover is a different change and is told to run its own E2E or declare its own skip from its tree (releases after 3 blocks; an unreachable PR fails open to not-owed). A skip accepted before its PR existed is written straight into the PR's slot when it opens for the same repo and branch. The provider lookups run in a detached scan, queued when the gate arms, when a PR opens, and at each turn end; the gate decides on the last scan for the session's current PRs, begun after the last observed post, and stays open until one lands. Each PR is checked for its own walkthrough: a post to one PR settles only that one, and opening another re-arms the check. A PR whose own background run is in flight is set aside |
|
|
57
57
|
| `Stop` | `guardrail-stage-gate.sh` | **enforce** | a skill invoked this session declared `mandatoryStages` and one of those files was never opened | — | **block** the turn until the stages are read or a `MUGGLE_STAGE_SKIP` marker records a legitimate skip (releases after 3 blocks) |
|
|
58
58
|
| `Stop` | `guardrail-debug-path-gate.sh` | **enforce** | a local execution returned a non-passing run this session and nothing routed it through `_shared/debug-failed-run.md` | — | **block** the turn until the run is diagnosed (its `*-failure-classified` emit or feedback naming it) or a `MUGGLE_DEBUG_SKIP: <runId> <reason>` marker clears that run (releases after 3 blocks, leaving the PR's walkthrough comment unsettled). Quiet while a background acceptance-tester is in flight — its failed runs land in this session's state and it debugs them itself |
|
|
@@ -4,15 +4,18 @@ set -uo pipefail
|
|
|
4
4
|
# watcher follow-through gate (Stop). When a muggle-pr-followup watch this
|
|
5
5
|
# session owns has recorded due work — a rebase on a stale branch, a fix on a red
|
|
6
6
|
# head — and no attempt for it is recorded, block the turn end and name the
|
|
7
|
-
# dispatch.
|
|
7
|
+
# dispatch. A muggle watch service report the session was never woken for blocks
|
|
8
|
+
# the same way, naming its tick, so a busy owner still hears every slot it owns.
|
|
9
|
+
# Released only by the attempt itself (for a report, the re-arm its tick ends
|
|
10
|
+
# on), a new head, or the user's own
|
|
8
11
|
# HOLD WATCH #<pr-number>: a session once sat on both for a day, re-arming its
|
|
9
12
|
# watch and asking "needs input" at every wake, and every prose rule against it
|
|
10
13
|
# held only as long as the session agreed with it.
|
|
11
14
|
#
|
|
12
15
|
# Synchronous (only a sync Stop hook can block the turn end) and fires on every
|
|
13
16
|
# turn end, so the pre-filter is bash builtins only: a glob over the slots for a
|
|
14
|
-
# non-empty watch-due.env (the watch loop empties it when nothing is due)
|
|
15
|
-
# owner.json names this session. No slot has one on nearly every turn, so Node
|
|
17
|
+
# non-empty watch-due.env (the watch loop empties it when nothing is due) or an
|
|
18
|
+
# undelivered service report, whose owner.json names this session. No slot has one on nearly every turn, so Node
|
|
16
19
|
# never starts. The attempt counters, preferences, and the hold are judged in
|
|
17
20
|
# guardrails.mjs, from local files alone — no provider call. Degrades to {}.
|
|
18
21
|
|
|
@@ -30,11 +33,11 @@ guardrail_wants() {
|
|
|
30
33
|
# A backslash in a glob escapes the next character, so a native Windows HOME
|
|
31
34
|
# would match nothing; forward slashes name the same directory.
|
|
32
35
|
local sessions_dir="${GUARDRAIL_HOME//\\//}/.muggle-ai/muggle-do/sessions"
|
|
33
|
-
local
|
|
34
|
-
for
|
|
35
|
-
|
|
36
|
-
slot_dir="${due_file%/watch-due.env}"
|
|
36
|
+
local slot_dir owner_json
|
|
37
|
+
for slot_dir in "$sessions_dir"/*/; do
|
|
38
|
+
slot_dir="${slot_dir%/}"
|
|
37
39
|
[[ $slot_dir == *.stopped ]] && continue
|
|
40
|
+
guardrail_slot_has_news "$slot_dir" || continue
|
|
38
41
|
[[ -f $slot_dir/owner.json ]] || continue
|
|
39
42
|
owner_json=""
|
|
40
43
|
IFS= read -r -d '' owner_json <"$slot_dir/owner.json" || true
|
|
@@ -43,6 +46,18 @@ guardrail_wants() {
|
|
|
43
46
|
return 1
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
# Whether a slot holds anything the gate judges: due work the watch recorded, or
|
|
50
|
+
# a muggle watch service report its owner was never woken for — queued while a
|
|
51
|
+
# fresh loop watches, or the exited service loop's own EVENT/TERMINAL line.
|
|
52
|
+
guardrail_slot_has_news() {
|
|
53
|
+
local slot_dir="$1" service_output=""
|
|
54
|
+
[[ -s $slot_dir/watch-due.env || -s $slot_dir/watch-service.queued.out ]] && return 0
|
|
55
|
+
[[ -s $slot_dir/watch-service.out ]] || return 1
|
|
56
|
+
IFS= read -r -d '' service_output <"$slot_dir/watch-service.out" || true
|
|
57
|
+
service_output=$'\n'"$service_output"
|
|
58
|
+
[[ $service_output == *$'\n'"EVENT "* || $service_output == *$'\n'"TERMINAL "* ]]
|
|
59
|
+
}
|
|
60
|
+
|
|
46
61
|
if guardrail_is_hook_script; then
|
|
47
62
|
guardrail_run_standalone "$GUARDRAIL_SUBCOMMAND"
|
|
48
63
|
fi
|
|
@@ -933,6 +933,11 @@ var WATCH_DUE_FILE_NAME = "watch-due.env";
|
|
|
933
933
|
var WATCH_DUE_HEAD_FIELD = "HEAD";
|
|
934
934
|
var WATCH_DUE_REBASE_FIELD = "REBASE_DUE";
|
|
935
935
|
var WATCH_DUE_CI_RED_FIELD = "CI_RED_HEAD";
|
|
936
|
+
var SERVICE_LOOP_OUTPUT_FILE = "watch-service.out";
|
|
937
|
+
var SERVICE_LOOP_QUEUED_WAKE_FILE = "watch-service.queued.out";
|
|
938
|
+
var SERVICE_LOOP_EVENT_LINE_PREFIX = "EVENT ";
|
|
939
|
+
var SERVICE_LOOP_TERMINAL_LINE_PREFIX = "TERMINAL ";
|
|
940
|
+
var OWNER_WAKE_LINE_PREFIXES = [SERVICE_LOOP_TERMINAL_LINE_PREFIX, SERVICE_LOOP_EVENT_LINE_PREFIX];
|
|
936
941
|
var ENV_FILE_LINE = /^([A-Z_]+)="?([^"]*)"?$/;
|
|
937
942
|
var USER_PREFERENCES_PATH_SEGMENTS = [".muggle-ai", "preferences.json"];
|
|
938
943
|
var PREFERENCE_DEFAULTS_PATH_SEGMENTS = ["config", "preference-defaults.json"];
|
|
@@ -993,6 +998,13 @@ function parseWatchDueRecord(watchDueText) {
|
|
|
993
998
|
};
|
|
994
999
|
return dueRecord.rebaseDueKey || dueRecord.ciRedHeadSha ? dueRecord : null;
|
|
995
1000
|
}
|
|
1001
|
+
function undeliveredWakeLineIn(slotPath) {
|
|
1002
|
+
for (const reportFile of [SERVICE_LOOP_QUEUED_WAKE_FILE, SERVICE_LOOP_OUTPUT_FILE]) {
|
|
1003
|
+
const wakeLine = readSlotText(join(slotPath, reportFile)).split(/\r?\n/).find((line) => OWNER_WAKE_LINE_PREFIXES.some((prefix) => line.startsWith(prefix)));
|
|
1004
|
+
if (wakeLine !== void 0) return wakeLine;
|
|
1005
|
+
}
|
|
1006
|
+
return void 0;
|
|
1007
|
+
}
|
|
996
1008
|
|
|
997
1009
|
// src/guardrails/watchArmed.ts
|
|
998
1010
|
var WATCH_SKIP_MARKER = /^\s*echo\s+["']?MUGGLE_WATCH_SKIP\b/;
|
|
@@ -1472,7 +1484,8 @@ function isDueRecordSuperseded(slotPath, slotPr, dueRecord) {
|
|
|
1472
1484
|
function owedWorkInSlot(slotPath, slug, sessionId2, preferences) {
|
|
1473
1485
|
if (slug.endsWith(STOPPED_SLOT_SUFFIX)) return [];
|
|
1474
1486
|
const dueRecord = parseWatchDueRecord(readSlotText(join(slotPath, WATCH_DUE_FILE_NAME)));
|
|
1475
|
-
|
|
1487
|
+
const undeliveredWakeLine = undeliveredWakeLineIn(slotPath);
|
|
1488
|
+
if (!dueRecord && undeliveredWakeLine === void 0) return [];
|
|
1476
1489
|
if (readJsonRecord(join(slotPath, OWNER_FILE_NAME)).session_id !== sessionId2) return [];
|
|
1477
1490
|
if (existsSync(join(slotPath, RESULT_FILE_NAME))) return [];
|
|
1478
1491
|
const slotPr = readSlotPr(slotPath);
|
|
@@ -1480,8 +1493,8 @@ function owedWorkInSlot(slotPath, slug, sessionId2, preferences) {
|
|
|
1480
1493
|
const prNumber = slotPr?.number;
|
|
1481
1494
|
if (!slotPr?.repo || typeof prUrl !== "string" || typeof prNumber !== "number") return [];
|
|
1482
1495
|
if (TERMINAL_SLOT_PR_STATES.includes((slotPr.state ?? "").toLowerCase())) return [];
|
|
1483
|
-
if (isDueRecordSuperseded(slotPath, slotPr, dueRecord)) return [];
|
|
1484
1496
|
const lastSeenEntry = lastSeenEntryFor(readSlotText(join(slotPath, LAST_SEEN_FILE_NAME)), `${slotPr.repo}#${prNumber}`);
|
|
1497
|
+
if (lastSeenEntry.forward_stages_in_flight === true) return [];
|
|
1485
1498
|
const workOn = (kind, dueOn) => ({
|
|
1486
1499
|
kind,
|
|
1487
1500
|
slug,
|
|
@@ -1490,6 +1503,8 @@ function owedWorkInSlot(slotPath, slug, sessionId2, preferences) {
|
|
|
1490
1503
|
dueOn
|
|
1491
1504
|
});
|
|
1492
1505
|
const owed = [];
|
|
1506
|
+
if (undeliveredWakeLine !== void 0) owed.push(workOn("pending-wake" /* PendingWake */, undeliveredWakeLine));
|
|
1507
|
+
if (!dueRecord || isDueRecordSuperseded(slotPath, slotPr, dueRecord)) return owed;
|
|
1493
1508
|
const isRebaseOwed = dueRecord.rebaseDueKey !== "" && preferences.autoRebase === ALWAYS_PREFERENCE_VALUE && !isRebaseBudgetExhausted(lastSeenEntry, preferences.maxCatchUpRebases) && !isRebaseKeyAttempted(lastSeenEntry, dueRecord.rebaseDueKey);
|
|
1494
1509
|
if (isRebaseOwed) owed.push(workOn("rebase" /* Rebase */, dueRecord.rebaseDueKey));
|
|
1495
1510
|
if (dueRecord.ciRedHeadSha !== "" && !isCiHeadAttempted(lastSeenEntry, dueRecord.ciRedHeadSha)) {
|
|
@@ -3461,6 +3476,9 @@ function watchGate() {
|
|
|
3461
3476
|
}
|
|
3462
3477
|
function owedWatchWorkLine(work) {
|
|
3463
3478
|
const muggleDo = muggleSkill("/muggle-do");
|
|
3479
|
+
if (work.kind === "pending-wake" /* PendingWake */) {
|
|
3480
|
+
return `- PR #${work.prNumber} (${work.prUrl}): the muggle watch reported \`${work.dueOn}\` and it never reached this session: run \`${muggleSkill("/muggle:muggle-pr-followup")} ${work.slug} ${work.prNumber} --wake=follow-through\`.`;
|
|
3481
|
+
}
|
|
3464
3482
|
if (work.kind === "rebase" /* Rebase */) {
|
|
3465
3483
|
return `- PR #${work.prNumber} (${work.prUrl}) is behind or conflicting with its base (key ${work.dueOn}) and no rebase was attempted: dispatch \`${muggleDo} rebase on ${work.prUrl} slug=${work.slug}\`.`;
|
|
3466
3484
|
}
|
|
@@ -3492,7 +3510,7 @@ function watchFollowThroughGate() {
|
|
|
3492
3510
|
const holdInstruction = `Only the user can hold it: their own message containing \`${WATCH_HOLD_PHRASE_PREFIX}<pr-number>\` for that PR. Ask if you must; never decide it for them.`;
|
|
3493
3511
|
const reason = decision.blockCount === 1 ? `Do not end the turn yet. A muggle-pr-followup watch this session owns found work due that nothing acted on:
|
|
3494
3512
|
${owedList}
|
|
3495
|
-
autoRebase=always makes a due rebase binding, and how long a CI run or an eval takes is never a reason to wait. Act now: run the cycle the tick dispatches \u2014 if it finds actionable review feedback it dispatches that first. That cycle's first step records its attempt (conflict_resolve_attempts / ci_fix_attempts), which, like a new head, clears this. Writing the count without running the cycle \u2014 or for an E2E run queued for a different PR \u2014 leaves the PR red and the watch quiet. An escalation entry with no attempt behind it does not clear this, and neither does re-arming the watch. ${holdInstruction}` : `Watcher work still owed (reminder ${decision.blockCount}):
|
|
3513
|
+
autoRebase=always makes a due rebase binding, and how long a CI run or an eval takes is never a reason to wait. Act now: run the cycle the tick dispatches \u2014 if it finds actionable review feedback it dispatches that first. That cycle's first step records its attempt (conflict_resolve_attempts / ci_fix_attempts), which, like a new head, clears this. Writing the count without running the cycle \u2014 or for an E2E run queued for a different PR \u2014 leaves the PR red and the watch quiet. An escalation entry with no attempt behind it does not clear this, and neither does re-arming the watch. An undelivered watch report clears once the tick it names re-arms the watch from this session. ${holdInstruction}` : `Watcher work still owed (reminder ${decision.blockCount}):
|
|
3496
3514
|
${owedList}
|
|
3497
3515
|
${holdInstruction}`;
|
|
3498
3516
|
return blockStop(reason, host);
|
|
@@ -23,7 +23,7 @@ set -uo pipefail
|
|
|
23
23
|
|
|
24
24
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
25
25
|
|
|
26
|
-
slot="" repo="" pr_number="" base_branch="" exec_loop=1
|
|
26
|
+
slot="" repo="" pr_number="" base_branch="" owner_session="" exec_loop=1
|
|
27
27
|
|
|
28
28
|
while [ $# -gt 0 ]; do
|
|
29
29
|
case "$1" in
|
|
@@ -31,13 +31,14 @@ while [ $# -gt 0 ]; do
|
|
|
31
31
|
--repo) repo="$2"; shift 2 ;;
|
|
32
32
|
--pr) pr_number="$2"; shift 2 ;;
|
|
33
33
|
--base) base_branch="$2"; shift 2 ;;
|
|
34
|
+
--owner) owner_session="$2"; shift 2 ;;
|
|
34
35
|
--no-exec) exec_loop=0; shift ;;
|
|
35
36
|
*) echo "pr-watch-arm: unknown argument $1" >&2; exit 2 ;;
|
|
36
37
|
esac
|
|
37
38
|
done
|
|
38
39
|
|
|
39
40
|
if [ -z "$slot" ] || [ -z "$repo" ] || [ -z "$pr_number" ] || [ -z "$base_branch" ]; then
|
|
40
|
-
echo "usage: pr-watch-arm.sh --slot <dir> --repo <owner/repo> --pr <n> --base <branch> [--no-exec]" >&2
|
|
41
|
+
echo "usage: pr-watch-arm.sh --slot <dir> --repo <owner/repo> --pr <n> --base <branch> [--owner <session-id>] [--no-exec]" >&2
|
|
41
42
|
exit 2
|
|
42
43
|
fi
|
|
43
44
|
|
|
@@ -199,17 +200,21 @@ fi
|
|
|
199
200
|
|
|
200
201
|
watch_record_due_work "$slot" "$head_sha" "$recorded_rebase_due_key" "$ci_red_head"
|
|
201
202
|
|
|
202
|
-
# Claim the slot for
|
|
203
|
+
# Claim the slot for its owner: the session --owner names, else this session.
|
|
204
|
+
# The muggle watch service arms outside every session, so it passes the owner
|
|
205
|
+
# the slot already records; without it every loop the service restarted left
|
|
206
|
+
# its slot unowned. watcher_lease_is_foreign reads an absent
|
|
203
207
|
# owner.json as "not foreign", so a slot armed without one leases itself to a
|
|
204
208
|
# live PID nothing can classify: once the arming session dies its watcher polls
|
|
205
209
|
# into a closed pipe, and every later arm skips the slot as already owned until
|
|
206
210
|
# the loop's monitor window ends it. An unset id writes nothing rather than a placeholder
|
|
207
211
|
# — reconcile reads any id it does not recognise as another session's claim, and
|
|
208
212
|
# a bogus one would strand the slot exactly as an absent file does.
|
|
209
|
-
|
|
213
|
+
[ -n "$owner_session" ] || owner_session="${CLAUDE_CODE_SESSION_ID:-}"
|
|
214
|
+
if [ -n "$owner_session" ]; then
|
|
210
215
|
claimed_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
211
216
|
printf '{\n "session_id": "%s",\n "claimed_at": "%s"\n}\n' \
|
|
212
|
-
"$
|
|
217
|
+
"$owner_session" "$claimed_at" > "${slot}/owner.json"
|
|
213
218
|
# Register the slot with the muggle watch service, which restarts the loop
|
|
214
219
|
# outside every session if it dies and wakes this owner only when that loop
|
|
215
220
|
# reports on this PR. It lives in the slot, so a stop rename or a finalize
|
|
@@ -217,7 +222,7 @@ if [ -n "${CLAUDE_CODE_SESSION_ID:-}" ]; then
|
|
|
217
222
|
printf '{\n "registered_at": "%s",\n "registered_by": "pr-watch-arm"\n}\n' \
|
|
218
223
|
"$claimed_at" > "${slot}/watch-registration.json"
|
|
219
224
|
else
|
|
220
|
-
echo "pr-watch-arm: CLAUDE_CODE_SESSION_ID unset — slot left unowned, reconcile cannot re-arm it" >&2
|
|
225
|
+
echo "pr-watch-arm: no --owner and CLAUDE_CODE_SESSION_ID unset — slot left unowned, reconcile cannot re-arm it" >&2
|
|
221
226
|
fi
|
|
222
227
|
|
|
223
228
|
echo "ARMED pr=$pr_number watermark seeded at ${slot}/watch-watermark.env"
|
|
@@ -60,11 +60,12 @@ echo "$$" > "${slot}/watch.pid"
|
|
|
60
60
|
# Who hears this loop's exit. A session hears the background command it armed;
|
|
61
61
|
# a loop the muggle watch service started is heard by the service, which wakes
|
|
62
62
|
# the owner session only when the loop reports. A session arming the slot takes
|
|
63
|
-
# it back, and its own drain covers whatever an undelivered service report held
|
|
63
|
+
# it back, and its own drain covers whatever an undelivered service report held,
|
|
64
|
+
# the ones queued while a service loop watched on included.
|
|
64
65
|
if [ -n "${MUGGLE_PR_WATCH_LISTENER:-}" ]; then
|
|
65
66
|
printf '%s\n' "$MUGGLE_PR_WATCH_LISTENER" > "${slot}/watch-listener"
|
|
66
67
|
else
|
|
67
|
-
rm -f "${slot}/watch-listener" "${slot}/watch-service.out"
|
|
68
|
+
rm -f "${slot}/watch-listener" "${slot}/watch-service.out" "${slot}/watch-service.queued.out"
|
|
68
69
|
fi
|
|
69
70
|
started=$(date +%s)
|
|
70
71
|
fails=0
|
|
@@ -105,6 +105,7 @@ var CiRollupBucket = /* @__PURE__ */ ((CiRollupBucket2) => {
|
|
|
105
105
|
// src/pr-watch/tickVerdict.ts
|
|
106
106
|
function resolveWatchTickVerdict(lastSeenEntry, observation, preferences) {
|
|
107
107
|
const { headSha, rebaseKey } = observation;
|
|
108
|
+
if (lastSeenEntry.forward_stages_in_flight === true) return "hold-forward-stages" /* HoldForwardStages */;
|
|
108
109
|
if (observation.isRebaseDue) {
|
|
109
110
|
if (isRebaseBudgetExhausted(lastSeenEntry, preferences.maxCatchUpRebases)) {
|
|
110
111
|
return "block-rebase-budget-exhausted" /* BlockRebaseBudgetExhausted */;
|
|
@@ -50,7 +50,7 @@ Each skill sets a `model:` in its `SKILL.md` frontmatter sized to its cognitive
|
|
|
50
50
|
|
|
51
51
|
| Model | Skills | Why this tier |
|
|
52
52
|
|-------|--------|---------------|
|
|
53
|
-
| `haiku` | `muggle`, `muggle-status`, `muggle-repair`, `muggle-upgrade`, `muggle-preferences`, `muggle-feedback`, `muggle-init`, `muggle-ci-install`, `muggle-login`, `muggle-logout`, `muggle-run-view`, `muggle-cleanup`, `muggle-register` | Routers and dumb pipes. They follow an explicit procedure with no open-ended reasoning: route intent to a downstream skill, run a fixed CLI sequence, CRUD a config file, or format a status report. |
|
|
53
|
+
| `haiku` | `muggle`, `muggle-status`, `muggle-repair`, `muggle-upgrade`, `muggle-preferences`, `muggle-feedback`, `muggle-bug-report`, `muggle-init`, `muggle-ci-install`, `muggle-login`, `muggle-logout`, `muggle-run-view`, `muggle-cleanup`, `muggle-register` | Routers and dumb pipes. They follow an explicit procedure with no open-ended reasoning: route intent to a downstream skill, run a fixed CLI sequence, CRUD a config file, or format a status report. |
|
|
54
54
|
| `sonnet` | `muggle-pr-visual-walkthrough` (executes via the `visual-walkthrough-builder` agent), `muggle-test-regenerate-missing`, `muggle-pr-followup` | Multi-step orchestration with light judgment, short of deep reasoning: assemble run data and build a PR section with fit-vs-overflow handling; scan, filter, bulk-dispatch, and classify per-item failures into buckets; run a watcher tick across a dozen procedure files and fire the one `/muggle-do` directive its verdict calls for. More moving parts than a router, but each step is well-defined. The watcher moved up from `haiku`: its tick eval passed 3–4 of 23 scenarios there, describing the procedure instead of running it, and a tick now runs only when its token-free watch loop exits with something to act on. |
|
|
55
55
|
| `opus` (explicit pin) | `muggle-test-prepare` (executes via the `test-prepare-runner` agent) | Pinned for **reliability**, not raw reasoning load: it's flaky on smaller models, and since other skills gate on the environment it readies, a wrong call is expensive. Pin explicitly rather than leaving `model:` unset so it stays on Opus even when the user's session runs a cheaper model. |
|
|
56
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Audit trail
|
|
2
2
|
|
|
3
|
-
**Arm first.** If this cycle leaves a PR open and its watch is not armed yet, stop reading and arm it now ([`respawn-watcher.md`](respawn-watcher.md), or Stage
|
|
3
|
+
**Arm first.** If this cycle leaves a PR open and its watch is not armed yet, stop reading and arm it now ([`respawn-watcher.md`](respawn-watcher.md), or Stage 5.5 on a forward cycle, whose Stage 8 then lifts the hold). The block is written after the arm, never instead of it.
|
|
4
4
|
|
|
5
5
|
What a cycle shows the user before it ends: the tests the change involved, their results, and links to the proof. It reports and gates nothing. Anything missing is stated in the block, never a reason to stop, retry, or ask.
|
|
6
6
|
|
|
@@ -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, 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
|
|
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 PR's watch is armed at Stage 5.5 but holds every cycle until this stage clears and Stage 8 lifts the hold.
|
|
4
4
|
|
|
5
5
|
## Turn preamble
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Open PR — forward mode
|
|
2
2
|
|
|
3
|
-
The forward pipeline's PR stages, which run on either side of Stage 6. **Stage 5.5** opens the change — a PR on GitHub (`gh pr create`) or an MR on GitLab (`glab mr create`), provider resolved in Step 5 — as soon as unit tests pass, before any browser run. **Stage 7** settles that run's result on it,
|
|
3
|
+
The forward pipeline's PR stages, which run on either side of Stage 6. **Stage 5.5** opens the change — a PR on GitHub (`gh pr create`) or an MR on GitLab (`glab mr create`), provider resolved in Step 5 — as soon as unit tests pass, before any browser run, and arms its watch with every cycle held. **Stage 7** settles that run's result on it, and **Stage 8** lifts the hold.
|
|
4
4
|
|
|
5
5
|
The PR goes up first because opening it needs nothing from the run: CI and reviewers start on the diff while E2E runs, and the run's [PR progress](../../_shared/dev-loop/run.md#pr-progress) fills the PR's walkthrough comment case by case. The walkthrough check stays red until Stage 7 settles that comment, so an open PR never passes as tested before its run lands.
|
|
6
6
|
|
|
@@ -62,6 +62,16 @@ Per repo:
|
|
|
62
62
|
|
|
63
63
|
A create that fails ends the cycle for that repo: report it under **Errors** and run no E2E for it, since the run would have no PR to settle.
|
|
64
64
|
|
|
65
|
+
6. **Seed and arm the watch, held.** Write `~/.muggle-ai/muggle-do/sessions/<slug>/prs.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#prsjson), one entry per PR this stage opened:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
[{ "repo": "owner/repo", "number": 142, "url": "...", "head_sha": "...", "state": "open" }]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Seed `last_seen.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#last_seenjson): the empty-watermark shape with `pushed_shas: []`, `lastBodyReviewId: 0` and `lastConversationCommentId: 0` (forward mode has no prior reviews to skip), and `"forward_stages_in_flight": true`. **Do not** seed `cycle.json` or `requirements.md`. Then arm each PR's watch per [`../../muggle-pr-followup/arm-watcher.md`](../../muggle-pr-followup/arm-watcher.md). The arm writes `owner.json` and `watch-registration.json`, so from here on the PR is watched, owned by this session, and visible to the muggle watch service and to reconcile, however Stage 6 ends.
|
|
72
|
+
|
|
73
|
+
The flag is the hold. While it is set the watch still reports, but the tick dispatches nothing — no address-reviews, rebase, or fix-ci — and logs a `deferred` line instead (the verdict is `hold-forward-stages`), because Stage 6 is testing the head any such cycle would push over. A watch wake that arrives during Stages 6–7.5 runs that tick between steps of this cycle and goes back to the stage in flight; it never pre-empts it. Reviews, CI and branch drift wait in the watermarks, undispatched, for Stage 8.
|
|
74
|
+
|
|
65
75
|
## Stage 7 — report on the PR
|
|
66
76
|
|
|
67
77
|
Runs once Stage 6 has recorded this change's verdict; a Stage 6 readiness halt never reaches it. Per repo, using the provider resolved in Stage 5.5:
|
|
@@ -86,25 +96,17 @@ The E2E repair loop ([`../e2e-repair.md`](../e2e-repair.md)) runs once Stage 7 h
|
|
|
86
96
|
|
|
87
97
|
## Stage 8 handoff
|
|
88
98
|
|
|
89
|
-
After every repo is processed and Stage 7.5 has cleared,
|
|
90
|
-
|
|
91
|
-
Write `~/.muggle-ai/muggle-do/sessions/<slug>/prs.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#prsjson):
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
[{ "repo": "owner/repo", "number": 142, "url": "...", "head_sha": "...", "state": "open" }]
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Seed `~/.muggle-ai/muggle-do/sessions/<slug>/last_seen.json` per [`../../muggle-pr-followup/state-schemas.md`](../../muggle-pr-followup/state-schemas.md#last_seenjson) — empty-watermark shape with `pushed_shas: []`. Forward mode never has prior reviews to skip, so `lastBodyReviewId: 0` and `lastConversationCommentId: 0`.
|
|
99
|
+
After every repo is processed and Stage 7.5 has cleared, lift the hold Stage 5.5 set and hand each PR to its watch. The handoff ticks are the LAST action this stage takes.
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
Per PR: rewrite `last_seen.json` without `forward_stages_in_flight` (whole-file rewrite), then run its tick, `/muggle:muggle-pr-followup <slug> <n> --wake=stage-handoff`. The tick refreshes `prs.json` from the provider (Stage 7 may have force-pushed the tested head), dispatches whatever the hold kept back — reviews first, then a rebase or fix-ci — or idles, and leaves one loop polling per [`../../muggle-pr-followup/arm-watcher.md`](../../muggle-pr-followup/arm-watcher.md), the same procedure [`../respawn-watcher.md`](../respawn-watcher.md) settles every later watch with. A loop that died during Stage 6 is re-armed there. Never a recurring `/loop` cron — every cron fire is a model turn, while the loop polls token-free. The PR counts as watched only while that loop is running; a seeded slot alone is not a watch.
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
Stage 7.5 keeps its meaning: it is still the gate in front of every cycle the watch dispatches, because nothing dispatches until this handoff lifts the hold. A cycle that exits before Stage 8 — a Stage 6 readiness halt, a stalled run — leaves the hold set and says so on the **Stage 8** line: the PR stays watched and its reports still reach this session, but no cycle runs on it until the forward cycle resumes or the user asks for the hold to be lifted.
|
|
102
104
|
|
|
103
|
-
If
|
|
105
|
+
If Stage 5.5 opened no PR, there is no slot and nothing to hand off — record the reason in `result.md` and exit.
|
|
104
106
|
|
|
105
107
|
## Invariants
|
|
106
108
|
|
|
107
|
-
- Branch synced with its base before the push, never after; PR opened per non-skipped repo before Stage 6 starts, ready for review — never a draft; the tested head is the PR's head before its walkthrough settles; designated walkthrough comment settled via Mode A, or its skip reason stated; `prs.json`+`last_seen.json` seeded (no `cycle.json`, no `requirements.md`); Stage 7.5 cleared before
|
|
109
|
+
- Branch synced with its base before the push, never after; PR opened per non-skipped repo before Stage 6 starts, ready for review — never a draft; the tested head is the PR's head before its walkthrough settles; designated walkthrough comment settled via Mode A, or its skip reason stated; `prs.json`+`last_seen.json` seeded and the watch armed, held, when the PR opens (no `cycle.json`, no `requirements.md`); Stage 7.5 cleared before the hold lifts; the handoff tick is the last action.
|
|
108
110
|
|
|
109
111
|
## Output
|
|
110
112
|
|
|
@@ -117,7 +119,7 @@ The cycle's closing message opens with the [audit trail](../audit-trail.md), on
|
|
|
117
119
|
**Overflow comments posted:** repo → PR #
|
|
118
120
|
**Recurring run:** `already scheduled` | `<recommended options>` (bug fixes only)
|
|
119
121
|
**Stage 7.5:** `green` | `waived — <reason>` | `decision-pending`
|
|
120
|
-
**Stage 8:** `Watching <N> PR(s) — one watch loop per PR,
|
|
122
|
+
**Stage 8:** `Watching <N> PR(s) — hold lifted, one watch loop per PR` | `Held — <reason>; watched since Stage 5.5, cycles wait for the hold to lift` | `No PRs to watch — no slot seeded`
|
|
121
123
|
**Errors:** repo → message
|
|
122
124
|
|
|
123
125
|
## Post-merge cleanup
|
|
@@ -4,5 +4,5 @@ Two modes, set by the `/muggle-do` invocation. Each consumer loads only its mode
|
|
|
4
4
|
|
|
5
5
|
| Mode | When | Procedure |
|
|
6
6
|
| :--- | :--- | :-------- |
|
|
7
|
-
| Forward | A fresh feature, called by `/muggle-do`'s forward pipeline. Opens the PR after Stage 5 (Stage 5.5), settles its walkthrough after Stage 6 (Stage 7),
|
|
7
|
+
| Forward | A fresh feature, called by `/muggle-do`'s forward pipeline. Opens the PR after Stage 5 (Stage 5.5) and arms its watch with cycles held, settles its walkthrough after Stage 6 (Stage 7), lifts the hold at Stage 8. | [`open-prs/forward.md`](open-prs/forward.md) |
|
|
8
8
|
| Update | The PR already exists; the address-reviews orchestrator called this stage to push + refresh title/description/walkthrough. | [`open-prs/update.md`](open-prs/update.md) |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mbugreport
|
|
3
|
+
description: Explicit short alias for the `muggle-bug-report` skill. ONLY invoke when the user explicitly types `mbugreport` or `/mbugreport` — never auto-trigger from any other phrasing.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# mbugreport — alias for muggle-bug-report
|
|
8
|
+
|
|
9
|
+
Invoke the `muggle-bug-report` skill via the Skill tool. Forward any user-provided arguments unchanged. In a host with no Skill tool (Codex), open `../muggle-bug-report/SKILL.md` and follow it with those arguments.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Codex reads this beside SKILL.md. An alias is for the user to type, never for
|
|
2
|
+
# the model to pick on its own: Codex's equivalent of disable-model-invocation.
|
|
3
|
+
interface:
|
|
4
|
+
display_name: "mbugreport"
|
|
5
|
+
short_description: "Short alias for the muggle-bug-report skill"
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: false
|
|
@@ -49,5 +49,6 @@ If the user intent clearly matches one command, route directly — no menu neede
|
|
|
49
49
|
- post results to PR/attach walkthrough/visual evidence on PR → `muggle-pr-visual-walkthrough`
|
|
50
50
|
- watch my PR for reviews/follow up on PR reviews/babysit PR review thread → `muggle-pr-followup`
|
|
51
51
|
- give feedback on a run/the test was wrong/step N didn't work/show my feedback/delete feedback → `muggle-feedback`
|
|
52
|
+
- report a bug in muggle/muggle itself is broken/my bug reports/status of BUG-NNNN → `muggle-bug-report`
|
|
52
53
|
|
|
53
54
|
If intent is ambiguous, use `AskUserQuestion` with the most likely options rather than asking the user to type a clarification.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: muggle-bug-report
|
|
3
|
+
model: haiku
|
|
4
|
+
description: "Use when the user wants to report a bug in Muggle AI itself (a muggle command or tool erroring, a run hanging, a dashboard or billing problem), or to list, check (BUG-4821) or reply to their bug reports. Not for bugs in the user's own app, nor a generated test script step that misbehaved (muggle-feedback). Triggers on /muggle-bug-report, report a muggle bug."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Muggle Bug Report
|
|
8
|
+
|
|
9
|
+
> Telemetry first step: see [`_shared/telemetry-emit.md`](../_shared/telemetry-emit.md). Use `skillName: "muggle-bug-report"`.
|
|
10
|
+
|
|
11
|
+
> Running outside Claude Code (in Codex, for one)? Read [`../_shared/host-tool-equivalents.md`](../_shared/host-tool-equivalents.md) first — it maps the tools and paths this skill names to your host's.
|
|
12
|
+
|
|
13
|
+
Files a bug about Muggle AI to the Muggle team and follows it: every report gets a short id (`BUG-4821`), a ticket page on the dashboard, and in-app updates as the team works it.
|
|
14
|
+
|
|
15
|
+
## Routing
|
|
16
|
+
|
|
17
|
+
| Intent | Op file |
|
|
18
|
+
|---|---|
|
|
19
|
+
| "report a bug" / "muggle is broken" / "file this" / no arguments | [`ops/file.md`](ops/file.md) |
|
|
20
|
+
| "my bug reports" / "list my tickets" | [`ops/list.md`](ops/list.md) |
|
|
21
|
+
| "status BUG-4821" / "what happened to my report" | [`ops/status.md`](ops/status.md) |
|
|
22
|
+
| "reply to BUG-4821" / "answer their question" | [`ops/reply.md`](ops/reply.md) |
|
|
23
|
+
|
|
24
|
+
If intent is ambiguous, use `AskUserQuestion` once with **File a bug / List my reports / Check one / Reply** — never ask the user to type a clarification.
|
|
25
|
+
|
|
26
|
+
## Constraints (all ops)
|
|
27
|
+
|
|
28
|
+
- **Every tool takes the `bugReportId`, never the short id.** Turn a `BUG-NNNN` the user names into its `bugReportId` with `muggle-remote-bug-report-list`: page with `pageSize: 50`, passing `nextCursor` back as `cursor`, until an item's `shortId` matches. No match on any page → say so and show the list.
|
|
29
|
+
- **Screenshots are paths on this machine**: images only (png, jpg, gif, webp), at most 5, 5 MB each. Pass absolute paths in `screenshotPaths`; the tool reads and uploads them.
|
|
30
|
+
- **Not signed in** (`UNAUTHORIZED`): hand off to the `muggle-login` skill, then resume the op.
|
|
31
|
+
- **`dashboardUrl`** in each response is the ticket's page; print it with the short id.
|
|
32
|
+
|
|
33
|
+
## Non-negotiables (all ops)
|
|
34
|
+
|
|
35
|
+
- Never file or reply without showing the user exactly what will be sent and getting a confirm.
|
|
36
|
+
- Never add context the context tool did not return, and never put a secret, token or password in a title, description, steps or reply. If the user's text contains one, point it out and ask them to remove it before filing.
|
|
37
|
+
- Show only what the response holds; never guess a ticket's status or what the team will do.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# File a bug
|
|
2
|
+
|
|
3
|
+
## 1. Ask what went wrong
|
|
4
|
+
|
|
5
|
+
Take what the user already said from the prompt or arguments; ask only for what is missing.
|
|
6
|
+
|
|
7
|
+
- **Title** — one line. Draft it from their description and let them edit.
|
|
8
|
+
- **What happened** — the description, in their words.
|
|
9
|
+
- **Severity** — `AskUserQuestion`: **Blocker** (can't continue) / **Major** (works around it with effort) / **Minor** (cosmetic or small). Wire values: `blocker`, `major`, `minor`.
|
|
10
|
+
- **Steps / expected / actual** — `AskUserQuestion`: **Add steps, expected and actual** / **Skip**. When added, collect each as free text.
|
|
11
|
+
- **Screenshots** — `AskUserQuestion`: **Attach screenshots** / **No screenshots**. When attaching, collect absolute file paths.
|
|
12
|
+
|
|
13
|
+
## 2. Route a script-step report to feedback
|
|
14
|
+
|
|
15
|
+
If the report is about one generated test script or one of its steps doing the wrong thing (clicked the wrong element, step N failed, wrong text typed), `AskUserQuestion`:
|
|
16
|
+
|
|
17
|
+
> "This sounds like script feedback, which regenerates the script. Which do you want?"
|
|
18
|
+
> - **Script feedback** — invoke the `muggle-feedback` skill via the Skill tool with the user's description as `args`, then stop.
|
|
19
|
+
> - **Bug report anyway**
|
|
20
|
+
|
|
21
|
+
Anything else — a command or tool error, a hang, a crash, a dashboard or billing problem — continues here.
|
|
22
|
+
|
|
23
|
+
## 3. Gather and show context
|
|
24
|
+
|
|
25
|
+
Call `muggle-local-bug-report-context-get` with `cwd` set to the current working directory. It returns the CLI and Studio versions, operating system, last-used project and newest local run, with secret-looking values already left out.
|
|
26
|
+
|
|
27
|
+
Print the report as it will be sent:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Title: <title>
|
|
31
|
+
Severity: <Blocker | Major | Minor>
|
|
32
|
+
What happened:
|
|
33
|
+
<description>
|
|
34
|
+
Steps / expected / actual: <each, or "none">
|
|
35
|
+
Screenshots: <file names, or "none">
|
|
36
|
+
|
|
37
|
+
Included with your report:
|
|
38
|
+
<each context line from the tool, plus any "left out" line>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 4. Confirm
|
|
42
|
+
|
|
43
|
+
`AskUserQuestion`:
|
|
44
|
+
|
|
45
|
+
> "File this bug report?"
|
|
46
|
+
> - **File it**
|
|
47
|
+
> - **Edit** — ask which part, collect the change, then print §3 again
|
|
48
|
+
> - **Cancel** — print "Cancelled — nothing was sent." and stop
|
|
49
|
+
|
|
50
|
+
## 5. File
|
|
51
|
+
|
|
52
|
+
Call `muggle-remote-bug-report-create` with `title`, `description`, `severity`, the optional `stepsToReproduce` / `expectedBehavior` / `actualBehavior`, `screenshotPaths`, and `clientContext` set to the tool's `clientContext` JSON block unchanged.
|
|
53
|
+
|
|
54
|
+
| Error | Response |
|
|
55
|
+
|---|---|
|
|
56
|
+
| A screenshot refused (`INVALID_ARGUMENT`) | Print the message; `AskUserQuestion`: **Fix the path** / **File without it** |
|
|
57
|
+
| `bug_report_rate_limited` (429) | "You have filed 10 reports in the last hour. Try again later." Stop. |
|
|
58
|
+
| `UNAUTHORIZED` | Hand off to `muggle-login`, then retry once |
|
|
59
|
+
| Anything else | Print it verbatim; nothing was filed |
|
|
60
|
+
|
|
61
|
+
## 6. Report
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Filed <shortId>: <title>
|
|
65
|
+
Track it: <dashboardUrl>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Updates arrive in the dashboard inbox. Check later with "status <shortId>".
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# List bug reports
|
|
2
|
+
|
|
3
|
+
## 1. Fetch
|
|
4
|
+
|
|
5
|
+
`muggle-remote-bug-report-list` with `pageSize: 20`. No items → print "You have not filed any bug reports." and offer `AskUserQuestion`: **File a bug** ([`file.md`](file.md)) / **Done**.
|
|
6
|
+
|
|
7
|
+
## 2. Render
|
|
8
|
+
|
|
9
|
+
Newest activity first, as the response orders it:
|
|
10
|
+
|
|
11
|
+
| Short id | Title | Status | Severity | Last update |
|
|
12
|
+
|---|---|---|---|---|
|
|
13
|
+
|
|
14
|
+
- **Status** — the wire value in words: `new` → New, `triaged` → Triaged, `in_progress` → In progress, `needs_info` → Needs info, `fixed` → Fixed, `closed` → Closed.
|
|
15
|
+
- **Last update** — `lastActivityAtMs`, human-readable (e.g. `2 days ago`).
|
|
16
|
+
- Mark a **Needs info** row "waiting on you".
|
|
17
|
+
|
|
18
|
+
When `nextCursor` is set, add "More reports exist" and offer **Show more** in §3.
|
|
19
|
+
|
|
20
|
+
Print the response's `dashboardUrl` as the link to all reports.
|
|
21
|
+
|
|
22
|
+
## 3. Offer next action
|
|
23
|
+
|
|
24
|
+
`AskUserQuestion`:
|
|
25
|
+
|
|
26
|
+
> "What next?"
|
|
27
|
+
> - **Open one** — pick a row, then [`status.md`](status.md)
|
|
28
|
+
> - **Reply to one** — pick a row, then [`reply.md`](reply.md)
|
|
29
|
+
> - **Show more** — only when `nextCursor` is set; fetch with `cursor: nextCursor` and append
|
|
30
|
+
> - **Done**
|