Task Description Add a branch name validation utility to packages/opencode/src/tasks/pulse-verdicts.ts that validates branch names before git operations.
Currently branch names are used directly in git commands without validation. Add a validateBranchName() function that:
Rejects names with dangerous characters (spaces, shell specials, backticks, $, etc.) Allows safe characters: alphanumeric, hyphen, underscore, slash, dot, plus Returns validated branch or throws descriptive error Quality Gates (Non-Negotiable) Acceptance Criteria Function exported from pulse-verdicts.ts Function rejects: spaces, backticks, $, ;, |, &, newlines Function accepts: feature/my-branch, fix/issue_123, release/v1.0+beta Tests cover edge cases: empty string, extremely long names, unicode No type errors, no lint violations Test file under 500 linesTest Scenarios to Cover Valid branch names (normal cases) Shell injection attempts (my$(cmd)branch, `backtick`) Path traversal attempts (../evil) Empty/null/whitespace inputs Extremely long branch names (>255 chars)
Task Description
Add a branch name validation utility to
packages/opencode/src/tasks/pulse-verdicts.tsthat validates branch names before git operations.Currently branch names are used directly in git commands without validation. Add a
validateBranchName()function that:Quality Gates (Non-Negotiable)
Acceptance Criteria
pulse-verdicts.tsfeature/my-branch,fix/issue_123,release/v1.0+betaTest Scenarios to Cover
my$(cmd)branch,`backtick`)../evil)