feat(products): diff engine — add/update/unchanged/error + INV-11 fingerprint

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 15:28:03 -07:00
parent 19ee695c20
commit 9bc6e4dbd2
3 changed files with 321 additions and 2 deletions
+4 -2
View File
@@ -31,8 +31,10 @@ from .models import (
_HANDLE_RE = re.compile(r"^[a-z0-9-]+$")
_STATUSES = {"draft", "active", "archived"}
# Product columns handled as attributes (title, option_names), not via fields{}.
_ATTRIBUTE_COLUMNS = {"Title", "Option1 Name", "Option2 Name", "Option3 Name"}
# Title is handled as an attribute, not via fields{}. Option names live in BOTH
# .option_names (the values) and fields{} (the file-presence signal the diff
# needs: absent column == untouched, never a clear).
_ATTRIBUTE_COLUMNS = {"Title"}
# Sentinel: the cell failed normalization (the error is already recorded).
_INVALID = object()