Skip to content

Tracked every same-named definition instead of first occurrence only - #4

Merged
kridaydave merged 4 commits into
mainfrom
fix/track-same-named-functions
Aug 22, 2026
Merged

Tracked every same-named definition instead of first occurrence only#4
kridaydave merged 4 commits into
mainfrom
fix/track-same-named-functions

Conversation

@kridaydave

Copy link
Copy Markdown
Contributor

PR made by x-preview-f from opencode on behalf of Kriday.
Two same-named methods in one file (say hit on two Go receivers) used to collapse into a vague ambiguity note, and the untouched twin could hide real changes. The engine now keeps every definition and matches them by content before pairing leftovers.

Summary :

  • Changed FunctionMap to hold every def per name instead of first-occurrence-wins
  • Diffing aligns each name group: exact body match first, then positional pairing
  • Removed the "defined multiple times" ambiguity disputes; dockets now point at the exact changed definition
  • Kept bare-name identity so impl-block refactors still don't fabricate conflicts

Ready For Review !!

The engine kept one def per bare name, so two same-named methods in a
file collapsed into an ambiguity note and the untouched twin shadowed
real changes. FunctionMap now holds all defs per name and diffing aligns
each group by content: exact body match first, positional pairing of
leftovers. Identity survives impl-block moves, so the qualified-key
regression stays fixed.
Adversarial review caught two real bugs in the first cut: ours adding a
same-named overload while theirs edited the original flipped a clean
merge to High/Blocked, and add/add divergence drifted off the old
conflict message. Divergence now requires both sides to mutate existing
defs; pure additions stay unilateral. Rename/rename swallow and row
swapping on count asymmetry are logged in TODO.md as known friction.
Re-review caught the residual case: ours' addition appearing verbatim
inside theirs' additions still fabricated a High conflict because the
convergent check demanded exact set equality. Subset containment in
either direction is now clean; only disjoint additions conflict.
Third review pass caught one more false High: both branches converging
on the same body while one also kept an extra copy read as divergent.
When neither side deleted anything, stripping shared defs must leave at
most a one-sided remainder to stay clean. Shared deletions keep the old
convergent path.
@kridaydave
kridaydave merged commit f6afe7e into main Aug 22, 2026
5 checks passed
@kridaydave
kridaydave deleted the fix/track-same-named-functions branch August 22, 2026 09:41
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