fix(sandbox): use spec-required cleveragents/plan-<plan_id> branch naming in GitWorktreeSandbox #3263
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!3263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/git-worktree-branch-naming"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes a branch naming convention bug in
GitWorktreeSandbox.create()where sandbox branches were being created assandbox/<plan_id>instead of the spec-requiredcleveragents/plan-<plan_id>format. This ensures all CleverAgents-managed git branches are correctly namespaced under thecleveragents/prefix as defined in the specification.Changes
src/cleveragents/infrastructure/sandbox/git_worktree.py:f"sandbox/{safe_plan_id}"tof"cleveragents/plan-{safe_plan_id}"to match the spec-required naming format.cleveragents/plan-<plan_id>instead ofsandbox/<plan_id>), keeping documentation in sync with the implementation.features/steps/git_worktree_coverage_boost_steps.py:sandbox/test→cleveragents/plan-testsandbox/cleanup-test→cleveragents/plan-cleanup-testsandbox/branch-delete-fail→cleveragents/plan-branch-delete-failfeatures/garbage_collection.feature:sandbox/test-plantocleveragents/plan-test-planto align with the corrected naming convention.Design Decisions
cleveragents/namespace prefix: The spec designatescleveragents/as the authoritative namespace for all branches managed by CleverAgents tooling. Using this prefix ensures branches are visually grouped in git clients, avoids collisions with user-created branches, and makes automated cleanup (garbage collection) unambiguous.plan-infix: Theplan-segment distinguishes plan-execution branches from any other future branch types that may be introduced under thecleveragents/namespace. This matches the format shown inagents plan executeoutput in the specification.Testing
cleveragents/plan-{safe_plan_id}is the branch name producedRelated Issues
Closes #2601
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
- Implemented branch naming change in GitWorktreeSandbox.create() from sandbox/<plan_id> to cleveragents/plan-<plan_id>, located in src/cleveragents/infrastructure/sandbox/git_worktree.py - Updated the create() method docstring to reflect the new branch naming convention - Updated test fixtures: - features/steps/git_worktree_coverage_boost_steps.py: sandbox/test -> cleveragents/plan-test, sandbox/cleanup-test -> cleveragents/plan-cleanup-test, sandbox/branch-delete-fail -> cleveragents/plan-branch-delete-fail - Updated scenario: - features/garbage_collection.feature: sandbox/test-plan -> cleveragents/plan-test-plan - Design rationale: - Adopted the spec-required format: cleveragents/plan-{safe_plan_id} to align with the spec-defined namespace for all CleverAgents-managed git branches - Ensures consistent branch naming across code, tests, and features for easier policy enforcement and maintainability ISSUES CLOSED: #2601GitWorktreeSandboxcreates branch namedsandbox/<plan_id>instead of spec-requiredcleveragents/plan-<plan_id>#2601🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3263-1775374200]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3263-1775373000]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
✅ Review Complete — Clean, spec-aligned bug fix
Review Summary
Scope: Single-line production fix + test fixture updates (3 files, 7 insertions, 7 deletions)
Specification Alignment ✅
agents plan executeoutput clearly showsBranch: cleveragents/plan-01HXM8C2— this fix aligns the implementation with that requirement.cleveragents/namespace prefix is the spec-defined namespace for all CleverAgents-managed git branches.plan-infix correctly distinguishes plan-execution branches from other potential future branch types.Correctness ✅
f"sandbox/{safe_plan_id}"→f"cleveragents/plan-{safe_plan_id}"._sanitise_branch_name()function already handles slashes in its allowed character set, so thecleveragents/plan-prefix won't be mangled._sanitise_branch_name()(empty input →"sandbox") would producecleveragents/plan-sandbox, which is still correctly namespaced.sandbox/branch prefix — the change is self-contained.Test Quality ✅
git_worktree_coverage_boost_steps.pycorrectly mirror the new naming convention.garbage_collection.featurescenario fixture is updated to match.sandbox/<plan_id>branch name references remain in test files on this branch.PR Metadata ✅
fix(sandbox): ...) withISSUES CLOSED: #2601footer ✓Closes #2601✓Type/Bug✓v3.3.0✓CI Status
Scheduling merge for when all checks complete.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
GitWorktreeSandboxcreates branch namedsandbox/<plan_id>instead of spec-requiredcleveragents/plan-<plan_id>#2601GitWorktreeSandboxcreates branch namedsandbox/<plan_id>instead of spec-requiredcleveragents/plan-<plan_id>#2601Review Summary — LGTM ✅ (Self-Review)
Reviewed PR #3263 with focus on specification-compliance, requirements-coverage, and behavior-correctness.
Scope
Single-line production fix + docstring update in
git_worktree.py, plus 4 test fixture updates across 2 test files. Clean, minimal blast radius.Deep Dive Results
Specification Compliance ✅
agents plan executeoutput clearly showsBranch: cleveragents/plan-01HXM8C2— this fix aligns the implementation with that requirement.cleveragents/namespace prefix is the spec-defined namespace for all CleverAgents-managed git branches.plan-infix correctly distinguishes plan-execution branches from other potential future branch types under thecleveragents/namespace.src/reference the oldsandbox/branch prefix pattern — the change is self-contained.Requirements Coverage ✅
sandbox/<plan_id>tocleveragents/plan-<plan_id>create()docstring updated to reflect new namingBehavior Correctness ✅
_sanitise_branch_name()regex ([^a-zA-Z0-9/_.\-]+) already allows slashes in its character set, so thecleveragents/plan-prefix will not be mangled by sanitisation — verified by reading the regex definition._sanitise_branch_name()fallback (empty input →"sandbox") would producecleveragents/plan-sandbox, which is still correctly namespaced under thecleveragents/prefix. Theplan_idvalidation at the top ofcreate()already rejects empty strings, so this fallback only triggers for strings composed entirely of disallowed characters — an extreme edge case.Test Quality ✅
git_worktree_coverage_boost_steps.pycorrectly updated:sandbox/test→cleveragents/plan-testsandbox/cleanup-test→cleveragents/plan-cleanup-testsandbox/branch-delete-fail→cleveragents/plan-branch-delete-failgarbage_collection.featurescenario fixture updated:sandbox/test-plan→cleveragents/plan-test-planrobot/container_tool_exec.robot) reference/tmp/sandbox/as a filesystem path, not a branch name — correctly left unchanged.PR Metadata & Commit Standards ✅
fix(sandbox): ...) withISSUES CLOSED: #2601footer ✓Closes #2601✓Type/Bug✓v3.3.0(matches issue) ✓fix/git-worktree-branch-naming✓Minor Observations (Non-blocking)
_sanitise_branch_name()fallback value — The fallback value on line ~51 is still the string"sandbox", a leftover from the old naming convention. While this is not introduced by this PR and the resulting branch name (cleveragents/plan-sandbox) is still correctly namespaced, a future cleanup could change this to something more semantically appropriate like"unknown"or"default". Consider filing a low-priority follow-up issue.Decision: APPROVED ✅
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer