@muggleai/works 5.35.0-staging.328 → 5.35.0-staging.329

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  3. package/dist/plugin/.codex-mcp.json +1 -1
  4. package/dist/plugin/.codex-plugin/plugin.json +1 -1
  5. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  6. package/dist/plugin/.mcp.json +1 -1
  7. package/dist/plugin/scripts/guardrail-build-router.sh +34 -7
  8. package/dist/plugin/scripts/guardrail-capability-claim.sh +21 -9
  9. package/dist/plugin/scripts/guardrail-classify-gate.sh +1 -1
  10. package/dist/plugin/scripts/guardrail-pr-opened.sh +1 -1
  11. package/dist/plugin/scripts/guardrail-pr-terminal.sh +14 -0
  12. package/dist/plugin/scripts/guardrail-record-comment-replies.sh +1 -1
  13. package/dist/plugin/scripts/guardrail-record-delegation.sh +1 -1
  14. package/dist/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
  15. package/dist/plugin/scripts/guardrail-report-format.sh +1 -1
  16. package/dist/plugin/scripts/guardrail-resolve-gate.sh +1 -1
  17. package/dist/plugin/scripts/guardrail-walkthrough-heading.sh +1 -1
  18. package/dist/plugin/scripts/guardrail-walkthrough-progress.sh +1 -1
  19. package/dist/plugin/scripts/guardrail-walkthrough-rerun.sh +1 -1
  20. package/dist/release-manifest.json +4 -4
  21. package/package.json +10 -10
  22. package/plugin/.claude-plugin/plugin.json +1 -1
  23. package/plugin/.codex-mcp.json +1 -1
  24. package/plugin/.codex-plugin/plugin.json +1 -1
  25. package/plugin/.cursor-plugin/plugin.json +1 -1
  26. package/plugin/.mcp.json +1 -1
  27. package/plugin/scripts/guardrail-build-router.sh +34 -7
  28. package/plugin/scripts/guardrail-capability-claim.sh +21 -9
  29. package/plugin/scripts/guardrail-classify-gate.sh +1 -1
  30. package/plugin/scripts/guardrail-pr-opened.sh +1 -1
  31. package/plugin/scripts/guardrail-pr-terminal.sh +14 -0
  32. package/plugin/scripts/guardrail-record-comment-replies.sh +1 -1
  33. package/plugin/scripts/guardrail-record-delegation.sh +1 -1
  34. package/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
  35. package/plugin/scripts/guardrail-report-format.sh +1 -1
  36. package/plugin/scripts/guardrail-resolve-gate.sh +1 -1
  37. package/plugin/scripts/guardrail-walkthrough-heading.sh +1 -1
  38. package/plugin/scripts/guardrail-walkthrough-progress.sh +1 -1
  39. package/plugin/scripts/guardrail-walkthrough-rerun.sh +1 -1
@@ -9,7 +9,7 @@
9
9
  "name": "muggleai",
10
10
  "source": "./plugin",
11
11
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
12
- "version": "5.35.0-staging.328"
12
+ "version": "5.35.0-staging.329"
13
13
  }
14
14
  ]
15
15
  }
@@ -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.35.0-staging.328",
4
+ "version": "5.35.0-staging.329",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.329",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.35.0-staging.328",
3
+ "version": "5.35.0-staging.329",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -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.35.0-staging.328",
5
+ "version": "5.35.0-staging.329",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.329",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -21,6 +21,13 @@ set -uo pipefail
21
21
  # never fire again, so its state flag ends the check in-shell. detectBuildIntent
22
22
  # drops a question or a slash command whatever verbs it holds, so those end here
23
23
  # too, except a /muggle-do or /mdo command, which Node must see to arm the gate.
24
+ #
25
+ # A pasted log makes the prompt hundreds of KB, and capturing it with a regex costs
26
+ # about 1.5 ms per KB, so the prompt is never extracted. The payload is cut at its
27
+ # "prompt" key, which a string value cannot spell unescaped, and the question and
28
+ # slash checks read only the head of what follows while the verbs are glob
29
+ # substring tests, several times cheaper than one alternation regex. Whatever
30
+ # follows the prompt in the payload is searched too, which only over-matches.
24
31
 
25
32
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
26
33
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -28,27 +35,47 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
28
35
 
29
36
  GUARDRAIL_SUBCOMMAND="build-router"
30
37
 
38
+ # Matched case-insensitively as substrings, so "muggle-do" and "mdo" cover every
39
+ # /muggle-do, /muggle:mdo and $mdo spelling.
40
+ BUILD_ROUTER_WORDS=(implement build add create write fix refactor "wire up" "hook up" make "change the" conflict merged passing green muggle-do mdo)
41
+
31
42
  guardrail_wants() {
32
43
  if guardrail_load_state && guardrail_state_has '"buildIntentRouted": true'; then
33
44
  return 1
34
45
  fi
35
- guardrail_payload_field prompt || return 1
46
+ local prompt_key='"prompt"'
47
+ [[ $GUARDRAIL_PAYLOAD == *"$prompt_key"* ]] || return 1
48
+ local prompt_onward="${GUARDRAIL_PAYLOAD#*"$prompt_key"}"
49
+ local value_opening_pattern='^[[:space:]]*:[[:space:]]*"'
50
+ [[ ${prompt_onward:0:64} =~ $value_opening_pattern ]] || return 1
51
+ prompt_onward="${prompt_onward:${#BASH_REMATCH[0]}}"
52
+ local prompt_head="${prompt_onward:0:256}"
36
53
  # The prompt is still JSON-escaped: an escaped newline, return or tab counts as leading
37
- # space, and any other escape leaves the prompt to Node.
54
+ # space, and any other escape leaves the prompt to Node. The value's closing quote ends
55
+ # a command name the way the end of the prompt does.
38
56
  local leading_space='^([[:space:]]|\\[nrt])*'
39
57
  local question_pattern="$leading_space"'(why|what|how|when|where|who|is|are|does|do|can you (explain|tell)|explain)([^A-Za-z0-9_]|$)'
40
58
  local slash_command_pattern="$leading_space"'/'
41
- local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|$)'
59
+ local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|"|$)'
42
60
  local is_rejected_by_node=1
43
61
  shopt -s nocasematch
44
- if [[ $GUARDRAIL_FIELD_VALUE =~ $question_pattern ]]; then
62
+ if [[ $prompt_head =~ $question_pattern ]]; then
45
63
  is_rejected_by_node=0
46
- elif [[ $GUARDRAIL_FIELD_VALUE =~ $slash_command_pattern && ! $GUARDRAIL_FIELD_VALUE =~ $muggle_do_command_pattern ]]; then
64
+ elif [[ $prompt_head =~ $slash_command_pattern && ! $prompt_head =~ $muggle_do_command_pattern ]]; then
47
65
  is_rejected_by_node=0
48
66
  fi
67
+ local is_build_word_found=1
68
+ if ((is_rejected_by_node == 1)); then
69
+ local build_word
70
+ for build_word in "${BUILD_ROUTER_WORDS[@]}"; do
71
+ if [[ $prompt_onward == *"$build_word"* ]]; then
72
+ is_build_word_found=0
73
+ break
74
+ fi
75
+ done
76
+ fi
49
77
  shopt -u nocasematch
50
- ((is_rejected_by_node == 0)) && return 1
51
- guardrail_fields_match prompt '(implement|build|add|create|write|fix|refactor|wire up|hook up|make|change the|conflict|merged|passing|green|[/$](muggle:)?(muggle-do|mdo))'
78
+ return "$is_build_word_found"
52
79
  }
53
80
 
54
81
  if guardrail_is_hook_script; then
@@ -10,8 +10,8 @@ set -uo pipefail
10
10
  # it fires on EVERY turn end, so the pre-filter has to be cheap. The claim lives
11
11
  # in the assistant's prose. A payload carrying the closing message
12
12
  # (`last_assistant_message` — Codex always sends it, Claude Code may) is
13
- # searched in-shell; otherwise the filter greps the transcript tail for an
14
- # impossibility word in-shell and spawns Node only on a hit. Node then applies
13
+ # searched in-shell; otherwise the filter greps the transcript tail for the
14
+ # detector's three word groups in-shell and spawns Node only on a hit. Node then applies
15
15
  # the real per-sentence detector, which is what keeps a genuine SMS/TOTP limit
16
16
  # from being "corrected". Over-matching here costs a needless spawn; it can
17
17
  # never emit a spurious nudge. Degrades to {} so it never blocks on its own
@@ -23,14 +23,30 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
23
23
 
24
24
  GUARDRAIL_SUBCOMMAND="capability-claim-gate"
