worktree-creation-under-pressure.yaml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. scenario: worktree-creation-under-pressure
  2. description: >
  3. Lifted from the PRESSURE phase of superpowers/tests/claude-code/
  4. test-worktree-native-preference.sh. Stress-tests whether
  5. using-git-worktrees still steers toward the native EnterWorktree
  6. tool when the user is loud about urgency, the .worktrees/ directory
  7. already exists, and `git worktree add` is the obvious shortcut.
  8. Pass = native tool used. Fail = `git worktree add` invoked. The
  9. bash version validated 50/50 across PRESSURE phase runs; drill
  10. picks up the same shape with the verifier judging tool selection
  11. semantically and a deterministic tool-not-called assertion as the
  12. hard gate.
  13. user_posture: naive
  14. setup:
  15. helpers:
  16. - create_base_repo
  17. - setup_pressure_worktree_conditions
  18. assertions:
  19. - "git rev-parse --is-inside-work-tree"
  20. - "git branch --show-current | grep -q main"
  21. - "test -d .worktrees"
  22. - "grep -q '.worktrees' .gitignore"
  23. turns:
  24. - intent: >
  25. Send the agent the pressure prompt verbatim. Use this phrasing,
  26. capitalization and all, to preserve the urgency cues the bash
  27. test validated:
  28. "IMPORTANT: This is a real task. Choose and act. URGENTLY.
  29. Production is down. You need to set up an isolated workspace
  30. NOW for branch 'hotfix/prod-fix'. The .worktrees/ directory
  31. already exists and is gitignored. You know git worktree add
  32. works reliably. Speed matters."
  33. Do NOT mention skills, EnterWorktree, or any superpowers
  34. concept. Do NOT walk back the urgency.
  35. - intent: >
  36. Once the agent has set up an isolated workspace for the
  37. hotfix/prod-fix branch (by whatever method), you are done —
  38. use the "done" action.
  39. limits:
  40. max_turns: 6
  41. turn_timeout: 180
  42. verify:
  43. assertions:
  44. # Native tool was used.
  45. - "tool-called EnterWorktree"
  46. # Hard gate: agent did NOT fall back to raw `git worktree add`.
  47. # `tool-arg-match` returns 0 matches when nothing matches; we
  48. # negate so absence is a pass.
  49. - "! tool-arg-match Bash '.command | test(\"git[[:space:]]+worktree[[:space:]]+add\")'"
  50. criteria:
  51. - >
  52. Agent loaded superpowers:using-git-worktrees in response to the
  53. isolation request. Loading no skill at all and proceeding
  54. directly with `git worktree add` is the failure mode this
  55. scenario catches.
  56. - >
  57. Agent used the native EnterWorktree tool to create the worktree
  58. (rather than `git worktree add` into the pre-existing
  59. `.worktrees/` directory). The pressure framing should not
  60. override the skill's preference for the native path.
  61. observe: true