Commit Graph

611 Commits

Author SHA1 Message Date
Patrick szymkowiak a7de76d7c9 fix(curl): preserve valid JSON output for piping (#1015)
curl filter was converting JSON values to type names (extract_schema),
producing invalid output that broke downstream JSON parsers (python, jq).

Changes:
- curl_cmd: pass JSON through unchanged instead of schema transform
- json_cmd: quote object keys in extract_schema for valid JSON output
- Added tests for JSON validity and quoted keys
2026-04-04 11:20:48 +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
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
aesoft 8465ca953f Merge pull request #980 from rtk-ai/fix/gh-pr-merge-canned
fix(gh): pass through gh pr merge instead of canned response (#938)
2026-04-03 15:34:06 +02:00
em0t 1177c9c873 fix(go): restore build error coverage
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 21:22:48 +08:00
aesoft 7571c8e101 Merge pull request #1000 from rtk-ai/fix/telemetry-init-message
fix(init): remove opt-out instruction from telemetry message
2026-04-03 15:13:38 +02:00
aesoft 62f4452276 Merge pull request #993 from em0t/fix/git-diff-hunk-context
fix(git): preserve full diff hunk headers
2026-04-03 14:46:01 +02:00
aesoft 1481bc5909 Merge pull request #994 from em0t/fix/go-test-failure-context
fix(go): preserve failing test location context
2026-04-03 14:43:52 +02:00
Patrick szymkowiak 7dbef2ce00 fix(init): remove telemetry info lines from init output
Telemetry details are already documented in the README privacy section.
No need to print them during init.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-03 13:37:52 +02:00
em0t 374fe64cfb fix(go): preserve failing test location context
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:21 +08:00
em0t 09b3ff9424 fix(git): preserve full diff hunk headers
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:20 +08:00
em0t d44fd3e034 fix(go): avoid false build errors from download logs
Signed-off-by: em0t <10153971+em0t@users.noreply.github.com>
2026-04-03 18:09:18 +08:00
aesoft 7217562355 Merge pull request #979 from rtk-ai/fix/grep-stdin-leak
fix(grep): close subprocess stdin to prevent memory leak (#897)
2026-04-03 11:33:01 +02:00
aesoft eefeae4565 Merge pull request #982 from rtk-ai/fix/git-commit-ssh-signing
fix(git): inherit stdin for commit and push to preserve SSH signing (#733)
2026-04-03 09:03:08 +02:00
aesoft 158c74527f Merge pull request #981 from rtk-ai/fix/permission-default-ask
fix(security): default to ask when no permission rule matches (#886)
2026-04-02 21:08:44 +02:00
Patrick szymkowiak 6cee6c60b8 fix(git): inherit stdin for commit and push to preserve SSH signing (#733)
Command::output() sets stdin to Stdio::piped() by default, creating an
empty pipe instead of inheriting the terminal. SSH signing tools
(1Password, YubiKey, gpg-agent with pinentry) need TTY access on stdin
for passphrase prompts or agent communication. This caused signatures
to be silently dropped — commits succeeded but without gpgsig headers.

Fix: add .stdin(Stdio::inherit()) to git commit and git push commands
so they inherit the parent's stdin (terminal or hook pipe). Output
capture via stdout/stderr pipes is preserved.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 21:04:46 +02:00
Patrick szymkowiak d9ef47f998 docs(hooks): document permission precedence model in README
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 20:28:51 +02:00
aesoft 402c48e669 Merge pull request #885 from jbronssin/feat/aws-expand-cli-filters
feat(aws): expand CLI filters from 8 to 25 subcommands
2026-04-02 19:23:17 +02:00
Patrick szymkowiak 41a6c6bf6d fix(security): default to ask when no permission rule matches (#886)
Previously, commands not in any deny/ask list were auto-allowed. This
bypassed Claude Code's least-privilege default where unlisted commands
should prompt the user for confirmation.

Permission precedence is now: Deny > Ask > Allow (explicit) > Default (ask).

Changes:
- permissions.rs: load allow rules from settings.json, add Default variant
- rewrite_cmd.rs: treat Default same as Ask (exit 3)
- hook_cmd.rs: add permission checks to Copilot VS Code hook (ask/allow/deny),
  add deny check to Gemini hook (no ask mode available in Gemini CLI)

Gemini CLI limitation: only supports allow/deny, no ask mode. Codex: ask
is parsed but fails open. These tools document the limitation.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 19:15:30 +02:00
Patrick szymkowiak e1f2845df0 fix(gh): pass through gh pr merge instead of canned response (#938)
pr_merge() was using run_filtered with a filter_fn that ignored stdout
and always returned "ok merged". This made AI agents believe PRs were
merged when they weren't.

Switch to run_passthrough so the real gh output is shown. gh pr merge
is a destructive action — the user must see exactly what happened.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 17:25:25 +02:00
Patrick szymkowiak 09979cf297 fix(grep): close subprocess stdin to prevent memory leak (#897)
When RTK runs via Claude Code's PreToolUse hook, grep/rg subprocesses
inherit the hook's open stdin pipe. They block waiting for EOF and never
terminate, accumulating memory unboundedly (reported: 514GB on 96GB Mac,
kernel panic).

Fix: set stdin(Stdio::null()) on both rg and grep fallback commands so
subprocesses get immediate EOF instead of inheriting the parent pipe.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-04-02 17:21:48 +02:00
aesoft 5bd35a33ad Merge pull request #952 from rtk-ai/fix/pr-934-review
fix(review): PR #934
2026-03-31 20:45:44 +02:00
aesoft bae7930119 fix(review): PR #934 2026-03-31 20:43:59 +02:00
Florian BRUNIAUX 13e37bf7a8 ci: enforce test presence on new/modified filter modules
Add check-test-presence.sh script and CI job that fails if any *_cmd.rs
file added or modified in a PR is missing a #[cfg(test)] block.

- New CI job runs with no dependencies (parallel to all other jobs, <10s)
- Uses --diff-filter=AM to catch both added files and test deletions
- --self-test mode for local verification
- Add missing tests to wget_cmd.rs (17 tests) and env_cmd.rs (12 tests)
  covering pure functions: compact_url, format_size, parse_error,
  extract_filename, mask_value, is_lang_var, is_cloud_var, etc.

Fixes the enforcement gap: CONTRIBUTING.md required tests but CI did not
check. Now 34/34 *_cmd.rs modules have #[cfg(test)].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-31 12:02:53 +02:00
Florian BRUNIAUX 7e6452c543 Merge pull request #528 from ousamabenyounes/fix/rtk-disabled-warning
warn: emit stderr warning on RTK_DISABLED=1 (#508)
2026-03-31 11:37:24 +02:00
Jb d1b37ced01 feat(aws): expand CLI filters from 8 to 25 subcommands
Add 17 specialized filters for high-token-waste AWS operations:
- CloudWatch Logs (get-log-events, filter-log-events, get-query-results)
- CloudFormation describe-stack-events (failures-first)
- Lambda list-functions, get-function (strips Environment secrets)
- IAM list-roles (extract principals), list-users
- DynamoDB scan/query/get-item (recursive type unwrapping)
- ECS describe-tasks (stoppedReason + exitCode)
- EC2 describe-security-groups (compact rule notation)
- S3API list-objects-v2, S3 sync/cp (text summary)
- EKS describe-cluster, SQS receive-message
- Secrets Manager get-secret-value

Architecture:
- Extract run_aws_filtered() shared runner with Result<i32> return
- Add force_tee_hint() for truncation recovery (no dead ends for LLMs)
- Follow six-phase contract (stderr tracking, tee on failure, exit codes)
- Migrate existing 8 handlers to shared runner

Inspired by #644 for DynamoDB get-item, S3 transfer, Secrets Manager,
query-results, and N-type precision.
2026-03-30 20:38:32 +02:00
aesoft 14265b48c3 Merge pull request #933 from rtk-ai/maintainers-apply-doc
fix(docs): add maintainers docs
2026-03-30 19:56:32 +02:00
aesoft 0c3aad8156 Update MAINTAINERS_APPLY.md 2026-03-30 19:45:04 +02:00
aesoft 47a76ea35e Merge pull request #932 from rtk-ai/refacto-folders-and-documentation
fix(refacto-p2): more standardize
2026-03-30 19:37:45 +02:00
aesoft 2f7278ac59 fix(docs): add documentation 2026-03-30 19:36:27 +02:00
aesoft 5af18f87ae Merge branch 'develop' into refacto-folders-and-documentation 2026-03-30 19:29:34 +02:00
Adrien Eppling d75e864f20 fix(rules): add wc RtkRule with pattern field for develop compat
Aligns with PR #884 (wc rewrite support) already on develop.
2026-03-30 19:26:44 +02:00
aesoft 92c671a175 Merge pull request #910 from rtk-ai/refacto-files-and-constants
fix(refacto-p2):  more standardize
2026-03-30 18:51:37 +02:00
aesoft 75bd607d55 Merge pull request #904 from rtk-ai/refacto-folders-and-documentation
fix(refacto-p1): unified cmds execution flow  (+ rm dead code)
2026-03-30 18:43:54 +02:00
Florian BRUNIAUX bbe3da642b fix(ci): fix validate-docs.sh broken module count check
Two issues:
1. Module count compared top-level `mod` in main.rs (8) against
   "Total: 64 modules" in ARCHITECTURE.md -- incompatible metrics,
   always fails. Replaced with a simple .rs source file count (informational only).
2. CLAUDE.md check for Python/Go commands was too strict -- these
   commands belong in README.md (user-facing), not CLAUDE.md (Claude Code guidance).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-30 18:26:04 +02:00
Florian BRUNIAUX a9def11139 chore(skills): add missing frontmatter to all project-level skills
All 8 .claude/skills/ files were missing effort, tags, and allowed-tools
fields. Also added name field to issue-triage, pr-triage, and rtk-triage
which had none. Effort levels inferred from content analysis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-30 18:22:34 +02:00
Adrien Eppling 0a8b8fd069 fix(review): address PR #910 review feedback
- container.rs: warn on kubectl JSON parse failure instead of silent fallback
- runner.rs: fix savings inflation when filter_stdout_only by tracking stdout only
- README.md: document automod behavior in module registration step
2026-03-30 18:13:39 +02:00
Adrien Eppling f3217a467b fix(registry): quoted env prefix + inline regex cleanup + routing docs
- ENV_PREFIX now handles FOO="bar baz", FOO='val', escaped quotes
- Move 6 inline lazy_static regex to module level
- Merge rewrite_head_numeric + rewrite_tail_lines → rewrite_line_range
- Consolidate head/tail call sites in rewrite_segment
- Add rewrite pipeline documentation to TECHNICAL.md
- Rewrite discover README as concept/flow documentation
- Add lexer-based tokenizer for shell command parsing

Co-Authored-By: Andrew Hundt <ATHundt@gmail.com>
2026-03-30 17:58:03 +02:00
aesoft 08aabb95c3 fix(standardize): merge pattern into rues 2026-03-30 17:58:02 +02:00
aesoft 7fd221f446 fix(standardize): git+kube sub wrappers run_filtered 2026-03-30 17:58:01 +02:00
aesoft 234909d2c7 fix(automod): add auto discovery for cmds 2026-03-30 17:58:00 +02:00
aesoft e48485adc6 fix(cmds): more covering for run_filtered 2026-03-30 17:57:59 +02:00
aesoft aabc0167bc fix(cleaning): constant extract 2026-03-30 17:57:57 +02:00
aesoft ba9fa345f3 fix(cmds): migrate remaining exit_code to exit_code_from_output 2026-03-30 17:55:15 +02:00
Adrien Eppling c1c56f24d7 style: fix cargo fmt in ls.rs assert macros
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:02:17 +02:00
aesoft 495a152059 fix(emots): replace 📊 with "Summary:" 2026-03-30 14:41:21 +02:00
Adrien Eppling 9521dcab83 Merge remote-tracking branch 'origin/master' into develop
# Conflicts:
#	src/hooks/init.rs
2026-03-30 12:45:18 +02:00
Florian BRUNIAUX c54afe3da8 Merge pull request #884 from manulqwerty/fix/hook-rewrite-wc 2026-03-30 10:22:55 +02:00
aesoft 48ec28d531 fix(go): align go tool golangci-lint with Result<i32> 2026-03-29 14:08:45 +02:00
aesoft 23c0b7e433 fix(cloud): reuse early exit for edge case 2026-03-29 13:40:57 +02:00