fix(matching): conflict_resolution picks freshest (last_seen_at) value, deterministic (#1539) #1722
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1722
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/conflict-resolution-freshness-1539"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Проблема (#1539)
conflict_resolution.py_resolve/first_non_nullитерировалcandidates.values()в порядке вставки dict — недетерминированно.Решение (freshness — выбор владельца)
_freshest_non_null(candidates, timestamps): среди non-null берёт значение источника с maxlast_seen_at. Применён кfirst_non_null-правилу, unknown-fallback и priority-list fallback. Явные priority-списки по-прежнему авторитетны (ранжир бьёт freshness). Threading через опциональныйtimestamps: dict|None(source→last_seen_at) — shape результата не изменён, старые callers работают.Tie-break детерминированный: равный last_seen_at → лексикографически меньшее имя источника; нет timestamps → fallback по sorted-name (вместо insertion order).
Verify
ruffclean;pytest -k "conflict or resolution or matching"→ 99 passed (+11 тестов: fresher-wins, order-independence, tie, partial, ranking-beats-freshness).NB
resolve_*пока не вызывается из прода (update_canonical_fields— no-op stub; полная арбитрация — Stage 8.x). Сигнатура готова к проводкеlast_seen_at.Closes #1539