scripts/cherry-pick-wave.sh previously removed worktrees unconditionally
in non-interactive contexts and accepted loose branch patterns. Now:
- destructive_consent gate wraps remove_worktrees. Removal fires only
when --yes, --force-delete, or interactive tty detected. Otherwise
prints '[dry-run] would remove worktree: <path>' with instructions.
- Pattern hardening: rejects empty pattern, patterns starting with
wildcards (*, ?, [), and requires first char to match [A-Za-z0-9_-].
- --force-delete flag: explicit opt-in to destructive removal in
non-tty contexts (for CI/automation).
- Help text updated for new flag and safety semantics.
Backward-compat preserved for callers passing --yes (existing test still
passes). New behavior only affects callers running non-interactively
without --yes or --force-delete — they now see dry-run instead of
silent destruction.
Existing test tests/scripts/test-cherry-pick-wave.sh still passes.
shellcheck clean.
Consumes v2.9.3..HEAD 'Harden scripts/cherry-pick-wave.sh pattern
handling and delete safety'.
Swarm: 8 tasks across 2 waves, TDD on all Go changes.
HIGH fixes:
- rpi serve --run-id now matches 12-hex IDs (was misclassifying as goals)
- cherry-pick-wave.sh: pattern validation + prefix-scoped rm fallback
- -o flag contract: rename local --output to --output-dir/--output-file
on defrag, memory, context_assemble (stops shadowing root format flag)
MEDIUM fixes:
- defrag --json now emits JSON (was printing text unconditionally)
- Remove dead promote-anti-patterns from doctor suggestions
- Pin install scripts to tagged releases instead of mutable main
- Add ao doctor + skill-lint CI jobs to validate.yml
- Add learning coherence quality gate script
Process:
- Drain 7 unconsumed next-work.jsonl entries (0% → 100% resolution)
- 192 lines of new tests (TDD: test-first across all Go changes)