# Source Command Megaminx Status

> One-shot status across GCP solves, Kaggle kernels, and local runs for the megaminx competition.

- Skill: `erlemar/source-command-megaminx-status` (Agent Skill)
- Install (CLI): `npx skillmds@latest add erlemar/source-command-megaminx-status`
- Raw SKILL.md: https://api.skillmd.com/api/skills/erlemar/source-command-megaminx-status/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: Erlemar (https://skillmd.com/u/erlemar)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/erlemar/source-command-megaminx-status

---


# source-command-megaminx-status

Use this skill when the user asks to run the migrated source command `megaminx-status`.

## Command Template

# /megaminx-status

Bundles the status checks we run repeatedly during long solves. Reports compact
progress for each active workstream so you can decide what to do next.

## Execution

Do the following in parallel where possible (one Bash call per workstream):

### 1. GCP VM (Phase 1, Phase 2, or any cayley-gpu run)

```bash
IP=<GCP_VM_IP>  # or read from <SSH_KEY> if set
ssh -i <SSH_KEY> \
    -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
    <user>@$IP \
    "ls -la /home/<user>/cayley/megaminx/submissions/ 2>&1 | tail -8; \
     echo '---active solves---'; \
     ps -ef | grep -E 'python.*03_solve' | grep -v grep | head -3; \
     echo '---tail of newest log---'; \
     ls -t /home/<user>/cayley/megaminx/submissions/*.log 2>/dev/null | head -1 | \
       xargs -I{} bash -c 'echo \"-- {} --\"; tail -8 {}'; \
     echo '---chain log---'; \
     cat /home/<user>/run_phase2_chain.log 2>&1 | tail -10"
```

Report: which scripts running, latest progress line (`pid=N attempts=N/M`), any chain status.

### 2. Local 4090 (Phase B or any local solve)

```bash
ls -la megaminx/submissions/*.log 2>&1 | tail -5
echo '---active processes---'
tasklist 2>&1 | grep -i python | head -5
echo '---GPU utilization---'
nvidia-smi --query-gpu=memory.used,memory.total,utilization.gpu --format=csv 2>&1 | head -2
echo '---tail of newest log---'
ls -t megaminx/submissions/*.log 2>/dev/null | head -1 | xargs tail -8
```

Report: GPU util, memory, latest progress line.

### 3. Kaggle (training kernels and probes)

```bash
export KAGGLE_API_TOKEN=$KAGGLE_API_TOKEN
.venv/Scripts/kaggle.exe kernels list --user artgor --mine -p 1 -s 5 2>&1 | head -20
```

For any kernel showing `running`, also fetch:
```bash
.venv/Scripts/kaggle.exe kernels status artgor/<slug> 2>&1
```

Report: which kernels running / done / cancelled, last-completed time.

## Output format

Print a compact 3-section block:

```
GCP (<GCP_VM_IP>):
  - <script>: pid=N attempts=N/M (M-N remaining, ETA Xh)
  - chain: <last status line>

Local (4090):
  - <script>: pid=N attempts=N/M (GPU XX% util, X MiB)

Kaggle:
  - <slug>: <status> (started Xh ago)
```

End with a one-line "next obvious action" suggestion (e.g. "wait Xh for Phase B",
"submit current Phase 1 csv", "Kaggle kernel needs ckpt download").

## Gotchas

- `kaggle kernels output` while RUNNING returns nothing — only `status` works mid-run.
- After a kernel finishes (even cancelled/killed), `output` returns the partial /kaggle/working/ contents.
- GCP IP changes when the VM is stopped+started — re-fetch from `gcloud compute instances list` if SSH fails.
- 03_solve.py exits non-zero at end of full-range solves due to a benign `UnboundLocalError` on `report` (fixed in main, but pre-fix runs still affected). If you see exit code 1 on a finished solve, check the CSV row count, not the exit code.

