|
| 1 | +--- |
| 2 | +name: analyzing-orb-sizing |
| 3 | +description: Retrospectively assesses whether an Amp orb was under-sized, over-sized, or appropriately sized from thread tool output and measured workloads. Use when reviewing orb size, resource pressure, OOM failures, build performance, or orb cost efficiency. |
| 4 | +compatibility: Requires Python 3.9+ and the Amp CLI when analyzing a thread ID. |
| 5 | +argument-hint: <thread-id-or-export.json> --size <a0.tiny|a0.small|a0.medium|a0.large> |
| 6 | +--- |
| 7 | + |
| 8 | +# Analyzing Orb Sizing |
| 9 | + |
| 10 | +Assess orb sizing from evidence, not repository type alone. Run the bundled analyzer first, then use `read_thread` when semantic context is needed to decide whether observed workloads were representative. |
| 11 | + |
| 12 | +## Run the analyzer |
| 13 | + |
| 14 | +From the repository root: |
| 15 | + |
| 16 | +```bash |
| 17 | +python3 .agents/skills/analyzing-orb-sizing/scripts/analyze.py \ |
| 18 | + T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --size a0.small |
| 19 | +``` |
| 20 | + |
| 21 | +It also accepts an existing export, which is useful offline: |
| 22 | + |
| 23 | +```bash |
| 24 | +amp threads export T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /tmp/thread.json |
| 25 | +python3 .agents/skills/analyzing-orb-sizing/scripts/analyze.py \ |
| 26 | + /tmp/thread.json --size a0.small --json |
| 27 | +``` |
| 28 | + |
| 29 | +Always pass the size used by that thread. Project defaults are prospective and may not match an existing orb. |
| 30 | + |
| 31 | +## Interpret the result |
| 32 | + |
| 33 | +- **under-sized**: hard resource-pressure evidence such as OOM, exit 137, allocation failure, or measured usage that reaches the orb limit. Move up one size, then repeat the representative workload. |
| 34 | +- **over-sized**: representative measured workloads fit comfortably on the next smaller size with CPU and memory headroom. Move down one size and verify there. |
| 35 | +- **right-sized**: representative measurements use meaningful capacity without pressure and do not safely fit the next smaller size. |
| 36 | +- **insufficient-evidence**: the transcript lacks trustworthy resource measurements or hard pressure signals. Do not interpret an uneventful thread as proof of over-sizing. |
| 37 | + |
| 38 | +The analyzer only treats shell/tool results as machine evidence. User and assistant prose can describe the task but must not be counted as telemetry. |
| 39 | + |
| 40 | +## Add evidence to a future thread |
| 41 | + |
| 42 | +Run the slowest representative build or test under GNU `time` inside the orb: |
| 43 | + |
| 44 | +```bash |
| 45 | +/usr/bin/time -v cargo test |
| 46 | +/usr/bin/time -v ./gradlew test |
| 47 | +``` |
| 48 | + |
| 49 | +For parallel builds, also record the orb identity and capacity: |
| 50 | + |
| 51 | +```bash |
| 52 | +printf 'orb-capacity cpus=%s memory_kb=%s\n' "$(nproc)" "$(awk '/MemTotal/ {print $2}' /proc/meminfo)" |
| 53 | +``` |
| 54 | + |
| 55 | +Use a clean and an incremental build when both matter. One trivial command, setup/install work, model thinking time, network waits, and idle thread duration are not representative sizing measurements. |
| 56 | + |
| 57 | +## Apply judgment after the script |
| 58 | + |
| 59 | +1. Use `read_thread` to identify what the measured command did and whether it represents normal project work. |
| 60 | +2. Separate compute delay from dependency downloads, network services, lock contention, and test sleeps. |
| 61 | +3. Prefer multiple representative samples. A hard OOM is decisive; an over-sizing recommendation needs measured headroom. |
| 62 | +4. Mention confidence, evidence, and missing evidence in the final recommendation. |
| 63 | +5. Disk is 40 GB for every documented size, so changing size does not solve disk pressure. |
| 64 | + |
| 65 | +## Size reference |
| 66 | + |
| 67 | +| Size | CPUs | Memory | Hourly price | |
| 68 | +|---|---:|---:|---:| |
| 69 | +| `a0.tiny` | 1 | 2 GB | $0.10 | |
| 70 | +| `a0.small` | 2 | 4 GB | $0.21 | |
| 71 | +| `a0.medium` | 8 | 16 GB | $0.83 | |
| 72 | +| `a0.large` | 16 | 32 GB | $1.66 | |
| 73 | + |
| 74 | +Treat prices as a dated reference and verify current Amp pricing before making a cost forecast. |
0 commit comments