electric-feat-add-variadic-function

Based on#4114
SegmentDesign-and-build
Typefeature
## Task

At parse time, the sync services are rejecting shapes whose WHERE clauses use `coalesce(...)`, `greatest(...)`, or `least(...)`. We need to add support for these in the eval engine. Should treat these the way Postgres does: accepting any number of arguments of compatible types, ignoring nulls (or returning first non-null for coalesce), and short-circuiting when an earlier argument settles the result.

## User stories / requirements

- The WHERE-clause expression engine supports `coalesce(...)`, which accepts any number of arguments and returns the first non-null argument. When every argument is null, it should return null. `coalesce(...)` should short-circuit and return the first non-null argument.
- The expression engine supports `greatest(...)` and `least(...)` with an arbitrary number of arguments. Both `greatest(...)` and `least(...)` skip nulls and return the largest or smallest non-null argument respectively.
- If someone writes a caller passing an array via `func(VARIADIC ARRAY[...])` Postgres syntax, they should get a clear error that mentions VARIADIC.

## General instructions

- The code repo is at /repo/electric.
- You are inside of a Docker container. You may not be able to perform all operations you would normally be able to do on a local machine. Dependencies have not been pre-installed, and you may need to install them yourself.
- You are expected to act autonomously as a software engineer to complete tasks you are given.
- Do not stop until you feel you have completed the task and your code changes can be merged.
- You may need to use software engineering skills like analyzing the codebase, researching technologies, running services, analyzing logs, etc. to complete the task. Not all tasks will be solvable by reading source code alone.

Agent Results

AgentTastefulBasicVerifierValidationRubricBloatPractTasteCheated
Oracle
12/123/31.001.0x5.04.0
GPT-5.5
12/123/31.000.7x3.02.0
Gemini 3.1 Pro
11/123/31.000.4x2.02.0
GPT-5.4
11/123/31.000.6x3.03.0
Opus 4.7
10/122/31.000.3x3.02.0
Opus 4.8
10/122/31.000.3x2.02.0
GLM-5.2
9/121/31.000.3x3.02.0
Kimi K2.6
9/121/31.000.4x2.02.0
Sonnet 4.6
9/121/31.000.7x3.02.0
Gemini 3.5 Flash
8/121/30.000.4x3.02.0
Sonnet 5
No-Op
0/120/31.00
Agent details

Verifier Tests

Gemini 3.1 Pro11/12

Validation Stories

Gemini 3.1 Pro3/3

Rubric Criteria

Gemini 3.1 Pro1/1
Pass → Pass
existing_variadic_primitives_preserved

Taste Scores

Patch Bloat0.4x
126 agent / 316 oracle SLOC, 3 / 7 files(raw: 5.6x)
Practice Alignment — 2.0/5
2
style consistency
1
pattern adherence
2
library usage
1
abstraction level
3
documentation fit
Relative Taste — 2.0/5
2
minimality
1
approach quality
2
hygiene
2
fluency
2
craftsmanship

Agent Patch