Originally created by: fu351
_git_force_push_to_protected() (src/doberman/engine/rules/commands.py:417) only escalates a force-push to BLOCK when the target ref is in the hardcoded DEFAULT_PROTECTED_BRANCHES list (("main", "master", "release", "develop"), line 87) — used unless a caller supplies its own protected_branches to DestructiveCommandRule.__init__. A force-push to any other branch or remote — a teammate's feature branch, a shared long-lived staging/prod branch not named one of those four, or any branch on a fork remote — is not classified as risky at all by this rule today (verified: _segment_verdict's only force-push check is line 605, gated entirely on protected_branches membership). This under-classifies real destructive-history risk for any team whose branch-naming convention differs from the four defaults. This issue is a design question first: should Doberman (a) widen the default list, (b) escalate any force-push that isn't to the current branch's own remote-tracking branch to AUTH regardless of name, or (c) leave it name-list-based by design (simpler, fewer false positives) and instead make it easier to configure per-repo? Open the issue, get maintainer agreement on the direction in the issue thread, then implement.
Changes how force-pushes are risk-classified (what counts as "protected" for force-push purposes) — a wrong call here either produces false BLOCKs across common workflows or leaves a real destructive-history gap, so it needs a maintainer decision on the intended classification before code lands.
main/master/release/develop force-pushes less protected.DestructiveCommandRule.__init__'s existing protected_branches override parameter (used by callers/tests to pass a custom list) must keep working exactly as it does today — this is an additive/behavioral change, not an interface break.src/doberman/engine/rules/commands.py — _git_force_push_to_protected (line 417), DEFAULT_PROTECTED_BRANCHES (line 87), the force-push branch in _segment_verdict (line 605), DestructiveCommandRule.__init__ (line 759).tests/unit/test_rule_commands.py — existing force-push tests, to extend once a direction is agreed.BLOCKed exactly as today (regression test).DestructiveCommandRule(protected_branches=...)'s existing override behavior is unchanged.ruff check . && ruff format --check . and lint-imports passpytest passespytest tests/unit/test_rule_commands.py -v -k force
git push --force (no scope creep into rm/bulk-delete/git reset --hard).New here? Start with CONTRIBUTING.md. Issues are labelled level-1 (docs only) through level-10 (new subsystem) — pick one at your level and climb. Comment to claim an issue before starting.
Ticket changed by: fu351
Ticket changed by: fu351