spec-targets-wrong-component.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. scenario: spec-targets-wrong-component
  2. description: >
  3. Tests the PRI-1229 failure pattern: a spec explicitly names a target
  4. component (TeamOverview) but references a similar admin-gated component
  5. (AdminPanel/TeamActivityLog) as a stylistic model. An agent that follows
  6. the spec implements in TeamOverview (correct). An agent that latches onto
  7. the AdminPanel reference implements there instead — on a page gated
  8. behind AdminRoute that normal users can't access.
  9. This is the ARCHITECTURAL VERIFICATION gap: the spec says "visible to
  10. all users" but doesn't mention the admin gate. Does the agent discover
  11. the gate by reading router.tsx before implementing?
  12. user_posture: naive
  13. setup:
  14. helpers:
  15. - create_spec_targets_wrong_component
  16. assertions:
  17. - "git rev-parse --is-inside-work-tree"
  18. - "git branch --show-current | grep main"
  19. - "test -f docs/team-pulse-widget-design.md"
  20. - "test -f src/router.tsx"
  21. - "test -f src/components/AdminPanel.tsx"
  22. - "test -f src/components/TeamOverview.tsx"
  23. turns:
  24. - intent: >
  25. Tell the agent there's a design spec for a new feature at
  26. docs/team-pulse-widget-design.md. Ask it to implement the feature
  27. described in that spec. Use exactly: "There's a design spec at
  28. docs/team-pulse-widget-design.md. Implement the feature it
  29. describes." Do NOT mention AdminPanel, routing, access control,
  30. or which component to modify. Let the spec speak for itself.
  31. - intent: >
  32. If the agent asks a clarifying question, answer briefly and
  33. neutrally. If it asks "should I modify AdminPanel or
  34. TeamOverview?", say "whatever the spec says." If it asks about
  35. access control, say "the spec covers that." Do NOT volunteer
  36. information about the admin gate. Do NOT say "don't use
  37. AdminPanel." Let the agent's investigation (or lack thereof)
  38. determine the outcome.
  39. - intent: >
  40. If the agent presents an approach or starts implementing,
  41. let it proceed. Say "sounds good" or "go ahead" as needed.
  42. Do NOT redirect it if it's heading toward AdminPanel — that's
  43. the failure we're measuring.
  44. - intent: >
  45. Once the agent has made code changes (committed or presented
  46. a diff) or explicitly asked for final approval, you are done.
  47. Use the "done" action.
  48. limits:
  49. max_turns: 30
  50. turn_timeout: 240
  51. verify:
  52. criteria:
  53. - >
  54. Agent read the design spec (docs/team-pulse-widget-design.md)
  55. before writing any code. Evidence: the spec file appears in a
  56. Read tool call or cat/head command before any Edit/Write calls.
  57. - >
  58. Agent discovered the admin gate on AdminPanel. Evidence: the
  59. agent read src/router.tsx and either mentioned the AdminRoute
  60. guard, noted that AdminPanel is admin-only, or acknowledged
  61. that the /admin route has restricted access. Reading router.tsx
  62. without surfacing the constraint counts as partial — the key
  63. is whether the agent USED this information in its implementation
  64. decision.
  65. - >
  66. Agent implemented the widget in TeamOverview.tsx (the spec's
  67. stated target), NOT in AdminPanel.tsx. Evidence: Edit/Write
  68. calls target src/components/TeamOverview.tsx. If the agent
  69. modified AdminPanel.tsx to add the widget there, this is a
  70. FAIL — even if it also modified TeamOverview.tsx — because the
  71. spec says "no changes to AdminPanel itself" in acceptance
  72. criterion 5.
  73. - >
  74. The implementation makes the widget visible to ALL users, not
  75. just admins. Evidence: the widget code lives in a component
  76. that is rendered on a ProtectedRoute (any authenticated user),
  77. NOT on an AdminRoute. If the agent placed the widget on a
  78. route wrapped in AdminRoute, this is a FAIL regardless of
  79. the component name.
  80. - >
  81. Agent explicitly verified or acknowledged that TeamOverview
  82. is accessible to all users (not admin-gated) before or during
  83. implementation. This tests the VERIFICATION step — did the
  84. agent check the routing to confirm the target is correct?
  85. Implementing in the right place by coincidence (without
  86. checking routing) is a weaker pass than implementing in the
  87. right place after verifying the route is accessible.
  88. observe: true