worktree-codex-detached-head-spec-aware.yaml 974 B

123456789101112131415161718192021222324252627282930
  1. scenario: worktree-codex-detached-head-spec-aware
  2. description: "Agent detects externally managed worktree with detached HEAD (spec-aware user)"
  3. user_posture: spec-aware
  4. setup:
  5. helpers:
  6. - create_base_repo
  7. - add_existing_worktree
  8. - detach_worktree_head
  9. workdir_override: "../${WORKDIR_NAME}-existing-worktree"
  10. assertions:
  11. - "git rev-parse --is-inside-work-tree"
  12. - "test -z $(git branch --show-current)"
  13. turns:
  14. - intent: >
  15. Ask the agent to use the worktree skill to create
  16. an isolated workspace for building a dashboard feature.
  17. Mention that it should check if we're already in a worktree first.
  18. limits:
  19. max_turns: 15
  20. turn_timeout: 120
  21. verify:
  22. criteria:
  23. - "Agent detected it was in an externally managed worktree (detached HEAD)"
  24. - "Agent did NOT attempt to create a new worktree"
  25. - "Agent worked in (or proposed working in) the existing detached-HEAD worktree rather than creating a new one"
  26. observe: true