[PR #659] [MERGED] fix(comparison): break function collection collation ties #2144

Closed
opened 2026-10-16 21:14:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/659
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/function-collation-ties


📝 Commits (1)

  • 3aaf7e2 fix(comparison): break function collection collation ties

📊 Changes

2 files changed (+85 additions, -3 deletions)

View changed files

📝 src/domain/functionComparison.test.ts (+74 -0)
📝 src/domain/functionComparisonNormalization.ts (+11 -3)

📄 Description

Summary

Prevent reordered, otherwise identical function collections from producing false changes when distinct Unicode strings collate equally.

No separate issue: this is a focused comparison regression reproduced through complete analyze_function Evidence.

Problem and expected behavior

On 19f8cdd, two callee names, caf\u00e9 and cafe\u0301, compare equal under localeCompare. Sorting their canonical records therefore preserves input order. Reversing the same two callees makes the calls dimension and overall function comparison report changed, with different normalized digests.

Collection order should not create a change. The two exact names must still remain distinct.

Change and scope

Keep the existing locale collation as the primary order and use the existing exact-string comparator only to break ties. This preserves non-tied order and digests, without Unicode normalization or record deduplication.

Contract and boundary impact

  • Semantic owner: canonical collection sorting in function comparison.
  • CLI/MCP: corrected comparison statuses/digests for tied values; no schema or tool changes.
  • Provider/platform: no provider or host behavior change.
  • Evidence/provenance: exact values, duplicate records, and source Evidence links remain intact.
  • Process/authorization/cleanup: none; pure domain logic.
  • Generated metadata/package: none.

Evidence and regression coverage

The reordered-callee regression fails on unchanged base while 21 existing/control tests pass. Added controls confirm:

  • Removing or replacing either exact Unicode name still reports a change.
  • Ordinary non-tied collections preserve the legacy digest.

The fixed suite passes. Independent review additionally exercised the shared helper's consumers and Unicode permutations without finding an issue.

Validation performed

  • Function, changed-behavior, bundle, and comparison-semantics suites: 39 tests passed.
  • npm run check: passed (93 lint warnings, 0 errors).
  • npm run jscpd: passed.
  • npm run scan:todos: passed.
  • git diff --check: passed.
  • Independent review: no findings.

Node.js 24.19.0, npm 11.9.0. Hosted CI is tracked separately; no complete local suite pass is claimed.

Compatibility, safety, and release

Non-tied canonical order is intentionally preserved. This fixes input-order dependence within collation ties; it does not redefine the existing primary collation policy. Packaging, native providers, and real Hopper/Ghidra execution are unaffected and were not rerun locally.

Prepared with AI assistance.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/659 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/function-collation-ties` --- ### 📝 Commits (1) - [`3aaf7e2`](https://github.com/morluto/rea/commit/3aaf7e2c54029a456145d6e3287fd9122f3abbe3) fix(comparison): break function collection collation ties ### 📊 Changes **2 files changed** (+85 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/functionComparison.test.ts` (+74 -0) 📝 `src/domain/functionComparisonNormalization.ts` (+11 -3) </details> ### 📄 Description ## Summary Prevent reordered, otherwise identical function collections from producing false changes when distinct Unicode strings collate equally. No separate issue: this is a focused comparison regression reproduced through complete `analyze_function` Evidence. ## Problem and expected behavior On `19f8cdd`, two callee names, `caf\u00e9` and `cafe\u0301`, compare equal under `localeCompare`. Sorting their canonical records therefore preserves input order. Reversing the same two callees makes the calls dimension and overall function comparison report `changed`, with different normalized digests. Collection order should not create a change. The two exact names must still remain distinct. ## Change and scope Keep the existing locale collation as the primary order and use the existing exact-string comparator only to break ties. This preserves non-tied order and digests, without Unicode normalization or record deduplication. ## Contract and boundary impact - Semantic owner: canonical collection sorting in function comparison. - CLI/MCP: corrected comparison statuses/digests for tied values; no schema or tool changes. - Provider/platform: no provider or host behavior change. - Evidence/provenance: exact values, duplicate records, and source Evidence links remain intact. - Process/authorization/cleanup: none; pure domain logic. - Generated metadata/package: none. ## Evidence and regression coverage The reordered-callee regression fails on unchanged base while 21 existing/control tests pass. Added controls confirm: - Removing or replacing either exact Unicode name still reports a change. - Ordinary non-tied collections preserve the legacy digest. The fixed suite passes. Independent review additionally exercised the shared helper's consumers and Unicode permutations without finding an issue. ## Validation performed - Function, changed-behavior, bundle, and comparison-semantics suites: 39 tests passed. - `npm run check`: passed (93 lint warnings, 0 errors). - `npm run jscpd`: passed. - `npm run scan:todos`: passed. - `git diff --check`: passed. - Independent review: no findings. Node.js 24.19.0, npm 11.9.0. Hosted CI is tracked separately; no complete local suite pass is claimed. ## Compatibility, safety, and release Non-tied canonical order is intentionally preserved. This fixes input-order dependence within collation ties; it does not redefine the existing primary collation policy. Packaging, native providers, and real Hopper/Ghidra execution are unaffected and were not rerun locally. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2144
No description provided.