25
25
 
26
+ # Whether the text holds all three word groups detectFalseCapabilityClaim needs in one sentence:
27
+ # an impossibility, a flow a managed profile clears, and a testing context. Each is a superset of
28
+ # its capabilityClaim.ts pattern, matched anywhere in the text, so it never drops a claim Node
29
+ # would catch. An impossibility word alone hits most turn ends, which say "can't" about anything.
30
+ # The apostrophe slot takes a curly quote as UTF-8 bytes or as the backslash-u2019 escape JSON may carry.
31
+ capability_claim_text_could_match() {
32
+ local text="$1"
33
+ local impossibility_pattern='can(.{1,3}|\\u2019)t|could ?n(.{1,3}|\\u2019)?t|unable to|no way to|not able to|untestable|unverifiable|not testable|impossible|infeasible|blocked from|no (local )?(mail|email|smtp) path'
34
+ local cleared_flow_pattern='link|otp|code|password|verif|2fa|factor|inbox|mail|smtp|captcha|log ?in|logged|sign|auth|credential|sms|text|totp'
35
+ local testing_context_pattern='e2e|end.to.end|test|verif|validat|automat|coverage|covered|exercis|reproduc|replay|script|muggle|playwright|cypress|selenium'
36
+ local matched=1
37
+ shopt -s nocasematch
38
+ [[ $text =~ $impossibility_pattern && $text =~ $cleared_flow_pattern && $text =~ $testing_context_pattern ]] && matched=0
39
+ shopt -u nocasematch
40
+ return "$matched"
41
+ }
42
+
26
43
  guardrail_wants() {
27
44
  if guardrail_load_state && guardrail_state_has '"capabilityClaimNudged": true'; then
28
45
  return 1
29
46
  fi
30
- local claim_pattern='can.t|cannot|unable to|no way to|untestable|unverifiable|impossible|infeasible'
31
47
  local closing_message_pattern='"last_assistant_message"[[:space:]]*:[[:space:]]*"'
32
48
  if [[ $GUARDRAIL_PAYLOAD =~ $closing_message_pattern ]]; then
33
- guardrail_payload_matches "$claim_pattern"
49
+ capability_claim_text_could_match "$GUARDRAIL_PAYLOAD"
34
50
  return
35
51
  fi
36
52
  local transcript_pattern='"transcript_path"[[:space:]]*:[[:space:]]*"([^"]*)"'
@@ -42,11 +58,7 @@ guardrail_wants() {
42
58
  # in-shell costs more than a tail. Gone for the session once the gate has nudged.
43
59
  local transcript_tail
44
60
  transcript_tail="$(tail -c 20000 "$transcript" 2>/dev/null)"
45
- local matched=1
46
- shopt -s nocasematch
47
- [[ $transcript_tail =~ $claim_pattern ]] && matched=0
48
- shopt -u nocasematch
49
- return "$matched"
61
+ capability_claim_text_could_match "$transcript_tail"
50
62
  }
51
63
 
52
64
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="classify-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
24
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="pr-opened"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
21
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,6 +14,12 @@ set -uo pipefail
14
14
  # dropped it a close+reopen — routine, to re-fire a lost workflow trigger — left
15
15
  # the handoff armed on a change that is open again. Degrades to {} so it never
16
16
  # blocks.
17
+ #
18
+ # The output shapes are searched across the whole payload, which carries the
19
+ # command's full output, so the command is checked first: detectPrTerminal only
20
+ # reads the output of a merge, close or reopen, or of the watch scripts, and a
21
+ # payload with no command at all is left to it. Every other command ends here
22
+ # before its output is scanned.
17
23
 
18
24
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
25
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -22,6 +28,14 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
22
28
  GUARDRAIL_SUBCOMMAND="pr-terminal"
23
29
 
24
30
  guardrail_wants() {
31
+ if guardrail_payload_field command; then
32
+ local terminal_command_pattern='(gh|glab)[[:space:]]+(pr|mr)[[:space:]]+(merge|close|reopen)|pr-watch-(loop|arm)\.sh'
33
+ local is_terminal_command=1
34
+ shopt -s nocasematch
35
+ [[ $GUARDRAIL_FIELD_VALUE =~ $terminal_command_pattern ]] && is_terminal_command=0
36
+ shopt -u nocasematch
37
+ ((is_terminal_command == 0)) || return 1
38
+ fi
25
39
  guardrail_payload_matches '(merged|closed|reopened) pull request|TERMINAL pr='
26
40
  }
27
41
 
@@ -25,7 +25,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
25
25
  GUARDRAIL_SUBCOMMAND="record-comment-replies"
26
26
 
27
27
  guardrail_wants() {
28
- guardrail_payload_matches 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
28
+ guardrail_fields_match command 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
29
29
  }
30
30
 
31
31
  if guardrail_is_hook_script; then
@@ -17,7 +17,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
17
17
  GUARDRAIL_SUBCOMMAND="record-delegation"
18
18
 
19
19
  guardrail_wants() {
20
- guardrail_payload_matches 'acceptance-tester'
20
+ guardrail_fields_match subagent_type 'acceptance-tester'
21
21
  }
22
22
 
23
23
  if guardrail_is_hook_script; then
@@ -20,7 +20,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
20
20
  GUARDRAIL_SUBCOMMAND="record-stage-signals"
21
21
 
22
22
  guardrail_wants() {
23
- guardrail_payload_matches 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
23
+ guardrail_fields_match command tool_name 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
24
24
  }
25
25
 
26
26
  if guardrail_is_hook_script; then
@@ -24,7 +24,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
24
24
  GUARDRAIL_SUBCOMMAND="report-gate"
25
25
 
26
26
  guardrail_wants() {
27
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
27
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
28
28
  }
29
29
 
30
30
  if guardrail_is_hook_script; then
@@ -19,7 +19,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
19
  GUARDRAIL_SUBCOMMAND="resolve-gate"
20
20
 
21
21
  guardrail_wants() {
22
- guardrail_payload_matches 'resolveReviewThread|resolved=(true|false)'
22
+ guardrail_fields_match command 'resolveReviewThread|resolved=(true|false)'
23
23
  }
24
24
 
25
25
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="walkthrough-heading-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
24
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-progress-update"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-rerun-notice"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.35.0-staging.328",
3
- "buildId": "run-328-1",
4
- "commitSha": "3162d721a3d25f687ab53afb59245c9bf9c41746",
5
- "buildTime": "2026-11-10T23:25:16Z",
2
+ "release": "5.35.0-staging.329",
3
+ "buildId": "run-329-1",
4
+ "commitSha": "47c57776ee5bc65d5784fa23a00f4f2c9fd7a6bc",
5
+ "buildTime": "2026-11-11T03:01:40Z",
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.35.0-staging.328",
4
+ "version": "5.35.0-staging.329",
5
5
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -66,21 +66,21 @@
66
66
  "typecheck:browser-bench": "tsc --noEmit -p internal/browser-bench/tsconfig.json"
67
67
  },
