SupportedUnderstudyAction Enum validation for 'method' on act/observe

Merged
MI
10mo ago
+164-4

why

act and observe don't fail on validation if the LLM generates an action with a non-supported method

what changed

  • Added z.enum(supportedUnderstudyAction) to the act and observe inference schemas

test plan

  • Evals (act/observe)

Summary by cubic

Enforces SupportedUnderstudyAction enum for the method field in act and observe so invalid actions are rejected during schema validation. Prevents unsupported methods from slipping through when the LLM generates actions and supports Linear STG-1212.

  • Bug Fixes

    • Use z.enum(Object.values(SupportedUnderstudyAction)) for act/observe; unsupported methods fail fast across Zod v3/v4.
    • Added tests confirming enum validation works in both Zod v3 and v4.
    • Updated method description to reference Understudy interaction methods instead of Playwright.
  • Refactors

    • Migrated enum compatibility tests from Playwright to Vitest and moved them to packages/core/tests.