# Upgrade Guide — vNEXT

<!-- assembled-by: assemble-next-md -->
<!-- bump: patch -->

## What Changed

Fixed a false-positive in the `dangerous-command-guard` safety hook. The hook allows the safe `git push --force-with-lease` to your own feature/PR branch while still blocking a force-push to a protected branch (main, master, develop, release*). It was deciding "is this a protected branch?" by scanning the entire command line for those words — so unrelated text in the command (a chained status message, a log path, anything mentioning "release" or "main") could wrongly trip the block and refuse a perfectly safe branch update. The check now reads only the extracted `git push …` portion of the command, keeping the protected-branch block precise while removing the false-positive. The same one-line fix is applied to all three places the guard is written (the shipped template, the update-migration writer, and the fresh-install writer), so deployed agents pick it up on their next update.

## What to Tell Your User

I fixed a case where my safety check for force-pushes was a little too eager — if a command happened to mention a word like "release" or "main" anywhere in it, I'd block a safe update to my own branch by mistake. Now I only look at the actual push command, so safe updates go through while real force-pushes to protected branches are still stopped. Existing agents get this automatically on their next update.

## Summary of New Capabilities

No new capability — this is a precision fix to an existing safety hook. The force-with-lease carve-out now scans only the push command, eliminating false-positives from unrelated command text while leaving the protected-branch block fully intact.

## Evidence

Reproduced live on 2026-06-07 (topic 19437): a `git push --force-with-lease` to a feature branch was blocked because the surrounding command text mentioned "release cadence". Before: the guard's protected-branch regex matched the word "release" anywhere in the command input and returned a block. After: the guard extracts only the `git push …` invocation and finds no protected-branch token there, so the push is allowed. A regression test pins the exact case — `git push --force-with-lease origin echo/provider-swap && echo "advancing the release cadence on main"` now exits 0 (allowed) — alongside the existing tests that still confirm force-with-lease to `main`/`master` is blocked and plain `--force`/`-f` is blocked. All 11 guard tests pass; the two sibling guard test suites (gh-pr-merge gate, codex dangerous-command block) also stay green.