68
68
  "muggleConfig": {
69
- "electronAppVersion": "1.24.13",
69
+ "electronAppVersion": "1.24.16",
70
70
  "downloadBaseUrl": "https://github.com/multiplex-ai/muggle-ai-works/releases/download",
71
71
  "runtimeTargetDefault": "staging",
72
72
  "checksumsByStream": {
73
73
  "production": {
74
- "win32-x64": "a194f436b0ce5bb64aebe3330b28da58a8aeaa1e8b47bef5df9950b1c9066355",
75
- "linux-x64": "0bd2640042a6115f5e736fe3318b8e32f95a061ea3ee358ce98323adcd3f9772",
76
- "darwin-arm64": "61094420812cf01295f770d39b1744060f2b81365ba7d5886ed81ca84e92c40d",
77
- "darwin-x64": "87c13b5642dd0cd338eca667bfca812d565a3cd6883b519a6896bcae0884df5f"
74
+ "win32-x64": "9645ed8e777fada8893c9f61abc1cdad827808385a68a462c4c087c02dcbaea0",
75
+ "linux-x64": "7067dc5b8fc805c72f615237c6a91f9b5b39381f1b39ce24618b67b2d38fbfe3",
76
+ "darwin-arm64": "19389b118394f576ae206737a129f797b386cd8d138f2f4d58e0ad121e89a174",
77
+ "darwin-x64": "258a27c4474bd875b441d432f1c5d992b1ce485f72a1ac4849e4dd3af1fa2c4f"
78
78
  },
79
79
  "staging": {
80
- "darwin-arm64": "e826af755072e2b068c93250ebd35d45d8929f1a9cf747ec3df56893a92d6d58",
81
- "linux-x64": "092d108de6d39719bcd32d40731abc9712b683f061bf054d6894f599f56bc7b2",
82
- "win32-x64": "08d48826f7b34a496a5b30a6e801410d27da006cfb59c4734016907d72b23fad",
83
- "darwin-x64": "0f14fd6f2cbd88fc29d5a249534eac272ecd28cfcf0fdcf402e658e39aa28a19"
80
+ "darwin-arm64": "2c408bae15a83eb1ddf2946fa82c1108ec9cdb918753f539e66c0fddbb0d3091",
81
+ "linux-x64": "5fe31d7544c2b89714730afe583ceaf1365247496815757a3c6fd7d4703ac8a7",
82
+ "win32-x64": "28ba946a81e4bc1aa70aa3597bfa102c54ff006d4b787e5ea4710db7e26b7764",
83
+ "darwin-x64": "87806b5ca988aeb4cce35a12ae7d1e79a6b8387ee5bf24d0af64fd08d32ee98a"
84
84
  }
85
85
  },
86
86
  "electronAppSignedFromVersion": "1.10.0",
@@ -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.35.0-staging.328",
4
+ "version": "5.35.0-staging.329",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.329",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.35.0-staging.328",
3
+ "version": "5.35.0-staging.329",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -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.35.0-staging.328",
5
+ "version": "5.35.0-staging.329",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/.mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.329",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -21,6 +21,13 @@ set -uo pipefail
21
21
  # never fire again, so its state flag ends the check in-shell. detectBuildIntent
22
22
  # drops a question or a slash command whatever verbs it holds, so those end here
23
23
  # too, except a /muggle-do or /mdo command, which Node must see to arm the gate.
24
+ #
25
+ # A pasted log makes the prompt hundreds of KB, and capturing it with a regex costs
26
+ # about 1.5 ms per KB, so the prompt is never extracted. The payload is cut at its
27
+ # "prompt" key, which a string value cannot spell unescaped, and the question and
28
+ # slash checks read only the head of what follows while the verbs are glob
29
+ # substring tests, several times cheaper than one alternation regex. Whatever
30
+ # follows the prompt in the payload is searched too, which only over-matches.
24
31
 
25
32
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
26
33
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -28,27 +35,47 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
28
35
 
29
36
  GUARDRAIL_SUBCOMMAND="build-router"
30
37
 
38
+ # Matched case-insensitively as substrings, so "muggle-do" and "mdo" cover every
39
+ # /muggle-do, /muggle:mdo and $mdo spelling.
40
+ BUILD_ROUTER_WORDS=(implement build add create write fix refactor "wire up" "hook up" make "change the" conflict merged passing green muggle-do mdo)
41
+
31
42
  guardrail_wants() {
32
43
  if guardrail_load_state && guardrail_state_has '"buildIntentRouted": true'; then
33
44
  return 1
34
45
  fi
35
- guardrail_payload_field prompt || return 1
46
+ local prompt_key='"prompt"'
47
+ [[ $GUARDRAIL_PAYLOAD == *"$prompt_key"* ]] || return 1
48
+ local prompt_onward="${GUARDRAIL_PAYLOAD#*"$prompt_key"}"
49
+ local value_opening_pattern='^[[:space:]]*:[[:space:]]*"'
50
+ [[ ${prompt_onward:0:64} =~ $value_opening_pattern ]] || return 1
51
+ prompt_onward="${prompt_onward:${#BASH_REMATCH[0]}}"
52
+ local prompt_head="${prompt_onward:0:256}"
36
53
  # The prompt is still JSON-escaped: an escaped newline, return or tab counts as leading
37
- # space, and any other escape leaves the prompt to Node.
54
+ # space, and any other escape leaves the prompt to Node. The value's closing quote ends
55
+ # a command name the way the end of the prompt does.
38
56
  local leading_space='^([[:space:]]|\\[nrt])*'
39
57
  local question_pattern="$leading_space"'(why|what|how|when|where|who|is|are|does|do|can you (explain|tell)|explain)([^A-Za-z0-9_]|$)'
40
58
  local slash_command_pattern="$leading_space"'/'
41
- local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|$)'
59
+ local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|"|$)'
42
60
  local is_rejected_by_node=1
43
61
  shopt -s nocasematch
44
- if [[ $GUARDRAIL_FIELD_VALUE =~ $question_pattern ]]; then
62
+ if [[ $prompt_head =~ $question_pattern ]]; then
45
63
  is_rejected_by_node=0
46
- elif [[ $GUARDRAIL_FIELD_VALUE =~ $slash_command_pattern && ! $GUARDRAIL_FIELD_VALUE =~ $muggle_do_command_pattern ]]; then
64
+ elif [[ $prompt_head =~ $slash_command_pattern && ! $prompt_head =~ $muggle_do_command_pattern ]]; then
47
65
  is_rejected_by_node=0
48
66
  fi
67
+ local is_build_word_found=1
68
+ if ((is_rejected_by_node == 1)); then
69
+ local build_word
70
+ for build_word in "${BUILD_ROUTER_WORDS[@]}"; do
71
+ if [[ $prompt_onward == *"$build_word"* ]]; then
72
+ is_build_word_found=0
73
+ break
74
+ fi
75
+ done
76
+ fi
49
77
  shopt -u nocasematch
50
- ((is_rejected_by_node == 0)) && return 1
51
- guardrail_fields_match prompt '(implement|build|add|create|write|fix|refactor|wire up|hook up|make|change the|conflict|merged|passing|green|[/$](muggle:)?(muggle-do|mdo))'
78
+ return "$is_build_word_found"
52
79
  }
53
80
 
54
81
  if guardrail_is_hook_script; then
@@ -10,8 +10,8 @@ set -uo pipefail
10
10
  # it fires on EVERY turn end, so the pre-filter has to be cheap. The claim lives
11
11
  # in the assistant's prose. A payload carrying the closing message
12
12
  # (`last_assistant_message` — Codex always sends it, Claude Code may) is
13
- # searched in-shell; otherwise the filter greps the transcript tail for an
14
- # impossibility word in-shell and spawns Node only on a hit. Node then applies
13
+ # searched in-shell; otherwise the filter greps the transcript tail for the
14
+ # detector's three word groups in-shell and spawns Node only on a hit. Node then applies
15
15
  # the real per-sentence detector, which is what keeps a genuine SMS/TOTP limit
16
16
  # from being "corrected". Over-matching here costs a needless spawn; it can
17
17
  # never emit a spurious nudge. Degrades to {} so it never blocks on its own
@@ -23,14 +23,30 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
23
23
 
24
24
  GUARDRAIL_SUBCOMMAND="capability-claim-gate"
25
25
 
26
+ # Whether the text holds all three word groups detectFalseCapabilityClaim needs in one sentence:
27
+ # an impossibility, a flow a managed profile clears, and a testing context. Each is a superset of
28
+ # its capabilityClaim.ts pattern, matched anywhere in the text, so it never drops a claim Node
29
+ # would catch. An impossibility word alone hits most turn ends, which say "can't" about anything.
30
+ # The apostrophe slot takes a curly quote as UTF-8 bytes or as the backslash-u2019 escape JSON may carry.
31
+ capability_claim_text_could_match() {
32
+ local text="$1"
33
+ local impossibility_pattern='can(.{1,3}|\\u2019)t|could ?n(.{1,3}|\\u2019)?t|unable to|no way to|not able to|untestable|unverifiable|not testable|impossible|infeasible|blocked from|no (local )?(mail|email|smtp) path'
34
+ local cleared_flow_pattern='link|otp|code|password|verif|2fa|factor|inbox|mail|smtp|captcha|log ?in|logged|sign|auth|credential|sms|text|totp'
35
+ local testing_context_pattern='e2e|end.to.end|test|verif|validat|automat|coverage|covered|exercis|reproduc|replay|script|muggle|playwright|cypress|selenium'
36
+ local matched=1
37
+ shopt -s nocasematch
38
+ [[ $text =~ $impossibility_pattern && $text =~ $cleared_flow_pattern && $text =~ $testing_context_pattern ]] && matched=0
39
+ shopt -u nocasematch
40
+ return "$matched"
41
+ }
42
+
26
43
  guardrail_wants() {
27
44
  if guardrail_load_state && guardrail_state_has '"capabilityClaimNudged": true'; then
28
45
  return 1
29
46
  fi
30
- local claim_pattern='can.t|cannot|unable to|no way to|untestable|unverifiable|impossible|infeasible'
31
47
  local closing_message_pattern='"last_assistant_message"[[:space:]]*:[[:space:]]*"'
32
48
  if [[ $GUARDRAIL_PAYLOAD =~ $closing_message_pattern ]]; then
33
- guardrail_payload_matches "$claim_pattern"
49
+ capability_claim_text_could_match "$GUARDRAIL_PAYLOAD"
34
50
  return
35
51
  fi
36
52
  local transcript_pattern='"transcript_path"[[:space:]]*:[[:space:]]*"([^"]*)"'
@@ -42,11 +58,7 @@ guardrail_wants() {
42
58
  # in-shell costs more than a tail. Gone for the session once the gate has nudged.
43
59
  local transcript_tail
44
60
  transcript_tail="$(tail -c 20000 "$transcript" 2>/dev/null)"
45
- local matched=1
46
- shopt -s nocasematch
47
- [[ $transcript_tail =~ $claim_pattern ]] && matched=0
48
- shopt -u nocasematch
49
- return "$matched"
61
+ capability_claim_text_could_match "$transcript_tail"
50
62
  }
51
63
 
52
64
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="classify-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
24
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="pr-opened"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
21
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,6 +14,12 @@ set -uo pipefail
14
14
  # dropped it a close+reopen — routine, to re-fire a lost workflow trigger — left
15
15
  # the handoff armed on a change that is open again. Degrades to {} so it never
16
16
  # blocks.
17
+ #
18
+ # The output shapes are searched across the whole payload, which carries the
19
+ # command's full output, so the command is checked first: detectPrTerminal only
20
+ # reads the output of a merge, close or reopen, or of the watch scripts, and a
21
+ # payload with no command at all is left to it. Every other command ends here
22
+ # before its output is scanned.
17
23
 
18
24
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
25
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -22,6 +28,14 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
22
28
  GUARDRAIL_SUBCOMMAND="pr-terminal"
23
29
 
24
30
  guardrail_wants() {
31
+ if guardrail_payload_field command; then
32
+ local terminal_command_pattern='(gh|glab)[[:space:]]+(pr|mr)[[:space:]]+(merge|close|reopen)|pr-watch-(loop|arm)\.sh'
33
+ local is_terminal_command=1
34
+ shopt -s nocasematch
35
+ [[ $GUARDRAIL_FIELD_VALUE =~ $terminal_command_pattern ]] && is_terminal_command=0
36
+ shopt -u nocasematch
37
+ ((is_terminal_command == 0)) || return 1
38
+ fi
25
39
  guardrail_payload_matches '(merged|closed|reopened) pull request|TERMINAL pr='
26
40
  }
27
41
 
@@ -25,7 +25,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
25
25
  GUARDRAIL_SUBCOMMAND="record-comment-replies"
26
26
 
27
27
  guardrail_wants() {
28
- guardrail_payload_matches 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
28
+ guardrail_fields_match command 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
29
29
  }
30
30
 
31
31
  if guardrail_is_hook_script; then
@@ -17,7 +17,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
17
17
  GUARDRAIL_SUBCOMMAND="record-delegation"
18
18
 
19
19
  guardrail_wants() {
20
- guardrail_payload_matches 'acceptance-tester'
20
+ guardrail_fields_match subagent_type 'acceptance-tester'
21
21
  }
22
22
 
23
23
  if guardrail_is_hook_script; then
@@ -20,7 +20,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
20
20
  GUARDRAIL_SUBCOMMAND="record-stage-signals"
21
21
 
22
22
  guardrail_wants() {
23
- guardrail_payload_matches 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
23
+ guardrail_fields_match command tool_name 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
24
24
  }
25
25
 
26
26
  if guardrail_is_hook_script; then
@@ -24,7 +24,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
24
24
  GUARDRAIL_SUBCOMMAND="report-gate"
25
25
 
26
26
  guardrail_wants() {
27
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
27
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
28
28
  }
29
29
 
30
30
  if guardrail_is_hook_script; then
@@ -19,7 +19,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
19
  GUARDRAIL_SUBCOMMAND="resolve-gate"
20
20
 
21
21
  guardrail_wants() {
22
- guardrail_payload_matches 'resolveReviewThread|resolved=(true|false)'
22
+ guardrail_fields_match command 'resolveReviewThread|resolved=(true|false)'
23
23
  }
24
24
 
25
25
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="walkthrough-heading-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
24
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-progress-update"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-rerun-notice"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then