Skip to content

Score-based channel matcher for re-import after name shortening #143

Description

@pskillen

Problem

Export name shortening (#130) abbreviates or truncates channel wire names to fit radio LCD limits. On re-import, identity merge keys (channelImportMergeKeys / incomingChannelMergeKey) no longer match the pre-export composed names.

#130 shipped an easy win: opt-in relaxedChannelMatch on applyImportToCodeplug / previewImportMerge that falls back to frequency + location (+ DMR CC/TS) when wire-name keys miss, and ignoreNameMatch on multi-mode / multi-talkgroup collapse heuristics.

That mitigates simple cases but is intentionally conservative (unique RF-context match only; no weighted scoring).

Proposal

Implement a thorough weighted score-based matcher for channel re-import identity, considering:

  • Composed / stashed wire names (fuzzy)
  • RX / TX frequency
  • Location (lat/lon tolerance)
  • Colour code / timeslot (digital)
  • Mode / multi-mode profile shape
  • Contact / TG list context where available

Return a confidence score; merge when above threshold and unambiguous. Surface low-confidence or ambiguous pairs for operator review instead of silent wrong merges.

Context

  • Merge helpers: src/lib/channelExpansion/index.ts (channelsAreRelaxedImportMergeCandidates, ChannelMergeCandidateOptions)
  • Active import: src/lib/importMerge.ts (ImportMergeOptions.relaxedChannelMatch)
  • Name keys: src/lib/channelNaming.ts (channelImportMergeKeys, incomingChannelMergeKey)
  • Long-term per-profile overrides remain #122.

Acceptance

  • Scoring function with documented weights and thresholds
  • Wired into active import merge behind a flag (default off or conservative)
  • Unit tests for abbreviated-name round-trip scenarios
  • Docs in docs/features/import-export/ describing limitations of relaxed vs score-based matching

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions