Skip to content

C1a: Consolidate the node-CRUD transport layer — fold tauri-commands node half into backendAdapter - #1255

Merged
malibio merged 2 commits into
mainfrom
issue-1251-c1a-transport-consolidation
May 30, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-1251-c1a-transport-consolidation

Conversation

@malibio

@malibio malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #1251

…ough backendAdapter (#1251)

Deletes the 19 node-CRUD pass-through functions (createNode, getNode,
updateNode, updateTaskNode, deleteNode, getChildren, getDescendants,
getChildrenTree, moveNode, createMention, deleteMention, getOutgoing/
IncomingMentions, getMentioningRoots, queryNodes, mentionAutocomplete,
createContainerNode) and their type re-exports from tauri-commands.ts.
All call sites — shared-node-store, reactive-node-service, node-card-inline,
ai-chat-node-viewer, navigation-service, and base-node — now import
backendAdapter directly. Test spies and module mocks moved from
tauri-commands to backendAdapter accordingly. tauri-commands.ts is now
the non-node Tauri system commands module only.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review — C1a: Consolidate node-CRUD transport layer (#1251)

Review Type: Initial Review


Requirements Check

  • ✅ Node-CRUD functions removed from tauri-commands.ts; the file exports only non-node Tauri commands (local-agent, chat-model, PTY, capture-settings, ACP).
  • ✅ No production node-CRUD code path imports tauri-commands; all route through backendAdapter. Verified with grep — zero hits for node-CRUD function names in non-test production files.
  • ✅ shared-node-store.svelte.ts now imports { backendAdapter } from ./backend-adapter and calls backendAdapter.* for all 7 node operations (createNode, getNode, updateNode, updateTaskNode, deleteNode, getChildren, getChildrenTree).
  • ✅ reactive-node-service.svelte.ts no longer imports moveNode from tauri-commands; all four moveNode call sites now use backendAdapter.moveNode(...).
  • ✅ node-card-inline.svelte and navigation-service.ts now import getNode via backendAdapter.
  • ✅ base-node.svelte — mentionAutocomplete and createNode moved to backendAdapter. Per the issue, this component was listed in "DO NOT TOUCH" for its non-node imports (slash commands, PTY) but its node-CRUD calls were correctly migrated.
  • ✅ Non-node consumers (agent-store.svelte.ts, model-store.svelte.ts, pty-terminal.svelte, ai-chat-pty-session.svelte, ai-chat-model-picker.svelte) unchanged — still import non-node commands from tauri-commands.
  • ✅ TauriAdapter field marshaling and withDiagnosticLogging unchanged — no modifications to backend-adapter.ts.
  • ✅ All 132 test files / 3873 tests pass with no new failures.

Findings

Nitpicks

Nit: Stale comment in base-node.svelte (line 415)

// Create node using Tauri commands (works in Tauri environment)

The call site now uses backendAdapter.createNode(...) which routes through all three adapter implementations (Tauri, HTTP, Mock). The comment should read something like "Create node via backendAdapter (Tauri, HTTP dev, or Mock)". Minor but misleads future readers about transport.


Nit: Stale comment in shared-node-store.svelte.ts (line ~553)

// tauriCommands mock running and need a way to assert the

The __test_setLastPersistedContent JSDoc still references "tauriCommands mock" — should be updated to "backendAdapter mock" for consistency with the new import surface.


Nit: Stale deprecation in src/tests/utils/test-node-helpers.ts (line ~13)

* @deprecated Use tauri-commands instead

The HttpAdapter interface in the test helper carries a @deprecated Use tauri-commands instead JSDoc. This was pre-existing and is now doubly misleading — consumers should use backendAdapter directly. Low urgency since it's a test utility, but worth a follow-up.


Summary

This is a clean, well-scoped transport consolidation. The implementation is mechanically precise: every node-CRUD call site has been migrated, the non-node tauri-commands half is fully preserved, test mock surfaces are consistently updated to backendAdapter, and the full test suite passes. The getMentioningRoots → getMentioningContainers name mismatch the issue flagged as a risk was already handled correctly at the adapter layer with no consumers calling the old name.

The three nits are all stale comments — none affect correctness or the transport boundary. The PR is a net improvement by eliminating a redundant abstraction layer.

Recommendation: APPROVE

@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.

Review status: APPROVE — all acceptance criteria met, full test suite passes (132 files / 3873 tests). Three stale comments flagged as nits, none affect correctness. Clean elimination of a redundant wrapper layer.

Update three comments left behind after the C1a transport migration:
- base-node.svelte: clarify backendAdapter routes across all three implementations
- shared-node-store.svelte.ts: update test JSDoc to reference backendAdapter mock
- test-node-helpers.ts: update deprecated notice to point to backendAdapter

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed all 3 review nits in a follow-up commit:\n- base-node.svelte: updated comment to reference backendAdapter\n- shared-node-store.svelte.ts: updated test JSDoc to reference backendAdapter mock\n- test-node-helpers.ts: updated @deprecated notice to point to backendAdapter

@malibio
malibio merged commit 17bb94c into main May 30, 2026
@malibio
malibio deleted the issue-1251-c1a-transport-consolidation branch May 30, 2026 12:06
malibio added a commit that referenced this pull request Jun 22, 2026
…node half into backendAdapter (#1255)

* C1a: Remove node-CRUD facade from tauri-commands, route consumers through backendAdapter (#1251)

Deletes the 19 node-CRUD pass-through functions (createNode, getNode,
updateNode, updateTaskNode, deleteNode, getChildren, getDescendants,
getChildrenTree, moveNode, createMention, deleteMention, getOutgoing/
IncomingMentions, getMentioningRoots, queryNodes, mentionAutocomplete,
createContainerNode) and their type re-exports from tauri-commands.ts.
All call sites — shared-node-store, reactive-node-service, node-card-inline,
ai-chat-node-viewer, navigation-service, and base-node — now import
backendAdapter directly. Test spies and module mocks moved from
tauri-commands to backendAdapter accordingly. tauri-commands.ts is now
the non-node Tauri system commands module only.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* Address review nits: update stale tauri-commands references in comments

Update three comments left behind after the C1a transport migration:
- base-node.svelte: clarify backendAdapter routes across all three implementations
- shared-node-store.svelte.ts: update test JSDoc to reference backendAdapter mock
- test-node-helpers.ts: update deprecated notice to point to backendAdapter

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Michael Libio <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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.

C1a: Consolidate the node-CRUD transport layer — fold tauri-commands node half into backendAdapter

1 participant