Skip to content

Fix merge_keys case-sensitivity bug in build_context - #51

Merged
coordt merged 1 commit into
masterfrom
fix/issue-44-merge-keys-case-bug
Sep 27, 2026
Merged

coordt merged 1 commit into
masterfrom
fix/issue-44-merge-keys-case-bug

Conversation

@coordt

@coordt coordt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • update_context lowercased the context key before looking it up in composition.merge_keys, but merge_keys is a user-authored dict with no case normalization — a mixed-case key like myKey with merge_keys = {"myKey": "update"} silently fell back to the comprehensive strategy instead of the one configured. Dropped the .lower() call and documented that merge key matching is case-sensitive.
  • Added a real (non-mocked) build_context integration test that interleaves two overlays and a task with a conflicting mixed-case merge key, closing the mock-only coverage gap for this seam.

Fixes #44

Test plan

  • uv run pytest --agent-digest=term -p no:sugar — 329 passed
  • New test confirmed to fail against the old (buggy) code and pass with the fix
  • ruff check / ruff format --check clean
  • Pre-commit hooks (incl. mypy) passed on commit
  • /code-review medium — no findings

…tion test

update_context lowercased the context key before looking it up in
composition.merge_keys, but merge_keys is a user-authored dict with no case
normalization, so a mixed-case key like myKey with merge_keys = {"myKey":
"update"} silently fell back to the comprehensive strategy. Drop the
.lower() call and document that merge key matching is case-sensitive.

Also adds a real (non-mocked) build_context test that interleaves two
overlays and a task with a conflicting mixed-case merge key, closing the
mock-only coverage gap called out in #44.

Fixes #44
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-27 12:13 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Version hint: patch
Current version: 0.9.0
New version (when merged): 0.9.1

Comment ID: Display version hint-auto-generated

@coordt
coordt merged commit 0c72a8a into master Sep 27, 2026
5 checks passed
@coordt
coordt deleted the fix/issue-44-merge-keys-case-bug branch September 27, 2026 12:13
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.

build_context: mock-only test coverage; merge_keys case bug for mixed-case context vars

1 participant