Skip to content

ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (6/6) - #1633

Open
sid597 wants to merge 2 commits into
eng-1986-send-obsidian-relations-through-the-cross-app-convertersfrom
eng-1986-add-color-to-the-cross-app-schema-types
Open

sid597 wants to merge 2 commits into
eng-1986-send-obsidian-relations-through-the-cross-app-convertersfrom
eng-1986-add-color-to-the-cross-app-schema-types

Conversation

@sid597

@sid597 sid597 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Reviewer brief

ENG-1986 moves Obsidian sync off its own converters and onto the shared CrossApp converters, without loss of functionality. It ships as six PRs. PRs 1 to 4 and 6 are stacked on #1575 (ENG-1823). PR 5 targets main:

  1. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (1/6) #1620: tests that pin exactly what Obsidian sync sends to upsert_concepts today. No production change.
  2. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (2/6) #1630: node type, relation type and relation triple schemas go through the shared converters.
  3. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (3/6) #1631: nodes and their Content go through the shared converters.
  4. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (4/6) #1632: relation instances go through the shared converters.
  5. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (5/6) #1634: color becomes a CrossApp field on node types and relation types, in packages/database. It doesn't depend on PRs 1 to 4.
  6. This PR. Obsidian sync sends color through the shared converters. It needs PR 5, and its branch carries PR 5's change until that merges.

Why six and not one: each step changes one kind of row, and #1620's tests show whether a stored value changed. PR 5 changes the shared contract, so it goes first in its own PR and needs its own review. Together the steps are well over the 400-line guideline.

  • Review focus: the packages/database changes in this diff are PR 5 (ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (5/6) #1634). Review them there. This PR's own change is in apps/obsidian, and the packages/database files drop out of this diff once PR 5 merges and main is merged down the stack.
  • Result: color is a CrossApp field on node types and relation types (CrossAppNodeSchema.color, CrossAppRelationTypeSchema.color). The shared converters write it to literal_content.color and read it back out of metadata. Obsidian sync sends it through the CrossApp types.
  • Result: this is the one PR in the stack that changes stored rows. On Obsidian node type and relation type rows, color moves from literal_content.source_data to the top level of literal_content, where format already is. A local relation type now sends an empty source_data, because color was its only entry. The three ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (1/6) #1620 rows that pin this are updated.
  • Review focus: why a field. On ENG-2091, Marc-Antoine wrote that values CrossApp carries have to be explicit fields, and named format and colour (2026-10-23, 2026-10-25). format is already a field. sourceData is not in this PR.
  • Review focus: the value differs by type. A node type carries a hex color (#7DA13E) and a relation type carries a tldraw color name (blue). The contract types both as a string, and concept_design.md says which is which.
  • Review focus: no reader changes. The only code that reads a schema's color from the database is Obsidian import's parseSchemaLiteralContent (importNodes.ts:1191). Since [ENG-1295 & ENG-1350 & ENG-1297] F5 import and refresh published nodes #722 it has read source_data.color and then the top-level color, so this version and older plugin versions import the color from new rows. Relation type import sets a default color, and Roam reads no color.
  • Review focus: parseSchemaLiteralContent reads source_data.color first, the opposite order to format. The order has no effect today: a new row has only the top-level key, an older row only source_data, and upsert_concepts replaces literal_content whole.
  • Risk or follow-up: Roam's nodeSchemaToCrossApp doesn't set color. Roam node types keep theirs in canvasSettings.color, and Roam sync still builds node type rows with its own converter. No ticket covers this yet.
  • Risk or follow-up: no backfill. A row written before this PR keeps source_data.color until its schema is edited and sent again. dbNodeSchemaToCrossApp and dbRelationTypeSchemaToCrossApp read only the top-level key, as they do for format, so they return no color for such a row. Nothing reads CrossApp color yet. The first consumer has to fall back to source_data.color, as resolveSchemaFormat does for format.
  • Risk or follow-up: the Zod validators on ENG-2005 Zod validators for the cross-app types #1619 (ENG-2005) are strict and type-checked against these contracts. Whichever PR merges second adds color there.

Verification

  • apps/obsidian: vitest run passes (261 tests), tsc --noEmit --skipLibCheck passes, and eslint --max-warnings 0 is clean on the changed files.
  • packages/database: vitest run passes (152 tests) and tsc --noEmit --skipLibCheck passes. eslint --max-warnings 0 reports five no-unnecessary-type-assertion warnings in dbToCrossAppConverters.ts at lines 79 to 140. This PR's first change in that file is at line 171.
  • apps/roam: tsc --noEmit --skipLibCheck passes and vitest run passes (716 tests).
  • Prettier is clean on the changed files.
  • Not run: the packages/database cucumber features, which need a database, and a sync followed by an import between two vaults.

Loom video

Not recorded yet. This PR stays a draft until it has one.

Scope check

  • Ran $scope-check against ENG-1986 and the final diff.
  • Scope beyond Done When: None. Done When asks that the cross-app schemas are complete, and color is the field the contract owner agreed to add.

Standards check

  • Ran $dg-pr-adherence-check against the final diff and PR metadata.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context. Use $dg-delegated-full-review when no other full-review workflow is available.

- CrossAppNodeSchema and CrossAppRelationTypeSchema gain an optional color.
  The shared converters write it to literal_content.color and read it back,
  out of metadata.
- Obsidian sync sends color through the CrossApp types instead of nesting it
  under literal_content.source_data, as format already does. Obsidian import
  reads both places, so rows written before this still import their color.
- concept_design.md lists the new mapping.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
discourse-graph Ready Ready Preview Nov 16, 2026 8:02am UTC

Request Review

@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

ENG-1986

@supabase

supabase Bot commented Nov 16, 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 ↗︎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T07:34:25.066122Z f981cdc Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch was successfully deployed

1 active deployment
Preview — f981cdc3 Deployed Nov 16, 2026 by vercel[bot]
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