Skip to content

Document and name the overlay/pattern extra_context merge contract - #52

Merged
coordt merged 1 commit into
masterfrom
fix/issue-46-overlay-merge-contract
Sep 27, 2026
Merged

coordt merged 1 commit into
masterfrom
fix/issue-46-overlay-merge-contract

Conversation

@coordt

@coordt coordt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • process_overlay merged pattern extra_context twice (before and after questions) with only a one-line comment explaining why, making the ordering invariant invisible to callers of merge_contexts.
  • Extracted the second pass into a named function, render_pattern_context_after_questions, with a docstring stating the real contract: pattern extra_context may reference question answers (rendered twice), overlay extra_context may not (rendered once, before questions).
  • No behavior change — verified the two merge_contexts calls are identical before/after.
  • Documented that test_uses_answers_from_ui (via package_path) is the deletion test covering this invariant, rather than adding a duplicate test.

Fixes #46

Test plan

  • uv run pytest tests/test_context_builder/test_overlays.py — 8 passed
  • uv run pytest — 330 passed (12 pre-existing, unrelated test_git_commands.py errors from local git setup)
  • ruff check / ruff format --check on changed files
  • mypy on changed file — no new errors
  • pre-commit hooks passed on commit

process_overlay merged pattern extra_context twice (before and after
questions) with only a one-line comment explaining why. Extract the
second pass into render_pattern_context_after_questions with a
docstring stating the real contract: pattern extra_context may
reference question answers, overlay extra_context may not.

Fixes #46
@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:44 UTC

@github-actions

Copy link
Copy Markdown
Contributor

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

Comment ID: Display version hint-auto-generated

@coordt
coordt merged commit d0149c3 into master Sep 27, 2026
5 checks passed
@coordt
coordt deleted the fix/issue-46-overlay-merge-contract branch September 27, 2026 12:44
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.

process_overlay's two-pass merge relies on an undocumented, untested ordering invariant

1 participant