Commit Graph

590 Commits

Author SHA1 Message Date
Florian BRUNIAUX c73ed470a7 fix: update version references to 0.18.0 in docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:34:38 +01:00
Florian BRUNIAUX 439fa33c3f Merge remote-tracking branch 'origin/master' into docs/v0.15.1-python-go-complete 2026-02-15 18:34:16 +01:00
Florian BRUNIAUX ec54833621 fix: update version references to 0.16.0 in README.md and CLAUDE.md
CI validate-docs requires version consistency across all doc files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 18:19:10 +01:00
github-actions[bot] 2bc7d207b6 chore(master): release 0.18.0 (#132)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.18.0
2026-02-15 16:00:57 +01:00
heAdz0r 606b86ed43 feat(gain): colored dashboard with efficiency meter and impact bars (#129)
* feat(gain): add colored dashboard with efficiency meter and impact bars

Upgrade `rtk gain` output with rich terminal visualization:
- Colored percentage cells (green ≥70%, yellow ≥40%, red <40%)
- Efficiency meter: ASCII progress bar with savings percentage
- Impact bars: proportional block charts per command
- Styled section headers (bold green)
- Command names in bright cyan
- History tier indicators (▲/■/•)
- Dynamic column widths for clean table alignment
- KPI-style key-value layout for summary metrics

All visual features are TTY-aware via std::io::IsTerminal — output
degrades gracefully to plain text when piped or redirected.

No new dependencies (uses existing `colored` crate).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add dashboard visualization screenshot

Shows colored terminal output of `rtk gain -p` with:
- Project-scoped token savings header
- Efficiency meter with color gradient
- Per-command table with colored Avg% and Impact bars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 15:50:24 +01:00
github-actions[bot] ec88f5c109 chore(master): release 0.17.0 (#126)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.17.0
2026-02-15 15:28:48 +01:00
heAdz0r 356c0d61a3 refactor(init): add upsert_rtk_block for idempotent CLAUDE.md management (#123)
Replace naive append-or-skip logic in run_claude_md_mode with
upsert_rtk_block() that handles all 4 cases:
- Added: no existing block → append
- Updated: stale block → replace in-place
- Unchanged: current block → no-op
- Malformed: opening marker without closing → warn safely

Includes 4 unit tests covering each case.
2026-02-15 15:15:08 +01:00
playb0t 1d7d9d065e fix(integrity): address security review findings
Addresses all findings from FlorianBruniaux's review of PR #119:

C-02 (CRITICAL): Remove RTK_SKIP_INTEGRITY env var bypass
  - Any process in the environment could disable verification
  - If attacker can modify hook, they can also set env var
  - Recovery path: `rtk init -g --auto-patch` to re-baseline

I-02 (IMPORTANT): Invert is_operational_command to whitelist
  - Explicitly enumerate commands requiring integrity check
  - New commands fail open (no check) rather than creating
    false confidence about protection coverage

I-03 (IMPORTANT): Strict hash file parsing
  - Validate exact sha256sum format: "<64 hex>  <filename>"
  - Reject single-space separator, missing filename, garbage
  - Prevents silent acceptance of corrupted hash files

N-01 (NIT): Safe hash truncation in error output
  - Use .get(..16).unwrap_or() instead of &[..16] slice
  - Prevents potential panic on malformed stored hash

N-02 (NIT): Remove bypass hint from error message
  - "To override: RTK_SKIP_INTEGRITY=1" leaked mechanism
  - Resolved automatically by C-02 (env var removed entirely)

Tests: 14 → 16 (+hash_only_no_filename, +wrong_separator)
2026-02-15 20:38:46 +07:00
igor 68fd570f2b feat(cargo): add cargo nextest support with failures-only output (#107)
Add token-optimized filtering for `cargo nextest` output: strip
compilation noise, PASS lines, and post-summary recaps; show only
failure details and a compact summary. Extract flush_failure_block
helper to DRY up failure block collection (was repeated 4 times).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 14:14:28 +01:00
Michael Coen 7401f1099f feat(hook): handle global options before subcommands (#99)
* fix(hook): use POSIX character classes for cross-platform grep compatibility

Replace \s with [[:space:]] in all grep -E patterns. The \s shorthand
is a PCRE extension not guaranteed by POSIX ERE, causing intermittent
match failures on macOS depending on grep version and locale settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(hook): handle global options before subcommands in git/cargo/docker/kubectl

Normalize commands by stripping global options (git -C, --no-pager;
cargo +toolchain; docker -H, --context; kubectl --context, -n) to
correctly identify the subcommand for rewrite matching. Preserves all
original arguments in the rewritten command.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:15:02 +01:00
Florian BRUNIAUX fb37bc9f04 Merge branch 'master' into docs/v0.15.1-python-go-complete
Resolve 9 conflicts:
- Versions: take master (0.16.0)
- Hooks: take master (POSIX character classes + ENV_PREFIX)
- CHANGELOG/CLAUDE.md: take master entries
- parser/mod.rs: add multibyte/emoji tests from master
- ruff_cmd.rs: take pub fn visibility from master

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 18:20:57 +01:00
github-actions[bot] d67ade9ecf chore(master): release 0.16.0 (#121)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.16.0
2026-02-14 14:48:30 +01:00
Florian BRUNIAUX 4cae6b6c9a feat(python): add lint dispatcher + universal format command (#100)
* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Python and Go support (#88)

* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Python and Go language support

Implements comprehensive support for Python and Go development tooling
with 70-90% token reduction across all commands.

Python commands (3):
- rtk ruff: Linter/formatter with JSON (check) and text (format) parsing (80%+)
- rtk pytest: Test runner with state machine text parser (90%+)
- rtk pip: Package manager with auto-detect uv (70-85%)

Go commands (4):
- rtk go test: NDJSON streaming parser for interleaved test events (90%+)
- rtk go build: Text filter showing errors only (80%)
- rtk go vet: Text filter for issues (75%)
- rtk golangci-lint: JSON parser grouped by rule (85%)

Architecture:
- Standalone Python commands (mirror lint/prettier pattern)
- Go sub-enum (mirror git/cargo pattern)
- 5 new modules: ruff_cmd, pytest_cmd, pip_cmd, go_cmd, golangci_cmd
- Hook integration in rtk-rewrite.sh for transparent rewrites
- Comprehensive tests (47 new tests, all passing)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(benchmark): add Python and Go commands

Add benchmark sections for Python (ruff, pytest, pip) and Go (go test/build/vet, golangci-lint) to validate >80% token savings in CI pipeline.

Sections conditionally execute based on project markers (pyproject.toml, go.mod) and tool availability.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: make install-local.sh self-contained (#89)

- Build from source automatically instead of requiring a pre-built binary
- Default install dir to ~/.cargo/bin
- Skip rebuild when binary is up to date
- Warn if install dir is not in PATH

* chore(master): release 0.15.0 (#90)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(vitest): robust JSON extraction for pnpm/dotenv prefixes (#92)

* fix(vitest): robust JSON extraction for pnpm/dotenv prefixes

Problem: RTK's vitest parser forces --reporter=json but pnpm/dotenv prepend
non-JSON text to stdout (banners, env messages), causing 100% Tier 1 failure
and useless 500-char passthrough.

Solution:
- Add extract_json_object() to parser/mod.rs (shared utility)
- Algorithm: find "numTotalTests" or first standalone {, brace-balance forward
- VitestParser now tries direct parse → extract+parse → regex → passthrough
- Replace hardcoded Command::new("pnpm") with package_manager_exec("vitest")
- Delete orphan doc comment on line 203

Impact:
- Before: 100% Tier 3 passthrough with pnpm workflows
- After: Tier 1 success with prefixes, maintains 99.5% token savings

Tests:
- 6 tests for extract_json_object (clean, pnpm, dotenv, nested, no-json, strings)
- 3 tests for VitestParser with prefixes
- All 277 tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore(benchmark): add vitest, pnpm, and gh commands

Add benchmarks for recently implemented commands:
- vitest run (PR #92 - JSON extraction fix)
- pnpm list/outdated (PR #6)
- gh pr list/run list (existing gh support)

These commands are now tested in CI to ensure token savings are maintained.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: improve CI reliability and hook coverage (#95)

* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(ci): prevent Python/Go benchmark sections from being silently skipped

**Problem:**
Python and Go benchmark sections were silently skipped in CI because
the RTK repository doesn't contain pyproject.toml or go.mod files.
The sections only ran when these project files existed.

**Solution:**
1. Create temporary fixtures with minimal project structure:
   - Python: pyproject.toml + sample.py + test_sample.py
   - Go: go.mod + main.go + main_test.go
2. Resolve RTK to absolute path to work after cd into temp dirs
3. Install required tools in CI workflow:
   - Python: ruff, pytest
   - Go: stable version + golangci-lint

**Impact:**
- Python/Go sections now appear in CI benchmark output
- Self-contained fixtures ensure consistent benchmarking
- No dependency on RTK project structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(hooks): add missing RTK command rewrites

Add 8 missing command rewrites to rtk-rewrite.sh and rtk-suggest.sh:
- cargo check/install/fmt
- tree, find, diff
- head → rtk read (with --max-lines transformation)
- wget

Fixes BSD sed compatibility for head transformation by using literal
spaces instead of \s+ (which doesn't work on macOS).

Impact: ~18.2K tokens saved on previously missed commands discovered
by `rtk discover`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore(master): release 0.15.1 (#96)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(python): add lint dispatcher + universal format command

Phase 1: Enhanced rtk lint
- Add pylint JSON2 parser (80-85% token savings)
- Add mypy text parser (75-80% token savings)
- Smart dispatcher: Python tools (pip) vs JS tools (npm)
- Reuse ruff_cmd JSON parser for rtk lint ruff

Phase 2: New rtk format command
- Universal formatter: black/ruff/prettier
- Auto-detect from pyproject.toml/package.json
- Implement black output parser (70-85% savings)
- Reuse existing prettier/ruff formatters

Phase 3: Hook integration
- Auto-rewrite: pylint → rtk lint pylint
- Auto-rewrite: mypy → rtk lint mypy
- Auto-rewrite: black --check → rtk format black

Files changed:
- src/lint_cmd.rs: +454 lines (pylint/mypy parsers, dispatcher)
- src/format_cmd.rs: +386 lines (NEW - universal formatter)
- src/ruff_cmd.rs: Export filter functions as pub
- src/prettier_cmd.rs: Export filter_prettier_output as pub
- src/main.rs: Add Commands::Format + routing
- hooks/rtk-rewrite.sh: Add Python tool rewrite rules

Testing: 10 new unit tests, all 313 tests passing
Impact: 80-90% token savings on Python workflows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Michael Coen <mhcoen@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-14 14:22:48 +01:00
github-actions[bot] f90a1cbfa7 chore(master): release 0.15.4 (#120)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.15.4
2026-02-14 13:15:47 +01:00
Florian BRUNIAUX d4cb2c0810 Merge pull request #116 from ChrisGVE/master
fix(git): Returns "Not a git repository" when git status is executed in a non-repo folder #82
2026-02-14 13:14:21 +01:00
playb0t 95677e9786 feat(security): add SHA-256 hook integrity verification
Add runtime integrity verification for rtk-rewrite.sh to detect
unauthorized modifications to the PreToolUse hook.

The hook auto-approves all rewritten commands via permissionDecision:
"allow", bypassing Claude Code's permission prompts. Any modification
by a local process (malicious dependency, compromised npm postinstall,
etc.) becomes a command injection vector.

Changes:
- New module: src/integrity.rs (SHA-256 hash, verify, runtime gate)
- rtk init: stores hash after hook installation (idempotent)
- rtk verify: new subcommand for manual integrity check
- rtk init --show: displays integrity status
- rtk uninstall: cleans up hash file
- Operational commands check integrity at startup (fail closed)
- Emergency bypass: RTK_SKIP_INTEGRITY=1

Ref: SA-2025-RTK-001 (Finding F-01)
Ref: PromptArmor hook hijacking (Oct 2025)
Ref: CVE-2025-54794, CVE-2025-54795
2026-02-14 18:37:40 +07:00
Christian C. Berclaz 04e6bb032c fix(git): fix for issue #82
Returns "Not a git repository" when git status is executed in a
non-repo folder
2026-02-14 10:27:51 +01:00
polamin 6612f22060 improve: hook coverage from 0.2% to ~80% with env prefix stripping (#97)
Two root causes for low interception rates:

1. Environment variable prefixes broke pattern matching.
   Commands like `TEST_SESSION_ID=2 npx playwright test` start
   with an env var, not the command name, so no pattern matched.
   Fix: strip leading env vars for matching, preserve for execution.

2. Missing patterns for commands RTK already supports:
   npm run/test, vue-tsc, docker compose, docker run/build/exec,
   kubectl describe/apply, gh api/release.

Also fixes vitest "run" duplication bug where `vitest run` became
`rtk vitest run run`.

Includes 50-test regression suite (hooks/test-rtk-rewrite.sh).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:31:23 +01:00
github-actions[bot] 0517182f5b chore(master): release 0.15.3 (#108)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.15.3
2026-02-13 18:08:26 +01:00
polamin 155e26423d fix: prevent UTF-8 panics on multi-byte characters (#93)
* fix: prevent UTF-8 panics on multi-byte characters (Thai, emoji, CJK)

Replace all byte-indexed string slicing (`&s[..n]`) with char-aware
operations across 10 locations in 7 files. Rust strings are UTF-8, so
byte slicing can land mid-character on Thai (3 bytes), emoji (4 bytes),
or CJK text and panic at runtime.

Fixes applied:
- git.rs: filter_log_output, format_status_output
- log_cmd.rs: error/warning message truncation (2 locations)
- env_cmd.rs: long value display, mask_value
- parser/mod.rs: truncate_output
- grep_cmd.rs: clean_line (pattern context + fallback truncation)
- wget_cmd.rs: compact_url, truncate_line, parse_error

Also adds safe_char_boundary() utility and 20 regression tests covering
Thai, emoji, and CJK input across all affected modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: collect chars once in compact_url to avoid redundant iteration

Address review feedback: collect chars into Vec once instead of
calling .chars() multiple times. Also fixes byte-vs-char length check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unused safe_char_boundary function and tests

Address review: function was defined but never called anywhere.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: convert remaining is_char_boundary to full .chars() approach

Address review: use consistent .chars() everywhere instead of
mixing byte-based is_char_boundary with char-based operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:03:32 +01:00
github-actions[bot] 737e94696f chore(master): release 0.15.2 (#104)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.15.2
2026-02-13 16:06:02 +01:00
Michael Coen 4aafc832d4 fix(hook): use POSIX character classes for cross-platform grep compatibility (#98)
Replace \s with [[:space:]] in all grep -E patterns. The \s shorthand
is a PCRE extension not guaranteed by POSIX ERE, causing intermittent
match failures on macOS depending on grep version and locale settings.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:53:25 +01:00
Florian BRUNIAUX 5a68839486 docs: comprehensive v0.15.1 documentation update for Python/Go support
Complete documentation overhaul for RTK v0.15.1 Python and Go support
across all user-facing and technical documentation.

## Changes

### Critical (P0)
- **CLAUDE.md**: Added maintenance warning, CHANGELOG reference, hook
  coverage section, corrected module count (46 modules)
- **Hooks**: Added Python/Go rewrites (ruff, pytest, pip, go, golangci-lint)
- **CI Validation**: New workflow validates doc consistency on every PR

### User Documentation (P1)
- **README.md**: Added Python/Go Stack section, updated command tables,
  added benchmarks, explicit v0.15.1 mention

### Technical Documentation (P2)
- **ARCHITECTURE.md**: Updated metadata (v0.15.1, 2026-02-12), added
  Python/Go modules to organization table, 3 new filtering strategies
  (JSON/TEXT Dual, State Machine, NDJSON), complete Python & Go
  Module Architecture section

## Validation
- ✅ All docs mention version 0.15.1
- ✅ Module count consistent (46 across all docs)
- ✅ All Python/Go commands documented
- ✅ Hook rewrites present and tested
- ✅ scripts/validate-docs.sh passes

## Impact
- Prevents documentation drift (CI validation)
- Claude Code immediately uses Python/Go via hooks
- Clear architecture guidance for contributors
- 375 lines added across 6 files

Closes #[issue-number-if-any]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:21:52 +01:00
github-actions[bot] d8227be9d1 chore(master): release 0.15.1 (#96)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-13 08:46:01 +01:00
Florian BRUNIAUX 50bb4943f7 fix: improve CI reliability and hook coverage (#95)
* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(ci): prevent Python/Go benchmark sections from being silently skipped

**Problem:**
Python and Go benchmark sections were silently skipped in CI because
the RTK repository doesn't contain pyproject.toml or go.mod files.
The sections only ran when these project files existed.

**Solution:**
1. Create temporary fixtures with minimal project structure:
   - Python: pyproject.toml + sample.py + test_sample.py
   - Go: go.mod + main.go + main_test.go
2. Resolve RTK to absolute path to work after cd into temp dirs
3. Install required tools in CI workflow:
   - Python: ruff, pytest
   - Go: stable version + golangci-lint

**Impact:**
- Python/Go sections now appear in CI benchmark output
- Self-contained fixtures ensure consistent benchmarking
- No dependency on RTK project structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(hooks): add missing RTK command rewrites

Add 8 missing command rewrites to rtk-rewrite.sh and rtk-suggest.sh:
- cargo check/install/fmt
- tree, find, diff
- head → rtk read (with --max-lines transformation)
- wget

Fixes BSD sed compatibility for head transformation by using literal
spaces instead of \s+ (which doesn't work on macOS).

Impact: ~18.2K tokens saved on previously missed commands discovered
by `rtk discover`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 08:46:01 +01:00
Florian BRUNIAUX ab43e4b823 fix(vitest): robust JSON extraction for pnpm/dotenv prefixes (#92)
* fix(vitest): robust JSON extraction for pnpm/dotenv prefixes

Problem: RTK's vitest parser forces --reporter=json but pnpm/dotenv prepend
non-JSON text to stdout (banners, env messages), causing 100% Tier 1 failure
and useless 500-char passthrough.

Solution:
- Add extract_json_object() to parser/mod.rs (shared utility)
- Algorithm: find "numTotalTests" or first standalone {, brace-balance forward
- VitestParser now tries direct parse → extract+parse → regex → passthrough
- Replace hardcoded Command::new("pnpm") with package_manager_exec("vitest")
- Delete orphan doc comment on line 203

Impact:
- Before: 100% Tier 3 passthrough with pnpm workflows
- After: Tier 1 success with prefixes, maintains 99.5% token savings

Tests:
- 6 tests for extract_json_object (clean, pnpm, dotenv, nested, no-json, strings)
- 3 tests for VitestParser with prefixes
- All 277 tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore(benchmark): add vitest, pnpm, and gh commands

Add benchmarks for recently implemented commands:
- vitest run (PR #92 - JSON extraction fix)
- pnpm list/outdated (PR #6)
- gh pr list/run list (existing gh support)

These commands are now tested in CI to ensure token savings are maintained.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 08:46:01 +01:00
github-actions[bot] 5d128cf53b chore(master): release 0.15.0 (#90)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-13 08:46:01 +01:00
Michael Coen 6bcdb3e586 feat: make install-local.sh self-contained (#89)
- Build from source automatically instead of requiring a pre-built binary
- Default install dir to ~/.cargo/bin
- Skip rebuild when binary is up to date
- Warn if install dir is not in PATH
2026-02-13 08:46:01 +01:00
Florian BRUNIAUX 30a30eefd9 feat: add Python and Go support (#88)
* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Python and Go language support

Implements comprehensive support for Python and Go development tooling
with 70-90% token reduction across all commands.

Python commands (3):
- rtk ruff: Linter/formatter with JSON (check) and text (format) parsing (80%+)
- rtk pytest: Test runner with state machine text parser (90%+)
- rtk pip: Package manager with auto-detect uv (70-85%)

Go commands (4):
- rtk go test: NDJSON streaming parser for interleaved test events (90%+)
- rtk go build: Text filter showing errors only (80%)
- rtk go vet: Text filter for issues (75%)
- rtk golangci-lint: JSON parser grouped by rule (85%)

Architecture:
- Standalone Python commands (mirror lint/prettier pattern)
- Go sub-enum (mirror git/cargo pattern)
- 5 new modules: ruff_cmd, pytest_cmd, pip_cmd, go_cmd, golangci_cmd
- Hook integration in rtk-rewrite.sh for transparent rewrites
- Comprehensive tests (47 new tests, all passing)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(benchmark): add Python and Go commands

Add benchmark sections for Python (ruff, pytest, pip) and Go (go test/build/vet, golangci-lint) to validate >80% token savings in CI pipeline.

Sections conditionally execute based on project markers (pyproject.toml, go.mod) and tool availability.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 08:46:01 +01:00
github-actions[bot] 61405c8676 chore(master): release 0.15.1 (#96)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.15.1
2026-02-13 00:40:29 +01:00
Florian BRUNIAUX ac80bfa88f fix: improve CI reliability and hook coverage (#95)
* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(ci): prevent Python/Go benchmark sections from being silently skipped

**Problem:**
Python and Go benchmark sections were silently skipped in CI because
the RTK repository doesn't contain pyproject.toml or go.mod files.
The sections only ran when these project files existed.

**Solution:**
1. Create temporary fixtures with minimal project structure:
   - Python: pyproject.toml + sample.py + test_sample.py
   - Go: go.mod + main.go + main_test.go
2. Resolve RTK to absolute path to work after cd into temp dirs
3. Install required tools in CI workflow:
   - Python: ruff, pytest
   - Go: stable version + golangci-lint

**Impact:**
- Python/Go sections now appear in CI benchmark output
- Self-contained fixtures ensure consistent benchmarking
- No dependency on RTK project structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(hooks): add missing RTK command rewrites

Add 8 missing command rewrites to rtk-rewrite.sh and rtk-suggest.sh:
- cargo check/install/fmt
- tree, find, diff
- head → rtk read (with --max-lines transformation)
- wget

Fixes BSD sed compatibility for head transformation by using literal
spaces instead of \s+ (which doesn't work on macOS).

Impact: ~18.2K tokens saved on previously missed commands discovered
by `rtk discover`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 00:23:53 +01:00
Florian BRUNIAUX e5adba8b21 fix(vitest): robust JSON extraction for pnpm/dotenv prefixes (#92)
* fix(vitest): robust JSON extraction for pnpm/dotenv prefixes

Problem: RTK's vitest parser forces --reporter=json but pnpm/dotenv prepend
non-JSON text to stdout (banners, env messages), causing 100% Tier 1 failure
and useless 500-char passthrough.

Solution:
- Add extract_json_object() to parser/mod.rs (shared utility)
- Algorithm: find "numTotalTests" or first standalone {, brace-balance forward
- VitestParser now tries direct parse → extract+parse → regex → passthrough
- Replace hardcoded Command::new("pnpm") with package_manager_exec("vitest")
- Delete orphan doc comment on line 203

Impact:
- Before: 100% Tier 3 passthrough with pnpm workflows
- After: Tier 1 success with prefixes, maintains 99.5% token savings

Tests:
- 6 tests for extract_json_object (clean, pnpm, dotenv, nested, no-json, strings)
- 3 tests for VitestParser with prefixes
- All 277 tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore(benchmark): add vitest, pnpm, and gh commands

Add benchmarks for recently implemented commands:
- vitest run (PR #92 - JSON extraction fix)
- pnpm list/outdated (PR #6)
- gh pr list/run list (existing gh support)

These commands are now tested in CI to ensure token savings are maintained.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 23:11:24 +01:00
github-actions[bot] 72b90200bd chore(master): release 0.15.0 (#90)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.15.0
2026-02-12 22:12:23 +01:00
Michael Coen b82ad16853 feat: make install-local.sh self-contained (#89)
- Build from source automatically instead of requiring a pre-built binary
- Default install dir to ~/.cargo/bin
- Skip rebuild when binary is up to date
- Warn if install dir is not in PATH
2026-02-12 22:06:32 +01:00
Florian BRUNIAUX a005bb15c0 feat: add Python and Go support (#88)
* feat(cargo): aggregate test output into single line (#83)

Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: add Python and Go language support

Implements comprehensive support for Python and Go development tooling
with 70-90% token reduction across all commands.

Python commands (3):
- rtk ruff: Linter/formatter with JSON (check) and text (format) parsing (80%+)
- rtk pytest: Test runner with state machine text parser (90%+)
- rtk pip: Package manager with auto-detect uv (70-85%)

Go commands (4):
- rtk go test: NDJSON streaming parser for interleaved test events (90%+)
- rtk go build: Text filter showing errors only (80%)
- rtk go vet: Text filter for issues (75%)
- rtk golangci-lint: JSON parser grouped by rule (85%)

Architecture:
- Standalone Python commands (mirror lint/prettier pattern)
- Go sub-enum (mirror git/cargo pattern)
- 5 new modules: ruff_cmd, pytest_cmd, pip_cmd, go_cmd, golangci_cmd
- Hook integration in rtk-rewrite.sh for transparent rewrites
- Comprehensive tests (47 new tests, all passing)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(benchmark): add Python and Go commands

Add benchmark sections for Python (ruff, pytest, pip) and Go (go test/build/vet, golangci-lint) to validate >80% token savings in CI pipeline.

Sections conditionally execute based on project markers (pyproject.toml, go.mod) and tool availability.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 21:51:10 +01:00
Florian BRUNIAUX 06b10491f9 feat(cargo): aggregate test output into single line (#83) (#85)
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 20:36:13 +01:00
Florian BRUNIAUX 3806c4b423 feat(cargo): aggregate test output into single line (#83)
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".

Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```

After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```

Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)

Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback

Closes #83

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 17:59:14 +01:00
github-actions[bot] bec3ce8927 chore(master): release 0.14.0 (#79)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.14.0
2026-02-12 12:29:14 +01:00
patrick szymkowiak c84fa3c060 fix: add website URL (rtk-ai.app) across project metadata (#81)
- Cargo.toml: add homepage field
- README.md: add website/github/install links
- Formula/rtk.rb: update homepage to website
- release.yml: update homepage and docs link in formula template

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 12:28:37 +01:00
patrick szymkowiak a0d2184bfe feat(ci): automate Homebrew formula update on release (#80)
Replaces the commented-out TODO homebrew section with a working
automation modeled on rtk-ai/vox's release pipeline.

On each release, the new homebrew job:
1. Downloads checksums.txt from the just-published release
2. Parses sha256 for all 4 platforms (macOS/Linux × Intel/ARM)
3. Generates the formula with correct version and hashes
4. Pushes to rtk-ai/homebrew-tap via GitHub API

Requires HOMEBREW_TAP_TOKEN org secret (already used by vox).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 12:26:16 +01:00
patrick szymkowiak 55d010ad5e fix: update stale repo URLs from pszymkowiak/rtk to rtk-ai/rtk (#78)
Closes #77

- install.sh: update REPO to rtk-ai/rtk (was using old fork name)
- INSTALL.md: fix curl URL from /blob/ (returns HTML) to raw URL
- Cargo.toml: update repository field
- Formula/rtk.rb: update all download URLs and tap reference

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 12:17:37 +01:00
patrick szymkowiak fd9d38e177 Merge pull request #76 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.13.1
v0.13.1
2026-02-12 12:02:47 +01:00
github-actions[bot] 9e764c459f chore(master): release 0.13.1 2026-02-12 10:59:50 +00:00
patrick szymkowiak bb20b1e9e1 Merge pull request #75 from rtk-ai/fix/release-workflow-73
fix(ci): fix release artifacts not uploading (#73)
2026-02-12 11:59:32 +01:00
Patrick szymkowiak bd76b36190 fix(ci): fix release workflow not uploading artifacts to GitHub releases
Closes #73

Three issues prevented release-please from uploading build artifacts:

1. Upload steps had `if: github.event_name == 'workflow_call'` conditions
   that evaluated to false when called from release-please (event_name
   reflects the caller's `push` event, not `workflow_call`)
2. Missing `secrets: inherit` in release-please.yml workflow_call
3. Dead `on: release: published` trigger (GITHUB_TOKEN actions can't
   trigger other workflows)

Fix aligned with working rtk-ai/vox pipeline:
- Remove conditional `if` on upload step (always upload)
- Simplify version detection with `inputs.tag` fallback
- Remove dead `release: published` trigger
- Add `secrets: inherit` to workflow_call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 11:54:23 +01:00
patrick szymkowiak 1d8a0a083a Merge pull request #74 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.13.0
v0.13.0
2026-02-12 11:03:38 +01:00
github-actions[bot] 0d388b3f05 chore(master): release 0.13.0 2026-02-12 09:43:19 +00:00
patrick szymkowiak 6e181aec08 Merge pull request #72 from agregio-solutions/feat/configurable-db-path
feat(sqlite): add custom sqlite db location
2026-02-12 10:42:52 +01:00
Joan Bordeau 93364b5457 feat(sqlite): add custom sqlite db location 2026-02-10 21:42:46 +01:00
patrick szymkowiak 36ebd76e11 Merge pull request #71 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.12.0
v0.12.0
2026-02-09 03:07:31 +01:00