Skip to content

canvas: define a versioned persistent graph document #30

Description

@guicybercode

Context

An infinite canvas should not make terminal components or React layout state the source of truth. The graph must be durable, forward-compatible, and independent from rendering technology.

Goal

Define a CanvasDocument domain model for nodes, edges, groups, layout, viewport, and task bindings.

Scope

  • Define stable node/edge/group IDs and document revision.
  • Model Terminal, Note, Task, Agent Team, File Tree, and future Portal node kinds.
  • Separate node presentation data from referenced domain entities.
  • Define typed connection purposes such as message, context, ownership, and visual-only.
  • Persist coordinates, dimensions, collapsed state, z-order, groups, and viewport.
  • Add optimistic concurrency and schema migrations.
  • Preserve unknown node kinds for forward compatibility where safe.

Acceptance criteria

  • Deleting a visual node does not delete its task, session, worktree, or note unless separately confirmed.
  • A terminal node references a session ID; it never owns PTY state or replay bytes.
  • Graph cycles are allowed for visual/message links but validated for orchestration semantics.
  • Stale document writes cannot overwrite a newer layout.
  • Import/export has explicit size and node-count limits.
  • Documents survive daemon and UI restart.
  • Serialization, migration, corruption, and referential-integrity tests are present.
  • The format is documented before UI implementation.

Out of scope

Canvas rendering and real-time multi-user editing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions