-
Notifications
You must be signed in to change notification settings - Fork 6
[ENG-1847] Define shared cross-app node content contract #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sid597
merged 6 commits into
main
from
eng-1847-define-shared-cross-app-node-content-contract
Jun 19, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7e5540d
[ENG-1847] Define shared cross-app node content contract
sid597 a967efa
[ENG-1847] Trim cross-app contract comments
sid597 62755d0
[ENG-1847] Simplify cross-app contract naming
sid597 ee6f436
[ENG-1847] Keep cross-app node examples focused
sid597 5954c54
[ENG-1847] Inline single-use node example values
sid597 e757b67
Document RID local ID delimiter contract
sid597 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import type { CrossAppNode } from "./crossAppNodeContract"; | ||
| import { spaceUriAndLocalIdToRid } from "./lib/rid"; | ||
|
|
||
| const ROAM_SOURCE_SPACE_ID = "https://roamresearch.com/#/app/MAPLab"; | ||
| const ROAM_SOURCE_NODE_ID = "tgWb6JozF"; | ||
|
|
||
| const roamFullMarkdown = `# Sleep improves memory consolidation | ||
|
|
||
| Multiple studies show that sleep after learning strengthens memory traces. | ||
|
|
||
| - Supported by [[EVD]] - Rasch & Born 2013 | ||
| `; | ||
|
|
||
| export const roamOriginNodeExample: CrossAppNode = { | ||
| sourceApp: "roam", | ||
| sourceSpaceId: ROAM_SOURCE_SPACE_ID, | ||
| sourceSpaceName: "MAPLab", | ||
| sourceNodeId: ROAM_SOURCE_NODE_ID, | ||
| sourceNodeRid: spaceUriAndLocalIdToRid( | ||
| ROAM_SOURCE_SPACE_ID, | ||
| ROAM_SOURCE_NODE_ID, | ||
| ), | ||
| nodeType: { | ||
| sourceNodeTypeId: "rCLM0schema", | ||
| label: "Claim", | ||
| }, | ||
| content: { | ||
| direct: { value: "Sleep improves memory consolidation" }, | ||
| full: { format: "text/markdown", value: roamFullMarkdown }, | ||
| }, | ||
| sourceModifiedAt: "2026-06-12T14:00:00.000Z", | ||
| }; | ||
|
|
||
| const OBSIDIAN_SOURCE_SPACE_ID = "obsidian:9a8b7c6d5e4f3210"; | ||
| const OBSIDIAN_SOURCE_NODE_ID = "0192f1a0-7b3c-7e2a-9f10-1a2b3c4d5e6f"; | ||
| const OBSIDIAN_SOURCE_NODE_TYPE_ID = "evd-7c1f9a2b"; | ||
|
|
||
| const obsidianFullMarkdown = `--- | ||
| nodeTypeId: ${OBSIDIAN_SOURCE_NODE_TYPE_ID} | ||
| nodeInstanceId: ${OBSIDIAN_SOURCE_NODE_ID} | ||
| --- | ||
|
|
||
| # REM sleep correlates with recall | ||
|
|
||
| Participants with more REM sleep showed better next-day recall. | ||
| `; | ||
|
|
||
| export const obsidianOriginNodeExample: CrossAppNode = { | ||
| sourceApp: "obsidian", | ||
| sourceSpaceId: OBSIDIAN_SOURCE_SPACE_ID, | ||
| sourceSpaceName: "Research Vault", | ||
| sourceNodeId: OBSIDIAN_SOURCE_NODE_ID, | ||
| sourceNodeRid: spaceUriAndLocalIdToRid( | ||
| OBSIDIAN_SOURCE_SPACE_ID, | ||
| OBSIDIAN_SOURCE_NODE_ID, | ||
| "note", | ||
| ), | ||
| nodeType: { | ||
| sourceNodeTypeId: OBSIDIAN_SOURCE_NODE_TYPE_ID, | ||
| label: "Evidence", | ||
| }, | ||
| content: { | ||
| direct: { value: "EVD - REM sleep and recall" }, | ||
| full: { format: "text/markdown", value: obsidianFullMarkdown }, | ||
| }, | ||
| sourceModifiedAt: "2026-06-14T10:30:00.000Z", | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| export type CrossAppNode = { | ||
| sourceApp: "roam" | "obsidian"; | ||
| /** | ||
| * Stable source-space id. Maps to `Space.url`, not numeric `Space.id`. | ||
| */ | ||
| sourceSpaceId: string; | ||
| sourceSpaceName: string; | ||
| /** | ||
| * Node id inside the source app/space. | ||
| * Roam: page/block UID. | ||
| * Obsidian: nodeInstanceId. | ||
| */ | ||
| sourceNodeId: string; | ||
| sourceNodeRid: string; | ||
| nodeType: { | ||
| /** | ||
| * Node type/schema id inside the source app/space. | ||
| * Maps to the schema Concept's `source_local_id`. | ||
| */ | ||
| sourceNodeTypeId: string; | ||
| label: string; | ||
| }; | ||
| content: { | ||
| direct: { value: string }; | ||
| full: { | ||
| /** | ||
| * Contract media type for `full.value`; current Content rows store the | ||
| * markdown in `text`, not in a typed media column. | ||
| */ | ||
| format: "text/markdown"; | ||
| value: string; | ||
| }; | ||
| }; | ||
| /** | ||
| * Source modified timestamp, or latest required `Content.last_modified` when | ||
| * deriving from persisted `direct` and `full` rows. | ||
| */ | ||
| sourceModifiedAt: string; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.