[chore]: strengthen regex validation on `act`, `observe` for `elementId`

Merged
MI
10mo ago
+7-0

why

Stricter validation on LLM responses for chosen elementId to interact with

what changed

V3 includes only elementIds in the shape number-number to account for iframe ordinals. This PR ensures the LLMs have stricter validation on the elementId generation by changing the observe and act schemas to to enforce

z.string().regex(/^\d+-\d+$/)

test plan

  • act evals
  • observe evals
  • combination evals
  • regression evals

Summary by cubic

Enforce 'number-number' format for elementId in observe and act via regex (^\d+-\d+$) to prevent invalid IDs. Aligns with Linear STG-675 guardrail requirements for elementId formatting.