Skip to content

ENG-1858 Materialize Obsidian-origin markdown into Roam#1224

Draft
sid597 wants to merge 1 commit into
eng-1856-store-source-identity-metadata-for-roam-imported-nodes-v2from
eng-1858-materialize-obsidian-origin-markdown-into-roam-v2
Draft

ENG-1858 Materialize Obsidian-origin markdown into Roam#1224
sid597 wants to merge 1 commit into
eng-1856-store-source-identity-metadata-for-roam-imported-nodes-v2from
eng-1858-materialize-obsidian-origin-markdown-into-roam-v2

Conversation

@sid597

@sid597 sid597 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Roam materializer for one Obsidian-origin CrossAppNode.
  • Create new imported pages through Roam's native data.page.fromMarkdown API.
  • Re-import by stable source RID, update the existing page title, materialize replacement blocks, and remove only the previous children after the replacement succeeds.
  • Preserve and refresh imported source identity metadata.
  • Return structured create/update results and actionable failure stages without dropping the source RID or source-modified timestamp.
  • Make the ENG-1856 source-identity writer await Roam's asynchronous block-props update so metadata write failures are observable.

Why

Roam could discover shared Obsidian nodes and store imported source identity, but it could not materialize the shared markdown into local pages. Re-importing also needs to update the page matched by stable source RID rather than creating a duplicate.

Behavior

First import

  • Validates the Obsidian source RID, modified timestamp, title, and markdown content type.
  • Creates a uniquely identified Roam page from the source markdown.
  • Stores the source RID and source-modified timestamp.
  • Removes the new page if source-identity persistence fails, avoiding an untracked partial import.

Re-import

  • Finds the imported page by source RID.
  • Updates its title with page merging disabled.
  • Imports replacement markdown before deleting the previously captured children, so a markdown-parser failure leaves the old content intact.
  • Refreshes source identity only after content replacement succeeds.

Scope

This is intentionally a materializer API only. ENG-1859 will connect the discovery selection UI and multi-node import reporting.

This PR is stacked on ENG-1856 v2 because source-identity lookup and persistence are direct dependencies.

Validation

  • pnpm --filter roam test -- materializeObsidianNode.test.ts — 12 test files / 56 tests passed
  • pnpm --filter roam check-types — passed
  • ESLint on all affected files — passed
  • Prettier on all affected files — passed
  • pnpm --filter roam build — built with 0 errors
  • git diff --check — passed

The repository declares Node 22+, while the validation shell used Node 20.20.2. This produced an engine warning but no test, type-check, lint, or build failure.

Runtime demo status

A throwaway developer-extension bundle exposing the real materializer and source-identity functions is prepared at /mnt/data/projects/dg-test-eng-1858. The temporary exposure was removed from source before this commit.

The live Roam graph dry run is still pending because no configured Playwright Roam profile was available in the implementation environment. Do not treat the mocked unit tests as proof of real Datalog/block-props/fromMarkdown behavior until that manual run is completed.

Residual runtime boundary

Roam mutations are not transactional. If replacement markdown is imported successfully but deletion of a previous child fails, the structured result reports replace-page-content and preserves source identity, but the page can temporarily contain both replacement content and remaining old blocks.

@linear-code

linear-code Bot commented Jul 12, 2026

Copy link
Copy Markdown

ENG-1858

@supabase

supabase Bot commented Jul 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jul 12, 2026 6:18pm

Request Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant