Skip to content

Frontend dead-code cleanup: vestigial conflict/validation members + dead OptimisticOperationManager (C1b re-audit residue) #1277

Closed

Description

@malibio

Spun off from architectural-audit #1228 (the C1b re-audit). This is NOT the C1b refactor — that re-audit concluded the data-vs-hierarchy ownership boundary is already clean (structureTree owns edges, shared-node-store owns the data cache + OCC, reactive-node-service holds no node data, per frontend-state-and-persistence.md). What remains is dead code left behind by the C2/C2b/C3a/C5 work. Per CLAUDE.md's "delete dead code / no @deprecated" rule, clean it up.

Dead code to delete (all in packages/desktop-app/src/lib/services/shared-node-store.svelte.ts unless noted)

  • validateNodeReferences (~:2255) — carries a @deprecated JSDoc tag (banned by project rules); only tests call it. Delete + its tests.
  • ensureAncestorChainPersisted (~:2241) — no-op stub ("Backend handles relationships via graph edges"). No production caller (the only hit, navigation-service.ts:92, is a stale comment). Delete + fix the stale comment.
  • Pre-C5 client-side conflict subsystem — detectConflict (:2329), handleConflict (:2356), setConflictResolver/getConflictResolver (:2389/:2396), the conflictResolver field (:513), and createDefaultResolver. This is the client-side conflict detection path that ADR-026's C5 amendment made the daemon own ("the client consumes the verdict; it does not guess"). Still wired into updateNode (~:935-938) but only reachable if a caller sets previousVersion — no production caller does (only tests). ⚠️ Verify no caller passes previousVersion before deleting; this touches the live updateNode path. Keep conflictNotifications (the daemon-OCC path uses it).
  • Dead OptimisticOperationManager — packages/desktop-app/src/lib/services/optimistic-operation-manager.svelte.ts is imported only by its own test; the service does snapshot/rollback inline. Delete the file + its test (the inline rollback already works — don't wire it in).

Doc fixes (packages/nodespace-docs/architecture/frontend-state-and-persistence.md — nodespace-docs repo, doc/ branch)

  • Line ~425: lists reactive-structure-tree.svelte.ts under services/ — it's in stores/. Fix the path.
  • Line ~154: claims indent/outdent use OptimisticOperationManager — OOM is dead; the service uses inline rollback. Fix the claim.

Stale comments (doc nits, low priority)

  • reactive-node-service.svelte.ts:4-8 "Phase 1.2 / Backward compatible" header — describes a finished migration. Update/remove.
  • reactive-node-service.svelte.ts:~1632 ReactiveNodeService alias-export comment — stale.

Acceptance criteria

  • All five vestigial members + their tests deleted; no @deprecated tags remain in the store.
  • optimistic-operation-manager.svelte.ts + its test deleted (or, if a reason to keep emerges, documented — but inline rollback works, so default is delete).
  • Confirmed no production caller passes previousVersion to updateNode before removing the conflict subsystem.
  • conflictNotifications and the daemon-OCC conflict path (from C5/C5: Replace the client-side 5s conflict heuristic with the daemon's authoritative OCC version conflict (amends ADR-026) #1273) are untouched and still work.
  • Doc path + OOM claim fixed in frontend-state-and-persistence.md (separate doc/ PR in nodespace-docs).
  • No lint suppression. bun run test and bun run check green.

Testing

  • bun run test (never bun test) green after removals — especially the store + conflict tests (the conflict-subsystem removal is the one with live-path risk).
  • bun run check clean (no dangling type refs from the deleted members/file).
  • bun run test:all before PR.

Risk

  • Low overall (dead-code removal), with ONE caution: the detectConflict/conflictResolver subsystem is reachable via the live updateNode path. Verify it's truly dead (no previousVersion caller) before deleting; if a caller exists, surface it rather than forcing the delete.

Standard NodeSpace startup / PR sequence

EnterWorktree({name: "issue-<N>-frontend-deadcode-cleanup"}), bun install, bun run test baseline, gh:*. createLogger not console; bun run test not bun test. Before PR: bun run test:all + bun run check, bun run quality:fix + commit, bun run gh:pr <N>, /pragmatic-code-review, then ExitWorktree + gh pr merge --squash --delete-branch. The doc fix is a small separate PR in nodespace-docs on a doc/ branch.


Spun off from #1228 (architectural audit), C1b re-audit — residual dead-code cleanup (C1b itself is resolved, no refactor needed).

Activity

  1. malibio commented on May 30, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 133 passed (3858 tests)

  2. self-assigned this
    on May 30, 2026
  3. added a commit that references this issue on Jun 22, 2026
    e113d92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions