Commit Graph

681 Commits

Author SHA1 Message Date
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
aesoft aaf4d1d9fe Merge pull request #422 from KuSh/cleanup-warnings
chore: apply clippy suggestions
2026-04-11 12:08:40 +02:00
aesoft 2ba8d372df Merge pull request #270 from KuSh/pnpm-filters
feat(pnpm): Add filter argument support
2026-04-11 10:42:36 +02:00
aesoft 95d9d134b0 Merge pull request #1141 from ousamabenyounes/fix/issue-602
fix(clippy): show full error blocks instead of truncated headline
2026-04-10 14:20:39 +02:00
aesoft a2576883a2 Merge pull request #1096 from michaelschleiss/fix/codex-home-init-path
fix(init): install Codex global instructions in CODEX_HOME
2026-04-10 12:27:21 +02:00
Ousama Ben Younes f4074f898a fix(clippy): show full error blocks instead of truncated headline
Previously `filter_cargo_clippy` only captured the first line of each
error diagnostic (truncated to 160 chars), discarding the file location,
code snippet, `^` markers, and `= note:` context that developers need to
actually fix the issue. This made rtk unusable for `cargo clippy -- -D warnings`.

Now errors are collected as full multi-line blocks (up to 15 lines each,
up to 10 errors total), matching the approach used by `filter_cargo_build`.
Warning grouping by lint rule is unchanged.

Fixes #602

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 10:22:19 +00:00
aesoft 21e67a1113 Merge pull request #924 from rtk-ai/feat/pr-review-skill
feat(skills): add /pr-review skill for batch PR review
2026-04-10 09:52:53 +02:00
aesoft 1400788224 Merge branch 'develop' into feat/pr-review-skill 2026-04-10 09:52:44 +02:00
aesoft 6d7a9f2d4b Merge pull request #936 from rtk-ai/chore/skills-frontmatter
chore(skills): add missing frontmatter to all project-level skills
2026-04-10 09:51:45 +02:00
aesoft c16713a973 Merge pull request #890 from rtk-ai/fix/filter-truncation-621
fix(json): rename --schema to --keys-only, closes #621
2026-04-09 20:17:15 +02:00
aesoft fd0c87a8f3 Update CLAUDE.md 2026-04-09 20:16:03 +02:00
michaelschleiss d442799e34 fix(init): honor CODEX_HOME for Codex global paths 2026-04-09 10:32:43 +02:00
aesoft 66b90f1ed3 Merge pull request #802 from Yosoyepa/feat/add-new-agents
feat(init): add support for kilocode and antigravity agents
2026-04-09 09:28:11 +02:00
aesoft 0b1c32b3cc Merge pull request #959 from tmchow/osc/958-fix-timeout-summary
fix: report package-level failures (timeouts, signals) in go test summary
2026-04-09 09:14:07 +02:00
aesoft 644c50f786 Merge pull request #1001 from rtk-ai/feat/telemetry-enrichment
feat(telemetry): enrich daily ping with gap detection and quality metrics
2026-04-09 08:57:21 +02:00
yosoyepa d0a3797ec5 feat(init): add native support for Kilo Code and Google Antigravity
Add rtk init --agent kilocode and rtk init --agent antigravity commands.

Kilo Code: installs .kilocode/rules/rtk-rules.md (project-scoped)
Google Antigravity: installs .agents/rules/antigravity-rtk-rules.md (project-scoped)

Both follow the same prompt-level guidance pattern as Cline and Windsurf,
using rules files that instruct the agent to prefix shell commands with rtk.
2026-04-08 15:37:29 -05:00
aesoft 224461b27e Merge pull request #1029 from rtk-ai/feat/refac-doc
docs: consolidate to user-facing guide only (removes duplicates and legacy flat docs)
2026-04-08 20:53:28 +02:00
Patrick szymkowiak be5c0576d9 fix(docs): update TELEMETRY.md to match code after review fixes
- passthrough_top example: "npm ci:8" -> "npm:8" (first word only)
- estimated_savings_usd_30d: $5/Mtok -> $3/Mtok (input pricing)
- Remove needless borrow in build_meta_usage (clippy)

Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-08 17:30:24 +02:00
Patrick szymkowiak 15f666dd8d fix(telemetry): 7 bugs in enrichment — privacy leak, broken meta_usage, pricing
P0 fixes:
- top_passthrough: GROUP BY first word only, not full command args (privacy leak)
- build_meta_usage: use dedicated count query instead of scanning deduplicated top list (was always returning 0 or 1)

P1 fixes:
- Single Tracker connection per ping (was opening 2 SQLite connections)
- first_seen_days: propagate DB errors instead of unwrap_or(None)
- ecosystem_mix: bound to 90 days instead of full table scan
- avg_savings_per_command: compute per-command mean, not per-row mean
- estimated_savings_usd_30d: use $3/Mtok (Sonnet input rate) not $5/Mtok

Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-08 11:10:29 +02:00
Trevin Chow c85a387363 fix: report package-level failures (timeouts, signals) in go test summary
When go test times out or is killed by a signal, the JSON stream
contains a package-level {"action":"fail"} with no Test field and no
FailedBuild field. The parser only handled test-level and build-level
failures, so this event was silently dropped. The summary then saw
0 passes + 0 fails and reported "No tests found" instead of the
actual failure.

The fix adds handling for package-level failures: a new else branch
in the fail handler, package-level output capture in the output
handler, and inclusion in the summary count and display.

Before: "Go test: No tests found"
After:  "Go test: 0 passed, 1 failed in 1 packages" with the
        timeout output shown under the package name.

Fixes #958

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:10:12 -07:00
Florian BRUNIAUX cea6e2093d docs: add Star History and StarMapper to README
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-06 18:48:43 +02:00
Florian BRUNIAUX 6938a9dacc docs: fix broken README links and reduce redundancy, point to docs site
- Fix broken links: docs/TROUBLESHOOTING.md and docs/AUDIT_GUIDE.md were
  removed in previous commit; update nav header and Documentation section
- Condense Supported AI Tools: keep the summary table, replace 12 per-agent
  detail blocks with a single link to rtk-ai.app/guide/supported-agents
- Condense Configuration: keep essential snippet and tee recovery example,
  link to rtk-ai.app/guide/configuration for full reference
- Update Documentation section: lead with rtk-ai.app/guide as primary entry,
  keep INSTALL.md, ARCHITECTURE.md, CONTRIBUTING.md, SECURITY.md

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-06 18:37:05 +02:00
aesoft aa6317fb83 Merge pull request #990 from TropicalDog17/fix/issue-948
fix(ls): filter quality wrong truncation
2026-04-06 16:38:12 +02:00
aesoft d92c5d264a Merge pull request #1049 from rtk-ai/fix/resolve-merge-conflict
fix(merge): changelog conflicts
2026-04-06 12:42:50 +02:00
Adrien Eppling 12e57e870f merge: resolve CHANGELOG.md conflict (develop ← master)
Keep develop's [Unreleased] section on top, followed by master's
released versions (0.34.3, 0.34.2).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 12:36:55 +02:00
Florian BRUNIAUX 6e55f8984c docs: address Adrien's review — structure, missing content, agents
Structure:
- Move docs/README.md → .github/docs-pipeline-contract.md (interface
  contract is not user-facing content)
- Rewrite docs/guide/index.md as a proper landing page with RTK intro,
  flow diagram, and navigation (replaces empty nav stub)
- Move configuration.md → getting-started/configuration.md (sidebar order 4,
  after supported-agents per Adrien's suggestion)

Missing content:
- Add docs/guide/analytics/discover.md: rtk discover (missed savings analysis)
  and rtk session (adoption tracking across sessions)
- Add uninstall instructions to installation.md (rtk init -g --uninstall,
  cargo uninstall, brew uninstall)
- Add global flags section to what-rtk-covers.md (-u/--ultra-compact,
  -v/--verbose)
- Add rtk smart command to what-rtk-covers.md Files section

Agents:
- Update supported-agents.md: 10 agents (was 9)
- Add OpenClaw (TypeScript plugin, before_tool_call)
- Add Mistral Vibe (planned, issue #800)
- Fix GitHub Copilot: VS Code = transparent rewrite via PreToolUse,
  Copilot CLI = deny-with-suggestion (upstream limitation)

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-06 11:16:24 +02:00
aesoft f5e7a41046 Merge branch 'develop' into feat/refac-doc 2026-04-06 10:15:32 +02:00
aesoft d813919a24 Merge pull request #1021 from rtk-ai/hotfix/proxy-childguard-signal
fix(proxy): kill child process on SIGINT/SIGTERM to prevent orphans
2026-04-06 09:55:43 +02:00
Florian BRUNIAUX a94e9493b3 docs: consolidate to user-facing guide, remove duplicates and legacy flat docs
- Remove docs/reference/ (10 files): duplicates CONTRIBUTING.md, SECURITY.md,
  ARCHITECTURE.md, src/*/README.md (distributed pattern from PR #869)
- Remove docs/architecture/ (5 files): duplicates ARCHITECTURE.md ADRs and diagrams
- Remove docs/guide/commands/ (12 files): showed rtk <cmd> syntax users never type
  (hooks rewrite transparently); content was derived from FEATURES.md
- Remove docs/guide/filters/ (2 files): contributor content, belongs with src/filters/
- Remove docs/guide/analytics/discover.md, economics.md: implementation details
- Remove legacy flat docs/ (6 files): FEATURES.md (FR), TECHNICAL.md, TROUBLESHOOTING.md,
  AUDIT_GUIDE.md, tracking.md, filter-workflow.md — all superseded by guide/ rewrites
  or codebase distributed docs

- Add docs/guide/what-rtk-covers.md: replaces 12 command pages with one user-facing
  overview of 60+ commands by ecosystem, no rtk <cmd> syntax
- Enrich docs/guide/analytics/gain.md: absorb advanced workflows from AUDIT_GUIDE.md
  (CI integration, pandas analysis, cron snapshots)
- Adapt docs/guide/getting-started/quick-start.md: remove rtk <cmd> examples,
  explain hook transparency instead
- Update docs/README.md: single-tab contract, pointer to codebase for technical docs
- Update docs/guide/index.md: clean navigation matching final structure
- Add Mermaid diagrams to src/filters/README.md: build pipeline + filter lookup
  (preserves content from filter-workflow.md in its natural home)

Result: 9 files in docs/guide/ (was 39), zero legacy flat docs, zero duplicates.
Codebase distributed docs (ARCHITECTURE.md, CONTRIBUTING.md, src/*/README.md)
remain the source of truth for technical and contributor content.

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-05 21:26:07 +02:00
Florian BRUNIAUX 974db2ff0b docs(phase-4): complete reference, architecture tabs and remaining commands
Guide — 10 new command and analytics pages:
- commands/go.md: go test (NDJSON), golangci-lint
- commands/ruby.md: rspec, rubocop, rake
- commands/dotnet.md: dotnet build/test, binlog, format
- commands/containers.md: docker ps/images/logs/compose, kubectl pods/services/logs
- commands/github-cli.md: gh pr/issue/run, Graphite gt commands
- commands/data.md: json, env, log, curl, wget, aws, psql, summary
- commands/utilities.md: proxy passthrough, global flags, RTK_DISABLED
- filters/creating-filters.md: TOML DSL guide, field reference, inline tests
- analytics/discover.md: rtk discover — missed savings analysis
- analytics/economics.md: rtk cc-economics — dollar savings vs ccusage

Reference tab (9 pages):
- contributing/guide.md: design philosophy, PR process, TOML vs Rust decision
- contributing/security.md: vulnerability reporting, dangerous patterns, dep criteria
- contributing/coding-standards.md: Rust rules, error handling, lazy_static, fallback pattern
- contributing/testing.md: snapshot tests, token accuracy, cross-platform, benchmarks
- internals/command-routing.md: 6-phase lifecycle, exit codes, verbosity, module map
- internals/filter-pipeline.md: 12 filtering strategies, TOML stages, savings by ecosystem
- internals/tracking-system.md: SQLite schema, data flow, token estimation, Tracker API
- internals/hook-engine.md: rewrite registry, compound commands, exit code contract, rtk init
- toml-dsl/specification.md: complete field reference, pipeline order, build compilation

Architecture tab (4 pages):
- diagrams/command-flow.md: end-to-end Mermaid — hook → RTK → LLM
- diagrams/filter-pipeline.md: build pipeline + 8-stage runtime Mermaid
- decisions/why-no-async.md: ADR — single-threaded, <10ms startup constraint
- decisions/proxy-architecture.md: ADR — why CLI proxy over aliases/LD_PRELOAD/hooks-only

All pages carry valid frontmatter (title, description, sidebar.order).
No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-05 00:18:59 +02:00
Florian BRUNIAUX 25438b29ae docs(guide): add 11 Phase 1 guide pages — full MVP content
Creates the complete user-facing guide for the docs website:

Getting started:
- quick-start.md: 5-minute walkthrough (init, first commands, rtk gain)
- supported-agents.md: Claude Code, Cursor, Copilot, Gemini, Cline, Windsurf,
  Codex, OpenCode — integration tiers, install commands, graceful degradation

Commands (adapted from FEATURES.md, English, --help-first format):
- git.md: status/log/diff/show/add/commit/push/pull/branch + gh CLI
- cargo.md: test/nextest/build/check/clippy/install + generic test/err wrappers
- files.md: ls/read/grep/find/diff/wc/smart with before/after examples
- javascript.md: vitest/playwright/tsc/eslint/prettier/next/pnpm/npm/npx/prisma
- python.md: pytest/ruff/mypy/pip/deps

Reference:
- filters/using-filters.md: 8-stage pipeline, lookup priority, TOML DSL reference,
  Mermaid diagram (adapted from docs/filter-workflow.md)
- analytics/gain.md: rtk gain flags, daily/weekly/monthly breakdowns, export
  formats, token estimation, database management (from docs/AUDIT_GUIDE.md)
- configuration.md: full config.toml reference, env vars, tee system, telemetry
- troubleshooting.md: common issues and fixes (from docs/TROUBLESHOOTING.md)

All pages carry valid frontmatter (title, description, sidebar.order).
No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-05 00:09:14 +02:00
Florian BRUNIAUX 9c9879c2da docs: add interface contract and Phase 0 stubs for docs reorganization
Creates docs/README.md (interface contract defining 3-tab structure,
required frontmatter, and conventions) and 4 stub pages with valid
frontmatter for docs/guide/, docs/reference/, and docs/architecture/.
These are the prerequisites for the prepare-docs.mjs pipeline (Plan B)
and for Adrien's Phase 1 content work.

No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-04-04 23:54:16 +02:00
Adrien Eppling 33185101fc fix(proxy): kill child process on SIGINT/SIGTERM to prevent orphans
Drop-based ChildGuard doesn't run on signals with panic=abort (release
profile). Register a signal handler that stores the child PID in an
AtomicU32 and kills it on SIGINT/SIGTERM, then re-raises the signal
with default handler for correct exit status propagation.

