@muggleai/works 5.25.0-staging.191 → 5.25.0-staging.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/.mcp.json +1 -1
- package/dist/plugin/hooks/README.md +2 -2
- package/dist/plugin/hooks/codex-hooks.json +1 -1
- package/dist/plugin/hooks/hooks.json +1 -1
- package/dist/plugin/scripts/guardrail-record-tests.sh +4 -5
- package/dist/plugin/scripts/guardrail-skill-stages.sh +2 -0
- package/dist/plugin/scripts/guardrails.mjs +15 -4
- 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/hooks/codex-hooks.json +1 -1
- package/plugin/hooks/hooks.json +1 -1
- package/plugin/scripts/guardrail-record-tests.sh +4 -5
- package/plugin/scripts/guardrail-skill-stages.sh +2 -0
- package/plugin/scripts/guardrails.mjs +15 -4
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "muggleai",
|
|
10
10
|
"source": "./plugin",
|
|
11
11
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
12
|
-
"version": "5.25.0-staging.
|
|
12
|
+
"version": "5.25.0-staging.192"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
4
|
-
"version": "5.25.0-staging.
|
|
4
|
+
"version": "5.25.0-staging.192",
|
|
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.25.0-staging.
|
|
3
|
+
"version": "5.25.0-staging.192",
|
|
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.25.0-staging.
|
|
5
|
+
"version": "5.25.0-staging.192",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
|
@@ -35,10 +35,10 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
35
35
|
| Hook event | Wrapper | Strength | Condition | Preference | Effect |
|
|
36
36
|
| :--------- | :------ | :------- | :-------- | :--------- | :----- |
|
|
37
37
|
| `PostToolUse` (Bash) | `guardrail-pr-opened.sh` | advise | a `gh pr create`/`gh pr ready` just succeeded | `autoWatchPR` | start a `muggle-pr-followup` watcher on the new PR |
|
|
38
|
-
| `PostToolUse` (Bash + muggle execute/replay
|
|
38
|
+
| `PostToolUse` (Bash + muggle execute/replay MCP tools) | `guardrail-record-tests.sh` | record | a unit-test command passed, an E2E run happened (execute/replay call), or an `echo "MUGGLE_E2E_SKIP: <reason>"` marker declared E2E un-runnable, or a walkthrough carrying the `build-pr-section` sentinel was posted / declared un-postable via `echo "MUGGLE_WALKTHROUGH_SKIP: <reason>"` | — | set `unitTestsGreen` / `e2eRun` / `e2eSkipped` / `walkthroughPosted` / `walkthroughSkipped` session state |
|
|
39
39
|
| `PostToolUse` (Bash) | `guardrail-pr-terminal.sh` | advise | a PR just went terminal — a `gh pr merge`/`gh pr close` success line or the `TERMINAL pr=N` line the watch scripts print in a shell result (never bare `"state":"MERGED"` metadata). Not registered on `Monitor`: a Monitor call returns before its script prints anything, so its result never carries that line | — | record `terminalPending`, direct the post-merge handoff: finalize the watcher slot, tear down per `autoCleanup`, offer next options via AskUserQuestion |
|
|
40
40
|
| `PostToolUse` (AskUserQuestion) | `guardrail-offer-ran.sh` | record | a next-options offer ran while a terminal PR was pending | — | clear `terminalPending` — the only exit for the post-merge Stop gate |
|
|
41
|
-
| `PostToolUse` (Skill + muggle telemetry-skill-emit) | `guardrail-skill-stages.sh` | advise | a skill this plugin ships was invoked; its `SKILL.md` frontmatter may declare `mandatoryStages`. Registered on the skill's own MCP announcement too, so the declaration still lands if the Skill payload ever stops carrying a name | — | record `lastInvokedSkillName` + `mandatoryStages
|
|
41
|
+
| `PostToolUse` (Skill + muggle telemetry-skill-emit) | `guardrail-skill-stages.sh` | advise | a skill this plugin ships was invoked; its `SKILL.md` frontmatter may declare `mandatoryStages`. Registered on the skill's own MCP announcement too, so the declaration still lands if the Skill payload ever stops carrying a name. A muggle-test announcement is also an E2E run (the clean SKIP verdict), recorded here alone: the state store drops a write that cannot take the session's lock in time, so a second writer for one emit could lose either record | — | record `lastInvokedSkillName` + `mandatoryStages` (and `e2eRun` for a muggle-test announcement), and name the declared files as required reading at the moment of use |
|
|
42
42
|
| `PostToolUse` (Read) | `guardrail-record-stage-read.sh` | record | a markdown file under a `skills/` directory was opened | — | append to `stagesRead` — how the stage gate tells a stage that was read from one that was skipped |
|
|
43
43
|
| `PostToolUse` (Bash + muggle telemetry-event-emit / user-feedback-create) | `guardrail-record-stage-signals.sh` | record | a Step 6f `pre-execution-classification` emit, debug-path evidence for a failed run (a `*-failure-classified\|resolved` emit or feedback naming it), or a `MUGGLE_STAGE_SKIP` / `MUGGLE_CLASSIFY_SKIP` / `MUGGLE_DEBUG_SKIP` marker | — | set `classifiedTestCaseIds` / `debuggedRuns` / the matching skip flag |
|
|
44
44
|
| `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 |
|
|
@@ -9,10 +9,9 @@ set -uo pipefail
|
|
|
9
9
|
# Fires after every Bash call and every muggle execute/replay, so a keyword
|
|
10
10
|
# pre-filter for test runners and the muggle E2E tool names keeps Node off the
|
|
11
11
|
# hot path. Only a `test` command (npm/pnpm/yarn/jest/vitest/pytest/go/cargo),
|
|
12
|
-
# a muggle execute/replay/test-generation event, a
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# inspects the output for pass/fail and updates state. Degrades to {}.
|
|
12
|
+
# a muggle execute/replay/test-generation event, a skip marker, or a PR publish
|
|
13
|
+
# carrying a rendered walkthrough reaches guardrails.mjs, which then inspects
|
|
14
|
+
# the output for pass/fail and updates state. Degrades to {}.
|
|
16
15
|
#
|
|
17
16
|
# Each arm reads only the field guardrails.mjs judges it by — the command, or the
|
|
18
17
|
# tool's name. Against the whole payload, a jest config in a command's output or
|
|
@@ -33,7 +32,7 @@ GUARDRAIL_SUBCOMMAND="record-tests"
|
|
|
33
32
|
|
|
34
33
|
guardrail_wants() {
|
|
35
34
|
guardrail_fields_match command '(pnpm|npm|yarn)[[:space:]]+(run[[:space:]]+)?test|jest|vitest|pytest|go[[:space:]]+test|cargo[[:space:]]+test|MUGGLE_[A-Z0-9_]+_SKIP|gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]' \
|
|
36
|
-
|| guardrail_fields_match tool_name 'muggle.*(execute|test[-_]generation|replay)
|
|
35
|
+
|| guardrail_fields_match tool_name 'muggle.*(execute|test[-_]generation|replay)'
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
if [[ ${BASH_SOURCE[0]} == "$0" ]]; then
|
|
@@ -5,6 +5,8 @@ set -uo pipefail
|
|
|
5
5
|
# and, when its SKILL.md declares `mandatoryStages`, returns those files as
|
|
6
6
|
# required reading at the moment of use. The Stop gate
|
|
7
7
|
# (guardrail-stage-gate.sh) blocks the turn end while any of them is unread.
|
|
8
|
+
# For a muggle-test skill telemetry emit it also records the E2E run, so the
|
|
9
|
+
# emit has one writer and no lost write to race for.
|
|
8
10
|
#
|
|
9
11
|
# Skill calls are rare, so the pre-filter is a file test rather than a keyword
|
|
10
12
|
# scan: the invoked name is pulled out of the payload and Node runs only when it
|
|
@@ -1955,6 +1955,11 @@ function terminalGate() {
|
|
|
1955
1955
|
const reason = decision.blockCount === 1 ? `Do not end the turn yet. PR ${pendingPrList} went terminal (merged/closed) but the post-merge handoff has not run. Finalize the watcher slot, tear down per autoCleanup, then offer next options to the user ${nextOptionsOfferMethod()} \u2014 release, queued work, deferred items. Only that offer clears this gate.` : `Post-merge handoff still owed for PR ${pendingPrList} (reminder ${decision.blockCount}/${MAX_PR_TERMINAL_BLOCKS}): finalize + tear down, then offer the next options ${nextOptionsOfferMethod()}.`;
|
|
1956
1956
|
return blockStop(reason, host);
|
|
1957
1957
|
}
|
|
1958
|
+
function startWalkthroughScanOnGateArming(stateBefore, committed) {
|
|
1959
|
+
if (isWalkthroughGateArmed(committed) && !isWalkthroughGateArmed(stateBefore)) {
|
|
1960
|
+
startBackgroundJob("scan-walkthroughs" /* ScanWalkthroughs */, [sessionId], input.cwd);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1958
1963
|
function recordTests() {
|
|
1959
1964
|
const cmd = input.tool_input?.command ?? "";
|
|
1960
1965
|
const stateBefore = readState(sessionId);
|
|
@@ -1977,9 +1982,7 @@ function recordTests() {
|
|
|
1977
1982
|
return failedRunId ? applyFailedRun(withWalkthroughSkip, failedRunId) : withWalkthroughSkip;
|
|
1978
1983
|
};
|
|
1979
1984
|
const next = commitState(sessionId, record) ?? record(readState(sessionId));
|
|
1980
|
-
|
|
1981
|
-
startBackgroundJob("scan-walkthroughs" /* ScanWalkthroughs */, [sessionId], input.cwd);
|
|
1982
|
-
}
|
|
1985
|
+
startWalkthroughScanOnGateArming(stateBefore, next);
|
|
1983
1986
|
if (acceptedSkip) recordSkipReasonOnPrs(next, acceptedSkip);
|
|
1984
1987
|
if (judgedSkip && !judgedSkip.accepted) {
|
|
1985
1988
|
return envelope("PostToolUse", explainRejection(judgedSkip), host);
|
|
@@ -1999,8 +2002,16 @@ function skillStages() {
|
|
|
1999
2002
|
const skillName = resolveSkillNameFromToolInput(input.tool_input);
|
|
2000
2003
|
if (!skillName) return "{}";
|
|
2001
2004
|
const stagePaths = resolveSkillStagePaths(skillName, resolvePluginSkillsRoot());
|
|
2002
|
-
const
|
|
2005
|
+
const emittedRun = {
|
|
2006
|
+
unitTestPassed: false,
|
|
2007
|
+
e2eRan: isE2ERun(input),
|
|
2008
|
+
e2eSkipped: false,
|
|
2009
|
+
e2eSkipCycleScoped: false
|
|
2010
|
+
};
|
|
2011
|
+
const stateBefore = readState(sessionId);
|
|
2012
|
+
const invoke = (state) => applyRecordedRun(applySkillInvocation(state, skillName, stagePaths), emittedRun);
|
|
2003
2013
|
const next = commitState(sessionId, invoke) ?? invoke(readState(sessionId));
|
|
2014
|
+
startWalkthroughScanOnGateArming(stateBefore, next);
|
|
2004
2015
|
const unread = unreadMandatoryStages(next);
|
|
2005
2016
|
if (unread.length === 0) return "{}";
|
|
2006
2017
|
const ctx = `The ${skillName} skill declares required reading: ${unread.map(stageLabel).join(", ")}. Read those files now, before working through the skill's steps \u2014 they carry mandatory steps SKILL.md only links to, and treating them as optional elaboration is how those steps get silently dropped. A Stop gate holds the turn open until they are opened.`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"release": "5.18.0",
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-10-
|
|
3
|
+
"buildId": "run-192-1",
|
|
4
|
+
"commitSha": "d5a825598bf9a2595279ea5795c620f4b6196cb5",
|
|
5
|
+
"buildTime": "2026-10-24T20:09:35Z",
|
|
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.25.0-staging.
|
|
4
|
+
"version": "5.25.0-staging.192",
|
|
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.25.0-staging.
|
|
4
|
+
"version": "5.25.0-staging.192",
|
|
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.25.0-staging.
|
|
3
|
+
"version": "5.25.0-staging.192",
|
|
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.25.0-staging.
|
|
5
|
+
"version": "5.25.0-staging.192",
|
|
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
|
@@ -35,10 +35,10 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
35
35
|
| Hook event | Wrapper | Strength | Condition | Preference | Effect |
|
|
36
36
|
| :--------- | :------ | :------- | :-------- | :--------- | :----- |
|
|
37
37
|
| `PostToolUse` (Bash) | `guardrail-pr-opened.sh` | advise | a `gh pr create`/`gh pr ready` just succeeded | `autoWatchPR` | start a `muggle-pr-followup` watcher on the new PR |
|
|
38
|
-
| `PostToolUse` (Bash + muggle execute/replay
|
|
38
|
+
| `PostToolUse` (Bash + muggle execute/replay MCP tools) | `guardrail-record-tests.sh` | record | a unit-test command passed, an E2E run happened (execute/replay call), or an `echo "MUGGLE_E2E_SKIP: <reason>"` marker declared E2E un-runnable, or a walkthrough carrying the `build-pr-section` sentinel was posted / declared un-postable via `echo "MUGGLE_WALKTHROUGH_SKIP: <reason>"` | — | set `unitTestsGreen` / `e2eRun` / `e2eSkipped` / `walkthroughPosted` / `walkthroughSkipped` session state |
|
|
39
39
|
| `PostToolUse` (Bash) | `guardrail-pr-terminal.sh` | advise | a PR just went terminal — a `gh pr merge`/`gh pr close` success line or the `TERMINAL pr=N` line the watch scripts print in a shell result (never bare `"state":"MERGED"` metadata). Not registered on `Monitor`: a Monitor call returns before its script prints anything, so its result never carries that line | — | record `terminalPending`, direct the post-merge handoff: finalize the watcher slot, tear down per `autoCleanup`, offer next options via AskUserQuestion |
|
|
40
40
|
| `PostToolUse` (AskUserQuestion) | `guardrail-offer-ran.sh` | record | a next-options offer ran while a terminal PR was pending | — | clear `terminalPending` — the only exit for the post-merge Stop gate |
|
|
41
|
-
| `PostToolUse` (Skill + muggle telemetry-skill-emit) | `guardrail-skill-stages.sh` | advise | a skill this plugin ships was invoked; its `SKILL.md` frontmatter may declare `mandatoryStages`. Registered on the skill's own MCP announcement too, so the declaration still lands if the Skill payload ever stops carrying a name | — | record `lastInvokedSkillName` + `mandatoryStages
|
|
41
|
+
| `PostToolUse` (Skill + muggle telemetry-skill-emit) | `guardrail-skill-stages.sh` | advise | a skill this plugin ships was invoked; its `SKILL.md` frontmatter may declare `mandatoryStages`. Registered on the skill's own MCP announcement too, so the declaration still lands if the Skill payload ever stops carrying a name. A muggle-test announcement is also an E2E run (the clean SKIP verdict), recorded here alone: the state store drops a write that cannot take the session's lock in time, so a second writer for one emit could lose either record | — | record `lastInvokedSkillName` + `mandatoryStages` (and `e2eRun` for a muggle-test announcement), and name the declared files as required reading at the moment of use |
|
|
42
42
|
| `PostToolUse` (Read) | `guardrail-record-stage-read.sh` | record | a markdown file under a `skills/` directory was opened | — | append to `stagesRead` — how the stage gate tells a stage that was read from one that was skipped |
|
|
43
43
|
| `PostToolUse` (Bash + muggle telemetry-event-emit / user-feedback-create) | `guardrail-record-stage-signals.sh` | record | a Step 6f `pre-execution-classification` emit, debug-path evidence for a failed run (a `*-failure-classified\|resolved` emit or feedback naming it), or a `MUGGLE_STAGE_SKIP` / `MUGGLE_CLASSIFY_SKIP` / `MUGGLE_DEBUG_SKIP` marker | — | set `classifiedTestCaseIds` / `debuggedRuns` / the matching skip flag |
|
|
44
44
|
| `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 |
|
package/plugin/hooks/hooks.json
CHANGED
|
@@ -9,10 +9,9 @@ set -uo pipefail
|
|
|
9
9
|
# Fires after every Bash call and every muggle execute/replay, so a keyword
|
|
10
10
|
# pre-filter for test runners and the muggle E2E tool names keeps Node off the
|
|
11
11
|
# hot path. Only a `test` command (npm/pnpm/yarn/jest/vitest/pytest/go/cargo),
|
|
12
|
-
# a muggle execute/replay/test-generation event, a
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# inspects the output for pass/fail and updates state. Degrades to {}.
|
|
12
|
+
# a muggle execute/replay/test-generation event, a skip marker, or a PR publish
|
|
13
|
+
# carrying a rendered walkthrough reaches guardrails.mjs, which then inspects
|
|
14
|
+
# the output for pass/fail and updates state. Degrades to {}.
|
|
16
15
|
#
|
|
17
16
|
# Each arm reads only the field guardrails.mjs judges it by — the command, or the
|
|
18
17
|
# tool's name. Against the whole payload, a jest config in a command's output or
|
|
@@ -33,7 +32,7 @@ GUARDRAIL_SUBCOMMAND="record-tests"
|
|
|
33
32
|
|
|
34
33
|
guardrail_wants() {
|
|
35
34
|
guardrail_fields_match command '(pnpm|npm|yarn)[[:space:]]+(run[[:space:]]+)?test|jest|vitest|pytest|go[[:space:]]+test|cargo[[:space:]]+test|MUGGLE_[A-Z0-9_]+_SKIP|gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]' \
|
|
36
|
-
|| guardrail_fields_match tool_name 'muggle.*(execute|test[-_]generation|replay)
|
|
35
|
+
|| guardrail_fields_match tool_name 'muggle.*(execute|test[-_]generation|replay)'
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
if [[ ${BASH_SOURCE[0]} == "$0" ]]; then
|
|
@@ -5,6 +5,8 @@ set -uo pipefail
|
|
|
5
5
|
# and, when its SKILL.md declares `mandatoryStages`, returns those files as
|
|
6
6
|
# required reading at the moment of use. The Stop gate
|
|
7
7
|
# (guardrail-stage-gate.sh) blocks the turn end while any of them is unread.
|
|
8
|
+
# For a muggle-test skill telemetry emit it also records the E2E run, so the
|
|
9
|
+
# emit has one writer and no lost write to race for.
|
|
8
10
|
#
|
|
9
11
|
# Skill calls are rare, so the pre-filter is a file test rather than a keyword
|
|
10
12
|
# scan: the invoked name is pulled out of the payload and Node runs only when it
|
|
@@ -1955,6 +1955,11 @@ function terminalGate() {
|
|
|
1955
1955
|
const reason = decision.blockCount === 1 ? `Do not end the turn yet. PR ${pendingPrList} went terminal (merged/closed) but the post-merge handoff has not run. Finalize the watcher slot, tear down per autoCleanup, then offer next options to the user ${nextOptionsOfferMethod()} \u2014 release, queued work, deferred items. Only that offer clears this gate.` : `Post-merge handoff still owed for PR ${pendingPrList} (reminder ${decision.blockCount}/${MAX_PR_TERMINAL_BLOCKS}): finalize + tear down, then offer the next options ${nextOptionsOfferMethod()}.`;
|
|
1956
1956
|
return blockStop(reason, host);
|
|
1957
1957
|
}
|
|
1958
|
+
function startWalkthroughScanOnGateArming(stateBefore, committed) {
|
|
1959
|
+
if (isWalkthroughGateArmed(committed) && !isWalkthroughGateArmed(stateBefore)) {
|
|
1960
|
+
startBackgroundJob("scan-walkthroughs" /* ScanWalkthroughs */, [sessionId], input.cwd);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1958
1963
|
function recordTests() {
|
|
1959
1964
|
const cmd = input.tool_input?.command ?? "";
|
|
1960
1965
|
const stateBefore = readState(sessionId);
|
|
@@ -1977,9 +1982,7 @@ function recordTests() {
|
|
|
1977
1982
|
return failedRunId ? applyFailedRun(withWalkthroughSkip, failedRunId) : withWalkthroughSkip;
|
|
1978
1983
|
};
|
|
1979
1984
|
const next = commitState(sessionId, record) ?? record(readState(sessionId));
|
|
1980
|
-
|
|
1981
|
-
startBackgroundJob("scan-walkthroughs" /* ScanWalkthroughs */, [sessionId], input.cwd);
|
|
1982
|
-
}
|
|
1985
|
+
startWalkthroughScanOnGateArming(stateBefore, next);
|
|
1983
1986
|
if (acceptedSkip) recordSkipReasonOnPrs(next, acceptedSkip);
|
|
1984
1987
|
if (judgedSkip && !judgedSkip.accepted) {
|
|
1985
1988
|
return envelope("PostToolUse", explainRejection(judgedSkip), host);
|
|
@@ -1999,8 +2002,16 @@ function skillStages() {
|
|
|
1999
2002
|
const skillName = resolveSkillNameFromToolInput(input.tool_input);
|
|
2000
2003
|
if (!skillName) return "{}";
|
|
2001
2004
|
const stagePaths = resolveSkillStagePaths(skillName, resolvePluginSkillsRoot());
|
|
2002
|
-
const
|
|
2005
|
+
const emittedRun = {
|
|
2006
|
+
unitTestPassed: false,
|
|
2007
|
+
e2eRan: isE2ERun(input),
|
|
2008
|
+
e2eSkipped: false,
|
|
2009
|
+
e2eSkipCycleScoped: false
|
|
2010
|
+
};
|
|
2011
|
+
const stateBefore = readState(sessionId);
|
|
2012
|
+
const invoke = (state) => applyRecordedRun(applySkillInvocation(state, skillName, stagePaths), emittedRun);
|
|
2003
2013
|
const next = commitState(sessionId, invoke) ?? invoke(readState(sessionId));
|
|
2014
|
+
startWalkthroughScanOnGateArming(stateBefore, next);
|
|
2004
2015
|
const unread = unreadMandatoryStages(next);
|
|
2005
2016
|
if (unread.length === 0) return "{}";
|
|
2006
2017
|
const ctx = `The ${skillName} skill declares required reading: ${unread.map(stageLabel).join(", ")}. Read those files now, before working through the skill's steps \u2014 they carry mandatory steps SKILL.md only links to, and treating them as optional elaboration is how those steps get silently dropped. A Stop gate holds the turn open until they are opened.`;
|