Skip to content

[ENG-1847] Define shared cross-app node content contract#1129

Merged
sid597 merged 6 commits into
mainfrom
eng-1847-define-shared-cross-app-node-content-contract
Jun 19, 2026
Merged

[ENG-1847] Define shared cross-app node content contract#1129
sid597 merged 6 commits into
mainfrom
eng-1847-define-shared-cross-app-node-content-contract

Conversation

@sid597

@sid597 sid597 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Defines the app-neutral contract for Roam ↔ Obsidian node discovery / import / refresh. Definition only.

Linear: https://linear.app/discourse-graphs/issue/ENG-1847

  • crossAppNodeContract.tsCrossAppNode types: a typed view over the existing Concept/Content model; no new persistence path.
  • lib/rid.ts — RID helper promoted from obsidian into @repo/database; obsidian's rid.ts re-exports it (verbatim move, behavior-preserving).
  • fixtures/crossAppNodes.ts — one Roam + one Obsidian worked example.
  • package.json — exports for the contract + fixtures.

Full spec (field mapping, source-side gaps, markdown fidelity limits) lives on Linear ENG-1847. prettier / eslint / tsc green for @repo/database and apps/obsidian.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X4YAFA8BL48YJqTCHbJuwT


Open in Devin Review

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
discourse-graph Ready Ready Preview, Comment Jun 19, 2026 4:27pm

Request Review

@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

ENG-1847

@supabase

supabase Bot commented Jun 18, 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 ↗︎.

devin-ai-integration[bot]

This comment was marked as resolved.

@graphite-app

graphite-app Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR size/scope check

This PR is over our review-size guideline.

  • Recommended: ~200 lines changed
  • Acceptable limit: up to 400 lines when well-scoped/self-contained
  • Preferred file count: fewer than 5 files

Please split this into smaller PRs unless there is a clear reason the changes need to land together.

If keeping it as one PR, please add a brief justification covering:

  • What single problem this PR solves
  • Why the files/changes are coupled

@sid597

sid597 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5954c548c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sid597 sid597 requested review from maparent and mdroidian June 19, 2026 09:44

@mdroidian mdroidian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This was easy to follow, very clear.


One thing Devin noted which might be worth mentioning in the rid.ts to possibly save us in the future:

packages/database/src/lib/rid.ts:R13

Round-trip behavior of URL-based RIDs relies on localId never containing slashes

The spaceUriAndLocalIdToRid function for HTTP-based space URIs (packages/database/src/lib/rid.ts:13) simply concatenates ${spaceUri}/${localId}. The inverse ridToSpaceUriAndLocalId (packages/database/src/lib/rid.ts:33-35) splits on / and pops the last segment as sourceLocalId. This means a localId containing / would break the round-trip. In the example file, Roam UIDs (e.g., tgWb6JozF) don't contain slashes, and Obsidian uses the orn: format instead, so this isn't currently triggered. However, this is a latent fragility in the shared contract that future consumers should be aware of.

@sid597 sid597 merged commit 5be4274 into main Jun 19, 2026
7 of 8 checks passed
sid597 added a commit that referenced this pull request Jun 24, 2026
* [ENG-1847] Define shared cross-app node content contract

* [ENG-1849] Add node-type schema dependency to cross-app node fixtures

The cross-app node contract (ENG-1847) carries nodeType = { sourceLocalId, label } and the instance Concept references it via schema_represented_by_local_id, but the fixtures persisted no is_schema:true schema Concept for that id. Add the required schemaConcept (Roam Claim, Obsidian Evidence) carrying stable source identity + label only -- no source_data/format/color/tag, per the contract's "without redefining schema shape".

Roam's existing 5-min sync already persists the schema Concept per contract (convertDgToSupabaseConcepts -> discourseNodeSchemaToLocalConcept; all types on initial sync, edited types incrementally via nodeTypeSince), so no Roam sync code change is needed for F4/F9/F13. Stacked on eng-1847 (PR #1129, unmerged).

* [ENG-1849] Persist Roam schema labels
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.

2 participants