Skip to content

Remove parentId and collectionId from node wire response #1318

Closed

Description

@malibio

Problem

The node wire response (both gRPC NodeData proto and HTTP API) includes parent_id and collection_id fields that should not be there. These are relationship-derived projections, not stored fields on the node itself.

Per the data layer architecture:

  • Hierarchy lives in has_child relationships — no parent_id on nodes
  • Collection membership lives in member_of relationships — no collection_id on nodes

Including them on the node response contradicts the graph model and creates confusion about where the source of truth is.

What to Remove

Proto (packages/proto/proto/node_service.proto)

  • optional string parent_id = 4 from NodeData message
  • string collection_id = 10 from NodeData message
  • parent_id and collection_id fields from NodeResponse

Daemon (packages/daemon/src/services/node_service.rs)

  • Remove injection of parent_id and collection_id in node_to_proto()
  • Remove lookup calls that fetch parent/collection just to populate the response

Frontend TypeScript types

  • Remove parentId and collectionId from any Node type definition if present
  • Confirm no frontend code reads node.parentId or node.collectionId from a fetched node (the Explore agent found the frontend already ignores these — ReactiveStructureTree manages hierarchy separately)

What NOT to Change

  • parentId in CreateNodeInput — this is an input field for specifying where to place a new node, not a response field
  • Collection service methods (addNodeToCollection, removeNodeFromCollection) — these use collection_id as an operation parameter, not a node property
  • All internal Rust functions that use parent_id as a parameter for tree operations

Acceptance Criteria

  • NodeData proto no longer includes parent_id or collection_id fields
  • node_to_proto() no longer fetches or injects parent/collection into the response
  • All clients (Tauri frontend, HTTP API, MCP) continue to work correctly — relationships accessed via dedicated APIs
  • data-layer.md serialization contract section updated to note that parentId/collectionId are no longer in the wire format

Activity

  1. malibio commented on Jun 4, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 133 files, 3841 tests passing

  2. self-assigned this
    on Jun 4, 2026
  3. added a commit that references this issue on Jun 4, 2026
    5e03d14
  4. added a commit that references this issue on Jun 22, 2026
    835bef4
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