Fixes orphan processes when rtk proxy is killed by Claude Code, process
managers, or manual kill — the root cause behind issue #897.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:58:03 +02:00
aesoft a919335519 Merge pull request #978 from rtk-ai/fix/batch-priority-issues
fix(main): kill zombie processes + path for rtk md + missing intergrations
2026-04-04 12:03:29 +02:00
aesoft 614c64eec2 Update Cargo.toml 2026-04-04 11:08:41 +02:00
aesoft bade4547b3 Update Cargo.toml 2026-04-04 11:07:36 +02:00
Nicolas Le Cam 08181e9f65 chore: cleanup files added inadvertently
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-04 03:36:20 +02:00
Nicolas Le Cam 81c0939440 refactor(pnpm): consolidate build into generic passthrough
- Remove explicit PnpmCommands::Build variant (routed through Other)
- Simplify filter validation for Typecheck only
- Remove redundant warning eprintln!() call

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-04 03:36:19 +02:00
Nicolas Le Cam bad5fe90f4 feat: take review into account
- Add validate_pnpm_filters() to warn when filters used with unsupported commands
- Add comprehensive tests for all scenarios
- Improve comments and use idiomatic rust

Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-04 03:34:47 +02:00
Nicolas Le Cam a39ac4382a feat(pnpm): Add filter argument support
- Add support for pnpm global filter arguments (`--filter`) across all pnpm commands (`list`, `outdated`, `install`, etc.).
- Merge pnpm filters with native command arguments (`--filter` + custom args like `--depth`).
- Implement proper handling for `Vec<String>` (text filters) and `Vec<OsString>` (OS-specific filters).
- Add unit tests for `merge_pnpm_args` and CLI parsing to validate expected behavior.

This enables users to apply workspace-specific filtering directly via `--filter @scope` before running pnpm commands,
reducing token overhead by excluding irrelevant packages/dependencies from output.

Fixes: #259

FIXME: Add notes for typechecking/building with workspaces when filters are applied.
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-04 03:32:12 +02:00
Nicolas Le Cam c6f35c9771 fix: apply clippy suggestions
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
2026-04-04 01:25:16 +02:00
Tuan Tran d2ecbdb2ec bet 2026-04-04 01:10:31 +07:00
Tuan Tran 4cf0392777 chore: revert version bump 2026-04-04 01:07:54 +07:00
aesoft d85fe3384b fix(review): address ChildGuard disarm, stdin dedup, hook masking 2026-04-03 18:22:07 +02:00
aesoft 9c1cf2f403 Merge pull request #992 from em0t/fix/go-build-false-errors
fix(go): avoid false build errors from download logs
2026-04-03 16:04:23 +02:00
aesoft 13004e8b63 Merge branch 'fix/batch-priority-issues' of https://github.com/rtk-ai/rtk into fix/batch-priority-issues 2026-04-03 15:54:29 +02:00
em0t 2425ad68e5 fix(go): cover more build failure shapes
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 21:44:09 +08:00