Add metadata-driven token lookup resolution for normalization#107
Merged
Add metadata-driven token lookup resolution for normalization#107
Conversation
Member
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced Feb 27, 2026
c40a092 to
78cc2b5
Compare
62a3942 to
57f9199
Compare
Squash details: - Branch: st-ac3.17.3.8-remove-legacy-engine - Base: st-ac3.17.3.1-typed-change-engine - Squashed commits: 9 Original commits: - 754a3c1 internal/compare: remove legacy diagtree engine path - e7c9ab9 Rebuild compare breaking-change projections from typed changes - 3d8723b Keep nested breaking lines when direct change exists - c803a52 Fix compare maxChanges entry semantics and kind mapping - eee787a Track total breaking count independent of max-changes - c62ff6f Restore compare structured changes/grouped output contract - db468ce Align compare cmd tests with structured changes/grouped contract - 3b16bea Centralize compare Result structured model and JSON goldens - 4182404 Align text formatting to structured golden and add golden test
Squash details: - Branch: st-ac3.17.3.3-token-lookup - Base: st-ac3.17.3.8-remove-legacy-engine - Squashed commits: 9 Original commits: - 15bc37c normalize: add deterministic token lookup index - 15532da normalize: resolve token remaps lazily with memoization - fa79413 normalize: require source-direction evidence for token resolution - ae6243e normalize: snapshot token metadata and avoid caching none - cecbbd1 normalize: harden token lookup immutability and miss-cache tests - 303a00c normalize: defensively copy token lookup candidates - 44714f9 Simplify token lookup to direct per-call resolution - 1f44acb Clarify token lookup immutability contract and tighten tests - bcef934 normalize: document token lookup helpers
78cc2b5 to
8ad024b
Compare
57f9199 to
6da15c2
Compare
Zaid-Ajaj
approved these changes
Mar 2, 2026
corymhall
added a commit
that referenced
this pull request
Mar 2, 2026
## Summary This PR adds field-path and type-equivalence lookup helpers for normalization decisions. These helpers provide conservative, metadata-backed matching used to classify rename and maxItems-style transitions without schema rewriting. ## What Changed - Added field history flattening and lookup utilities. - Added resolver helpers for equivalent type transitions. - Added targeted fixtures for nested/coexistence maxItems scenarios. - Added extensive tests for path resolution, ambiguity handling, and equivalence checks. ## Why Token lookup alone is not enough for field/type transition classification. Compare-time normalization needs explicit field/type lookup primitives before integration. ## Context - Builds on token lookup primitives from #107. - Used by integration work in #110 and #111. ## Testing - `go test ./internal/normalize -count=1`
corymhall
added a commit
that referenced
this pull request
Mar 2, 2026
## Summary This PR wires token lookup outcomes into compare change generation. Missing/add/remap decisions now use metadata-backed token resolution in the engine path rather than post-processing. ## What Changed - Integrated token resolution into compare engine matching decisions. - Added typed normalization attribution for token-driven outcomes. - Added handling for retained aliases with canonical add/remap behavior. - Updated compare/json/text/summary tests to assert token-resolution behavior. - Threaded metadata through compare options where needed for lookup decisions. ## Why Token mapping decisions belong where canonical changes are generated. This reduces downstream synthetic behavior and keeps classification deterministic. ## Context - Uses lookup primitives from #107 and #108. - Prepares command/field-type integration cleanup in #110. ## Testing - `go test ./internal/compare ./compare -count=1`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces deterministic token lookup resolution from metadata history.
Lookup behavior is exposed as direct per-call APIs so compare-time decisions can query resolution state without precomputed global services.
What Changed
Why
Token equivalence is required to classify missing/add/remap changes correctly during compare generation.
This isolates token lookup as a focused primitive before integrating it into compare behavior in #109.
Context