Skip to content

fix(cicd): dev- prefix for pre-release tags#816

Merged
pszymkowiak merged 12 commits intomasterfrom
develop
Mar 25, 2026
Merged

fix(cicd): dev- prefix for pre-release tags#816
pszymkowiak merged 12 commits intomasterfrom
develop

Conversation

@pszymkowiak
Copy link
Collaborator

Summary

  • Fix pre-release tag prefix from v* to dev-* to stop polluting release-please
  • 42 RC releases and tags already cleaned up

Important

Squash merge this PR with a fix: title so release-please creates v0.33.1.

Test plan

  • RC tags and releases deleted (42)
  • release-please branch cleaned up
  • Squash merge -> release-please creates v0.33.1 PR

FlorianBruniaux and others added 12 commits March 20, 2026 14:09
The PreToolUse hook was emitting `permissionDecision: "allow"` on every
rewritten command, bypassing deny and ask rules in .claude/settings.json.

- Add `src/permissions.rs`: loads Bash deny/ask rules from all 4 Claude
  Code settings files (project + global, settings.json + settings.local.json),
  checks commands (including compound && / || / | / ;) and returns
  Allow / Deny / Ask verdict. 16 unit tests.
- Modify `src/rewrite_cmd.rs`: after finding a rewrite, check the original
  command against permissions. Exit 0 = allow (auto-approve rewrite),
  exit 2 = deny (passthrough, let CC native deny handle it),
  exit 3 = ask (print rewrite but no permissionDecision, CC prompts user).
- Update both hook files to handle exit codes 2 and 3. Version bumped 2→3.
- Bump `CURRENT_HOOK_VERSION` 2→3 in `hook_check.rs` so users with the old
  hook get the upgrade prompt.
- Fix set -euo pipefail bug in .claude/hooks/rtk-rewrite.sh: capture exit
  code with `|| EXIT_CODE=$?` instead of bare assignment.

Fixes #260

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Bug 1 (Critical): check_command() was called inside Some(rewritten),
so non-RTK commands (rm, kill, python3 -c) bypassed deny rules entirely.
Move verdict check before registry::rewrite_command() so all commands
are evaluated regardless of whether RTK has an equivalent.

Bug 4 (Medium): print!() before process::exit() could leave stdout
unflushed. Add explicit std::io::stdout().flush() after each print!().

Add Eq derive to PermissionVerdict (required for == comparison).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Bug 2 (Critical): *:* catch-all matched nothing. strip_suffix('*') left
"*:" which after trim became "*" (non-empty), so the branch returned
false instead of true. Fix: detect empty-or-star prefix after stripping.

Bug 3 (Medium): leading wildcards ("* --force"), middle wildcards
("git * main"), and multi-wildcard patterns ("git * --force *") fell
through to exact match, silently failing. Add glob_matches() with
character-level segment anchoring: first segment must be prefix, last
must be suffix, middle segments found via str::find in order.

Colon normalization in glob_matches(): "sudo:*" -> "sudo *" so both
fast path and glob path interpret colon syntax consistently.

New tests: test_star_colon_star_matches_everything,
test_leading_wildcard, test_leading_wildcard_no_partial,
test_middle_wildcard, test_middle_wildcard_no_match,
test_multiple_wildcards, test_deny_with_leading_wildcard,
test_deny_star_colon_star.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
…ormat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
fix(hook): respect Claude Code deny/ask permission rules on rewrite
Commands like `git status 2>&1` or `cargo test 2>/dev/null` were not
rewritten because the redirect suffix prevented pattern matching.

Now strips redirects (2>&1, 2>/dev/null, etc.) before matching,
then re-appends them to the rewritten command.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
fix: strip trailing stderr redirects before rewrite matching (#530)
Sync manifest and Cargo.toml with released v0.33.0.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
…lease-please

Pre-release tags on develop used v* prefix (e.g. v0.33.1-rc.60) which
release-please interpreted as the latest version, causing it to generate
wrong release versions. Changed to dev- prefix (e.g. dev-0.34.0-rc.61)
so release-please only sees stable v* tags.

Cleaned up: 42 RC releases and tags deleted.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
fix(cicd): use dev- prefix for pre-release tags
@pszymkowiak pszymkowiak merged commit 522bd64 into master Mar 25, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants