NEC-373: An Excalidraw hardness round failed with a just-inserted image's place repaired again and again (seed 779315737, not reproduced) #338

Merged
nectenda-agent merged 3 commits from worktree-nec-373-an-excalidraw-hardness-round-failed-with into main 2026-11-04 10:45:15 +00:00
Collaborator

Task: NEC-373 — https://projectron.nerchure.com/tasks/395

Two shapes added at once, one per vault, can take one fractional index. The drawing's file broke that tie by each shape's position in the file it came from, but Excalidraw breaks it by id. So a vault working through its file and a vault drawing live each re-placed a different shape, onto the same new index, and each repair was a version the other drew and repaired again. This failed the Excalidraw hardness run (seed 779315737). Proven before the fix: a unit test of the writer's order; the excalidraw-tie probe against real Excalidraw 2.29.0 and 2.27.3; and a two-vault e2e test with live sync off in one vault, which saw 31 repairs in 20 s. The file now writes a tie by id (SAFE-A53); elements with no index keep their file order. The same e2e test now sees at most one repair, and both files then hold the two shapes at two places, on one version each. A repair's log line now names its place before and after. Local gate passed; Excalidraw hardness run green for 90 min (seed 779315737 for 60 min, 331 rounds; seed 528014309 for 30 min, 167 rounds). Tested by the user in their vaults before this PR.

Spec: docs/changes/NEC-373-excalidraw-tie-order/spec.md

Changelog

Fixed a drawing open in two vaults repeatedly re-ordering a shape added in both at once, when one of them was not syncing the drawing live.

Task: NEC-373 — https://projectron.nerchure.com/tasks/395 Two shapes added at once, one per vault, can take one fractional index. The drawing's file broke that tie by each shape's position in the file it came from, but Excalidraw breaks it by id. So a vault working through its file and a vault drawing live each re-placed a different shape, onto the same new index, and each repair was a version the other drew and repaired again. This failed the Excalidraw hardness run (seed 779315737). Proven before the fix: a unit test of the writer's order; the excalidraw-tie probe against real Excalidraw 2.29.0 and 2.27.3; and a two-vault e2e test with live sync off in one vault, which saw 31 repairs in 20 s. The file now writes a tie by id (SAFE-A53); elements with no index keep their file order. The same e2e test now sees at most one repair, and both files then hold the two shapes at two places, on one version each. A repair's log line now names its place before and after. Local gate passed; Excalidraw hardness run green for 90 min (seed 779315737 for 60 min, 331 rounds; seed 528014309 for 30 min, 167 rounds). Tested by the user in their vaults before this PR. Spec: `docs/changes/NEC-373-excalidraw-tie-order/spec.md` ## Changelog Fixed a drawing open in two vaults repeatedly re-ordering a shape added in both at once, when one of them was not syncing the drawing live.
Two shapes with one index, the id-later first in the file: loading the
file re-places the later in the array, and reconcileElements the later
by id, on 2.29.0 and 2.27.3 alike, both onto one new index. Measured to
prove NEC-373's cause before fixing it.

Task: NEC-373

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztb9E6TaiDF8xQPbUjv
Two shapes added at once, one per vault, can take one fractional index.
The document writer broke that tie by where each had sat in its file;
Excalidraw breaks it by id. A vault working through its file reloaded it
and re-placed the later in the array, a vault bound live re-placed the
later by id in reconcile, both onto one new index, and each repair was a
version the other drew and repaired against: the Excalidraw hardness
run's seed 779315737, and 31 repairs in 20 s in the e2e reproduction with
live sync off in one vault. Ties now go by id (SAFE-A53); elements with no
index keep their file order. A repair's log line names its place before
and after.

Task: NEC-373

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztb9E6TaiDF8xQPbUjv
Check the tie is undone the same way in both vaults, and say only what was seen
All checks were successful
Release note / release-note (pull_request) Successful in 15s
CI / build (pull_request) Successful in 5m54s
CI / e2e (pull_request) Successful in 15m21s
CI / promote (pull_request) Has been skipped
CI / build (push) Successful in 6m9s
CI / e2e (push) Successful in 15m27s
CI / promote (push) Successful in 33s
726bc8687b
Review of NEC-373: the e2e test checked only that the repairs stop, so a
run that drew nothing would pass. It now also waits for both files to hold
the two shapes at two places, on one version each. The docs claimed the
reproduction never stopped, and that the probe measured a reload; both
now say what was observed.

Task: NEC-373

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztb9E6TaiDF8xQPbUjv
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda!338
No description provided.