Commit Graph

7 Commits

Author SHA1 Message Date
Patrick szymkowiak f7f443e2ee fix(benchmark): use --bare mode for claude CLI in VM (no OAuth keychain)
Claude Code on Linux headless VMs has no keychain access.
Use --bare mode which reads ANTHROPIC_API_KEY from env instead.
The OAuth access token works as API key in bare mode.

Signed-off-by: Patrick szymkowiak <pszymkowiak@innovtech.eu>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-16 11:39:34 +02:00
Patrick szymkowiak 2413b5138a feat(benchmark): multi-LLM quality tests (claude, gemini, codex, ollama)
Quality benchmark now auto-detects available LLM CLIs and uses them
for comprehension tests. No API keys needed — uses each tool's native
auth (OAuth for claude/codex, Google auth for gemini, local for ollama).

New --llm flag: claude | gemini | codex | ollama | auto (default)
Each backend is called via CLI pipe (temp file to avoid shell escaping).
All backends run in parallel when --llm=auto detects multiple.

Signed-off-by: Patrick szymkowiak <pszymkowiak@innovtech.eu>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-16 11:29:05 +02:00
Patrick szymkowiak cc15ea7a8c feat(benchmark): real-project savings + AI comprehension quality tests
Cloud-init VM now installs 50+ real tools (arch-aware for ARM/x86),
clones 14 open-source projects (ripgrep, Flask, Hugo, Vite, Redis,
Newtonsoft.Json, Polars, dbt-core, scikit-learn, Vue, T3, Sinatra,
Laravel, Spring Petclinic), and pre-builds dependencies.

New Phase 12: Token savings measured on real codebases instead of
toy projects. Covers Rust, Python, Go, JS/TS, C, C#, Ruby, Java.

New Phase 13: AI Comprehension Quality benchmark — asks Claude Haiku
the same factual questions on raw vs filtered output to validate that
RTK preserves semantic content while removing 85-99% of tokens.
Uses claude CLI auth (no API key needed) with ANTHROPIC_API_KEY fallback.

Signed-off-by: Patrick szymkowiak <pszymkowiak@innovtech.eu>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-16 11:27:07 +02:00
Patrick szymkowiak 87ee81f08b fix(benchmark): address PR review feedback
- Run cargo test directly through testCmd instead of faking results
- Add 60s per-test timeout on vmExec to prevent hung suite
- Make report path configurable via --report flag (default: project root)
- Fix shell injection in testRewrite by escaping single quotes

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-12 11:55:57 +02:00
Patrick szymkowiak 1fbb6d935b feat(benchmark): add Swift ecosystem tests (6 commands + savings)
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-12 10:36:37 +02:00
Patrick szymkowiak d13c185aac fix(benchmark): address review feedback from @FlorianBruniaux
- Strict exit codes: cargo/python/go tests expect exact exit codes
  instead of "any" (catches real regressions)
- Binary size limit documented: 8MB for ARM Linux VM vs 5MB x86 stripped
- --phase NaN guard: error message instead of silent no-op
- Verdict: 0 failures = READY, any failure = NOT READY (no more "minor issues" budget)
- rtk err exit code bug tracked in #846

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-12 10:36:37 +02:00
Patrick szymkowiak d22759b8c5 feat(benchmark): add multipass VM integration test suite
Bun/TypeScript orchestrator that creates an Ubuntu 24.04 VM via multipass,
installs all dev tools (Rust, Go, Node, Python, .NET, Terraform, etc.),
builds RTK, and runs 103 tests across 11 phases:

- Cargo quality (fmt, clippy, test)
- 47 Rust built-in commands (git, ls, grep, cargo, pytest, go, tsc...)
- 21 TOML filter commands (df, ps, shellcheck, hadolint, helm...)
- Hook rewrite engine (17 rewrite assertions)
- Exit code preservation
- Token savings verification (avg 81%)
- Pipe compatibility
- Edge cases (unicode, ANSI, empty output)
- Performance (memory < 20MB)
- Concurrency (10 parallel executions)

Usage:
  bun run scripts/benchmark/run.ts           # Full suite (~3 min)
  bun run scripts/benchmark/run.ts --quick   # Skip perf/concurrency
  bun run scripts/benchmark/run.ts --phase 3 # Single phase
  bun run scripts/benchmark/cleanup.ts       # Delete VM
  bun run scripts/benchmark/rebuild.ts       # Fast rebuild

Prerequisites: brew install multipass, bun
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-12 10:36:37 +02:00