Skip to content

Issue #22 (part 3 slice): Preview agrees with Move under LINK - #219

Merged
MattGyverLee merged 1 commit into
mainfrom
fix-22-link-preview-agreement
Nov 2, 2026
Merged

MattGyverLee merged 1 commit into
mainfrom
fix-22-link-preview-agreement

Conversation

@MattGyverLee

Copy link
Copy Markdown
Owner

Part of #22. This is the self-contained slice of the remainder: the LINK Preview/Move disagreement recorded as a known gap in #101. Part 2 (true Overwrite) is blocked on flexicon mirror-mode / empty-key emission. The rest of Part 3 (GOLD identity resolution layered on Merge, and the planner not comparing CatalogSourceId) needs a spec and a constitution amendment.

Change

Under ConflictMode.LINK, Move writes nothing to an existing item (transfer.execute: "LINK mode - item present, no field writes"), but the category planners emit a GUID-matched PlannedOverwrite(write_mode="merge") whenever fields differ, so Preview promised a merge Move never wrote (Principle III). preview._link_mode_skip now converts that overwrite, in build_run_plan's leaf loop, into a Skip(ALREADY_PRESENT_BY_GUID) whose detail says LINK writes no fields and lists the differences that are NOT applied. Natural-key matches and non-merge overwrites are left alone (the executor resolves references through them). Default modes are unchanged (these categories default to UPDATE).

Live verification (FLEXLIBS_REQUIRE_LIVE=1)

tests/integration/test_issue22_link_preview_live.py: private source GT-Src-22, Target restored from Target 2026-07-06 0218.fwbackup and claimed with lockout (released afterwards). A POS exists in both with Name/Abbreviation diverged in the source.

  • LINK: Preview plans no overwrite for the POS and emits the skip ("...LINK mode links by GUID and writes no fields, so the differences found are NOT applied (... 'GT22 old pos' -> 'GT22 new pos' ...)"); Move leaves target ('GT22 old pos','GT22old') unchanged.
  • UPDATE (control): Preview plans the merge; Move writes ('GT22 new pos','GT22new') ("UPDATE applied (2 field(s) written)").
  • 4 passed.

Unit: new tests/unit/test_issue22_link_preview.py; full unit suite 5685 passed, 80 skipped, 14 xfailed.

Left on #22

  • Part 2: true Overwrite (blocked on flexicon).
  • Part 3: GOLD identity resolution on Merge, and the planner not comparing CatalogSourceId, which Move writes.

Generated with Claude Code

Under ConflictMode.LINK Move writes nothing to an existing item, but the
category planners emit a GUID-matched merge overwrite whenever fields
differ. build_run_plan now converts that into an ALREADY_PRESENT_BY_GUID
skip whose detail says the differences are not applied.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MattGyverLee
MattGyverLee merged commit 30279fa into main Nov 2, 2026
1 check passed
@MattGyverLee
MattGyverLee deleted the fix-22-link-preview-agreement branch November 2, 2026 04:18
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.

1 participant