Backtestspydanticrun-20261005-183002#13687
populate_by_name (and implicit validate_by_name when validate_by_alias=False) is ignored by @validate_call
Better
Our patch was judged better than the merged fix.
In this judgment, Patch B = our agent, Patch A = the merged fix.
Both patches fix the root cause: the arguments schemas embedded the raw `validate_by_name` config key instead of the effective value.
**Patch A** reads the value from `self._config_wrapper.core_config(title=None)`. This reuses the existing compatibility logic, so it should handle both `populate_by_name=True` and `validate_by_alias=False`. The costs are:
- It builds the full core config one extra time for every arguments schema.
- It relies on a method that may mutate state.
- It passes `None` when the key is unset rather than the previous `False` default. This is probably harmless, since the key gets filtered out.
A's tests are weak. They only cover `populate_by_name`, never the worse `validate_by_alias=False` variant the issue highlights, and the experimental-schema test only checks `arguments-v3`. A also rewrites unrelated `dict(...)` → `{...}` lines in existing tests, which is pure churn.
**Patch B** adds a non-mutating `effective_validate_by_name` property. It mirrors `core_config()`'s precedence:
1. explicit `validate_by_name`
2. then `populate_by_name`
3. then `validate_by_alias is False`
B uses it in both arguments schema builders. It also uses it for model and dataclass signature generation, which is an adjacent consistency fix with low risk. Duplicating the precedence logic carries some risk of the two copies drifting apart, but the docstring explains why the property exists.
B's tests are clearly stronger. They are parametrized over both schema types and both triggering configs (`populate_by_name=True`, `validate_by_alias=False`). They check that the alias is rejected when `validate_by_alias=False`. They also test the precedence case (`populate_by_name=False` with `validate_by_name=True`). All of these would fail before the fix.
Correctness is roughly equal. B wins on test coverage of the issue's stated scenarios and on avoiding unrelated test churn.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
11m 55s
Wall-clock time in the container
Full test suite
No new failures
12,399 passed · 500 skipped · 12,899 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
61vs 39 merged
Changed lines, ours vs merged