@muggleai/works 5.27.0-staging.233 → 5.27.0-staging.235
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/README.md +1 -1
- package/dist/{chunk-YNTLACS2.js → chunk-KR7MX7M5.js} +29 -8
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/.mcp.json +1 -1
- package/dist/plugin/hooks/README.md +2 -2
- package/dist/plugin/scripts/guardrail-lib.sh +4 -1
- package/dist/plugin/scripts/guardrails.mjs +101 -95
- package/dist/release-manifest.json +3 -3
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-mcp.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/hooks/README.md +2 -2
- package/plugin/scripts/guardrail-lib.sh +4 -1
- package/plugin/scripts/guardrails.mjs +101 -95
|
@@ -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.27.0-staging.
|
|
12
|
+
"version": "5.27.0-staging.235"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ Nested GitLab namespaces of any depth are handled — the project path is everyt
|
|
|
167
167
|
|
|
168
168
|
When a PR is opened from a session running this plugin, Muggle reserves a comment for the acceptance walkthrough and holds the turn open until it's settled — by the walkthrough, or by a stated reason acceptance testing doesn't apply.
|
|
169
169
|
|
|
170
|
-
A PR opened any other way — the web UI, a teammate without the plugin — never passes through that session, so the same check also runs in GitHub Actions. It fails while the comment is still empty, and whenever the walkthrough reports a failed or inconclusive test case; the check's summary names each one with its failing step and a link to the run. When the Muggle PR watcher sees it red, it repairs the cases, re-runs the whole suite, and re-settles the comment.
|
|
170
|
+
A PR opened any other way — the web UI, a teammate without the plugin — never passes through that session, so the same check also runs in GitHub Actions. It fails while the comment is still empty, and whenever the walkthrough reports a failed or inconclusive test case; the check's summary names each one with its failing step and a link to the run. While a new E2E run is underway on the PR, the check stays in progress until that run's walkthrough replaces the previous one. When the Muggle PR watcher sees it red, it repairs the cases, re-runs the whole suite, and re-settles the comment.
|
|
171
171
|
|
|
172
172
|
The `autoInstallCiWorkflow` preference, chosen during `muggle init`, decides whether Muggle adds the workflow itself: `always` installs it in the repository `muggle init` runs in and in any repository `/muggle-do` opens a PR from, `ask` (the default) asks first, `never` leaves CI alone. To add it to a repository by hand:
|
|
173
173
|
|
|
@@ -776,14 +776,14 @@ function renderTestDetails(entry, testNumber, screenshotDetail = "before-and-aft
|
|
|
776
776
|
lines.push(`_${test.description.replace(/\s*\n\s*/g, " ")}_`, "");
|
|
777
777
|
}
|
|
778
778
|
lines.push(...renderResultTable(entry));
|
|
779
|
-
const frame = renderEndingFrame(test);
|
|
780
|
-
if (frame) {
|
|
781
|
-
lines.push("", ...frame);
|
|
782
|
-
}
|
|
783
779
|
const steps = renderSteps(test, screenshotDetail);
|
|
784
780
|
if (steps) {
|
|
785
781
|
lines.push("", `<details><summary>${stepsToggleLabel(test, screenshotDetail)}</summary>`, ...indented(steps), "</details>");
|
|
786
782
|
}
|
|
783
|
+
const frame = renderEndingFrame(test);
|
|
784
|
+
if (frame) {
|
|
785
|
+
lines.push("", ...frame);
|
|
786
|
+
}
|
|
787
787
|
return lines.join("\n");
|
|
788
788
|
}
|
|
789
789
|
function indented(content) {
|
|
@@ -3169,6 +3169,7 @@ var REPORT_SENTINEL = "muggle-pr-section";
|
|
|
3169
3169
|
var WALKTHROUGH_SLOT_MARKER = "<!-- muggle-pr-walkthrough:v1 -->";
|
|
3170
3170
|
var WALKTHROUGH_SKIPPED_MARKER = "<!-- muggle-pr-walkthrough-status:skipped -->";
|
|
3171
3171
|
var WALKTHROUGH_COMMENT_HEADING = "### Muggle AI \u2014 PR visual walkthrough";
|
|
3172
|
+
var RERUN_NOTICE_OPENING = "<!-- muggle-pr-walkthrough-rerun -->";
|
|
3172
3173
|
var GH_COMMENT_TIMEOUT_MS = 1e4;
|
|
3173
3174
|
var DEPENDENCY_BOT_LOGINS = ["dependabot[bot]", "renovate[bot]"];
|
|
3174
3175
|
|
|
@@ -3186,6 +3187,14 @@ ${WALKTHROUGH_COMMENT_HEADING}
|
|
|
3186
3187
|
|
|
3187
3188
|
**No E2E run \u2014 not applicable.** A dependency update opened by \`${login}\`; no coding session ran on it.`;
|
|
3188
3189
|
}
|
|
3190
|
+
function hasRerunNotice(body) {
|
|
3191
|
+
return body.includes(RERUN_NOTICE_OPENING);
|
|
3192
|
+
}
|
|
3193
|
+
function isRerunInProgress(bodies) {
|
|
3194
|
+
return bodies.some(
|
|
3195
|
+
(body) => classifyComment(body) !== "not-designated" /* NotDesignated */ && hasRerunNotice(body)
|
|
3196
|
+
);
|
|
3197
|
+
}
|
|
3189
3198
|
function classifyComment(body) {
|
|
3190
3199
|
if (body.includes(REPORT_SENTINEL)) return "reported" /* Reported */;
|
|
3191
3200
|
if (!body.includes(WALKTHROUGH_SLOT_MARKER)) return "not-designated" /* NotDesignated */;
|
|
@@ -3282,8 +3291,8 @@ function createCheckRun(repo, checkRun, run) {
|
|
|
3282
3291
|
return writeJson(["api", "--method", "POST", `repos/${repo}/check-runs`, "--input", "-"], {
|
|
3283
3292
|
name: checkRun.name,
|
|
3284
3293
|
head_sha: checkRun.headSha,
|
|
3285
|
-
status:
|
|
3286
|
-
conclusion: checkRun.conclusion,
|
|
3294
|
+
status: checkRun.status,
|
|
3295
|
+
...checkRun.conclusion ? { conclusion: checkRun.conclusion } : {},
|
|
3287
3296
|
output: { title: checkRun.title, summary: checkRun.summary }
|
|
3288
3297
|
}, run);
|
|
3289
3298
|
}
|
|
@@ -3312,11 +3321,13 @@ var CHECK_SUMMARY_MAX_CASES = 50;
|
|
|
3312
3321
|
var OUTCOME_CONCLUSIONS = {
|
|
3313
3322
|
["settled" /* Settled */]: "success" /* Success */,
|
|
3314
3323
|
["e2e-not-passing" /* E2eNotPassing */]: "failure" /* Failure */,
|
|
3324
|
+
["rerun-in-progress" /* RerunInProgress */]: null,
|
|
3315
3325
|
["unsettled" /* Unsettled */]: "failure" /* Failure */,
|
|
3316
3326
|
["unreadable" /* Unreadable */]: "neutral" /* Neutral */
|
|
3317
3327
|
};
|
|
3318
3328
|
var FIXED_SUMMARIES = {
|
|
3319
3329
|
["settled" /* Settled */]: "This PR's Muggle AI walkthrough comment is settled \u2014 every E2E acceptance case passed, or it states why E2E does not apply.",
|
|
3330
|
+
["rerun-in-progress" /* RerunInProgress */]: "A new E2E acceptance run is in progress on this PR. The walkthrough comment still shows the previous run; this check settles when the new run's walkthrough replaces it.",
|
|
3320
3331
|
["unsettled" /* Unsettled */]: "This PR's Muggle AI walkthrough comment is still empty. Run the E2E acceptance suite and post the walkthrough into it (/muggle:muggle-test), or record why E2E does not apply to this change.",
|
|
3321
3332
|
["unreadable" /* Unreadable */]: "The PR's comments could not be read, so the walkthrough duty could not be judged."
|
|
3322
3333
|
};
|
|
@@ -3359,6 +3370,12 @@ function judgeComments(pr, comments, run) {
|
|
|
3359
3370
|
}
|
|
3360
3371
|
}
|
|
3361
3372
|
if (verdict === "missing" /* Missing */) reserveComment(pr, comments, run);
|
|
3373
|
+
if (isRerunInProgress(bodies)) {
|
|
3374
|
+
return {
|
|
3375
|
+
outcome: "rerun-in-progress" /* RerunInProgress */,
|
|
3376
|
+
summary: FIXED_SUMMARIES["rerun-in-progress" /* RerunInProgress */]
|
|
3377
|
+
};
|
|
3378
|
+
}
|
|
3362
3379
|
const record = latestE2eResult(bodies);
|
|
3363
3380
|
if (record && record.unpassed.length > 0) {
|
|
3364
3381
|
return { outcome: "e2e-not-passing" /* E2eNotPassing */, summary: renderNotPassingSummary(record) };
|
|
@@ -3370,12 +3387,14 @@ async function runPrWalkthroughCheck(options, run = defaultGhRunner) {
|
|
|
3370
3387
|
const pr = { repo: options.repo, prNumber: options.prNumber };
|
|
3371
3388
|
const { outcome, summary } = judgeComments(pr, listPrComments(pr, run), run);
|
|
3372
3389
|
const conclusion = OUTCOME_CONCLUSIONS[outcome];
|
|
3390
|
+
const status = conclusion === null ? "in_progress" /* InProgress */ : "completed" /* Completed */;
|
|
3373
3391
|
if (options.publishCheckRun) {
|
|
3374
3392
|
createCheckRun(
|
|
3375
3393
|
options.repo,
|
|
3376
3394
|
{
|
|
3377
3395
|
name: CHECK_RUN_NAME,
|
|
3378
3396
|
headSha: options.headSha,
|
|
3397
|
+
status,
|
|
3379
3398
|
conclusion,
|
|
3380
3399
|
title: CHECK_RUN_TITLE,
|
|
3381
3400
|
summary
|
|
@@ -3383,9 +3402,11 @@ async function runPrWalkthroughCheck(options, run = defaultGhRunner) {
|
|
|
3383
3402
|
run
|
|
3384
3403
|
);
|
|
3385
3404
|
}
|
|
3386
|
-
const
|
|
3405
|
+
const isNotPassing = conclusion === "failure" /* Failure */ || status === "in_progress" /* InProgress */;
|
|
3406
|
+
const failsLocally = isNotPassing && !options.publishCheckRun;
|
|
3387
3407
|
return {
|
|
3388
3408
|
outcome,
|
|
3409
|
+
status,
|
|
3389
3410
|
conclusion,
|
|
3390
3411
|
exitCode: failsLocally ? 1 : 0,
|
|
3391
3412
|
summary
|
|
@@ -3424,7 +3445,7 @@ async function prWalkthroughCheckCommand(flags) {
|
|
|
3424
3445
|
return;
|
|
3425
3446
|
}
|
|
3426
3447
|
const judgment = await runPrWalkthroughCheck(target);
|
|
3427
|
-
process.stdout.write(`${judgment.conclusion}: ${judgment.summary}
|
|
3448
|
+
process.stdout.write(`${judgment.conclusion ?? judgment.status}: ${judgment.summary}
|
|
3428
3449
|
`);
|
|
3429
3450
|
process.exitCode = judgment.exitCode;
|
|
3430
3451
|
}
|
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-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-KR7MX7M5.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-WRYPWI33.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.27.0-staging.
|
|
4
|
+
"version": "5.27.0-staging.235",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
|
-
"version": "5.27.0-staging.
|
|
3
|
+
"version": "5.27.0-staging.235",
|
|
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.27.0-staging.
|
|
5
|
+
"version": "5.27.0-staging.235",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
|
@@ -47,12 +47,12 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
47
47
|
| `PostToolUse` (Bash) | `guardrail-record-comment-replies.sh` | record | an unresolved-thread fetch named review threads still awaiting an answer (classified by the `<!-- muggle-do:bot -->` marker, never the author login), a threaded reply the provider **confirmed** answered comments in one, or a `MUGGLE_REPLY_SKIP` marker deferred them | — | claim each thread and cover the comments answered, in the per-PR ledger beside the muggle-do slot |
|
|
48
48
|
| `PreToolUse` (Bash, `if` a command names `gh`/`glab`) | `guardrail-report-format.sh` | **enforce** | a `gh pr comment\|create\|edit` body — or a `gh api … issues/comments/<id>` PATCH editing one — reads like an E2E report but lacks the `build-pr-section` sentinel | — | **deny** — render via `muggle build-pr-section` instead |
|
|
49
49
|
| `PreToolUse` (muggle local execute/replay) | `guardrail-classify-gate.sh` | **enforce** | `muggle-test` is the skill in play and the target test case has no `pre-execution-classification` this session | — | **deny** — run Step 6f first (it calls `muggle-remote-test-script-list`, which is where the run learns the case has never passed) or record a legitimate skip via `MUGGLE_CLASSIFY_SKIP`. Scoped to `muggle-test`, so the single-target skills that legitimately skip classification are untouched; fails open when the test case can't be resolved |
|
|
50
|
-
| `PreToolUse` (muggle local execute/replay) | `guardrail-walkthrough-rerun.sh` | record | a browser run is about to start in a working tree (the tool call's `cwd`) whose branch has a PR, and that PR's walkthrough comment already shows a run or a skip | — | a detached job puts a "new E2E run in progress" banner, with its UTC start time, on top of the walkthrough the run will replace. The comment underneath is untouched
|
|
50
|
+
| `PreToolUse` (muggle local execute/replay) | `guardrail-walkthrough-rerun.sh` | record | a browser run is about to start in a working tree (the tool call's `cwd`) whose branch has a PR, and that PR's walkthrough comment already shows a run or a skip | — | a detached job puts a "new E2E run in progress" banner, with its UTC start time, on top of the walkthrough the run will replace. The comment underneath is untouched; the walkthrough check stays in progress until the run's own walkthrough replaces the whole body, banner included, and the walkthrough gate counts the PR as still owing that walkthrough. A reserved placeholder or a comment already bannered is left alone |
|
|
51
51
|
| `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). Quiet while a background acceptance-tester is in flight |
|
|
52
52
|
| `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) |
|
|
53
53
|
| `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 |
|
|
54
54
|
| `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-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 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 |
|
|
55
|
+
| `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 |
|
|
56
56
|
| `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) |
|
|
57
57
|
| `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). Quiet while a background acceptance-tester is in flight — its failed runs land in this session's state and it debugs them itself |
|
|
58
58
|
| `Stop` | `guardrail-comment-reply-gate.sh` | **enforce** | this session claimed a review thread and left one of its comments uncovered | — | **block** the turn until each comment gets its threaded reply per `do/per-comment-replies.md` or a `MUGGLE_REPLY_SKIP: <comment-id> <reason>` marker defers it (releases after 3 blocks). The claim is the signal, not a push, so a round that answers a question with no code change is caught too; a thread another session claimed never blocks this one |
|
|
@@ -115,9 +115,12 @@ guardrail_is_hook_script() {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
# Runs guardrails.mjs on the payload. Never blocks a turn: any failure degrades to {}.
|
|
118
|
+
# A here-string rather than a pipe, so the fallback hears only Node's exit status: a pipe's writer dies of SIGPIPE
|
|
119
|
+
# when Node exits before reading all of its stdin, and pipefail would count that as Node failing and print a second
|
|
120
|
+
# {} after its answer. It also spares forking a subshell to write the payload.
|
|
118
121
|
guardrail_run_node() {
|
|
119
122
|
local root="${CLAUDE_PLUGIN_ROOT:-${CURSOR_PLUGIN_ROOT:-}}"
|
|
120
|
-
|
|
123
|
+
node "${root}/scripts/guardrails.mjs" "$@" <<<"$GUARDRAIL_PAYLOAD" 2>/dev/null || printf '{}'
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
# Entry for a gate script executed directly: its guardrail_wants decides whether Node runs.
|
|
@@ -972,6 +972,102 @@ function applyWalkthroughSkip(state, skipped) {
|
|
|
972
972
|
if (!skipped || state.walkthroughSkipped === true) return state;
|
|
973
973
|
return { ...state, walkthroughSkipped: true };
|
|
974
974
|
}
|
|
975
|
+
|
|
976
|
+
// src/pr-walkthrough/comment.ts
|
|
977
|
+
function renderReservedComment() {
|
|
978
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
979
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
980
|
+
|
|
981
|
+
_Awaiting the E2E acceptance run. Muggle edits this comment in place when the run finishes \u2014 or records why E2E does not apply to this change._`;
|
|
982
|
+
}
|
|
983
|
+
function renderSkippedComment(code, detail) {
|
|
984
|
+
const stated = detail.trim();
|
|
985
|
+
if (code === "NOT_APPLICABLE" /* NotApplicable */) return renderNotApplicableComment(stated);
|
|
986
|
+
const qualifier = stated ? ` \u2014 ${stated}` : "";
|
|
987
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
988
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
989
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
990
|
+
|
|
991
|
+
**No E2E run.** Muggle verified \`${code}\` \u2014 ${E2E_SKIP_CODE_CLAIMS[code]}${qualifier}.`;
|
|
992
|
+
}
|
|
993
|
+
function renderNotApplicableComment(reason) {
|
|
994
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
995
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
996
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
997
|
+
|
|
998
|
+
**No E2E run \u2014 not applicable.** ${reason.replace(/\.$/, "")}.
|
|
999
|
+
|
|
1000
|
+
_The coding agent judged that a browser run cannot exercise this change (\`${"NOT_APPLICABLE" /* NotApplicable */}\`). Muggle did not verify this reason._`;
|
|
1001
|
+
}
|
|
1002
|
+
function renderUnreasonedSkipComment() {
|
|
1003
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1004
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1005
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
1006
|
+
|
|
1007
|
+
**No E2E run, and no verified reason given.** The session ended still owing an acceptance run and cited no skip code that Muggle could verify. Treat this PR as unvalidated by E2E.`;
|
|
1008
|
+
}
|
|
1009
|
+
var shortSha = (sha) => sha.slice(0, SHORT_SHA_LENGTH);
|
|
1010
|
+
function renderNoAppLogicChangeComment(declared, headSha, lastFullRun) {
|
|
1011
|
+
const cycleStart = declared.preCycleSha.toLowerCase();
|
|
1012
|
+
const head = headSha?.toLowerCase() ?? null;
|
|
1013
|
+
const isHeadPastCycleStart = head !== null && !head.startsWith(cycleStart) && !cycleStart.startsWith(head);
|
|
1014
|
+
const qualifier = declared.reason ? ` \u2014 ${declared.reason}` : "";
|
|
1015
|
+
const evidence = lastFullRun ? `${LAST_FULL_RUN_OPENING}
|
|
1016
|
+
|
|
1017
|
+
${lastFullRun}
|
|
1018
|
+
|
|
1019
|
+
</details>` : "_No full E2E run is on record for this PR._";
|
|
1020
|
+
const headline = isHeadPastCycleStart ? `**E2E skipped \u2014 no app-logic change in \`${shortSha(head)}\`.**` : `**E2E skipped \u2014 no app-logic change since \`${shortSha(cycleStart)}\`.**`;
|
|
1021
|
+
const baseTip = declared.baseTipSha?.toLowerCase() ?? null;
|
|
1022
|
+
const verdict = baseTip ? `**E2E skipped \u2014 the rebase onto \`${shortSha(baseTip)}\` changed no app logic in this PR.** Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path whose own patch changed in the rebase of \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}, if any did${qualifier}.` : `${headline} Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path changed since \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}${qualifier}.`;
|
|
1023
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1024
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1025
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
1026
|
+
|
|
1027
|
+
${verdict}
|
|
1028
|
+
|
|
1029
|
+
` + evidence;
|
|
1030
|
+
}
|
|
1031
|
+
function lastFullRunOf(body) {
|
|
1032
|
+
const status = classifyComment(body);
|
|
1033
|
+
if (status === "reported" /* Reported */) {
|
|
1034
|
+
return withoutRerunNotice(body).replace(REPORT_SENTINEL_TAG, "").trim();
|
|
1035
|
+
}
|
|
1036
|
+
if (status !== "skipped" /* Skipped */) return null;
|
|
1037
|
+
const start = body.indexOf(LAST_FULL_RUN_OPENING);
|
|
1038
|
+
if (start === -1) return null;
|
|
1039
|
+
return body.slice(start + LAST_FULL_RUN_OPENING.length).replace(/\s*<\/details>\s*$/, "").trim();
|
|
1040
|
+
}
|
|
1041
|
+
var formatUtcMinute = (date) => `${date.toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
1042
|
+
function hasRerunNotice(body) {
|
|
1043
|
+
return body.includes(RERUN_NOTICE_OPENING);
|
|
1044
|
+
}
|
|
1045
|
+
function withoutRerunNotice(body) {
|
|
1046
|
+
return body.replace(RERUN_NOTICE_BLOCK, "");
|
|
1047
|
+
}
|
|
1048
|
+
function withRerunNotice(body, startedAt) {
|
|
1049
|
+
return `${RERUN_NOTICE_OPENING}
|
|
1050
|
+
> **A new E2E run is in progress** \u2014 started ${formatUtcMinute(startedAt)}. The results below are from the previous run; this comment updates when the new run finishes.
|
|
1051
|
+
${RERUN_NOTICE_CLOSING}
|
|
1052
|
+
|
|
1053
|
+
` + withoutRerunNotice(body);
|
|
1054
|
+
}
|
|
1055
|
+
function classifyComment(body) {
|
|
1056
|
+
if (body.includes(REPORT_SENTINEL)) return "reported" /* Reported */;
|
|
1057
|
+
if (!body.includes(WALKTHROUGH_SLOT_MARKER)) return "not-designated" /* NotDesignated */;
|
|
1058
|
+
if (body.includes(WALKTHROUGH_SKIPPED_MARKER)) return "skipped" /* Skipped */;
|
|
1059
|
+
return "pending" /* Pending */;
|
|
1060
|
+
}
|
|
1061
|
+
function walkthroughVerdict(bodies) {
|
|
1062
|
+
const statuses = bodies.map(classifyComment);
|
|
1063
|
+
if (statuses.includes("reported" /* Reported */) || statuses.includes("skipped" /* Skipped */)) {
|
|
1064
|
+
return "satisfied" /* Satisfied */;
|
|
1065
|
+
}
|
|
1066
|
+
if (statuses.includes("pending" /* Pending */)) return "pending" /* Pending */;
|
|
1067
|
+
return "missing" /* Missing */;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// src/guardrails/walkthroughOwed.ts
|
|
975
1071
|
function runGh(args) {
|
|
976
1072
|
const timeoutMs = boundedChildTimeoutMs(GH_LOOKUP_TIMEOUT_MS);
|
|
977
1073
|
if (timeoutMs === null) return null;
|
|
@@ -997,9 +1093,13 @@ var defaultPrWalkthroughLookup = {
|
|
|
997
1093
|
prCarriesWalkthrough: (prUrl, acceptsSkip) => {
|
|
998
1094
|
const rendered = runGh(["pr", "view", prUrl, "--json", "body,comments"]);
|
|
999
1095
|
if (rendered === null) return true;
|
|
1000
|
-
return rendered
|
|
1096
|
+
return carriesCurrentWalkthrough(rendered, acceptsSkip);
|
|
1001
1097
|
}
|
|
1002
1098
|
};
|
|
1099
|
+
function carriesCurrentWalkthrough(rendered, acceptsSkip) {
|
|
1100
|
+
if (hasRerunNotice(rendered)) return false;
|
|
1101
|
+
return rendered.includes(REPORT_SENTINEL) || acceptsSkip && rendered.includes(WALKTHROUGH_SKIPPED_MARKER);
|
|
1102
|
+
}
|
|
1003
1103
|
function scanForOwedWalkthroughs(state, lookup = defaultPrWalkthroughLookup) {
|
|
1004
1104
|
const candidates = new Set(state.prsHandled);
|
|
1005
1105
|
const branchPrUrl = lookup.branchPrUrl();
|
|
@@ -1769,100 +1869,6 @@ function pathsWithChangedPatch(beforeDiff, afterDiff) {
|
|
|
1769
1869
|
});
|
|
1770
1870
|
}
|
|
1771
1871
|
|
|
1772
|
-
// src/pr-walkthrough/comment.ts
|
|
1773
|
-
function renderReservedComment() {
|
|
1774
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1775
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1776
|
-
|
|
1777
|
-
_Awaiting the E2E acceptance run. Muggle edits this comment in place when the run finishes \u2014 or records why E2E does not apply to this change._`;
|
|
1778
|
-
}
|
|
1779
|
-
function renderSkippedComment(code, detail) {
|
|
1780
|
-
const stated = detail.trim();
|
|
1781
|
-
if (code === "NOT_APPLICABLE" /* NotApplicable */) return renderNotApplicableComment(stated);
|
|
1782
|
-
const qualifier = stated ? ` \u2014 ${stated}` : "";
|
|
1783
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1784
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1785
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1786
|
-
|
|
1787
|
-
**No E2E run.** Muggle verified \`${code}\` \u2014 ${E2E_SKIP_CODE_CLAIMS[code]}${qualifier}.`;
|
|
1788
|
-
}
|
|
1789
|
-
function renderNotApplicableComment(reason) {
|
|
1790
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1791
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1792
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1793
|
-
|
|
1794
|
-
**No E2E run \u2014 not applicable.** ${reason.replace(/\.$/, "")}.
|
|
1795
|
-
|
|
1796
|
-
_The coding agent judged that a browser run cannot exercise this change (\`${"NOT_APPLICABLE" /* NotApplicable */}\`). Muggle did not verify this reason._`;
|
|
1797
|
-
}
|
|
1798
|
-
function renderUnreasonedSkipComment() {
|
|
1799
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1800
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1801
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1802
|
-
|
|
1803
|
-
**No E2E run, and no verified reason given.** The session ended still owing an acceptance run and cited no skip code that Muggle could verify. Treat this PR as unvalidated by E2E.`;
|
|
1804
|
-
}
|
|
1805
|
-
var shortSha = (sha) => sha.slice(0, SHORT_SHA_LENGTH);
|
|
1806
|
-
function renderNoAppLogicChangeComment(declared, headSha, lastFullRun) {
|
|
1807
|
-
const cycleStart = declared.preCycleSha.toLowerCase();
|
|
1808
|
-
const head = headSha?.toLowerCase() ?? null;
|
|
1809
|
-
const isHeadPastCycleStart = head !== null && !head.startsWith(cycleStart) && !cycleStart.startsWith(head);
|
|
1810
|
-
const qualifier = declared.reason ? ` \u2014 ${declared.reason}` : "";
|
|
1811
|
-
const evidence = lastFullRun ? `${LAST_FULL_RUN_OPENING}
|
|
1812
|
-
|
|
1813
|
-
${lastFullRun}
|
|
1814
|
-
|
|
1815
|
-
</details>` : "_No full E2E run is on record for this PR._";
|
|
1816
|
-
const headline = isHeadPastCycleStart ? `**E2E skipped \u2014 no app-logic change in \`${shortSha(head)}\`.**` : `**E2E skipped \u2014 no app-logic change since \`${shortSha(cycleStart)}\`.**`;
|
|
1817
|
-
const baseTip = declared.baseTipSha?.toLowerCase() ?? null;
|
|
1818
|
-
const verdict = baseTip ? `**E2E skipped \u2014 the rebase onto \`${shortSha(baseTip)}\` changed no app logic in this PR.** Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path whose own patch changed in the rebase of \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}, if any did${qualifier}.` : `${headline} Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path changed since \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}${qualifier}.`;
|
|
1819
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1820
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1821
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1822
|
-
|
|
1823
|
-
${verdict}
|
|
1824
|
-
|
|
1825
|
-
` + evidence;
|
|
1826
|
-
}
|
|
1827
|
-
function lastFullRunOf(body) {
|
|
1828
|
-
const status = classifyComment(body);
|
|
1829
|
-
if (status === "reported" /* Reported */) {
|
|
1830
|
-
return withoutRerunNotice(body).replace(REPORT_SENTINEL_TAG, "").trim();
|
|
1831
|
-
}
|
|
1832
|
-
if (status !== "skipped" /* Skipped */) return null;
|
|
1833
|
-
const start = body.indexOf(LAST_FULL_RUN_OPENING);
|
|
1834
|
-
if (start === -1) return null;
|
|
1835
|
-
return body.slice(start + LAST_FULL_RUN_OPENING.length).replace(/\s*<\/details>\s*$/, "").trim();
|
|
1836
|
-
}
|
|
1837
|
-
var formatUtcMinute = (date) => `${date.toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
1838
|
-
function hasRerunNotice(body) {
|
|
1839
|
-
return body.includes(RERUN_NOTICE_OPENING);
|
|
1840
|
-
}
|
|
1841
|
-
function withoutRerunNotice(body) {
|
|
1842
|
-
return body.replace(RERUN_NOTICE_BLOCK, "");
|
|
1843
|
-
}
|
|
1844
|
-
function withRerunNotice(body, startedAt) {
|
|
1845
|
-
return `${RERUN_NOTICE_OPENING}
|
|
1846
|
-
> **A new E2E run is in progress** \u2014 started ${formatUtcMinute(startedAt)}. The results below are from the previous run; this comment updates when the new run finishes.
|
|
1847
|
-
${RERUN_NOTICE_CLOSING}
|
|
1848
|
-
|
|
1849
|
-
` + withoutRerunNotice(body);
|
|
1850
|
-
}
|
|
1851
|
-
function classifyComment(body) {
|
|
1852
|
-
if (body.includes(REPORT_SENTINEL)) return "reported" /* Reported */;
|
|
1853
|
-
if (!body.includes(WALKTHROUGH_SLOT_MARKER)) return "not-designated" /* NotDesignated */;
|
|
1854
|
-
if (body.includes(WALKTHROUGH_SKIPPED_MARKER)) return "skipped" /* Skipped */;
|
|
1855
|
-
return "pending" /* Pending */;
|
|
1856
|
-
}
|
|
1857
|
-
function walkthroughVerdict(bodies) {
|
|
1858
|
-
const statuses = bodies.map(classifyComment);
|
|
1859
|
-
if (statuses.includes("reported" /* Reported */) || statuses.includes("skipped" /* Skipped */)) {
|
|
1860
|
-
return "satisfied" /* Satisfied */;
|
|
1861
|
-
}
|
|
1862
|
-
if (statuses.includes("pending" /* Pending */)) return "pending" /* Pending */;
|
|
1863
|
-
return "missing" /* Missing */;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
1872
|
// src/pr-walkthrough/reserve.ts
|
|
1867
1873
|
function commentWithStatus(comments, status) {
|
|
1868
1874
|
return comments.find((comment) => classifyComment(comment.body) === status);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"release": "5.26.0",
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-10-27T07:
|
|
3
|
+
"buildId": "run-235-1",
|
|
4
|
+
"commitSha": "9188a0adb34bfc61b130249b28c8bc5ecd88eac5",
|
|
5
|
+
"buildTime": "2026-10-27T07:32:07Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muggleai/works",
|
|
3
3
|
"mcpName": "io.github.multiplex-ai/muggle",
|
|
4
|
-
"version": "5.27.0-staging.
|
|
4
|
+
"version": "5.27.0-staging.235",
|
|
5
5
|
"description": "13 years of Microsoft hyperscale engineering, packaged as a harness for your AI coding agent.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
4
|
-
"version": "5.27.0-staging.
|
|
4
|
+
"version": "5.27.0-staging.235",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
package/plugin/.codex-mcp.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
|
-
"version": "5.27.0-staging.
|
|
3
|
+
"version": "5.27.0-staging.235",
|
|
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.27.0-staging.
|
|
5
|
+
"version": "5.27.0-staging.235",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/plugin/.mcp.json
CHANGED
package/plugin/hooks/README.md
CHANGED
|
@@ -47,12 +47,12 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
47
47
|
| `PostToolUse` (Bash) | `guardrail-record-comment-replies.sh` | record | an unresolved-thread fetch named review threads still awaiting an answer (classified by the `<!-- muggle-do:bot -->` marker, never the author login), a threaded reply the provider **confirmed** answered comments in one, or a `MUGGLE_REPLY_SKIP` marker deferred them | — | claim each thread and cover the comments answered, in the per-PR ledger beside the muggle-do slot |
|
|
48
48
|
| `PreToolUse` (Bash, `if` a command names `gh`/`glab`) | `guardrail-report-format.sh` | **enforce** | a `gh pr comment\|create\|edit` body — or a `gh api … issues/comments/<id>` PATCH editing one — reads like an E2E report but lacks the `build-pr-section` sentinel | — | **deny** — render via `muggle build-pr-section` instead |
|
|
49
49
|
| `PreToolUse` (muggle local execute/replay) | `guardrail-classify-gate.sh` | **enforce** | `muggle-test` is the skill in play and the target test case has no `pre-execution-classification` this session | — | **deny** — run Step 6f first (it calls `muggle-remote-test-script-list`, which is where the run learns the case has never passed) or record a legitimate skip via `MUGGLE_CLASSIFY_SKIP`. Scoped to `muggle-test`, so the single-target skills that legitimately skip classification are untouched; fails open when the test case can't be resolved |
|
|
50
|
-
| `PreToolUse` (muggle local execute/replay) | `guardrail-walkthrough-rerun.sh` | record | a browser run is about to start in a working tree (the tool call's `cwd`) whose branch has a PR, and that PR's walkthrough comment already shows a run or a skip | — | a detached job puts a "new E2E run in progress" banner, with its UTC start time, on top of the walkthrough the run will replace. The comment underneath is untouched
|
|
50
|
+
| `PreToolUse` (muggle local execute/replay) | `guardrail-walkthrough-rerun.sh` | record | a browser run is about to start in a working tree (the tool call's `cwd`) whose branch has a PR, and that PR's walkthrough comment already shows a run or a skip | — | a detached job puts a "new E2E run in progress" banner, with its UTC start time, on top of the walkthrough the run will replace. The comment underneath is untouched; the walkthrough check stays in progress until the run's own walkthrough replaces the whole body, banner included, and the walkthrough gate counts the PR as still owing that walkthrough. A reserved placeholder or a comment already bannered is left alone |
|
|
51
51
|
| `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). Quiet while a background acceptance-tester is in flight |
|
|
52
52
|
| `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) |
|
|
53
53
|
| `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 |
|
|
54
54
|
| `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-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 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 |
|
|
55
|
+
| `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 |
|
|
56
56
|
| `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) |
|
|
57
57
|
| `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). Quiet while a background acceptance-tester is in flight — its failed runs land in this session's state and it debugs them itself |
|
|
58
58
|
| `Stop` | `guardrail-comment-reply-gate.sh` | **enforce** | this session claimed a review thread and left one of its comments uncovered | — | **block** the turn until each comment gets its threaded reply per `do/per-comment-replies.md` or a `MUGGLE_REPLY_SKIP: <comment-id> <reason>` marker defers it (releases after 3 blocks). The claim is the signal, not a push, so a round that answers a question with no code change is caught too; a thread another session claimed never blocks this one |
|
|
@@ -115,9 +115,12 @@ guardrail_is_hook_script() {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
# Runs guardrails.mjs on the payload. Never blocks a turn: any failure degrades to {}.
|
|
118
|
+
# A here-string rather than a pipe, so the fallback hears only Node's exit status: a pipe's writer dies of SIGPIPE
|
|
119
|
+
# when Node exits before reading all of its stdin, and pipefail would count that as Node failing and print a second
|
|
120
|
+
# {} after its answer. It also spares forking a subshell to write the payload.
|
|
118
121
|
guardrail_run_node() {
|
|
119
122
|
local root="${CLAUDE_PLUGIN_ROOT:-${CURSOR_PLUGIN_ROOT:-}}"
|
|
120
|
-
|
|
123
|
+
node "${root}/scripts/guardrails.mjs" "$@" <<<"$GUARDRAIL_PAYLOAD" 2>/dev/null || printf '{}'
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
# Entry for a gate script executed directly: its guardrail_wants decides whether Node runs.
|
|
@@ -972,6 +972,102 @@ function applyWalkthroughSkip(state, skipped) {
|
|
|
972
972
|
if (!skipped || state.walkthroughSkipped === true) return state;
|
|
973
973
|
return { ...state, walkthroughSkipped: true };
|
|
974
974
|
}
|
|
975
|
+
|
|
976
|
+
// src/pr-walkthrough/comment.ts
|
|
977
|
+
function renderReservedComment() {
|
|
978
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
979
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
980
|
+
|
|
981
|
+
_Awaiting the E2E acceptance run. Muggle edits this comment in place when the run finishes \u2014 or records why E2E does not apply to this change._`;
|
|
982
|
+
}
|
|
983
|
+
function renderSkippedComment(code, detail) {
|
|
984
|
+
const stated = detail.trim();
|
|
985
|
+
if (code === "NOT_APPLICABLE" /* NotApplicable */) return renderNotApplicableComment(stated);
|
|
986
|
+
const qualifier = stated ? ` \u2014 ${stated}` : "";
|
|
987
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
988
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
989
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
990
|
+
|
|
991
|
+
**No E2E run.** Muggle verified \`${code}\` \u2014 ${E2E_SKIP_CODE_CLAIMS[code]}${qualifier}.`;
|
|
992
|
+
}
|
|
993
|
+
function renderNotApplicableComment(reason) {
|
|
994
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
995
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
996
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
997
|
+
|
|
998
|
+
**No E2E run \u2014 not applicable.** ${reason.replace(/\.$/, "")}.
|
|
999
|
+
|
|
1000
|
+
_The coding agent judged that a browser run cannot exercise this change (\`${"NOT_APPLICABLE" /* NotApplicable */}\`). Muggle did not verify this reason._`;
|
|
1001
|
+
}
|
|
1002
|
+
function renderUnreasonedSkipComment() {
|
|
1003
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1004
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1005
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
1006
|
+
|
|
1007
|
+
**No E2E run, and no verified reason given.** The session ended still owing an acceptance run and cited no skip code that Muggle could verify. Treat this PR as unvalidated by E2E.`;
|
|
1008
|
+
}
|
|
1009
|
+
var shortSha = (sha) => sha.slice(0, SHORT_SHA_LENGTH);
|
|
1010
|
+
function renderNoAppLogicChangeComment(declared, headSha, lastFullRun) {
|
|
1011
|
+
const cycleStart = declared.preCycleSha.toLowerCase();
|
|
1012
|
+
const head = headSha?.toLowerCase() ?? null;
|
|
1013
|
+
const isHeadPastCycleStart = head !== null && !head.startsWith(cycleStart) && !cycleStart.startsWith(head);
|
|
1014
|
+
const qualifier = declared.reason ? ` \u2014 ${declared.reason}` : "";
|
|
1015
|
+
const evidence = lastFullRun ? `${LAST_FULL_RUN_OPENING}
|
|
1016
|
+
|
|
1017
|
+
${lastFullRun}
|
|
1018
|
+
|
|
1019
|
+
</details>` : "_No full E2E run is on record for this PR._";
|
|
1020
|
+
const headline = isHeadPastCycleStart ? `**E2E skipped \u2014 no app-logic change in \`${shortSha(head)}\`.**` : `**E2E skipped \u2014 no app-logic change since \`${shortSha(cycleStart)}\`.**`;
|
|
1021
|
+
const baseTip = declared.baseTipSha?.toLowerCase() ?? null;
|
|
1022
|
+
const verdict = baseTip ? `**E2E skipped \u2014 the rebase onto \`${shortSha(baseTip)}\` changed no app logic in this PR.** Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path whose own patch changed in the rebase of \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}, if any did${qualifier}.` : `${headline} Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path changed since \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}${qualifier}.`;
|
|
1023
|
+
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1024
|
+
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1025
|
+
${WALKTHROUGH_COMMENT_HEADING}
|
|
1026
|
+
|
|
1027
|
+
${verdict}
|
|
1028
|
+
|
|
1029
|
+
` + evidence;
|
|
1030
|
+
}
|
|
1031
|
+
function lastFullRunOf(body) {
|
|
1032
|
+
const status = classifyComment(body);
|
|
1033
|
+
if (status === "reported" /* Reported */) {
|
|
1034
|
+
return withoutRerunNotice(body).replace(REPORT_SENTINEL_TAG, "").trim();
|
|
1035
|
+
}
|
|
1036
|
+
if (status !== "skipped" /* Skipped */) return null;
|
|
1037
|
+
const start = body.indexOf(LAST_FULL_RUN_OPENING);
|
|
1038
|
+
if (start === -1) return null;
|
|
1039
|
+
return body.slice(start + LAST_FULL_RUN_OPENING.length).replace(/\s*<\/details>\s*$/, "").trim();
|
|
1040
|
+
}
|
|
1041
|
+
var formatUtcMinute = (date) => `${date.toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
1042
|
+
function hasRerunNotice(body) {
|
|
1043
|
+
return body.includes(RERUN_NOTICE_OPENING);
|
|
1044
|
+
}
|
|
1045
|
+
function withoutRerunNotice(body) {
|
|
1046
|
+
return body.replace(RERUN_NOTICE_BLOCK, "");
|
|
1047
|
+
}
|
|
1048
|
+
function withRerunNotice(body, startedAt) {
|
|
1049
|
+
return `${RERUN_NOTICE_OPENING}
|
|
1050
|
+
> **A new E2E run is in progress** \u2014 started ${formatUtcMinute(startedAt)}. The results below are from the previous run; this comment updates when the new run finishes.
|
|
1051
|
+
${RERUN_NOTICE_CLOSING}
|
|
1052
|
+
|
|
1053
|
+
` + withoutRerunNotice(body);
|
|
1054
|
+
}
|
|
1055
|
+
function classifyComment(body) {
|
|
1056
|
+
if (body.includes(REPORT_SENTINEL)) return "reported" /* Reported */;
|
|
1057
|
+
if (!body.includes(WALKTHROUGH_SLOT_MARKER)) return "not-designated" /* NotDesignated */;
|
|
1058
|
+
if (body.includes(WALKTHROUGH_SKIPPED_MARKER)) return "skipped" /* Skipped */;
|
|
1059
|
+
return "pending" /* Pending */;
|
|
1060
|
+
}
|
|
1061
|
+
function walkthroughVerdict(bodies) {
|
|
1062
|
+
const statuses = bodies.map(classifyComment);
|
|
1063
|
+
if (statuses.includes("reported" /* Reported */) || statuses.includes("skipped" /* Skipped */)) {
|
|
1064
|
+
return "satisfied" /* Satisfied */;
|
|
1065
|
+
}
|
|
1066
|
+
if (statuses.includes("pending" /* Pending */)) return "pending" /* Pending */;
|
|
1067
|
+
return "missing" /* Missing */;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// src/guardrails/walkthroughOwed.ts
|
|
975
1071
|
function runGh(args) {
|
|
976
1072
|
const timeoutMs = boundedChildTimeoutMs(GH_LOOKUP_TIMEOUT_MS);
|
|
977
1073
|
if (timeoutMs === null) return null;
|
|
@@ -997,9 +1093,13 @@ var defaultPrWalkthroughLookup = {
|
|
|
997
1093
|
prCarriesWalkthrough: (prUrl, acceptsSkip) => {
|
|
998
1094
|
const rendered = runGh(["pr", "view", prUrl, "--json", "body,comments"]);
|
|
999
1095
|
if (rendered === null) return true;
|
|
1000
|
-
return rendered
|
|
1096
|
+
return carriesCurrentWalkthrough(rendered, acceptsSkip);
|
|
1001
1097
|
}
|
|
1002
1098
|
};
|
|
1099
|
+
function carriesCurrentWalkthrough(rendered, acceptsSkip) {
|
|
1100
|
+
if (hasRerunNotice(rendered)) return false;
|
|
1101
|
+
return rendered.includes(REPORT_SENTINEL) || acceptsSkip && rendered.includes(WALKTHROUGH_SKIPPED_MARKER);
|
|
1102
|
+
}
|
|
1003
1103
|
function scanForOwedWalkthroughs(state, lookup = defaultPrWalkthroughLookup) {
|
|
1004
1104
|
const candidates = new Set(state.prsHandled);
|
|
1005
1105
|
const branchPrUrl = lookup.branchPrUrl();
|
|
@@ -1769,100 +1869,6 @@ function pathsWithChangedPatch(beforeDiff, afterDiff) {
|
|
|
1769
1869
|
});
|
|
1770
1870
|
}
|
|
1771
1871
|
|
|
1772
|
-
// src/pr-walkthrough/comment.ts
|
|
1773
|
-
function renderReservedComment() {
|
|
1774
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1775
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1776
|
-
|
|
1777
|
-
_Awaiting the E2E acceptance run. Muggle edits this comment in place when the run finishes \u2014 or records why E2E does not apply to this change._`;
|
|
1778
|
-
}
|
|
1779
|
-
function renderSkippedComment(code, detail) {
|
|
1780
|
-
const stated = detail.trim();
|
|
1781
|
-
if (code === "NOT_APPLICABLE" /* NotApplicable */) return renderNotApplicableComment(stated);
|
|
1782
|
-
const qualifier = stated ? ` \u2014 ${stated}` : "";
|
|
1783
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1784
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1785
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1786
|
-
|
|
1787
|
-
**No E2E run.** Muggle verified \`${code}\` \u2014 ${E2E_SKIP_CODE_CLAIMS[code]}${qualifier}.`;
|
|
1788
|
-
}
|
|
1789
|
-
function renderNotApplicableComment(reason) {
|
|
1790
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1791
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1792
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1793
|
-
|
|
1794
|
-
**No E2E run \u2014 not applicable.** ${reason.replace(/\.$/, "")}.
|
|
1795
|
-
|
|
1796
|
-
_The coding agent judged that a browser run cannot exercise this change (\`${"NOT_APPLICABLE" /* NotApplicable */}\`). Muggle did not verify this reason._`;
|
|
1797
|
-
}
|
|
1798
|
-
function renderUnreasonedSkipComment() {
|
|
1799
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1800
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1801
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1802
|
-
|
|
1803
|
-
**No E2E run, and no verified reason given.** The session ended still owing an acceptance run and cited no skip code that Muggle could verify. Treat this PR as unvalidated by E2E.`;
|
|
1804
|
-
}
|
|
1805
|
-
var shortSha = (sha) => sha.slice(0, SHORT_SHA_LENGTH);
|
|
1806
|
-
function renderNoAppLogicChangeComment(declared, headSha, lastFullRun) {
|
|
1807
|
-
const cycleStart = declared.preCycleSha.toLowerCase();
|
|
1808
|
-
const head = headSha?.toLowerCase() ?? null;
|
|
1809
|
-
const isHeadPastCycleStart = head !== null && !head.startsWith(cycleStart) && !cycleStart.startsWith(head);
|
|
1810
|
-
const qualifier = declared.reason ? ` \u2014 ${declared.reason}` : "";
|
|
1811
|
-
const evidence = lastFullRun ? `${LAST_FULL_RUN_OPENING}
|
|
1812
|
-
|
|
1813
|
-
${lastFullRun}
|
|
1814
|
-
|
|
1815
|
-
</details>` : "_No full E2E run is on record for this PR._";
|
|
1816
|
-
const headline = isHeadPastCycleStart ? `**E2E skipped \u2014 no app-logic change in \`${shortSha(head)}\`.**` : `**E2E skipped \u2014 no app-logic change since \`${shortSha(cycleStart)}\`.**`;
|
|
1817
|
-
const baseTip = declared.baseTipSha?.toLowerCase() ?? null;
|
|
1818
|
-
const verdict = baseTip ? `**E2E skipped \u2014 the rebase onto \`${shortSha(baseTip)}\` changed no app logic in this PR.** Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path whose own patch changed in the rebase of \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}, if any did${qualifier}.` : `${headline} Muggle verified \`${"NO_APP_LOGIC_CHANGE" /* NoAppLogicChange */}\` \u2014 every path changed since \`${shortSha(cycleStart)}\` is ${NON_APP_PATH_SUMMARY}${qualifier}.`;
|
|
1819
|
-
return `${WALKTHROUGH_SLOT_MARKER}
|
|
1820
|
-
${WALKTHROUGH_SKIPPED_MARKER}
|
|
1821
|
-
${WALKTHROUGH_COMMENT_HEADING}
|
|
1822
|
-
|
|
1823
|
-
${verdict}
|
|
1824
|
-
|
|
1825
|
-
` + evidence;
|
|
1826
|
-
}
|
|
1827
|
-
function lastFullRunOf(body) {
|
|
1828
|
-
const status = classifyComment(body);
|
|
1829
|
-
if (status === "reported" /* Reported */) {
|
|
1830
|
-
return withoutRerunNotice(body).replace(REPORT_SENTINEL_TAG, "").trim();
|
|
1831
|
-
}
|
|
1832
|
-
if (status !== "skipped" /* Skipped */) return null;
|
|
1833
|
-
const start = body.indexOf(LAST_FULL_RUN_OPENING);
|
|
1834
|
-
if (start === -1) return null;
|
|
1835
|
-
return body.slice(start + LAST_FULL_RUN_OPENING.length).replace(/\s*<\/details>\s*$/, "").trim();
|
|
1836
|
-
}
|
|
1837
|
-
var formatUtcMinute = (date) => `${date.toISOString().slice(0, 16).replace("T", " ")} UTC`;
|
|
1838
|
-
function hasRerunNotice(body) {
|
|
1839
|
-
return body.includes(RERUN_NOTICE_OPENING);
|
|
1840
|
-
}
|
|
1841
|
-
function withoutRerunNotice(body) {
|
|
1842
|
-
return body.replace(RERUN_NOTICE_BLOCK, "");
|
|
1843
|
-
}
|
|
1844
|
-
function withRerunNotice(body, startedAt) {
|
|
1845
|
-
return `${RERUN_NOTICE_OPENING}
|
|
1846
|
-
> **A new E2E run is in progress** \u2014 started ${formatUtcMinute(startedAt)}. The results below are from the previous run; this comment updates when the new run finishes.
|
|
1847
|
-
${RERUN_NOTICE_CLOSING}
|
|
1848
|
-
|
|
1849
|
-
` + withoutRerunNotice(body);
|
|
1850
|
-
}
|
|
1851
|
-
function classifyComment(body) {
|
|
1852
|
-
if (body.includes(REPORT_SENTINEL)) return "reported" /* Reported */;
|
|
1853
|
-
if (!body.includes(WALKTHROUGH_SLOT_MARKER)) return "not-designated" /* NotDesignated */;
|
|
1854
|
-
if (body.includes(WALKTHROUGH_SKIPPED_MARKER)) return "skipped" /* Skipped */;
|
|
1855
|
-
return "pending" /* Pending */;
|
|
1856
|
-
}
|
|
1857
|
-
function walkthroughVerdict(bodies) {
|
|
1858
|
-
const statuses = bodies.map(classifyComment);
|
|
1859
|
-
if (statuses.includes("reported" /* Reported */) || statuses.includes("skipped" /* Skipped */)) {
|
|
1860
|
-
return "satisfied" /* Satisfied */;
|
|
1861
|
-
}
|
|
1862
|
-
if (statuses.includes("pending" /* Pending */)) return "pending" /* Pending */;
|
|
1863
|
-
return "missing" /* Missing */;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
1872
|
// src/pr-walkthrough/reserve.ts
|
|
1867
1873
|
function commentWithStatus(comments, status) {
|
|
1868
1874
|
return comments.find((comment) => classifyComment(comment.body) === status);
|