NEC-345: A tool's write meeting a remote change not yet written keeps a copy the Markdown hardness checker calls unexplained #322

Merged
nectenda-agent merged 4 commits from worktree-nec-345-a-tools-write-meeting-a-remote-change-no into main 2026-10-26 16:33:17 +00:00
Collaborator

Task: NEC-345 — https://projectron.nerchure.com/tasks/366

A note's pending write, meeting a file another tool had edited while the document had moved too, kept the file in .nectenda-backups before merging it whatever the merge would do. The copy is of the file and can only save a line the file held; when every line of the file and of the document survives the merge it holds nothing the note does not, and Obsidian's modify event for the same write already merged such a file with no copy, so the copy came down to a few-millisecond race (Markdown hardness seed 1209056253, round 82). SAFE-A30's exception now also covers a merge that only adds, decided by a dry run on the merged text (mergeMayLose) at both SAFE-A30 sites; a refused line merge or any lost line keeps the file as before. The copy's log line no longer says the note was not being synced. Tests seen failing first and the helper mutation-checked both ways; a fresh-context review found no bug; the seed replayed for 25 minutes passes round 82 and ends clean; gate-local green at fd86ced5.

Spec: docs/changes/NEC-345-copy-only-when-the-merge-may-lose/spec.md

Changelog

A note changed by another tool while a collaborator's edit was still waiting to be written no longer leaves a copy in .nectenda-backups when the merge keeps every line of both.

Task: NEC-345 — https://projectron.nerchure.com/tasks/366 A note's pending write, meeting a file another tool had edited while the document had moved too, kept the file in .nectenda-backups before merging it whatever the merge would do. The copy is of the file and can only save a line the file held; when every line of the file and of the document survives the merge it holds nothing the note does not, and Obsidian's modify event for the same write already merged such a file with no copy, so the copy came down to a few-millisecond race (Markdown hardness seed 1209056253, round 82). SAFE-A30's exception now also covers a merge that only adds, decided by a dry run on the merged text (mergeMayLose) at both SAFE-A30 sites; a refused line merge or any lost line keeps the file as before. The copy's log line no longer says the note was not being synced. Tests seen failing first and the helper mutation-checked both ways; a fresh-context review found no bug; the seed replayed for 25 minutes passes round 82 and ends clean; gate-local green at fd86ced5. Spec: `docs/changes/NEC-345-copy-only-when-the-merge-may-lose/spec.md` ## Changelog A note changed by another tool while a collaborator's edit was still waiting to be written no longer leaves a copy in .nectenda-backups when the merge keeps every line of both.
A note's write meeting a file edited since disk and document last
agreed, with the document moved too, kept the file in .nectenda-backups
before merging it, whatever the merge would do. The copy is of the file,
so it can only ever save a line the file held; when every line of the
file and of the document is in the merge, it holds nothing the note does
not. Obsidian's modify event for the same write already merged such a
file with no copy, so whether a tool's append met by a collaborator's
pending write got one depended on which reader read the file first
(Markdown hardness seed 1209056253, round 82).

SAFE-A30's exception now covers a merge that only adds, beside one that
would change nothing. `mergeMayLose` decides, on the merged text itself:
a refused line merge, or any non-blank line of either side with fewer
copies in the result, keeps the file as before. Both SAFE-A30 sites use
it. The copy's log line no longer says the note was not being synced.

Tests that used the copy's wait as their interleaving point on an
additive edit now replace a line instead, so the copy is still kept.

Task: NEC-345

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DFbZfZoTuR9iyNdJumKn1
The helper's comment and the spec said a line both sides changed always
counts as lost. Where its character merge equals the document's line,
the merge changes nothing and no copy is kept: the file's change is in
it already. The review's probe (base ab, file xab, document xaby) shows
it; the code was right and the sentences were not.

Task: NEC-345

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DFbZfZoTuR9iyNdJumKn1
Task: NEC-345

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DFbZfZoTuR9iyNdJumKn1
Say where NEC-345's log string was grepped
All checks were successful
Release note / release-note (pull_request) Successful in 22s
CI / build (pull_request) Successful in 7m8s
CI / e2e (pull_request) Successful in 14m50s
CI / promote (pull_request) Has been skipped
CI / build (push) Successful in 6m26s
CI / e2e (push) Successful in 15m45s
CI / promote (push) Successful in 1m13s
3f44bc9948
Task: NEC-345

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013DFbZfZoTuR9iyNdJumKn1
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!322
No description provided.