Skip to content

Fix Phase 2 Excel identity and shared column-mapping heuristics#25

Merged
Mukku27 merged 1 commit into
mainfrom
cursor/fix-excel-mapping-6a40
Jul 10, 2026
Merged

Fix Phase 2 Excel identity and shared column-mapping heuristics#25
Mukku27 merged 1 commit into
mainfrom
cursor/fix-excel-mapping-6a40

Conversation

@Mukku27

@Mukku27 Mukku27 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Implements PR B / Phase 2 of the bug-fix plan: safer Excel row identity and a single column-mapping heuristic source.

Changes

  1. Excel identityremove / modify / add-upsert prefer ID when present; NAME-only destructive actions that match multiple rows raise AmbiguousProductMatchError (fail closed).
  2. Import impact previewestimate_import_impact() reports file rows, matched DB rows, and ambiguous names; the Streamlit upload UI surfaces these before approval.
  3. Shared mapping heuristicsCOLUMN_MAPPING_SYNONYMS + _heuristic_column_mapping in utils.py are the single source; prompt._fallback_column_mapping delegates to them (alias tokens also match spaced names like Product NameNAME).

Tests

  • New coverage for ID-targeted remove, ambiguous NAME reject, ID modify, impact estimation, and heuristic/fallback agreement
  • ruff check clean on touched files
  • pytest: 82 passed

Out of scope (Phase 3)

  • Startup ensure_schema
  • Audit log rotation
Open in Web Open in Cursor 

- Prefer ID for remove/modify/add upserts; fail closed on ambiguous NAME matches
- Surface estimated affected DB rows (and ambiguous names) in the import UI
- Deduplicate column-mapping synonyms into utils; prompt fallback reuses them

Co-authored-by: Mukesh Vemulapalli <vemulapallimukesh@gmail.com>
@Mukku27
Mukku27 marked this pull request as ready for review July 10, 2026 12:06
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Mukku27
Mukku27 merged commit 43059ea into main Jul 10, 2026
5 checks passed
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.

2 participants