Skip to content

Replace _possible_duplicate with a generic conflict journal (ADR-068) - #2534

Merged
malibio merged 4 commits into
mainfrom
issue-2377-conflict-journal
Sep 9, 2026
Merged

malibio merged 4 commits into
mainfrom
issue-2377-conflict-journal

Conversation

@malibio

@malibio malibio commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements ADR-068 (the issue's cited "ADR-066" is a stale reference — the live decision doc is nodespace-docs/decisions/068-convergence-conflicts-are-records-not-flags.md), all four delivery slices:

  • S1 — Local-only conflict + conflict_participant journal, UniqueFieldCollision/CollectionNameCollision detection wired into create_node/update_node post-commit, and full deletion of _possible_duplicate, POSSIBLE_DUPLICATE_FIELD, mark_possible_duplicates, is_possible_duplicate, and the frontend badge/util.
  • S2 — Conflicts view (new singleton nav tab), gRPC (ListConflicts/ConflictsForNode/ResolveConflict) + Tauri wiring, inline per-node conflict indicator, Recovered Items fully folded in (old badge/store/daemon commands deleted).
  • S3 — merge_nodes: property union (survivor wins ties, loser's overwritten values snapshotted), edge re-pointing (collision-drop, self-edge-drop, order preserved), loser archived — all in one ADR-069 transaction. User-initiated only.
  • S4 — Reconciliation sweep (15-minute backstop per database) that closes conflict records whose participants are gone or no longer collide.

Deviation from the ADR's literal text, confirmed with the user during planning: merge's loser tombstone uses the existing lifecycle_status = 'archived' rather than a new deleted value. Investigation showed ADR-042's "tombstone" is a cloud/sync-layer concept (is_deleted/deleted_at in Postgres), not a local lifecycle_status value — this codebase only has ["active", "archived"], enforced by validate_lifecycle_status, with an existing test asserting "deleted" stays rejected. Reusing archived avoids inventing a fourth concept; it already fully excludes a node from every active-scoped detection query and destroys nothing.

Bugs found and fixed via adversarial testing

  • Merge property union compared only top-level property keys on the first draft, so it never reached properties.<node_type>.<field> — the actual storage shape. Fixed to union one level into the shared type namespace.
  • Reconciliation sweep re-checked a UniqueFieldCollision from an arbitrary participant's exclusion perspective (node_ids.first(), sorted lexically) — whichever id won the sort determined whether the predicate excluded the participant who moved away or the one who didn't, producing a ~50%-of-the-time false "still colliding" result. Fixed to check each participant's own current value.

Test plan

  • bun run rust:test:core — 1284 lib tests + 24 integration test binaries, all passing (includes new merge_nodes_test.rs, conflict_reconciliation_test.rs, rewritten person_duplicate_convergence_test.rs/collection_name_convergence_test.rs/collection_membership_test.rs)
  • cargo test -p nodespace-daemon --lib — 188 passing (includes new conflict-journal gRPC round-trip test)
  • bun run test — 237 frontend test files, 4897 tests passing
  • bun run test:all — full suite (coverage, scripts, skill, Rust workspace) exits clean
  • bun run quality:fix — svelte-check/tsc/eslint/clippy (-D warnings) all clean
  • grep -rn _possible_duplicate packages/core/src packages/core/tests — empty (S1's literal acceptance criterion)
  • Manual smoke test in the running desktop app (not yet done in this session)

🤖 Generated with Claude Code

malibio and others added 3 commits September 9, 2026 10:59
Replaces the `_possible_duplicate` boolean property — unreachable on a
local-only install, unable to name the counterparty, and impossible to
clear — with a local-only `conflict` + `conflict_participant` journal.

S1 (headless core):
- New v005 migration, `ConflictKind`/`ConflictStatus`/`ConflictRecord`/
  `Resolution` model types, deterministic UUIDv5 conflict ids.
- `SqliteStore`/`NodeService` conflict-journal methods (record/list/
  resolve/conflicts_for_node).
- `UniqueFieldCollision` detection wired into `create_node`/`update_node`
  post-commit (the real caller `mark_possible_duplicates` never had);
  `CollectionNameCollision` detection rewritten onto the same journal.
- Deleted `_possible_duplicate`, `POSSIBLE_DUPLICATE_FIELD`,
  `mark_possible_duplicates`, `is_possible_duplicate`, and the frontend
  badge/util, with convergence tests rewritten against the journal.

S2 (Conflicts surface + Recovered Items fold-in):
- New gRPC RPCs (ListConflicts/ConflictsForNode/ResolveConflict) and
  Tauri commands.
- New `conflicts.svelte.ts` store (ADR-049 pattern), Conflicts view wired
  into navigation as a singleton tab, inline per-node conflict indicator
  replacing both the old badges.
- Recovered Items fully folded in: daemon JSONL commands, frontend store,
  and badge deleted; its `SupersededEdit` kind is defined and ready for
  the daemon-side write path (nodespaced-pro is out of this repo).

Deviation from ADR-068's literal text, confirmed with the user: merge's
future loser-tombstone will use the existing `lifecycle_status =
'archived'` rather than inventing a new `deleted` value — ADR-042's
tombstone turns out to be a cloud-sync concept, not a local lifecycle
state, so `archived` is the correct non-destructive local analog.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PK4q7pM7umReyBTt1w6tzN
The highest-risk slice, landed last per the ADR: SqliteStore::merge_nodes_in_tx
runs entirely inside one ADR-069 unit-of-work transaction —

- Property union onto the survivor, one level into the shared node_type
  namespace object (properties.<type>.<field>) where the real per-field
  data lives; survivor wins ties, loser's overwritten values captured for
  the eventual Resolution::Merge.superseded snapshot.
- Every relationship edge touching the loser re-pointed to the survivor
  via a plain endpoint UPDATE (order and other edge properties travel for
  free — no delete/reinsert). A re-point that would collide with an
  existing survivor edge on (in_node, out_node, relationship_type) is
  dropped, not an error; a self-edge produced by re-pointing both
  endpoints to the survivor is dropped too.
- Loser archived (lifecycle_status = 'archived'), not hard-deleted and not
  delete_subtree_atomic (which would cascade over has_child descendants
  the re-point step already moved). Confirms the earlier archived-not-
  deleted decision at the mechanism that actually needed it.
- Optional conflict_id closes the record as resolved with a
  Resolution::Merge in the same transaction via resolve_conflict_in_tx.

NodeService::merge_nodes composes these through with_transaction; gRPC
(MergeNodes RPC), Tauri command, and the Conflicts view's per-record
"Keep X" merge action wire it end to end. User-initiated only — nothing
calls this automatically at any confidence level.

Found and fixed a real bug via the new integration tests: the first
property-union draft compared only top-level property keys, so it never
saw properties.<type>.<field>) is the actual storage shape.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PK4q7pM7umReyBTt1w6tzN
A low-frequency (15-minute) background pass per database, spawned
alongside the embedding processor in build_database_services and stopped
by DatabaseServices::shutdown, that closes open conflict records whose
participants are gone or no longer collide:

- A hard-deleted participant closes the record unconditionally.
- UniqueFieldCollision/CollectionNameCollision records are re-checked
  against the participants' CURRENT live values via the same predicates
  detection uses (find_conflicting_unique, get_collection_by_name).
- New Resolution::SelfResolved{reason} distinguishes an auto-closed
  record from a human's Dismiss — the sweep is the backstop for the
  accepted TOCTOU gap in the pre-write-check/post-write-mark pattern,
  not a substitute for it.
- list_conflicts(Open) already excludes dismissed/resolved records, so
  the sweep never reopens a human's decision.

Found and fixed a real bug via an adversarial test that runs the same
scenario in a loop: the first draft re-checked a UniqueFieldCollision
from an ARBITRARY participant's exclusion perspective (node_ids.first(),
sorted lexically). Whichever id won the sort determined whether the
predicate excluded the participant who moved away or the one who didn't
— excluding the wrong one still finds the OTHER, unrelated, still-correct
participant and reports a false continuing collision. Fixed by checking
each participant's own CURRENT value against a still-live predicate hit,
not an arbitrary stand-in using the stale detected-at-time value.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PK4q7pM7umReyBTt1w6tzN
@malibio

malibio commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review — PR #2534

Review Type: Initial Review (full diff, origin/main...HEAD, 59 files, +3609/-2307)

Summary

This is a well-executed, well-tested replacement of the _possible_duplicate boolean hack with a proper conflict journal. The core design — deterministic symmetric ids, upsert-by-derived-id with a WHERE status = 'open' guard, post-commit best-effort detection, a single ADR-069 transaction for merge — is sound and consistently applied. The commit-by-commit narrative (S1 detection → S2 UI → S3 merge → S4 sweep) is atomic and each slice is independently well-tested, including a genuine regression test for the "arbitrary participant" sweep bug the author found and fixed. The delete-not-deprecate mandate is honored: _possible_duplicate, POSSIBLE_DUPLICATE_FIELD, mark_possible_duplicates, is_possible_duplicate, possible-duplicate.ts, possible-duplicate-badge.svelte, recovered_items.rs, recovered-items.svelte.ts, and recovered-items-badge.svelte are all gone from live code (verified by grep — every surviving match is a historical doc-comment reference).

This is a net positive and I'd lean toward approval, but S2's acceptance criteria promise three resolution actions (adopt existing, rename, restore) that are modeled end-to-end in the backend/store but never reach the UI — only Dismiss and Merge have buttons. That's a real, scoped gap worth calling out explicitly rather than letting it quietly ride on "S2 is done."


Requirements Check

S1 — Journal, detection, deletion of the flag

  • conflict + conflict_participant tables, no FK to node on the participant side (v005_conflict_journal.rs)
  • ConflictKind (4 variants) / ConflictStatus (3 variants) as specified
  • Deterministic uuidv5 ids, sorted participants (deterministic_conflict_id)
  • record_conflict upsert-by-derived-id, WHERE conflict.status = 'open' guard prevents reopening resolved/dismissed
  • list_conflicts, conflicts_for_node, resolve_conflict on NodeService
  • mark_possible_duplicates → detect_unique_field_collisions, wired into real callers (create_node, update_node)
  • mark_collection_name_collision rewritten onto the journal as its own ConflictKind
  • find_conflicting_unique scoped to lifecycle_status = 'active' (verified: nodes.rs SQL includes AND lifecycle_status = 'active')
  • Detection is post-commit, best-effort, error-swallowed at every site (crud.rs create/update, nodes.rs collection collision)
  • All five legacy artifacts deleted — verified via grep -rn "_possible_duplicate\|possible_duplicate\|POSSIBLE_DUPLICATE" and grep -rn "recovered_item\|recovered-item\|RecoveredItem": zero live-code hits, only doc-comment history references remain
  • Acceptance scenarios covered by person_duplicate_convergence_test.rs and collection_name_convergence_test.rs (occurrences bump, dismiss-then-redetect stays dismissed, schema-only extension type gets detection for free by construction)

S2 — Conflicts surface; fold in Recovered Items

  • Conflicts view groups by kind, participants are navigable (openParticipant), evidence rendered from record.detail (never re-derived), occurrences shown when >1, resolved/dismissed behind showResolved toggle
  • Dismiss is wired and persisted
  • Adopt existing, rename, restore are not wired in the UI. Resolution (Rust) and the TS Resolution union both model AdoptExisting, Rename, Restore; conflictsStore.adoptExisting() exists — but conflicts-pane.svelte only renders Dismiss and two "Keep X" (merge) buttons. There is no path in this PR for a user to actually invoke adopt-existing or rename from the Conflicts view, despite both underlying conflict kinds (UniqueFieldCollision, CollectionNameCollision) being fully detected.
  • Recovered Items folded in: commands/recovered_items.rs, recovered-items.svelte.ts, recovered-items-badge.svelte deleted; SupersededEdit reserved with no writer (correctly deferred — the daemon-side writer lives in nodespaced-pro, out of this repo per the issue)
  • One store on the canonical rune pattern (conflicts.svelte.ts: $state fields, one $derived memoized lookup, no $effect)
  • Inline indicator (conflict-indicator-badge.svelte) is a derived read of conflictsStore, links into the Conflicts view, does not resolve in a popover
  • conflict-notifications.svelte.ts left alone (only the discriminated union's member renamed recovered-items → conflict-journal, which is the correct/necessary touch, not scope creep)

S3 — Merge

  • One transaction via the ADR-069 with_transaction/NodeServiceTx seam — consistent with create_node_in_tx/update_node_in_tx/bulk_create_hierarchy_in_tx
  • Property union onto survivor, namespaced one level into properties.<node_type>, survivor wins ties, superseded values snapshotted into resolution.superseded
  • Every relationship row re-pointed generically (WHERE in_node = ?1 OR out_node = ?1, not just has_child) — properties (incl. order) travels via endpoint UPDATE, not delete+reinsert
  • Collision-on-repoint dropped and counted, not erred; self-edge from double-repoint dropped
  • Loser archived (lifecycle_status = 'archived'), not delete_subtree_atomic — deviation from ADR-068's literal "deleted" tombstone, pre-approved (see Deviation Sanity Check below)
  • Conflict record closed as resolved with Resolution::Merge in the same transaction when conflict_id given
  • User-initiated only — NodeService::merge_nodes has no internal caller; the Tauri command and gRPC RPC are the only paths in, and the UI gates it behind an explicit confirm dialog

S4 — Reconciliation sweep

  • 15-minute tokio::select! loop, modeled on cron_runner_loop, shutdown-aware via watch::Receiver<bool>, spawned per-database in build_database_services, stopped in DatabaseServices::shutdown
  • Closes records whose participant is hard-deleted (unconditional) or whose kind-specific predicate no longer finds a collision
  • list_conflicts(Open) excludes dismissed/resolved, so the sweep structurally cannot reopen a human decision
  • The "arbitrary participant" bug fix is real and specifically regression-tested: unique_field_collision_still_holds iterates every participant's own current value against find_conflicting_unique, rather than checking from one arbitrarily-chosen participant's exclusion perspective — sweep_result_does_not_depend_on_which_participant_id_sorts_first runs the scenario 8 times to catch a regression regardless of UUID sort order

Out of scope, verified not accidentally implemented: No DuplicateReactiveCreate detection (reserved, still_holds always returns true for it). No write rejected anywhere in the detection paths — every call site is best-effort/post-commit. No journal sync path added. No schema mechanism added for hiding fields from table views (the conflict table is plain SQL, not schema-driven — see the ADR-063 namespace check below).

Cannot verify from this repo (correctly out of scope): mark_possible_duplicate in nodespace-sync's pulled-write apply path, the apply hook reaching NodeService post-commit, and record_recovered_item in nodespaced-pro — none of these files exist in this checkout.

Documentation-hygiene note (not a functional finding): the issue references ADR-066; every commit message and in-code doc comment references ADR-068. This is presumably a renumbering and not something this review can resolve without access to nodespace-docs/decisions/, but it's worth a one-line callout in the PR description or a follow-up doc fix so a future reader isn't left searching for a nonexistent ADR-066.


Deviation Sanity Check (archived vs. literal "deleted" tombstone)

Per the pre-approved deviation, I checked whether archived genuinely behaves like a tombstone would need to:

  • find_conflicting_unique's WHERE ... AND lifecycle_status = 'active' (confirmed in nodes.rs) means an archived merge-loser cannot re-trigger a UniqueFieldCollision — correct exclusion.
  • get_collection_by_name (referenced throughout collection_name_convergence_test.rs, e.g. the "archived collection frees up its name" tests) is likewise active-only scoped, so an archived loser can't re-collide on CollectionNameCollision either.
  • The reconciliation sweep's hard-delete check (get_node(id).is_none()) does NOT fire for an archived node (it still exists), which is correct — archived-via-merge is intentionally distinct from hard-deleted-via-real-delete, and the sweep's per-kind predicate re-check (which already excludes non-active rows) is what actually retires any residual open record naming the archived loser.
  • Nothing in S2's UI treats archived specially as a display filter distinct from a "normal" archive, so a merge-archived node is indistinguishable in general list views from a user who explicitly archived something. This is a minor UX ambiguity (a merged-away node just vanishes from active views the same way an intentional archive would) but is consistent with the stated design ("fully reversible, nothing destroyed") and not a functional defect — flagging as a Suggestion below, not a Critical.

This reasoning holds. Not flagging the deviation itself as unexplained, per instructions.


Code Review Findings

🟡 Important

  1. S2 acceptance criteria for "adopt existing" and "rename" resolutions are modeled but not reachable from the UI.
    packages/desktop-app/src/lib/components/conflicts/conflicts-pane.svelte (full file, ~L4390-4446): the conflict-actions block only renders "Keep X" (merge) buttons and "Dismiss". Resolution::AdoptExisting and Resolution::Rename are fully defined server-side (packages/core/src/models/conflict.rs L131-142) and client-side (conflicts.svelte.ts adoptExisting()), and both cover conflict kinds that S1 already detects (UniqueFieldCollision, CollectionNameCollision) — this isn't blocked on an undelivered dependency the way Restore/SupersededEdit legitimately is. A user hitting a real CollectionNameCollision today has exactly two options in the UI: dismiss it or merge the two collections (destructive-ish, archives one side) — there's no lightweight "just rename mine" action despite the model supporting it. Recommend either wiring a minimal rename/adopt-existing action before merge, or explicitly re-scoping S2's acceptance criteria in the issue to note these ship in a follow-up, so the gap is a tracked decision rather than a silent shortfall.

  2. detect_unique_field_collisions runs unconditionally on every update_node call, including updates that touch neither properties nor a unique field.
    packages/core/src/services/node_service/crud.rs (~L1256, mirrored at the create_node call site ~L166): every successful update_node — even a NodeUpdate::new().with_content(...)-only rename with no properties touched — pays a get_node + get_schema_node round-trip inside detect_unique_field_collisions before checking whether any unique field is even present. On a hot path (e.g. bulk imports, frequent title edits) this is a guaranteed 2x read amplification per write for node types with no unique fields at all, and a 3rd read (find_conflicting_unique) for those that do. This is consistent with "detection is unconditional, best-effort" from the design, so it's not a correctness bug, but it's worth a cheap short-circuit: skip the call entirely when update.properties is None (nothing that could introduce a new unique-field value changed), which would eliminate the cost for the very common content-only-edit case without touching the create path or losing any detection coverage. (Note: mark_user_modified's pre-check right above already does a get_node conditionally on touches_content — a similar short-circuit here is a small, consistent change.)

🟢 Suggestions

  1. Merge-archived nodes are visually indistinguishable from intentionally-archived nodes.
    Nothing in the Conflicts view or elsewhere tags a lifecycle_status = 'archived' node with why it was archived. Once merged, the loser simply disappears from active views the same way any manual archive would, and there's no resolution.superseded-linked breadcrumb visible from the node itself (only from the now-resolved conflict record, which the user has to remember to go find in the Conflicts view's "show resolved" filter). Consider a properties._merged_into bookkeeping field or similar so a user who stumbles on an archived node later understands why, without correlating it back to a conflict record. Low priority — nothing is lost, it's a discoverability nit.

  2. pro-sync.svelte.ts doc comments are now stale.
    packages/desktop-app/src/lib/stores/pro-sync.svelte.ts (~L233-243): two doc comments still describe "the recovered-items log is per-user... keys off this axis-1 flag" and "e.g. loading the recovered-items log" as the motivating example for onProConfirmed. The mechanism (onProConfirmed) still exists and is presumably still useful for a future Pro-gated one-shot, but its cited example is now a deleted feature. Nit: update the comment to a still-live example or make it generic, so a future reader doesn't go looking for a recoveredItems store that no longer exists.

  3. bun.lock's unrelated configVersion removal.
    The one-line bun.lock diff (-"configVersion": 0,) is unrelated to the conflict journal and looks like an incidental bun install side effect from a different Bun version than whatever generated the original lockfile. Harmless, but worth a mention since CLAUDE.md calls for atomic, single-purpose changes — if this becomes a recurring diff noise pattern across PRs it's worth pinning the Bun version in CI/dev docs rather than letting it drift file-by-file.

  4. Inline conflict-indicator badge issues one conflicts_for_node IPC round-trip per rendered node.
    packages/desktop-app/src/lib/design/components/base-node.svelte mounts ConflictIndicatorBadge per node, which calls conflictsStore.loadForNode(nodeId) onMount (conflict-indicator-badge.svelte L28-31). On a view rendering many nodes (e.g. a long document or a large table), this is N gRPC round-trips just to answer "does any of these have an open conflict." This mirrors the pre-existing PossibleDuplicateBadge/RecoveredItemsBadge pattern being replaced (so it's not a regression this PR introduces), but since conflicts are now a first-class, generically-applicable concept across every node type (not just person), the potential fan-out is larger than before. Worth a follow-up to batch this — e.g. a single conflicts_for_node_batch(node_ids) call the viewer issues once for its visible set, or relying on conflictsStore.load() already having been called (from app-shell startup) and just reading hasOpenFor locally without a per-node network call at all, since hasOpenFor is already a derived in-memory lookup once records is populated.

Nits

  • Nit: packages/core/src/db/migrations/v005_conflict_journal.rs splits CONFLICT_JOURNAL_SQL on ; and executes each statement separately — fine for this fixed, developer-controlled string, but if a future migration ever needs a ; inside a string literal or trigger body this naive split will silently corrupt it. Not a problem today; just don't copy this pattern for anything more complex than flat CREATE TABLE/CREATE INDEX statements.
  • Nit: ConflictRecord.detail/resolution round-trip as JSON-encoded strings over the wire (node_service.proto ConflictRecord.detail, .resolution) rather than google.protobuf.Struct or similar — consistent with how NodeData.properties is already encoded elsewhere in this proto, so it's the right call for consistency even though it means every consumer (gRPC → Tauri → frontend) does its own serde_json::from_str/JSON.parse layer. No action needed, just noting the precedent was followed correctly.
  • Nit: conflicts-pane.svelte's window.confirm(...) for the merge action is a blocking browser-native dialog inside a Tauri webview — functionally fine, but inconsistent with the rest of the design system's modal components used elsewhere in this app. Cosmetic only.

Recommendation

APPROVE with the two Important items (#1 UI action gap, #2 update_node short-circuit) recommended as fast follow-ups rather than blockers — neither is a correctness or security regression, and the S1/S3/S4 core (the highest-risk, most load-bearing part of this change) is thoroughly and convincingly tested, including a genuine adversarial regression test for the sweep bug the author found during development. The architecture is consistent with existing patterns (ADR-069 transaction seam, cron_runner_loop shape for the sweep, the schema-field deletion done correctly rather than deprecated), and the delete-not-deprecate mandate was fully honored end to end.

If the team wants S2 to be considered fully complete against its literal acceptance criteria before merge, item #1 (wire adopt_existing/rename into the Conflicts view, or explicitly descope them to a follow-up issue) would be the one item I'd actually ask to resolve first.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

Two Important items flagged as recommended fast-follows (not blockers): S2's adopt_existing/rename resolution actions are modeled end-to-end but not wired into the Conflicts view UI, and detect_unique_field_collisions runs unconditionally on every update_node call even when no properties changed. Everything else — S1 detection, S3 merge (highest-risk slice), and S4's reconciliation sweep including its adversarial regression test — is thorough and correct.

…pdates

Addresses the two Important findings from PR #2534's pragmatic code
review:

- Conflicts view: adopt-existing and rename are now reachable, not just
  modeled server/store-side. Adopt-existing records which participant is
  "real" (non-destructive). Rename fetches the current node, updates its
  content, then records the resolution — an ordinary write, not a special
  backend path. Both are scoped to UniqueFieldCollision/
  CollectionNameCollision, the kinds S1 already detects.
- update_node skips the post-commit unique-field-collision re-check when
  an update touches NEITHER content nor properties (a title- or
  lifecycle_status-only change) — unique field values live under
  properties, so such an update cannot introduce or need to re-detect a
  collision. Gating on `touches_content` (not `properties.is_some()`
  alone, which a first draft tried and which broke a real re-detection
  path — a content-only rename must still re-run detection to bump
  occurrences/last_seen_at on an already-open record, caught by the
  existing `redetecting_the_same_collision_bumps_occurrences_not_a_new_record`
  test failing).

Also fixed two stale doc-comment references to the deleted
recovered-items log in pro-sync.svelte.ts (repointed to onProConfirmed's
still-live caller, collaboration-view.svelte).

Skipped as follow-ups, not blockers (per reviewer's own framing):
- Merge-archived nodes are visually indistinguishable from a manual
  archive (no bookkeeping breadcrumb on the node itself) — low-priority
  discoverability nit, nothing is lost.
- The inline per-node conflict indicator issues one conflicts_for_node
  IPC call per rendered node — pre-existing pattern from the badges it
  replaces, not a regression this PR introduces; batching is a separate
  follow-up.
- bun.lock's incidental configVersion diff — unrelated tooling noise.

New test: title_only_update_does_not_bump_occurrences locks in the safe
short-circuit boundary so a future change can't silently widen it back
to the broken properties-only gate.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PK4q7pM7umReyBTt1w6tzN
@malibio

malibio commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Address-Review Summary

Addressed (2/2 Important findings):

  1. S2 adopt-existing/rename wired into the UI — both actions were modeled server/store-side but unreachable. Added conflictsStore.rename(), and wired both adoptExisting/rename buttons into conflicts-pane.svelte for UniqueFieldCollision/CollectionNameCollision records. New store tests cover the rename happy path and the "node no longer exists" failure path.

  2. detect_unique_field_collisions short-circuit on inert updates — update_node now skips the post-commit re-check when an update touches neither content nor properties (a title- or lifecycle_status-only change). Note: my first attempt gated on properties.is_some() alone, which broke redetecting_the_same_collision_bumps_occurrences_not_a_new_record — a content-only update must still re-run detection to bump occurrences on an already-open record. Fixed to gate on the existing touches_content (content OR properties), and added title_only_update_does_not_bump_occurrences to lock in the actual safe boundary.

Skipped as follow-ups (per reviewer's own framing, not blockers):

  • Merge-archived nodes lack a visible "why archived" breadcrumb — low-priority discoverability nit, nothing is lost or hidden (the info lives in the resolved conflict record).
  • Per-node conflict indicator's N+1 IPC pattern — pre-existing from the badges it replaces, not a regression; batching is separable follow-up work.
  • bun.lock's incidental configVersion diff — unrelated Bun-version tooling noise.

Verification: bun run rust:test:core (1284 lib + 24 integration binaries), cargo test -p nodespace-daemon --lib (188), bun run test (237 files / 4899 tests), bun run quality:fix — all clean after these changes.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: Both addressed items are additive/corrective within the existing design (new UI actions using already-reviewed store/backend methods; a narrowed perf gate with a regression test proving the boundary). No new architectural surface, no changed data model, no new risk in S1/S3/S4 (the highest-risk, already-approved core). The PR was already APPROVE before this round.

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