feat(refacto-core): binary hook w/ native cmd exec + streaming#956
Open
feat(refacto-core): binary hook w/ native cmd exec + streaming#956
Conversation
Co-Authored-By: ahundt <ATHundt@gmail.com>
Contributor
Author
|
Removed strip_quote from last release requirements, will be added back for this |
+ remove unused import
Contributor
Author
|
not ready for review, need fix for a full standardized flow |
What changed:
- Add `run_claude()` with permissions check, audit logging, tool_input
preservation, and Ask/Allow/Deny support
- Add `run_cursor()` with flat JSON format (`permission`/`updated_input`)
- Add `audit_log()` (best-effort append when RTK_HOOK_AUDIT=1)
- Fix `run_gemini()` to load exclude_commands from config
- Convert all hook stdout to `writeln!` with `#[deny(clippy::print_stdout)]`
to prevent JSON protocol corruption (Claude Code bug #4669)
- Replace string-based heredoc detection with lexer-based `has_heredoc()`
(quote-aware: `<<` inside quotes no longer false-positives)
- Add shell prefix peeling (noglob, command, builtin, exec, nocorrect)
to `rewrite_segment()` in registry.rs
- Fix python3 -m pytest pattern, add pip show, add gt (Graphite) to RULES
- Remove `command ` from IGNORED_PREFIXES (was blocking `command git status`)
- Register `rtk hook claude`/`rtk hook cursor` binary commands in
settings.json instead of writing bash script files
- Add legacy script migration (deletes old rtk-rewrite.sh on `rtk init`)
- Simplify hook_check and integrity for script-free model
Integrates ~30 develop commits (PR #997): AWS expansion (8→25 cmds), SSH signing for git commit/push, go test context, grep stdin leak fix, default-to-ask permissions, gh pr merge passthrough. Conflict resolution (4 files): - git.rs: kept .output()+stdin(inherit) for commit/push (SSH/GPG signing) - go_cmd.rs: accepted incoming + added pub(crate) visibility - hook_check.rs: merged binary_hook_registered + other_integration_installed - hook_cmd.rs: fixed permissions path, println→writeln for Gemini deny Verified: 1445 tests pass, 0 clippy errors, all manual integration tests pass. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the idea of #536
Summary
Test plan
Should fix :
ISSUE #154
ISSUE #532
ISSUE #530
ISSUE #963
ISSUE #222
ISSUE #897
ISSUE #732
ISSUE #917 (for the env var prefix part)
ISSUE #294 (cover ~40%)
ISSUE #361