@muggleai/works 5.26.0-staging.209 → 5.26.0-staging.211
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-3Y6U6TRB.js} +336 -107
- 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-pr-followup/reconcile.md +1 -1
- package/dist/plugin/skills/muggle-pr-followup/state-schemas.md +1 -1
- 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-pr-followup/reconcile.md +1 -1
- package/plugin/skills/muggle-pr-followup/state-schemas.md +1 -1
- 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/scripts/muggle-watch/README.md +2 -2
- 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-3Y6U6TRB.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.211",
|
|
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.211",
|
|
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.211",
|
|
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.
|
|
@@ -18,7 +18,7 @@ Two invariants hold on every trigger, however the sweep was reached: it never se
|
|
|
18
18
|
|
|
19
19
|
A watcher lives and dies with its session: monitors and `/loop` crons are both session-bound, so a session that ends or hits its usage limit takes every watch down with it. No poller outlives its session to act on a PR. This is deliberate: a review is addressed only inside a session that carries the context to address it, never by a headless process that would reply without that context.
|
|
20
20
|
|
|
21
|
-
What does run out of session is the muggle watch service (`muggle watch`, a per-user scheduled job). It addresses nothing on any PR. For a slot registered in [`watch-registration.json`](state-schemas.md#watch-registrationjson) whose loop is gone while its owner is down, it resumes the **owning** session in the background. That session's reconcile, this procedure, re-arms the watch with its own context. Restarting an idle owner onto a newly installed build goes the same way — stop, then resume on reconcile — so the watchers come back with it. A slot whose PR went terminal while neither its loop nor its owner is running it finalizes itself, as Step 3 would, leaving the post-merge cleanup unrun. Everything else it finds (a dead watcher under
|
|
21
|
+
What does run out of session is the muggle watch service (`muggle watch`, a per-user scheduled job). It addresses nothing on any PR. For a slot registered in [`watch-registration.json`](state-schemas.md#watch-registrationjson) whose loop is gone while its owner is down, or idle in the background between turns, it resumes the **owning** session in the background, stopping an idle one first. That session's reconcile, this procedure, re-arms the watch with its own context. Restarting an idle owner onto a newly installed build goes the same way — stop, then resume on reconcile — so the watchers come back with it. A slot whose PR went terminal while neither its loop nor its owner is running it finalizes itself, as Step 3 would, leaving the post-merge cleanup unrun. Everything else it finds (a dead watcher under an owner mid-turn, waiting on its user, or open in a terminal; red CI; a stale branch) it only reports.
|
|
22
22
|
|
|
23
23
|
**Ownership is session-scoped too, and that is what bounds recovery.** Each slot records the session that armed it in [`owner.json`](state-schemas.md#ownerjson). Step 3.6 re-arms only slots the running session owns — watchers it armed itself, whose poller died under it. A slot owned by another session, or by none, is **never** re-armed here however dead its poller looks. The same argument that forbids a headless daemon forbids a fresh session inheriting a stranger's PR: it would be picking up review work it has no context for, on a branch it never built, and every push it made would be as context-blind as the daemon the design already rejected. Adoption exists precisely so that step is a deliberate act by the owner ([`adopt.md`](adopt.md)) rather than a side effect of starting a session.
|
|
24
24
|
|
|
@@ -59,7 +59,7 @@ The slot's opt-in to recovery by the muggle watch service (`muggle watch`, a per
|
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Recovery requires all of: the slot is registered, the PR is open on GitHub, no loop process carries the slot's `--slot` path, the heartbeat is older than the rollover hand-off, `polling.disabled` is absent, and the `owner.json` session is
|
|
62
|
+
Recovery requires all of: the slot is registered, the PR is open on GitHub, no loop process carries the slot's `--slot` path, the heartbeat is older than the rollover hand-off, `polling.disabled` is absent, and the `owner.json` session either has no running process or is a background session idle between turns. The service then resumes that session in the background from the project dir its transcript records, starting it on `/muggle:muggle-pr-followup reconcile`. An idle running owner is stopped first, and only after a throwaway background launch confirms Claude will resume it in that workspace. Reconcile re-arms only the slots the session owns, so recovery never moves a PR to another session. One resume per owner covers every slot it owns. The service caps resumes per pass and per owner, then falls back to a desktop alert. A resume whose turn ended on the usage-limit notice doesn't count toward the per-owner cap.
|
|
63
63
|
|
|
64
64
|
**Absent ⇒ observed only.** The service still reports on the slot's watcher, CI and branch standing, but never resumes its owner. Slots armed before this file existed stay that way until their next arm. The file lives in the slot, so a `.stopped` rename or a `result.md` retires it with the slot.
|
|
65
65
|
|
|
@@ -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-211-1",
|
|
4
|
+
"commitSha": "0cabdd3552a7494b4c1751b0a156dfea8e1b458e",
|
|
5
|
+
"buildTime": "2026-10-26T17:25:49Z",
|
|
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.211",
|
|
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.211",
|
|
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.211",
|
|
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.211",
|
|
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.
|
|
@@ -18,7 +18,7 @@ Two invariants hold on every trigger, however the sweep was reached: it never se
|
|
|
18
18
|
|
|
19
19
|
A watcher lives and dies with its session: monitors and `/loop` crons are both session-bound, so a session that ends or hits its usage limit takes every watch down with it. No poller outlives its session to act on a PR. This is deliberate: a review is addressed only inside a session that carries the context to address it, never by a headless process that would reply without that context.
|
|
20
20
|
|
|
21
|
-
What does run out of session is the muggle watch service (`muggle watch`, a per-user scheduled job). It addresses nothing on any PR. For a slot registered in [`watch-registration.json`](state-schemas.md#watch-registrationjson) whose loop is gone while its owner is down, it resumes the **owning** session in the background. That session's reconcile, this procedure, re-arms the watch with its own context. Restarting an idle owner onto a newly installed build goes the same way — stop, then resume on reconcile — so the watchers come back with it. A slot whose PR went terminal while neither its loop nor its owner is running it finalizes itself, as Step 3 would, leaving the post-merge cleanup unrun. Everything else it finds (a dead watcher under
|
|
21
|
+
What does run out of session is the muggle watch service (`muggle watch`, a per-user scheduled job). It addresses nothing on any PR. For a slot registered in [`watch-registration.json`](state-schemas.md#watch-registrationjson) whose loop is gone while its owner is down, or idle in the background between turns, it resumes the **owning** session in the background, stopping an idle one first. That session's reconcile, this procedure, re-arms the watch with its own context. Restarting an idle owner onto a newly installed build goes the same way — stop, then resume on reconcile — so the watchers come back with it. A slot whose PR went terminal while neither its loop nor its owner is running it finalizes itself, as Step 3 would, leaving the post-merge cleanup unrun. Everything else it finds (a dead watcher under an owner mid-turn, waiting on its user, or open in a terminal; red CI; a stale branch) it only reports.
|
|
22
22
|
|
|
23
23
|
**Ownership is session-scoped too, and that is what bounds recovery.** Each slot records the session that armed it in [`owner.json`](state-schemas.md#ownerjson). Step 3.6 re-arms only slots the running session owns — watchers it armed itself, whose poller died under it. A slot owned by another session, or by none, is **never** re-armed here however dead its poller looks. The same argument that forbids a headless daemon forbids a fresh session inheriting a stranger's PR: it would be picking up review work it has no context for, on a branch it never built, and every push it made would be as context-blind as the daemon the design already rejected. Adoption exists precisely so that step is a deliberate act by the owner ([`adopt.md`](adopt.md)) rather than a side effect of starting a session.
|
|
24
24
|
|
|
@@ -59,7 +59,7 @@ The slot's opt-in to recovery by the muggle watch service (`muggle watch`, a per
|
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Recovery requires all of: the slot is registered, the PR is open on GitHub, no loop process carries the slot's `--slot` path, the heartbeat is older than the rollover hand-off, `polling.disabled` is absent, and the `owner.json` session is
|
|
62
|
+
Recovery requires all of: the slot is registered, the PR is open on GitHub, no loop process carries the slot's `--slot` path, the heartbeat is older than the rollover hand-off, `polling.disabled` is absent, and the `owner.json` session either has no running process or is a background session idle between turns. The service then resumes that session in the background from the project dir its transcript records, starting it on `/muggle:muggle-pr-followup reconcile`. An idle running owner is stopped first, and only after a throwaway background launch confirms Claude will resume it in that workspace. Reconcile re-arms only the slots the session owns, so recovery never moves a PR to another session. One resume per owner covers every slot it owns. The service caps resumes per pass and per owner, then falls back to a desktop alert. A resume whose turn ended on the usage-limit notice doesn't count toward the per-owner cap.
|
|
63
63
|
|
|
64
64
|
**Absent ⇒ observed only.** The service still reports on the slot's watcher, CI and branch standing, but never resumes its owner. Slots armed before this file existed stay that way until their next arm. The file lives in the slot, so a `.stopped` rename or a `result.md` retires it with the slot.
|
|
65
65
|
|
|
@@ -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.
|
|
@@ -4,9 +4,9 @@ A standing per-user scheduled job that runs `muggle watch tick` every few minute
|
|
|
4
4
|
|
|
5
5
|
- **Tracks** active Claude Code sessions (`claude agents --json`) and Codex sessions (recent `~/.codex/sessions` rollouts). It also tracks their processes: claude, codex, muggle MCP servers, and PR watch loops. Each live Claude session is stamped with when it last loaded its plugins (its process start, or its newest muggle MCP server start after a `/reload-plugins`) and the muggle works build installed then, read off `~/.muggle-ai/postinstall.log`.
|
|
6
6
|
- **Checks every open PR-watch slot** under `~/.muggle-ai/muggle-do/sessions/`. Is its loop running, and heard by a live session? Is CI red? Is the branch behind or conflicting? Are review threads unresolved?
|
|
7
|
-
- **Keeps registered watchers running.** A slot carrying `watch-registration.json` (written by `pr-watch-arm.sh` on every arm) has its owner session resumed in the background when its loop is gone and the owner is down. The resumed session's `/muggle:muggle-pr-followup reconcile` re-arms it with that session's own context. The service never addresses a review, pushes, or kills a process.
|
|
7
|
+
- **Keeps registered watchers running.** A slot carrying `watch-registration.json` (written by `pr-watch-arm.sh` on every arm) has its owner session resumed in the background when its loop is gone and the owner is down, or idle in the background (stopped first, once a throwaway launch confirms Claude will resume it there). A resume that only hit the usage limit is retried without counting against the per-owner cap. The resumed session's `/muggle:muggle-pr-followup reconcile` re-arms it with that session's own context. The service never addresses a review, pushes, or kills a process.
|
|
8
8
|
- **Closes out finished slots.** A slot whose PR GitHub reports merged or closed, with no loop and no running owner, is finalized the way a watcher's terminal tick would: `prs.json` takes the state, `followup.log` the terminal line, and `result.md` is written. Only local files change; post-merge cleanup is left to a session and recorded as not run.
|
|
9
|
-
- **Keeps sessions on the installed build.** A session loaded before the newest global install (or a later user-scope plugin update) is behind. Idle background sessions are restarted onto the new build, up to 3 per tick: a session that owns open PR watches is stopped and resumed on `/muggle:muggle-pr-followup reconcile`, so its watchers come back with it; any other is respawned. Before either, a throwaway background launch in the session's workspace confirms Claude will bring it back; a workspace that refuses is left running and named once. Busy or waiting sessions wait for a later tick, and terminal sessions get one notification to run `/reload-plugins`. No interface runs a slash command inside another session.
|
|
9
|
+
- **Keeps sessions on the installed build.** A session loaded before the newest global install (or a later user-scope plugin update) is behind. Idle background sessions are restarted onto the new build, up to 3 per tick: a session that owns open PR watches is stopped and resumed on `/muggle:muggle-pr-followup reconcile`, so its watchers come back with it; any other is respawned. A resume waits for the stopped process to exit and passes no flag beyond `--bg`, so the session continues under its own id and name. Resuming a session that is still running, or adding flags, starts a copy that the agent view lists beside the original. Before either, a throwaway background launch in the session's workspace confirms Claude will bring it back; a workspace that refuses is left running and named once. Busy or waiting sessions wait for a later tick, and terminal sessions get one notification to run `/reload-plugins`. No interface runs a slash command inside another session.
|
|
10
10
|
- **Records and alerts.** Results go to `status.json` (last snapshot, with open-PR coverage per repo), `state.json` (active findings, recovery attempts, reload progress) and `events.jsonl` (raise/clear/resume/respawn/close-out history) under `~/.muggle-ai/watch/`. New alerts raise one desktop notification per tick.
|
|
11
11
|
|
|
12
12
|
## Install
|
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';
|