CAPY.BENCH
GitHub

Muse Code / muse-spark-1.3-contributor

Completed 6 of 7 TDD slices in 1h 17m at $0.25 — while S3 (Send one bounded GET) absorbed 24% of total budget ($0.06, 71 calls). Read failure diagnosis ↓

Outcome
6/7 slices
16 test failures (81/97 passed) · Agent marked 7/7 [x]
Time Elapsed
1h 17m
Range 14m–1h 51m (28 runs)
Estimated Cost
$0.25
USD · range $0.00–$12.90
Test Diagnostic:

Finished in 114.8 seconds (114.0s async, 0.7s sync) — 81/97 passed, 16 failed (68/97 in agent sandbox where loopback TCP failed with :eperm; on host: 7 ConnTest setup key mismatches, 2 CLIInterruptTest setsid EPERM crashes, 4 n/a ms regex mismatches, 2 HTTPS stdout logger + TestServer TLS alert crashes, 1 accept_delay_ms p50 timing assertion) (Agent checked off 7/7 in PLAN.md; post-run holdout audit rejected S7.)

Test suite & secondary run metricsTests, context, calls & commits
Test Suite
81/97
16 failed · 84% passed (114.8s)
Total Tokens
74.07M
99.33% cache hit · 494.1k uncached · 280.9k out
LLM & Tool Calls
358 turns
357 tool executions (10 errors)
Peak Context
388.5k peak
29,181 → 388,500 prompt tokens; compacted to 39,249 on Turn 339
Git Commits
8
Recorded in commit log below

Field Notes / 5 Observations

  1. Highest Token Volume on Leaderboard (74.07M Tokens, 388.5k Peak Context) for $0.25 at 99.33% Cache Hit Rate(3 points)Exact Session Window from Log (15:29:09–16:46:21 WIB / 77m 12s vs. 15:29–16:49 Note) · Wall-Clock Split & Two Retried HTTP 503s · 74.07M Tokens for $0.2522 (96.6% Cache Savings)
    • Exact Session Window from Log (15:29:09–16:46:21 WIB / 77m 12s vs. 15:29–16:49 Note) The session log (.muse-data/muse/sessions/2026/11/05/18be834b-cda1-4fec-bf05-22ce011609e7/session.jsonl) opened at 2026-11-05T08:29:09.756Z (15:29:09 WIB, user prompt at 15:29:12.167 WIB), committed S1–S7 between 15:54:33 and 16:40:00 WIB, committed the review consolidation pass (510b20e) at 16:46:12 WIB, and closed cleanly at 09:46:21.295Z (16:46:21 WIB) for an exact active duration of 77m 12s (4,631.5s, compared to 15:29–16:49 / 80m in the manual note).
    • Wall-Clock Split & Two Retried HTTP 503s: LLM inference consumed 86.0% of total wall-clock time (66m 23s / 3,983.3s across 358 completed turns, avg 11.13s/turn, peaking at 175.8s and 14,401 reasoning tokens on Turn 198 during S4 design), while tool execution and runtime overhead took only 14.0% (10m 48s / 648.2s) because loopback TCP tests failed immediately in the sandbox rather than running 5-second benchmark windows. Out of 360 total model attempts (run.usage), 2 failed with HTTP 503 server_error (at 15:58:12 during S2 and 16:26:04 during S4) and succeeded on automatic 1,000ms retry.
    • 74.07M Tokens for $0.2522 (96.6% Cache Savings) Across 358 completed LLM calls (208 with reasoning blocks totaling 164,502 thinking tokens), the run processed 73,788,829 input tokens (494,058 uncached + 73,294,771 cached, 99.33% cache hit rate) and 280,871 output tokens (74,069,700 total—2.49x the Pi Muse Spark run's 29.74M). At Meta's muse-spark-1.3-contributor rates ($0.10/1M uncached input, $0.002/1M cached input, $0.20/1M output), the run cost $0.252170 ($0.0494 input + $0.1466 cached + $0.0562 output) vs. $7.4351 uncached.
  2. Seatbelt 'proxy_only' Sandbox Blocked Loopback TCP (:eperm) & PTYs — Masking 16 Host Test Failures (81/97 Passed)(2 points)Why Only 68/97 Tests Ran Inside the Session · Forensic Breakdown of All 16 Host Test Failures (81/97 Passed in 114.8s)
    • Why Only 68/97 Tests Ran Inside the Session Muse Code launched with security_mode: {approval: "disabled", sandbox: "normal"} and local_command_network: {mode: "proxy_only"} (session.jsonl lines 1 & 9). Under macOS Seatbelt, every :gen_tcp.listen(0, ...) call failed with {:error, :eperm} (and Mix's TCP concurrency lock required MIX_OS_CONCURRENCY_LOCK=0 on every command). When the agent attempted an unsandboxed bash call on Turn 13 (events.jsonl line 234), the harness rejected it ("unsandboxed execution requires human approval, but approval prompts are disabled"). The agent wrote 68 pure/closed-port tests that passed in-sandbox and 29 local-TCP tests that it marked 'verified by inspection for CI' in PLAN.md.
    • Forensic Breakdown of All 16 Host Test Failures (81/97 Passed in 114.8s) Running mix test outside the sandbox executes the 29 server-backed tests; 13 pass (81/97 total) and 16 fail across 5 unverified code/test bugs: (1) 7 failures in test/capy_bench/http/conn_test.exs (lines 16–64): setup returns {:ok, server: server}, but all 7 test heads pattern-match %{port: port}, raising FunctionClauseError once TestServer.start!() succeeds; (2) 2 failures in test/capy_bench/cli_interrupt_test.exs (lines 79 & 105): the Python wrapper calls os.setsid() inside Port.open, which raises PermissionError: [Errno 1] Operation not permitted because OTP 28's erl_child_setup already makes the port child a process-group leader; (3) 4 failures in test/capy_bench/cli_http_test.exs (lines 181, 194, 210, 235): assert_summary/5 line 51 matches ~r/^Latency \(HTTP responses\): p50 (\d+|n\/a) ms, p95 (\d+|n\/a) ms$/, but CapyBench.Report prints "p50 n/a, p95 n/a" without " ms" when 0 responses complete; (4) 2 failures in HTTPS negative tests (cli_http_test.exs lines 154 & 168): OTP's default :logger prints TLS client Fatal - Bad Certificate / Unknown CA notices to stdout (breaking the 6-line summary parser) AND TestServer.accept_loop/5 (test_server.ex:115) crashes with CaseClauseError on {:error, {:tls_alert, ...}}; and (5) 1 failure in cli_http_test.exs:121 (latency includes connection setup): TestServer.accept_loop sleeps accept_delay_ms: 100 in userspace while the OS kernel TCP listen backlog completes the 3-way handshake immediately in parallel with the client's 100ms pacing interval.
  3. Why S7 Failed in Real Foreground Terminals: Background '&' SIG_IGN Misdiagnosis & Port Process-Group Isolation(3 points)Note vs. Repo PLAN.md on S7 (6/7 Holdout vs. 7/7 Checked) · How the S1 Sandbox Probe Misdiagnosed Escript SIGINT Behavior (Turns 41–68) · Why CapyBench.Interrupt's /bin/sh Port Never Sees Terminal Ctrl-C
    • Note vs. Repo PLAN.md on S7 (6/7 Holdout vs. 7/7 Checked) Although the agent checked [x] on S1–S7 in PLAN.md and committed 778d88e ('S7: handle Ctrl-C with partial summary and exit 130'), both S7 e2e tests in test/capy_bench/cli_interrupt_test.exs fail and pressing Ctrl-C against ./cb in a real foreground PTY kills the process immediately with return code -2 (SIGINT) and '^C' (zero summary output on stdout), matching the manual note's [ ] S7 assessment.
    • How the S1 Sandbox Probe Misdiagnosed Escript SIGINT Behavior (Turns 41–68) When pty.fork() failed in Turn 58 with OSError: out of pty devices (blocked by Seatbelt), the agent tested SIGINT in Turns 41, 62, and 63 via non-interactive bash scripts (/tmp/probe/sigtest.sh, /tmp/probe/sigmatrix.sh) that started the escript in the background with '&' ("$1" hello > /tmp/probe/out.log 2>&1 &). Because POSIX shells without job control automatically set SIGINT to SIG_IGN for background '&' jobs, kill -INT $PID had no effect—leading the agent to falsely conclude in PLAN.md line 42 that 'an escript-mode BEAM ignores SIGINT' and omit +Bi or a wrapper script.
    • Why CapyBench.Interrupt's /bin/sh Port Never Sees Terminal Ctrl-C Based on that false premise, lib/capy_bench/interrupt.ex spawns Port.open({:spawn_executable, "/bin/sh"}, [{:args, ["-c", "trap 'printf \"INTERRUPTED\\n\"' INT; read -r line || exit 0"]}, ...]). Because BEAM's erl_child_setup calls setsid()/setpgid(0, 0) on spawned port children, the /bin/sh helper runs in its own isolated process group and never receives terminal process-group SIGINT; it only passed unit test test/capy_bench/interrupt_test.exs because line 11 sent kill -INT directly to the helper's OS PID.
  4. Mid-Turn Async Context Compaction at 384k Tokens (Turn 339): Why the Final Summary Claimed S1–S7 Were 'Already Implemented'(2 points)Crossing the 384,000-Token Soft Compaction Threshold (Turns 334–338) · 88.9% Context Drop on Turn 339 & Post-Compaction Persona Shift
    • Crossing the 384,000-Token Soft Compaction Threshold (Turns 334–338) During the post-S7 release review pass, prompt context crossed Muse Code's soft_threshold_tokens: 384000 on Turn 334 (384,396 prompt tokens at 16:43:39 WIB), triggering background compaction candidate-3982 (strategy_id: "summary-preserved-suffix/v1", session.jsonl line 10297). While the async summarizer ran for 29.4 seconds, the agent executed Turns 335–338, reaching a peak of 388,500 prompt tokens (388,832 total tokens, 38.54% of the 1,007,997 context limit) on Turn 338.
    • 88.9% Context Drop on Turn 339 & Post-Compaction Persona Shift At 16:44:08 WIB (session.jsonl line 10444), install-4043 replaced all conversation history through sequence 3967 (Turns 1–331, covering S1–S7 implementation) with a structured markdown handoff summary, dropping Turn 339's prompt from 388,500 tokens to 39,249 uncached tokens. Because the post-compaction context began from that summary, the agent's final response (events.jsonl line 6639) reported: 'Done: S1–S7 were already implemented; this session finished with a review consolidation pass plus release verification, committed as 510b20e.'
  5. 8.5x Larger Initial Harness Prompt vs. Pi (29.2k vs. 3.4k Tokens) & Custom AST Lint Gate (mix capy_bench.lint)(2 points)Harness Ablation — Muse Code vs. Pi on muse-spark-1.3-contributor · Custom Elixir AST Linter (lib/mix/tasks/capy_bench/lint.ex) & Silent Crash Dumps
    • Harness Ablation — Muse Code vs. Pi on muse-spark-1.3-contributor On Turn 1, Muse Code v1.4.14 sent 85,375 bytes (29,181 input tokens: 48,581 bytes of base instructions + 36,397 bytes of developer context blocks including a 20,739-byte skills catalog for Blender, Web3D/WGSL, and workflow authoring, plus 397 bytes of user prompt), compared to just 3,437 tokens on Pi. Combined with 358 vs. 239 turns, Muse Code consumed 2.49x more total tokens (74.07M vs. 29.74M) and 78.6% higher cost ($0.25 vs. $0.14).
    • Custom Elixir AST Linter (lib/mix/tasks/capy_bench/lint.ex) & Silent Crash Dumps Because the sandbox blocked Hex package fetches in S1 (Turns 10–11 & 80–82), the agent built a 122-line custom Mix task (mix capy_bench.lint) using Code.string_to_quoted/2 and Macro.prewalk/2 to enforce @moduledoc presence, ban debug calls (IO.inspect/2, dbg/1, IEx.pry/0), and reject TODO/FIXME markers across all 10 lib/ files. However, piping mix commands through '| head' repeatedly closed stdout early on the BEAM, generating erl_crash.dump files that required prepending 'rm -f erl_crash.dump;' to every git add command from S2 through S7.
Slice / Phase Breakdown8 phases · 358 LLM calls · $0.25 · peak in S3

Slice / Phase Breakdown / 8 Phases

Step Range spans transcript events (LLM + tool + system turns) · LLM Calls count completed model inference turns

Per-stage slice breakdown of step ranges, LLM calls, thinking tokens, and cost
Slice / PhaseStep RangeLLM CallsThinking TokensEstimated Cost
S1 PassPreparation + S1: CLI help, escript, custom AST lint gate & Ctrl-C probe (2570c2e)
1–106(106 steps)10659,556
$0.05 (20%)
S2 PassS2: URL & argument validation with exit 2 (950d587)
107–125(19 steps)198,680
$0.01 (4%)
S3 PassS3: Zero-dep HTTP/1.1 & verified TLS client over :gen_tcp/:ssl (41b62fd)
126–196(71 steps)7143,399
$0.06 (24%)Peak
S4 PassS4: Paced 5s single-flight loop & connection reuse (109cfbf)
197–235(39 steps)3919,771
$0.03 (12%)
S5 PassS5: Status code breakdown & exit code rules (cdcf35f)
236–256(21 steps)213,150
$0.02 (8%)
S6 PassS6: Elapsed time & completed-response p50/p95 (b9ec924)
257–273(17 steps)173,925
$0.01 (4%)
S7 MissS7: Port-based SIGINT monitor & partial summary on exit 130 (778d88e)
274–306(33 steps)3318,274
$0.03 (12%)
PostRelease verification, 384k context compaction & review consolidation (510b20e)
307–358(52 steps)527,747
$0.04 (16%)
Total (8 phases)358 steps358164,502$0.25
Tokens, Cache & Cost74.07M tokens · 99.33% cache hit · 2026 Contributor API (98% cache off)

Tokens, Cache & Cost / 2026 Contributor API (98% cache off)

Total Tokens
74.07M(494.1k uncached · 280.9k out)
Cache Hit Rate
99.33%(73.29M / 73.79M prompt)
Thinking Tokens
164.5k(of 280.9k output)
Peak Context
388.5k peak(29,181 → 388,500 prompt tokens; compacted to 39,249 on Turn 339)
Cache Savings
-$7.18 (96.6%)(vs $7.44 uncached)
Unit Economics
$0.04 / slice(12.34M tok/slice)
Tool Precision
97.2% ok(10 err / 357 calls)
Token volume and estimated cost breakdown
ComponentTokensRateEstimated Cost
Input (uncached)494,058$0.10 / 1M$0.049406
Cached (cacheRead)73,294,771$0.002 / 1M (98% off)$0.146590
Output (incl. 164,502 reasoning)280,871$0.20 / 1M$0.056174
Total74,069,700—$0.25 ($0.252170)
Calls & Tool Breakdown358 LLM turns · 357 tool executions · 10 errors

Calls & Tool Breakdown / Tool Loop

LLM Inference Turns
358completed agent_response steps
Tool Executions
357347 succeeded· 10 non-zero / error
  • tool/bash
    188(53% · 185 ok, 3 err)
  • tool/edit_file
    85(24% · 79 ok, 6 err)
  • tool/write_file
    37(10% · 37 ok)
  • tool/read_file
    34(10% · 34 ok)
  • tool/write_todos
    10(3% · 10 ok)
  • tool/search
    2(1% · 2 ok)
  • tool/bash_input
    1(0% · 0 ok, 1 err)
Command & Interface UsedCLI · Single-prompt workflow

Command / Interface Used / CLI

muse exec --model muse-spark-1.3-contributor --effort high --no-approve @PROMPT.md

Run window: 15:29:09–16:46:21 (77m 12s active in session.jsonl; 15:29–16:49 / 80m in manual note) • Session 18be834b-cda1-4fec-bf05-22ce011609e7 (meta / muse-spark-1.3-contributor, Muse Code v1.4.14 dec7d7497f, 1 user message, 1 mid-turn context compaction at Turn 339)

Git Commits9 checkpoints · Riza Fahmi

Git Commits / 9 Checkpoints

Author: Riza Fahmi · Timestamps relative to post-run capture

  1. 510b20eConsolidate interruptible clock, trim stale docs, document private-CA trust
    -4 minutes
  2. 778d88eS7 MissS7: handle Ctrl-C with partial summary and exit 130
    -10 minutes
  3. b9ec924S6S6: report elapsed time and completed-response p50/p95
    -17 minutes
  4. cdcf35fS5S5: report outcome counts and exit codes
    -20 minutes
  5. 109cfbfS4S4: run a paced five-second loop with connection reuse
    -24 minutes
  6. 41b62fdS3S3: send one bounded GET with verified HTTPS and timeouts
    -33 minutes
  7. 950d587S2S2: validate CLI arguments with exit 2 and no requests
    -51 minutes
  8. 2570c2eS1S1: launch the cb CLI with help and lint gate
    -55 minutes
  9. 109a3a2init
    -83 minutes