Skip to content

C2b: Remove the Node.parentId field entirely (follow-up to #1247) #1248

Closed

Description

@malibio

Follow-up to #1247 (C2). Spun off from architectural-audit #1228. Do not start until #1247 is merged.

Context

#1247 (C2) makes structureTree the single source of truth for hierarchy: it deletes the mirror-only Node.parentId writes, unifies the two sync paths, and demotes parentId to a read-through accessor (getParentId(nodeId) → structureTree.getParent). It deliberately stops short of removing the parentId field from the Node type itself.

This issue finishes that: remove the Node.parentId field entirely.

Why it was deferred from #1247

SharedNodeStore.getNode() returns a live reference into the nodes Map, and Node is a plain serialized object produced in several places (the wire shape from backend-adapter, loadChildrenTree reconstruction, OCC snapshots via { ...node }). So parentId can't become a derived getter without addressing the type boundary and serialization layer — too invasive to combine with the sync-unification work.

Scope

Acceptance criteria

  • Node type has no parentId field; grep -rn "\.parentId" packages/desktop-app/src returns only structureTree-internal parentId parameters (the Map<parentId, ...> API), no Node.parentId reads/writes.
  • All hierarchy parent reads go through structureTree.getParent / getParentId.
  • Backend create/move payloads derive parent from structureTree at call time.
  • bun run check clean; bun run test:all green (no new failures).

Standard NodeSpace startup / PR sequence

EnterWorktree({name: "issue-<N>-c2b-remove-parentid-field"}); bun install; bun run test baseline; bun run gh:assign/gh:status. createLogger only, no any, bun run test not bun test. Before PR: bun run test:all + bun run check, bun run quality:fix (revert unrelated reformats), bun run gh:pr <N>, /pragmatic-code-review, then ExitWorktree + gh pr merge --squash --delete-branch.


Spun off from #1228 (architectural audit), finding C2 (follow-up C2b). Blocked on #1247.

Activity

  1. malibio commented on May 30, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 132 files, 3922 tests passed

  2. self-assigned this
    on May 30, 2026
  3. added a commit that references this issue on Jun 22, 2026
    35c2e3e
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