Phase 3: Graph view, backlinks, quick switcher, export

- Add outgoing_links (JSON) and backlinks_count to Document model
- POST /documents/{id}/detect-links — detect [[uuid]] patterns in content
- GET /documents/{id}/backlinks — documents referencing this doc
- GET /documents/{id}/outgoing-links — documents this doc references
- GET /documents/{id}/links — combined incoming + outgoing
- GET /projects/{id}/graph — full project relationship graph
- GET /search/quick — fuzzy search (Quick Switcher Cmd+K)
- GET /projects/{id}/documents/search — project-scoped search
- GET /documents/{id}/export — markdown|json export
- GET /projects/{id}/export — json|zip export
- 27 new tests
This commit is contained in:
Motoko
2026-03-30 23:46:45 +00:00
parent 202e70b4a8
commit 07f9ac91fc
9 changed files with 1887 additions and 6 deletions

View File

@@ -39,3 +39,6 @@ class Document(Base):
reasoning_steps: Mapped[str | None] = mapped_column(Text, nullable=True) # JSON array as text
model_source: Mapped[str | None] = mapped_column(String(100), nullable=True)
tiptap_content: Mapped[str | None] = mapped_column(Text, nullable=True) # JSON object as text
# Phase 3: Link tracking
outgoing_links: Mapped[str] = mapped_column(Text, nullable=False, default="[]") # JSON array of document IDs
backlinks_count: Mapped[int] = mapped_column(default=0, nullable=False) # Cached count of incoming links