NEC-356: Kanban e2e: a card deleted under another vault's unsaved edit came back once #327

Merged
nectenda-agent merged 9 commits from worktree-nec-356-kanban-e2e-a-card-deleted-under-another into main 2026-10-28 19:34:57 +00:00
Collaborator

Task: NEC-356 — https://projectron.nerchure.com/tasks/377

NEC-356: the Kanban delete tests chose a card the board held twice (left by the SAFE-A39 race test, by design); deleting one copy left the other, and the test read the survivor as a card come back. CI run 1596 reconstructed byte for byte. Both delete tests now choose a card the board holds once. Catalogued as FLAKE-22.

Ride-alongs, each on the user's choice:

  • NEC-359 (sync path): Enter on a card's editor and another writer's change landing before Kanban put the edit in the board's data: the board looked clean, got no base, and its save deleted the other writer's card from both vaults with no copy. A view in which an edit began within 1 s before another writer's change now gets what it had loaded as the base of its next save, but only for a save that holds none of the change (holdsNoneOf), only for 5 s, and giving way to a later change's base unless the board holds an edit. Three review rounds shaped it; each finding is a unit test, mutation-checked. SAFE-A50 reworded; docs/sync-limitations.md lists what stays open (a same-card in-place edit on both sides, as on main).
  • NEC-360: pnpm --filter @nectenda/e2e clean ran pnpm 12's built-in clean and emptied every node_modules; docs now say run clean.
  • NEC-361: the SAFE-A39 e2e log checks now read only lines written since their own write, as the SAFE-A50 one does.

Local gate passed at b8463eb3 (e2e 269 passed, 2 skipped).

Spec: docs/changes/NEC-356-kanban-delete-test-duplicate-card/spec.md

Also fixes NEC-359: Kanban e2e: a card another writer added under an unsaved edit was missing from both vaults once
Also fixes NEC-360: e2e clean after a stopped gate removes the worktree's own node_modules
Also fixes NEC-361: Kanban e2e: the SAFE-A39 log checks can pass on an earlier test's line

Changelog

A Kanban card another plugin or tool adds or deletes just as you finish editing a card is no longer undone in every vault.

Task: NEC-356 — https://projectron.nerchure.com/tasks/377 NEC-356: the Kanban delete tests chose a card the board held twice (left by the SAFE-A39 race test, by design); deleting one copy left the other, and the test read the survivor as a card come back. CI run 1596 reconstructed byte for byte. Both delete tests now choose a card the board holds once. Catalogued as FLAKE-22. Ride-alongs, each on the user's choice: - NEC-359 (sync path): Enter on a card's editor and another writer's change landing before Kanban put the edit in the board's data: the board looked clean, got no base, and its save deleted the other writer's card from both vaults with no copy. A view in which an edit began within 1 s before another writer's change now gets what it had loaded as the base of its next save, but only for a save that holds none of the change (holdsNoneOf), only for 5 s, and giving way to a later change's base unless the board holds an edit. Three review rounds shaped it; each finding is a unit test, mutation-checked. SAFE-A50 reworded; docs/sync-limitations.md lists what stays open (a same-card in-place edit on both sides, as on main). - NEC-360: `pnpm --filter @nectenda/e2e clean` ran pnpm 12's built-in clean and emptied every node_modules; docs now say `run clean`. - NEC-361: the SAFE-A39 e2e log checks now read only lines written since their own write, as the SAFE-A50 one does. Local gate passed at b8463eb3 (e2e 269 passed, 2 skipped). Spec: `docs/changes/NEC-356-kanban-delete-test-duplicate-card/spec.md` Also fixes NEC-359: Kanban e2e: a card another writer added under an unsaved edit was missing from both vaults once Also fixes NEC-360: e2e clean after a stopped gate removes the worktree's own node_modules Also fixes NEC-361: Kanban e2e: the SAFE-A39 log checks can pass on an earlier test's line ## Changelog A Kanban card another plugin or tool adds or deletes just as you finish editing a card is no longer undone in every vault.
"keeps a card another writer deletes from a board with an edit not saved
yet deleted" failed "Epsilon from A stays deleted" on main (CI run 1596)
and in a local gate. Every byte count in run 1596's log fits a board that
began the test with Epsilon twice: the SAFE-A39 race test earlier in the
file may leave a card twice, by design, and the test chose one of the
twins. The other writer removed one copy, the merge rightly kept the
other, and the assertion read the survivor as a card come back.

Both delete tests now choose a card the board holds once, and fail on
that precondition if there is none. Seeded with a twin, the old choice
failed 6 runs of 6 and the new one passed.

Task: NEC-356
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
B pressed Enter on a card's editor, and another writer's change, adding a
card, landed 32 ms later: before Kanban had put the committed edit in the
board's data. The guard found the board holding nothing unsaved, so gave
it no base (SAFE-A50), and Obsidian loaded the change. Kanban then saved
the edit on the board it showed before; read in against the change, the
save deleted the added card from both vaults, with no copy anywhere. Seen
once in eleven container runs while mutation-checking NEC-356, then made
certain with Enter and the change in one page task.

The guard now remembers when an edit last may have begun in each view,
from the probe SAFE-A39 already listens to. A view in which one began
within RELOAD_RACE_MS before another writer's change is given what it had
loaded as the base of its next save, holding an edit or not. Had the board
taken the change after all, the change is on both sides of the merge and
counts once. The cost is a card the user puts back just after such a
change: the merge leaves it out, and the save holding it is kept in
.nectenda-backups first, with the notice.

The e2e helper's log check now reads only lines written since its own
change, and waits for them: read at once, it passed on a line an earlier
test left, so it could not have seen this.

Unit tests fail 3 of 4 new ones without the change, and "...even with a
card's editor open" fails when every view is given a base. In the
container, the two new e2e tests fail with the old rule, and all 15 Kanban
tests pass with the new one.

Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
Found in review: the base the previous commit gives a board in which an
edit began just before another writer's change never lapsed. A press that
committed nothing earned one, no save followed to spend it, and a minute
later an unrelated save was read against the board from before the change:
a line a collaborator had put back meanwhile left every vault with no copy.
On main the same sequence lost nothing.

Such a base now lapses unless the board's save is read in within
EDITED_JUST_BEFORE_BASE_MS (5 s) of the change; the save of an edit
committed then comes a tenth of a second on, when the write after the
read-in asks. The review's sequence is a unit test: a base that never
lapses fails it, and one that lapses at once fails the three tests of the
fix. A key outside the board now has a test that it earns the board
nothing, failing when every view is marked. The e2e mode that presses Enter
and writes the change in one task now asserts the guard found the board
clean at the change, so its pass cannot rest on the edit landing first;
three container runs passed all 15 Kanban tests.

Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
Second review: the lapse in the previous commit shortened how long the
base lived but not what it was applied to. Within the five seconds, a save
built on the change was still read against the board from before it, and a
line a collaborator had put back meanwhile left every vault with no copy;
main kept it. A second change within the window also kept the first's base,
so an edit committed just before the second was read against the wrong
board.

The base exists for one save: Kanban's edit committed just after the
change, on the board it showed before, which holds none of the change. It
is now used only for a save that holds no line the change added beyond what
the board had loaded and every line it removed (holdsNoneOf). A save holding
any of the change was built on it and is read in as before. A later change's
base replaces one earned this way; one earned by a held edit stands.

Both review sequences are unit tests. Ignoring what the save holds fails
the two-seconds one; letting no save qualify fails the four tests of the
fix; keeping the earlier base fails the two-changes one.

Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
Third review: the previous commit gave a later change's base precedence
over one earned by an edit just before an earlier change, even when the
board by then held the edit Kanban had committed on the board from before
that earlier change. Its save was read against the board after the first
change and took the first writer's card from every vault with no copy. The
later base now replaces the earlier one only while the board holds nothing
unsaved. A unit test of the review's sequence fails without it.

Also documented as open, as on main: an edit committed just after the
change to the very card the change edited in place makes a save that
looks built on the change, so it gets no base, and the other writer's
wording is lost. Every rule by line counts found trades that case for one
losing a collaborator's put-back line instead.

Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
The full local gate failed two Kanban tests, both on the tests rather than
the sync path:

- "keeps a card another writer deletes as an edit is committed on the
  board deleted" asserted the guard found the board clean at the change.
  Under the whole suite's load Kanban had the edit in its data first; the
  guard took the held-edit path, which gave the save a base and kept the
  card deleted, so only that assertion failed. Enter and a change in one
  page task cannot force their order. The test now says which way the race
  went and asserts the outcome; the unit tests drive each way on purpose.
- The SAFE-A39 test after it had its click on a card's editor refused
  (NEC-301): our own notice for the kept save lay over the board. The
  helper now clears notices when it finishes, as the suite does elsewhere.

Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
Task: NEC-356
Also-fixes: NEC-359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
The two SAFE-A39 race tests checked B's diagnostic log with toContain over
the whole log, read once. The log is written in batches, so a read made at
once can miss the test's own line, and the check could pass on the same
line an earlier test left: the gap NEC-359 found in the SAFE-A50 check of
the same file. All three now go through one helper that waits for the line
among those written since the test's own write or change.

Task: NEC-356
Also-fixes: NEC-361
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
Say run clean for the e2e cleanup: bare clean is pnpm's, and empties node_modules
All checks were successful
Release note / release-note (pull_request) Successful in 20s
CI / build (pull_request) Successful in 5m57s
CI / e2e (pull_request) Successful in 15m3s
CI / promote (pull_request) Has been skipped
CI / build (push) Successful in 6m5s
CI / e2e (push) Successful in 14m54s
CI / promote (push) Successful in 33s
b8463eb3db
pnpm 12 has a built-in `pnpm clean` that deletes node_modules, and under
--filter it takes precedence over the e2e package's own clean script, though
`pnpm help clean` says a script overrides it. `pnpm --filter @nectenda/e2e
clean`, as CLAUDE.md and the e2e README gave it, removed every node_modules
in the workspace; found twice while stopping a gate, then reproduced on an
idle tree. The unit suites then failed to start, which reads as a broken
change. Both now give `run clean`, which runs clean.sh and leaves the
workspace alone, and say why. No script used the bare form.

Task: NEC-356
Also-fixes: NEC-360
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EV8ztax2AT1UHmdw8cJkEZ
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!327
No description provided.