Skip to content

Update documentation to reflect edge-based sibling ordering (remove before_sibling_id references) #619

Closed

Description

@malibio

Summary

Update documentation to reflect the edge-based sibling ordering architecture implemented in Issue #614. Currently, 115 references to the deprecated before_sibling_id field exist across 24 documentation files.

Context

PR #616 successfully removed the before_sibling_id field from the data model and migrated to edge-based fractional ordering using the has_child edge order field. All code and tests have been updated, but documentation files still reference the old architecture.

Code Status: ✅ Complete (all tests passing)
Documentation Status: ⚠️ Outdated (references deprecated field)

Affected Files (24 files, 115 references)

Architecture Documentation

  • docs/architecture/core/system-overview.md
  • docs/architecture/core/technology-stack.md
  • docs/architecture/components/data-storage.md
  • docs/architecture/persistence-layer.md
  • docs/architecture/dependency-based-persistence.md
  • docs/architecture/elegant-persistence-solution.md

Business Logic Documentation

  • docs/architecture/business-logic/database-schema.md
  • docs/architecture/business-logic/mcp-integration.md
  • docs/architecture/business-logic/node-behavior-system.md
  • docs/architecture/business-logic/overview.md

Data Layer Documentation

  • docs/architecture/data/surrealdb-schema-design.md
  • docs/architecture/data/sync-protocol.md
  • docs/architecture/data/optimistic-concurrency-control.md
  • docs/architecture/data/archived/storage-architecture-turso.md
  • docs/architecture/data/archived/README.md

Development Documentation

  • docs/architecture/development/hierarchy-reactivity-architecture-review.md
  • docs/architecture/development/persistence-coordinator-patterns.md
  • docs/architecture/development/standards/identifier-naming-conventions.md

Testing Documentation

  • docs/architecture/testing/http-dev-server.md
  • docs/architecture/testing/persistence-testing-strategy.md
  • docs/architecture/persistence/archived/persistence-system-review.md
  • docs/architecture/persistence/archived/persistence-testing-strategy.md
  • docs/architecture/persistence/archived/refactoring-plan.md

Decision Records

  • docs/architecture/decisions/adr-core-logic-migration-strategy.md

Tasks

1. Update Schema Examples

OLD (deprecated):

interface Node {
  id: string;
  before_sibling_id: string | null;  // ❌ Field removed
}

NEW (current architecture):

-- Sibling ordering stored in has_child edge order field (fractional ordering)
CREATE node:example CONTENT {
  id: 'example',
  content: 'Hello',
  // NO before_sibling_id - structure lives in edges!
};

-- Ordering is on the relationship, not the node
RELATE parent:A->has_child->node:B SET order = 0.5;

2. Update Code Examples

OLD:

pub struct Node {
    pub before_sibling_id: Option<String>,  // ❌ Removed
}

NEW:

// API parameter for specifying insertion point
pub struct CreateNodeParams {
    pub insert_after: Option<String>,  // ✅ "Insert after this node" (None = beginning)
}

// Data model - NO ordering field (derived from edges)
pub struct Node {
    pub id: String,
    pub content: String,
    // Ordering not stored on node - lives in has_child edges
}

3. Add Migration Notes

Add deprecation notices to relevant sections:

**DEPRECATED (Issue #614)**: The `before_sibling_id` field was removed in favor of edge-based ordering.

**Migration Path**:
- **Old**: `node.before_sibling_id` field stored sibling order
- **New**: `has_child` edge `order` field uses fractional ordering
- **API**: Use `insert_after` parameter to specify insertion point

See PR #616 for implementation details.

4. Update Architecture Diagrams

If any diagrams show before_sibling_id in the data model, update them to show:

  • Edge-based ordering
  • Fractional order values on edges
  • Clear separation between API parameters and data model

5. Update Specific Documentation Sections

docs/architecture/data/surrealdb-schema-design.md

  • Remove before_sibling_id from schema examples
  • Explain fractional ordering on edges
  • Document the has_child.order field

docs/architecture/development/hierarchy-reactivity-architecture-review.md

docs/architecture/decisions/adr-core-logic-migration-strategy.md

Acceptance Criteria

  • All 115 references to before_sibling_id / beforeSiblingId updated or removed
  • Schema examples show edge-based ordering
  • Code examples use insert_after API parameter
  • Migration notes added to relevant sections
  • Architecture diagrams updated (if applicable)
  • Documentation accurately reflects current implementation (as of PR Complete before_sibling_id removal - use has_child edge ordering #616)
  • Run verification: grep -r "before_sibling_id\|beforeSiblingId" docs/ --include="*.md" returns 0 results (except in migration notes/deprecation warnings)

Priority

Low - This is a documentation cleanup task. The code is correct and all tests pass. Outdated documentation doesn't block development or cause runtime issues.

Related Issues

Notes

  • This is purely a documentation task - no code changes required
  • Focus on accuracy and clarity for future developers
  • Consider adding examples showing the new edge-based ordering in action
  • Archived documentation files can optionally be updated or left as historical reference

Activity

  1. self-assigned this
    on Nov 22, 2025
  2. added a commit that references this issue on Nov 22, 2025
    35653fa
  3. added 3 commits that reference this issue on Nov 22, 2025
    e2fad34
    e2cf6da
    880fcef
  4. added 4 commits that reference this issue on Feb 4, 2026
    9e6e118
    c823375
    dc48cfe
    52206bd
  5. added a commit that references this issue on Feb 26, 2026
    dbb7a93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions