Files
roboco/tests/unit/api/routes
Renn F bd52e3d0c3 fix(schemas): pre-gateway-style cross-field validators on DelegateRequest
Pre-gateway parity for G7 of the 2026-05-11 design. The pre-gateway
TaskCreateInput at 254cc93:roboco/mcp/schemas/__init__.py:210-235 had
@field_validator hooks that caught the most common LLM-vs-schema
confusions with helpful "did you mean X?" hints. Those validators were
lost in the gateway refactor.

Three validators added to DelegateRequest:

- estimated_complexity: rejects ints (some agents send 1/2/3 thinking
  it's a priority), enforces enum {low|medium|high|critical}. Hint
  steers them to drop priority (which isn't a delegate parameter).

- nature: rejects invented values like the 2026-05-11 'standard'
  regression. Enum is {technical|non_technical}. Hint explicitly cites
  the regression so the LLM knows why this is enforced.

- task_type: rejects invented task_type values. Enum is {code,
  documentation, research, planning, design, administrative}.

Fail-fast at the Pydantic boundary returns a 422 with the structured
hint inline, so the agent loops a single retry instead of leaking a
TaskCompletenessError up the stack.

Existing tests in tests/unit/api/routes/v2/test_flow_*.py used
"nature": "feature" — a value that the gateway's TaskNature enum
never accepted, so it would have been rejected at completeness check
anyway. Updated both to "technical".

Spec ref: docs/superpowers/specs/2026-05-11-pre-gateway-parity-design.md
2026-05-11 06:00:58 +02:00
..
2026-05-02 03:11:49 +02:00
2026-05-02 03:11:49 +02:00
2026-05-06 21:02:31 +02:00