Skip to content

fix(guard): scope destructive Git cleanup to Path-owned targets - #346

Open
cristianuibar wants to merge 4 commits into
open-gsd:mainfrom
cristianuibar:fix/344-scope-destructive-git-guards
Open

cristianuibar wants to merge 4 commits into
open-gsd:mainfrom
cristianuibar:fix/344-scope-destructive-git-guards

Conversation

@cristianuibar

Copy link
Copy Markdown
Contributor

Forced Git cleanup commands were blocked even when the target belonged to the project rather than GSD Path. The guard now permits resolvable ordinary local branch/ref deletions and force-removal of registered unmanaged worktrees, while protecting GSD Path namespace refs, the STATE-bound branch, recorded task branches, managed worktrees, and unknown or unresolved targets.

The guard resolves literal targets in the repository selected by per-segment cd and stacked git -C options. Ambiguous shell or environment contexts fail closed. Remote-tracking branch deletion remains conservatively denied.

Verification:

  • 121 tests passed in 3.706s: python3 -B -m unittest tests.test_guard_hook
  • git diff --check passed
  • Python compilation check passed
  • Skill-resource sync passed: 490 resources, 0 warnings, no extra changes
  • Independent Sol review found no material defects

Worktree: /home/cristian/orca/workspaces/gsd-path/guard-blocks-forced-branch-delete-and-worktree-f

Fixes #344

@cristianuibar
cristianuibar force-pushed the fix/344-scope-destructive-git-guards branch from e160163 to c9b1c4d Compare October 5, 2026 05:35
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.

Guard blocks forced branch delete and worktree force-remove for non-Path branches and after milestone ship

1 participant