@muggleai/works 5.26.0-staging.209 → 5.26.0-staging.210
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/{chunk-PQVRAFNE.js → chunk-DLNSKLZD.js} +109 -6
- package/dist/{chunk-ZR7KLGHQ.js → chunk-H62MFQKC.js} +597 -26
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/.mcp.json +1 -1
- package/dist/plugin/agents/test-prepare-runner.md +1 -1
- package/dist/plugin/skills/_shared/dev-loop/run.md +2 -0
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +6 -3
- package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/claim-stack.md +43 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +1 -1
- package/dist/release-manifest.json +3 -3
- package/dist/src-A45WRSIF.js +1 -0
- 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/agents/test-prepare-runner.md +1 -1
- package/plugin/skills/_shared/dev-loop/run.md +2 -0
- package/plugin/skills/muggle-test-prepare/SKILL.md +6 -3
- package/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -0
- package/plugin/skills/muggle-test-prepare/steps/claim-stack.md +43 -0
- package/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +1 -1
- package/dist/src-J2TJ76XG.js +0 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-
|
|
2
|
-
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-DLNSKLZD.js';
|
|
2
|
+
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-H62MFQKC.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.26.0-staging.
|
|
4
|
+
"version": "5.26.0-staging.210",
|
|
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.26.0-staging.
|
|
3
|
+
"version": "5.26.0-staging.210",
|
|
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.26.0-staging.
|
|
5
|
+
"version": "5.26.0-staging.210",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
|
@@ -22,7 +22,7 @@ The dispatch prompt carries the resolved prepare plan:
|
|
|
22
22
|
|
|
23
23
|
Run these stage files from the skill, in order, exactly as written — they are the single source of truth for each stage's procedure:
|
|
24
24
|
|
|
25
|
-
1. [`../skills/muggle-test-prepare/steps/check-running.md`](../skills/muggle-test-prepare/steps/check-running.md)
|
|
25
|
+
1. [`../skills/muggle-test-prepare/steps/check-running.md`](../skills/muggle-test-prepare/steps/check-running.md) — when a service's port carries `keep` / `start` / `restart` from the stack claim, act only on what that allows. A port the plan gives no claim action is judged by check-running's table alone, exactly as before: a missing claim action is never a reason for `needs-input:`
|
|
26
26
|
2. [`../skills/muggle-test-prepare/steps/env-file.md`](../skills/muggle-test-prepare/steps/env-file.md)
|
|
27
27
|
3. [`../skills/muggle-test-prepare/steps/start-commands.md`](../skills/muggle-test-prepare/steps/start-commands.md)
|
|
28
28
|
4. [`../skills/muggle-test-prepare/steps/fresh-install.md`](../skills/muggle-test-prepare/steps/fresh-install.md)
|
|
@@ -35,3 +35,5 @@ Per test case, branch on `mode`:
|
|
|
35
35
|
Store the returned `runId`, tagged with its `mode`. If a run fails, log it and continue the batch — never abort. Read the result per [`failures.md`](failures.md), then [`publish.md`](publish.md).
|
|
36
36
|
|
|
37
37
|
**A refused run is not a failure.** A result headed `Run refused — checkout is not on the latest …` launched nothing and has no `runId`: the `cwd` checkout lacks its base's latest commit (`BEHIND_BASE`) or carries another branch's commits (`FOREIGN_BASE`). Sync it per [`../sync-branch-with-base.md`](../sync-branch-with-base.md), re-invoke [`muggle-test-prepare`](../../muggle-test-prepare/SKILL.md) so the dev server serves the synced code, and run the case again. Never route it through failure handling or count it as a result.
|
|
38
|
+
|
|
39
|
+
**A stack refusal is not a failure either.** One local service stack serves every session on the machine, and [`muggle-test-prepare`](../../muggle-test-prepare/SKILL.md) claims the ports this checkout needs before it starts anything. A result headed `Run refused — the target port is leased to another checkout` or `Run refused — the service stack changed since this checkout claimed it` launched nothing: re-invoke prepare, which re-claims the stack and restarts what moved, or reports it busy with this checkout's place in line. A run result carrying the `service stack changed during this run` warning describes code that may not be this checkout's — re-run it before counting it. Never kill a peer's service to get a port, and never count any of these as a result.
|
|
@@ -91,14 +91,15 @@ Decide stages, in order; read each detail file when you reach it:
|
|
|
91
91
|
| [derive-service-graph](./steps/derive-service-graph.md) | Derive services from workspace manifests |
|
|
92
92
|
| [rebase-check](./steps/rebase-check.md) | Sync every checkout under test onto the latest base — replays too |
|
|
93
93
|
| [resolve-sources](./steps/resolve-sources.md) | Pick the checkout each service runs from — replays too |
|
|
94
|
+
| [claim-stack](./steps/claim-stack.md) | Claim the shared ports this run needs — replays too; busy returns to the caller |
|
|
94
95
|
| [scope](./steps/scope.md) | Frontend / backend / full stack |
|
|
95
96
|
| [viability-check](./steps/viability-check.md) | Exclude services that can't run locally |
|
|
96
97
|
| [identify-services](./steps/identify-services.md) | Confirm the derived graph; fill the gaps |
|
|
97
98
|
| [e2e-instructions](./steps/e2e-instructions.md) | Startup order, manual steps, local gotchas |
|
|
98
99
|
|
|
99
|
-
The Decide phase's output is the **resolved prepare plan**: `services[]` (name, run directory from [resolve-sources](./steps/resolve-sources.md), start command, expected port, `external` flag, approval granted), `testingScope`, `excludedServices[]`, the recorded dev-server URL, the E2E run instructions, and resolved gate outcomes.
|
|
100
|
+
The Decide phase's output is the **resolved prepare plan**: `services[]` (name, run directory from [resolve-sources](./steps/resolve-sources.md), start command, expected port, `external` flag, approval granted, and the port's `keep` / `start` / `restart` from [claim-stack](./steps/claim-stack.md)), `testingScope`, `excludedServices[]`, the recorded dev-server URL, the E2E run instructions, and resolved gate outcomes.
|
|
100
101
|
|
|
101
|
-
A replay runs [rebase-check](./steps/rebase-check.md)
|
|
102
|
+
A replay runs [rebase-check](./steps/rebase-check.md), [resolve-sources](./steps/resolve-sources.md) and [claim-stack](./steps/claim-stack.md) before dispatching. They ask nothing unless a checkout cannot be brought up to date. A busy stack is not a question either: it returns to the caller.
|
|
102
103
|
|
|
103
104
|
**Execute (agent).** Dispatch the `test-prepare-runner` agent (subagent type `muggle:test-prepare-runner`; bare `test-prepare-runner` where the plugin namespace is absent), synchronously, passing the resolved plan; it returns `READY` / `DEGRADED` plus the readiness table. The agent's own definition lists its stage files; in a harness with no agent/subagent facility, run the execute-phase stages ([check-running](./steps/check-running.md) through [readiness-report](./steps/readiness-report.md)) inline instead.
|
|
104
105
|
|
|
@@ -118,6 +119,7 @@ Cleanup stops only what runs from the caller's own checkout. Another checkout's
|
|
|
118
119
|
4. Wait ~2 s, verify with `kill -0`
|
|
119
120
|
5. If still alive: `kill -9 <pid>`
|
|
120
121
|
6. Delete that checkout's log directory and tracking file
|
|
122
|
+
7. `muggle stack release --cwd "<caller's checkout>"` — gives up the lease, so the next session in line can have the ports. Run it even when nothing was stopped (a stack shared with peers, or "leave services running"): the services may stay up, but a lease nobody uses only makes peers wait for it to expire
|
|
121
123
|
|
|
122
124
|
Report:
|
|
123
125
|
|
|
@@ -155,7 +157,8 @@ The readiness table names the directory and commit each service runs from, so th
|
|
|
155
157
|
- **Never write a credential into the E2E run instructions** — plaintext notes are not a secret store, and this is the file a user pastes when asking why their stack won't start. Record the env-var or secret name, never its value.
|
|
156
158
|
- **Never leave orphan processes untracked** — every background PID goes into its checkout's tracking file.
|
|
157
159
|
- **Never kill a process the user started independently** — `external: true` survives cleanup.
|
|
158
|
-
- **Never kill or test against another checkout's service** — a listener tracked under a different checkout belongs to a peer session; see [check-running](./steps/check-running.md).
|
|
160
|
+
- **Never kill or test against another checkout's service** — a listener tracked under a different checkout belongs to a peer session; see [check-running](./steps/check-running.md). The one exception is a port the stack claim planned as `restart`: no session's lease needs that service any more.
|
|
161
|
+
- **Never start, restart or kill a service on a port this run has not claimed** — [claim-stack](./steps/claim-stack.md) runs first, and a busy stack goes back to the caller instead of being worked around.
|
|
159
162
|
- **Never start code that is not on the latest base** — no replay, preference, or approval skips [rebase-check](./steps/rebase-check.md) or [resolve-sources](./steps/resolve-sources.md).
|
|
160
163
|
- **Never assume start commands** — verify via indicator file; confirm with user.
|
|
161
164
|
- **Bail early on non-viable services** — don't start what can't run locally.
|
|
@@ -24,6 +24,7 @@ A port that answers proves nothing about which code answers it — a peer sessio
|
|
|
24
24
|
| A tracking entry with this port, a live PID, `dir` = the run directory and `headSha` = the commit it must serve | **Proven** — keep it. A base-checkout service a peer started is proven the same way, and shared |
|
|
25
25
|
| The plan marks the service `external: true` | **Vouched** — the user confirmed in Decide that they run it from this checkout; keep it, never kill it |
|
|
26
26
|
| Tracked under the run directory's checkout at an older `headSha` | **Stale** — restart it per [start-services](./start-services.md) |
|
|
27
|
+
| Tracked under a different checkout, PID alive, and the plan marks the port `restart` from [claim-stack](./claim-stack.md) | **Released** — no session's lease needs it any more; restart it from the run directory per [start-services](./start-services.md) |
|
|
27
28
|
| Tracked under a different checkout, PID alive | **A peer's** — never test against it, never kill it; [Port already held](#port-already-held) |
|
|
28
29
|
| Untracked | **Unknown code** — when the plan approves a restart for this service, treat it as stale: Clean Restart it through [smoke-test](./smoke-test.md)'s loop (kill → [fresh-install](./fresh-install.md) → [start-services](./start-services.md) → re-test). Otherwise [Port already held](#port-already-held) |
|
|
29
30
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Claim the stack
|
|
2
|
+
|
|
3
|
+
The machine runs **one** set of local services: one process per port, shared by every session on it. Before anything is checked, started or restarted, claim the ports this run needs, so two sessions never restart each other's services mid-run, or test against code that isn't theirs. Runs on every invocation, learning runs and replays alike, right after [resolve-sources](./resolve-sources.md) — in-session, never in the agent, because a busy stack has to reach the caller.
|
|
4
|
+
|
|
5
|
+
## Claim
|
|
6
|
+
|
|
7
|
+
One `--need` per service with an expected port, naming its run directory from [resolve-sources](./resolve-sources.md). The commit defaults to what that directory has checked out, which is the commit it must serve:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
muggle stack claim --cwd "<caller's checkout>" --label "<branch or task>" \
|
|
11
|
+
--need 3000=<run-dir-of-frontend> --need 8080=<run-dir-of-backend> --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A service whose port is not known yet goes unclaimed this run; [start-services](./start-services.md) records the port it finds, and the next invocation claims it.
|
|
15
|
+
|
|
16
|
+
The claim answers at once. It never waits on a peer unless asked to.
|
|
17
|
+
|
|
18
|
+
- **`GRANTED`** (exit 0) → the ports are this checkout's to use, alongside any session that needs the same code there (`sharedWith`). Each `plan` entry says what to do with its port, and travels in the resolved plan to the execute phase:
|
|
19
|
+
- `keep` — a tracked service already serves this directory and commit. [check-running](./check-running.md) still proves it.
|
|
20
|
+
- `start` — nothing tracked serves the port.
|
|
21
|
+
- `restart` — a tracked service serves other code that no session's lease needs any more, even when it was started from another checkout. [check-running](./check-running.md) replaces it.
|
|
22
|
+
- **`BUSY`** (exit 75) → another session's lease needs different code on a port this run needs, or a session ahead in line is still owed its turn there. Nothing was started or stopped. Don't ask the user to kill anything or pick another port — the line exists so they never have to. Return to the caller with the blockers (port, who holds it, for how long) and this checkout's `position`. The place is kept for as long as the checkout keeps asking. The caller does other work (unit tests, the next PR, cloud-side fetches) and invokes prepare again after `retryAfterMs`. With nothing else left to do, re-claim with `--wait <seconds>` to wait in the call.
|
|
23
|
+
|
|
24
|
+
`muggle stack status` shows every lease, the line, and the services prepare tracks, without taking a place.
|
|
25
|
+
|
|
26
|
+
## The lease
|
|
27
|
+
|
|
28
|
+
A granted claim is a lease. Every claim, `muggle stack check`, and every local execute run renews it. The lease lasts across the whole batch: prepare once, run every test case, then release it in [Cleanup](../SKILL.md#cleanup). A lease that is never released still ends, and its ports pass to whoever is next in line:
|
|
29
|
+
|
|
30
|
+
- **The session died.** Each run records the session's MCP server as a holder of the lease. Once every holder has exited and a minute has passed with no renewal, the lease ends. The minute rides out an MCP server restart.
|
|
31
|
+
- **Nobody renewed it for 20 minutes.** This covers a lease that never ran a test, so it has no holder to watch.
|
|
32
|
+
|
|
33
|
+
The lease belongs to the checkout, not to one run. Every test case of the same change, including cases run in parallel, runs under it and renews it, and none of them waits on the others.
|
|
34
|
+
|
|
35
|
+
The line is first come, first served per port, and it is pulled, not pushed: nothing calls a waiting session back. A session keeps its place by asking again within the suggested delay, and is served before anyone behind it who wants the same port. A session that stops asking keeps its turn for 30 seconds after the port frees, and its place for 10 minutes.
|
|
36
|
+
|
|
37
|
+
Holding a lease is optimistic, not exclusive. Nothing stops another process from binding a port. Instead, the local execute tools check the lease before every run and again when it ends:
|
|
38
|
+
|
|
39
|
+
- A run whose port another session's lease holds, from a checkout that never claimed it, is refused: `Run refused — the target port is leased to another checkout`.
|
|
40
|
+
- A run whose claimed port no longer serves the claimed code is refused: `Run refused — the service stack changed since this checkout claimed it`. Re-invoke prepare: it re-claims and restarts what moved.
|
|
41
|
+
- A run during which the stack changed returns its result with a warning, and that result is not trusted until it has been re-run.
|
|
42
|
+
|
|
43
|
+
None of these is a test result. Never route them through failure handling.
|
|
@@ -4,7 +4,7 @@ One decision, made before anything else: does a prepare recipe already exist for
|
|
|
4
4
|
|
|
5
5
|
Resolve the recipe location per [confirm-recipe](./confirm-recipe.md).
|
|
6
6
|
|
|
7
|
-
- **Recipe exists** → **replay run**. Run [rebase-check](./rebase-check.md)
|
|
7
|
+
- **Recipe exists** → **replay run**. Run [rebase-check](./rebase-check.md), [resolve-sources](./resolve-sources.md) and [claim-stack](./claim-stack.md), then go straight to the execute phase. No scan, no interview, no questions. The whole point of having learned is not to ask again.
|
|
8
8
|
- **No recipe** → **learning run**. Run the Decide stages in order, then the single gate at the end.
|
|
9
9
|
|
|
10
10
|
A recipe the user declined to save is the same as no recipe: the next run learns again. Declining is not a permanent no, it just means nothing was written.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"release": "5.18.0",
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
5
|
-
"buildTime": "2026-10-
|
|
3
|
+
"buildId": "run-210-1",
|
|
4
|
+
"commitSha": "6ff9e102fd856da52beaf3081430c147a3587ceb",
|
|
5
|
+
"buildTime": "2026-10-26T17:21:07Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CheckoutFreshnessVerdict, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackRelease, decideStackRenewal, deleteApiKeyData, deleteCredentials, e2e_exports as e2e, evaluateCheckoutFreshness, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, loadApiKeyData, loadCredentials, local_exports as localQa, markOnboardingCompleted, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-H62MFQKC.js';
|
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.26.0-staging.
|
|
4
|
+
"version": "5.26.0-staging.210",
|
|
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.26.0-staging.
|
|
4
|
+
"version": "5.26.0-staging.210",
|
|
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.26.0-staging.
|
|
3
|
+
"version": "5.26.0-staging.210",
|
|
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.26.0-staging.
|
|
5
|
+
"version": "5.26.0-staging.210",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/plugin/.mcp.json
CHANGED
|
@@ -22,7 +22,7 @@ The dispatch prompt carries the resolved prepare plan:
|
|
|
22
22
|
|
|
23
23
|
Run these stage files from the skill, in order, exactly as written — they are the single source of truth for each stage's procedure:
|
|
24
24
|
|
|
25
|
-
1. [`../skills/muggle-test-prepare/steps/check-running.md`](../skills/muggle-test-prepare/steps/check-running.md)
|
|
25
|
+
1. [`../skills/muggle-test-prepare/steps/check-running.md`](../skills/muggle-test-prepare/steps/check-running.md) — when a service's port carries `keep` / `start` / `restart` from the stack claim, act only on what that allows. A port the plan gives no claim action is judged by check-running's table alone, exactly as before: a missing claim action is never a reason for `needs-input:`
|
|
26
26
|
2. [`../skills/muggle-test-prepare/steps/env-file.md`](../skills/muggle-test-prepare/steps/env-file.md)
|
|
27
27
|
3. [`../skills/muggle-test-prepare/steps/start-commands.md`](../skills/muggle-test-prepare/steps/start-commands.md)
|
|
28
28
|
4. [`../skills/muggle-test-prepare/steps/fresh-install.md`](../skills/muggle-test-prepare/steps/fresh-install.md)
|
|
@@ -35,3 +35,5 @@ Per test case, branch on `mode`:
|
|
|
35
35
|
Store the returned `runId`, tagged with its `mode`. If a run fails, log it and continue the batch — never abort. Read the result per [`failures.md`](failures.md), then [`publish.md`](publish.md).
|
|
36
36
|
|
|
37
37
|
**A refused run is not a failure.** A result headed `Run refused — checkout is not on the latest …` launched nothing and has no `runId`: the `cwd` checkout lacks its base's latest commit (`BEHIND_BASE`) or carries another branch's commits (`FOREIGN_BASE`). Sync it per [`../sync-branch-with-base.md`](../sync-branch-with-base.md), re-invoke [`muggle-test-prepare`](../../muggle-test-prepare/SKILL.md) so the dev server serves the synced code, and run the case again. Never route it through failure handling or count it as a result.
|
|
38
|
+
|
|
39
|
+
**A stack refusal is not a failure either.** One local service stack serves every session on the machine, and [`muggle-test-prepare`](../../muggle-test-prepare/SKILL.md) claims the ports this checkout needs before it starts anything. A result headed `Run refused — the target port is leased to another checkout` or `Run refused — the service stack changed since this checkout claimed it` launched nothing: re-invoke prepare, which re-claims the stack and restarts what moved, or reports it busy with this checkout's place in line. A run result carrying the `service stack changed during this run` warning describes code that may not be this checkout's — re-run it before counting it. Never kill a peer's service to get a port, and never count any of these as a result.
|
|
@@ -91,14 +91,15 @@ Decide stages, in order; read each detail file when you reach it:
|
|
|
91
91
|
| [derive-service-graph](./steps/derive-service-graph.md) | Derive services from workspace manifests |
|
|
92
92
|
| [rebase-check](./steps/rebase-check.md) | Sync every checkout under test onto the latest base — replays too |
|
|
93
93
|
| [resolve-sources](./steps/resolve-sources.md) | Pick the checkout each service runs from — replays too |
|
|
94
|
+
| [claim-stack](./steps/claim-stack.md) | Claim the shared ports this run needs — replays too; busy returns to the caller |
|
|
94
95
|
| [scope](./steps/scope.md) | Frontend / backend / full stack |
|
|
95
96
|
| [viability-check](./steps/viability-check.md) | Exclude services that can't run locally |
|
|
96
97
|
| [identify-services](./steps/identify-services.md) | Confirm the derived graph; fill the gaps |
|
|
97
98
|
| [e2e-instructions](./steps/e2e-instructions.md) | Startup order, manual steps, local gotchas |
|
|
98
99
|
|
|
99
|
-
The Decide phase's output is the **resolved prepare plan**: `services[]` (name, run directory from [resolve-sources](./steps/resolve-sources.md), start command, expected port, `external` flag, approval granted), `testingScope`, `excludedServices[]`, the recorded dev-server URL, the E2E run instructions, and resolved gate outcomes.
|
|
100
|
+
The Decide phase's output is the **resolved prepare plan**: `services[]` (name, run directory from [resolve-sources](./steps/resolve-sources.md), start command, expected port, `external` flag, approval granted, and the port's `keep` / `start` / `restart` from [claim-stack](./steps/claim-stack.md)), `testingScope`, `excludedServices[]`, the recorded dev-server URL, the E2E run instructions, and resolved gate outcomes.
|
|
100
101
|
|
|
101
|
-
A replay runs [rebase-check](./steps/rebase-check.md)
|
|
102
|
+
A replay runs [rebase-check](./steps/rebase-check.md), [resolve-sources](./steps/resolve-sources.md) and [claim-stack](./steps/claim-stack.md) before dispatching. They ask nothing unless a checkout cannot be brought up to date. A busy stack is not a question either: it returns to the caller.
|
|
102
103
|
|
|
103
104
|
**Execute (agent).** Dispatch the `test-prepare-runner` agent (subagent type `muggle:test-prepare-runner`; bare `test-prepare-runner` where the plugin namespace is absent), synchronously, passing the resolved plan; it returns `READY` / `DEGRADED` plus the readiness table. The agent's own definition lists its stage files; in a harness with no agent/subagent facility, run the execute-phase stages ([check-running](./steps/check-running.md) through [readiness-report](./steps/readiness-report.md)) inline instead.
|
|
104
105
|
|
|
@@ -118,6 +119,7 @@ Cleanup stops only what runs from the caller's own checkout. Another checkout's
|
|
|
118
119
|
4. Wait ~2 s, verify with `kill -0`
|
|
119
120
|
5. If still alive: `kill -9 <pid>`
|
|
120
121
|
6. Delete that checkout's log directory and tracking file
|
|
122
|
+
7. `muggle stack release --cwd "<caller's checkout>"` — gives up the lease, so the next session in line can have the ports. Run it even when nothing was stopped (a stack shared with peers, or "leave services running"): the services may stay up, but a lease nobody uses only makes peers wait for it to expire
|
|
121
123
|
|
|
122
124
|
Report:
|
|
123
125
|
|
|
@@ -155,7 +157,8 @@ The readiness table names the directory and commit each service runs from, so th
|
|
|
155
157
|
- **Never write a credential into the E2E run instructions** — plaintext notes are not a secret store, and this is the file a user pastes when asking why their stack won't start. Record the env-var or secret name, never its value.
|
|
156
158
|
- **Never leave orphan processes untracked** — every background PID goes into its checkout's tracking file.
|
|
157
159
|
- **Never kill a process the user started independently** — `external: true` survives cleanup.
|
|
158
|
-
- **Never kill or test against another checkout's service** — a listener tracked under a different checkout belongs to a peer session; see [check-running](./steps/check-running.md).
|
|
160
|
+
- **Never kill or test against another checkout's service** — a listener tracked under a different checkout belongs to a peer session; see [check-running](./steps/check-running.md). The one exception is a port the stack claim planned as `restart`: no session's lease needs that service any more.
|
|
161
|
+
- **Never start, restart or kill a service on a port this run has not claimed** — [claim-stack](./steps/claim-stack.md) runs first, and a busy stack goes back to the caller instead of being worked around.
|
|
159
162
|
- **Never start code that is not on the latest base** — no replay, preference, or approval skips [rebase-check](./steps/rebase-check.md) or [resolve-sources](./steps/resolve-sources.md).
|
|
160
163
|
- **Never assume start commands** — verify via indicator file; confirm with user.
|
|
161
164
|
- **Bail early on non-viable services** — don't start what can't run locally.
|
|
@@ -24,6 +24,7 @@ A port that answers proves nothing about which code answers it — a peer sessio
|
|
|
24
24
|
| A tracking entry with this port, a live PID, `dir` = the run directory and `headSha` = the commit it must serve | **Proven** — keep it. A base-checkout service a peer started is proven the same way, and shared |
|
|
25
25
|
| The plan marks the service `external: true` | **Vouched** — the user confirmed in Decide that they run it from this checkout; keep it, never kill it |
|
|
26
26
|
| Tracked under the run directory's checkout at an older `headSha` | **Stale** — restart it per [start-services](./start-services.md) |
|
|
27
|
+
| Tracked under a different checkout, PID alive, and the plan marks the port `restart` from [claim-stack](./claim-stack.md) | **Released** — no session's lease needs it any more; restart it from the run directory per [start-services](./start-services.md) |
|
|
27
28
|
| Tracked under a different checkout, PID alive | **A peer's** — never test against it, never kill it; [Port already held](#port-already-held) |
|
|
28
29
|
| Untracked | **Unknown code** — when the plan approves a restart for this service, treat it as stale: Clean Restart it through [smoke-test](./smoke-test.md)'s loop (kill → [fresh-install](./fresh-install.md) → [start-services](./start-services.md) → re-test). Otherwise [Port already held](#port-already-held) |
|
|
29
30
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Claim the stack
|
|
2
|
+
|
|
3
|
+
The machine runs **one** set of local services: one process per port, shared by every session on it. Before anything is checked, started or restarted, claim the ports this run needs, so two sessions never restart each other's services mid-run, or test against code that isn't theirs. Runs on every invocation, learning runs and replays alike, right after [resolve-sources](./resolve-sources.md) — in-session, never in the agent, because a busy stack has to reach the caller.
|
|
4
|
+
|
|
5
|
+
## Claim
|
|
6
|
+
|
|
7
|
+
One `--need` per service with an expected port, naming its run directory from [resolve-sources](./resolve-sources.md). The commit defaults to what that directory has checked out, which is the commit it must serve:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
muggle stack claim --cwd "<caller's checkout>" --label "<branch or task>" \
|
|
11
|
+
--need 3000=<run-dir-of-frontend> --need 8080=<run-dir-of-backend> --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A service whose port is not known yet goes unclaimed this run; [start-services](./start-services.md) records the port it finds, and the next invocation claims it.
|
|
15
|
+
|
|
16
|
+
The claim answers at once. It never waits on a peer unless asked to.
|
|
17
|
+
|
|
18
|
+
- **`GRANTED`** (exit 0) → the ports are this checkout's to use, alongside any session that needs the same code there (`sharedWith`). Each `plan` entry says what to do with its port, and travels in the resolved plan to the execute phase:
|
|
19
|
+
- `keep` — a tracked service already serves this directory and commit. [check-running](./check-running.md) still proves it.
|
|
20
|
+
- `start` — nothing tracked serves the port.
|
|
21
|
+
- `restart` — a tracked service serves other code that no session's lease needs any more, even when it was started from another checkout. [check-running](./check-running.md) replaces it.
|
|
22
|
+
- **`BUSY`** (exit 75) → another session's lease needs different code on a port this run needs, or a session ahead in line is still owed its turn there. Nothing was started or stopped. Don't ask the user to kill anything or pick another port — the line exists so they never have to. Return to the caller with the blockers (port, who holds it, for how long) and this checkout's `position`. The place is kept for as long as the checkout keeps asking. The caller does other work (unit tests, the next PR, cloud-side fetches) and invokes prepare again after `retryAfterMs`. With nothing else left to do, re-claim with `--wait <seconds>` to wait in the call.
|
|
23
|
+
|
|
24
|
+
`muggle stack status` shows every lease, the line, and the services prepare tracks, without taking a place.
|
|
25
|
+
|
|
26
|
+
## The lease
|
|
27
|
+
|
|
28
|
+
A granted claim is a lease. Every claim, `muggle stack check`, and every local execute run renews it. The lease lasts across the whole batch: prepare once, run every test case, then release it in [Cleanup](../SKILL.md#cleanup). A lease that is never released still ends, and its ports pass to whoever is next in line:
|
|
29
|
+
|
|
30
|
+
- **The session died.** Each run records the session's MCP server as a holder of the lease. Once every holder has exited and a minute has passed with no renewal, the lease ends. The minute rides out an MCP server restart.
|
|
31
|
+
- **Nobody renewed it for 20 minutes.** This covers a lease that never ran a test, so it has no holder to watch.
|
|
32
|
+
|
|
33
|
+
The lease belongs to the checkout, not to one run. Every test case of the same change, including cases run in parallel, runs under it and renews it, and none of them waits on the others.
|
|
34
|
+
|
|
35
|
+
The line is first come, first served per port, and it is pulled, not pushed: nothing calls a waiting session back. A session keeps its place by asking again within the suggested delay, and is served before anyone behind it who wants the same port. A session that stops asking keeps its turn for 30 seconds after the port frees, and its place for 10 minutes.
|
|
36
|
+
|
|
37
|
+
Holding a lease is optimistic, not exclusive. Nothing stops another process from binding a port. Instead, the local execute tools check the lease before every run and again when it ends:
|
|
38
|
+
|
|
39
|
+
- A run whose port another session's lease holds, from a checkout that never claimed it, is refused: `Run refused — the target port is leased to another checkout`.
|
|
40
|
+
- A run whose claimed port no longer serves the claimed code is refused: `Run refused — the service stack changed since this checkout claimed it`. Re-invoke prepare: it re-claims and restarts what moved.
|
|
41
|
+
- A run during which the stack changed returns its result with a warning, and that result is not trusted until it has been re-run.
|
|
42
|
+
|
|
43
|
+
None of these is a test result. Never route them through failure handling.
|
|
@@ -4,7 +4,7 @@ One decision, made before anything else: does a prepare recipe already exist for
|
|
|
4
4
|
|
|
5
5
|
Resolve the recipe location per [confirm-recipe](./confirm-recipe.md).
|
|
6
6
|
|
|
7
|
-
- **Recipe exists** → **replay run**. Run [rebase-check](./rebase-check.md)
|
|
7
|
+
- **Recipe exists** → **replay run**. Run [rebase-check](./rebase-check.md), [resolve-sources](./resolve-sources.md) and [claim-stack](./claim-stack.md), then go straight to the execute phase. No scan, no interview, no questions. The whole point of having learned is not to ask again.
|
|
8
8
|
- **No recipe** → **learning run**. Run the Decide stages in order, then the single gate at the end.
|
|
9
9
|
|
|
10
10
|
A recipe the user declined to save is the same as no recipe: the next run learns again. Declining is not a permanent no, it just means nothing was written.
|
package/dist/src-J2TJ76XG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, CheckoutFreshnessVerdict, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, completeOnboarding, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports as e2e, evaluateCheckoutFreshness, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, loadApiKeyData, loadCredentials, local_exports as localQa, markOnboardingCompleted, mcp_exports as mcp, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, e2e_exports as qa, readPreferencesMetadata, readRunView, reconcileProjectPreferences, recordOnboardingSkip, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-ZR7KLGHQ.js';
|