Skip to content

MIT-618: add the pydantic-settings validate_by_name GitHub task (batch 6) - #170

Merged
ZachFara merged 3 commits into
feature/eval-setupfrom
feat/MIT-618-batch6
Nov 10, 2026
Merged

ZachFara merged 3 commits into
feature/eval-setupfrom
feat/MIT-618-batch6

Conversation

@ZachFara

@ZachFara ZachFara commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

What changed

tools/eval/github_tasks.py gets 1 more verified GitHub task, for 7 in all. Zach wants 20, so this is well short. The rest of the batch's leads failed the bar (see the rejected candidates).

Task Repo (license) Upstream release upstream_change
gh-pydantic-settings-validate-by-name pydantic/pydantic-settings (MIT) pydantic 2.14.0, 2026-10-08 pydantic-2.14-model-config-not-resolved (new)
  • Pairs: 0. The new key has one task.
    • The repository already has a task, gh-pydantic-settings-signature, but under a different key: that one is pydantic#13730, the private signature helper.
    • Batch 2 rejected this candidate as "the same upstream change". The issue itself cites a different change, pydantic#13825, so it is re-checked here at the coordinator's request.
  • Timing:
    • The upstream change is Do not mutate model_config attribute pydantic/pydantic#13825, "Do not mutate model_config attribute". It merged 2026-09-25, and commit 5da36b5 was authored and committed that same day, after the June 2026 cutoff.
    • It is an ancestor of v2.14.0, which was released 2026-10-08.
    • Issue pydantic-settings#1021 was opened 2026-10-09.
    • Fix #1022 was squash-merged 2026-10-13 as 3b405d4.
  • Base: the squash commit's parent, f0dd382.
  • Fix: it changes code. A new _validate_by_name_enabled in sources/utils.py resolves the config itself: validate_by_name, then the populate_by_name fallback, then the validate_by_alias=False implication. main.py, the env and secrets sources, the Azure source and the CLI source use it.
  • Laid over: only tests/test_settings.py.
    • tests/test_utils.py is left out, because it imports the fix's new helper by name.
    • tests/test_source_azure_key_vault.py is left out as well.
  • Test command: the two new tests that fail at the base, test_validate_by_alias_false_when_using_name and test_validate_by_alias_false_with_secrets_when_using_name. The PR's third new test (init kwarg priority) passes at the base on 2.14.0, so it is left out.
  • Setup: the same as the existing pydantic-settings task, uv pip install --exclude-newer=... -e . pytest==9.1.1, then pydantic==2.14.0.
  • Hard-set: not claimed. The error doesn't name a fix, but I didn't try the obvious one.

Base failing output (containerized)

Run Result
Base, pydantic 2.14.0 2 failed
Fix, pydantic 2.14.0 2 passed
Base, pydantic 2.13.5 2 passed (previous version, checked)

The key line, from both tests:

E       AssertionError: assert 'default' == 'honeycrisp'

The runs went through a .scratch/ helper that calls repos.materialize, repos.prepare and repos.run_tests with container.run, the same steps agent_eval.py check runs. Containers ran one at a time, none were left behind, and --on-host was never used.

Cause-word checks

  • Cause words (after the review fix):
    • back into model_config, back to model_config
    • no longer mutates, no longer mutates model_config, mutate model_config, mutates model_config, mutating model_config
    • model_config as declared, model_config no longer, model_config unchanged, leaves model_config
    • no longer writes validate_by_name, no longer sets validate_by_name, stopped writing validate_by_name, stopped setting validate_by_name
    • 2.14
  • Rule: every phrase carries its object, model_config or validate_by_name. The first version had bare verbs (written back, no longer writes, write back), which a symptom-only fix matches ("never written back to the field"), and write back also matches "write backend". Those were dropped, along with resolved validate_by_name. no longer mutates is still bare, as the review's list has it.
  • What they name: pydantic's change. Since 2.14 it leaves model_config as declared, and no longer writes the resolved validate_by_name back into it.
  • Version words: every word but 2.14 is a non-version word.
  • Left out: implies and validate_by_name alone, because a fix that only treats the symptom says them ("validate_by_alias=False implies validate by name"). I also dropped 13825, since is_version_word would read it as a version.
  • No hits. After the review fix I checked every word with grading v2's mentions against:
    • a fresh containerized base output, on 2.14.0 (2 failed) and on 2.13.5 (2 passed);
    • the whole laid-over tests/test_settings.py at the fix sha (5,388 lines);
    • the base pydantic_settings/ source (every file, from git archive of f0dd382);
    • the symptom words (validate_by_alias, alias, environment variable, default), in both directions;
    • the names of the traceback's test functions and of the functions the fix edits (_settings_restore_init_kwarg_names, _extract_field_info, _get_resolved_field_value, _nested_field_targets, _add_parser_args, __init__) and of the new helper;
    • three symptom-only sentences from the review: "no longer writes the value when validate_by_alias is False", "the env value is never written back to the field", "fall back to the resolved validate_by_name".
  • test_no_example_names_a_scenarios_cause in server/tests/test_variants.py passes.
  • Leak review: I read the laid-over file's 72 comments, 53 docstrings and 730 names at the fix sha, flagging anything about versions, model_config, resolving, writing, mutating or validate_by_name.
    • The hits are the existing test_populate_by_name_* and test_model_config_* tests, which are already in the base file, plus unrelated comments ("all resolve to the field", forward-reference docstrings).
    • The new tests have no comments or docstrings, and their names state only the symptom.
  • New version words: none. 2.14 is already in the expected set of test_the_cause_words_grader_v2_skips_are_exactly_the_versions.

Rejected candidates (this batch)

Why

MIT-618 (sixth batch), the GitHub-task eval: real post-cutoff tasks for the arms run.

How it was tested

  • Containerized runs of the base and the fix on pydantic 2.14.0, and of the base on 2.13.5, as above.
  • server/tests/test_eval_grader.py and server/tests/test_eval_repos.py pass (105 tests).
  • make check passes after git fetch origin and merging origin/feature/eval-setup (already up to date).

Learned

  • One repository can hold tasks for two upstream changes in one release. Check the issue's own cited upstream PR before calling a sibling "the same change": pydantic-settings#1021 cites pydantic#13825, not #13730.
  • When a fix PR adds several tests, run each at the base on the new version. Here one of the three new tests already passed at the base, so it stays out of the test command.
  • A test file that imports the fix's new helper by name (tests/test_utils.py here) can't be laid over, because the import names the fix. Lay over only the files that test the behaviour.
  • is_version_word treats a bare issue number such as 13825 as a version, so an upstream PR number as a cause word would add a version word. Leave it out.
  • pint 0.26.0 came out 2026-09-10, with two post-cutoff changes, both merged 2026-07-26: Greek mu for micro (pint#2365) and DOT OPERATOR in pretty printing (pint#2273). Their downstream fixes mostly state the cause in a test docstring or helper.
  • pytest 9.2 plugin-API and monkeypatch-undo breakages mostly get pins or test-only fixes downstream. In the pytest, pydantic and pint area, fewer than 1 in 20 searched candidates qualify.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y

ZachFara and others added 3 commits November 10, 2026 18:06
…IT-618)

Pydantic 2.14 leaves model_config as declared (pydantic#13825), so
pydantic-settings ignored env vars and secrets named after an aliased
field under validate_by_alias=False. Verified in containers: fails at
the base on 2.14.0, passes with the fix, passes at the base on 2.13.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y
Bare verbs such as "written back" and "no longer writes" match a fix
that only treats the symptom, and "write back" matches "write backend".
The phrases now name model_config or validate_by_name. Re-checked with
no hits against both base outputs, the laid-over tests, the base source,
the symptom words, the edited function names and symptom-only sentences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y
…T-618-batch6

# Conflicts:
#	tools/eval/github_tasks.py
@ZachFara
ZachFara merged commit 237164f into feature/eval-setup Nov 10, 2026
2 checks passed
@ZachFara
ZachFara deleted the feat/MIT-618-batch6 branch November 10, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant