Skip to content

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

Open
sid597 wants to merge 7 commits into
eng-1823-use-the-unified-upsert_concepts-in-obsidianfrom
eng-1986-refactor-obsidian-sync-to-use-the-new-cross-app
Open

sid597 wants to merge 7 commits into
eng-1823-use-the-unified-upsert_concepts-in-obsidianfrom
eng-1986-refactor-obsidian-sync-to-use-the-new-cross-app

Conversation

@sid597

@sid597 sid597 commented Nov 13, 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. This PR. 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. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (6/6) #1633: 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.

  • Result: Tests pin what Obsidian sync sends to upsert_concepts, through the full sync and the file-change sync. A full sync sends 14 rows: 12 are compared whole, and the other 2 (supports-type, claim-supports-claim) only by id. Every file-change payload is compared whole. Each later PR must keep these tests passing or name every expected row it changes.
  • Review focus: the expected rows. They record today's behaviour as it is. Three look unintended. An imported node type and an imported relation type are sent with this space's user as author_id, and their origin authorId lands in literal_content.source_data. An imported triple is sent with this space's user as author_id and drops its origin authorId.
  • Risk or follow-up: No fixture relation names a note missing from the vault, such as a relation left behind by a deleted note or an imported note's Source relation. Sync drops such a relation today, and no test pins that.
  • Review focus: the loadRelations mock from ENG-1823 never reached the sync. It recorded no calls while the sync ran. The tests now put relations.json in the fake vault, so the real loadRelations reads it.

Verification

  • pnpm ci:validate passes (Obsidian: 258 tests).
  • Mutation check: seventeen production changes, one at a time, each made the matching test fail. Examples: drop metadata.filePath, omit template_content for a type with no template, name a note by its basename, name a triple by its id, stop skipping imported notes or relations, drop dependency ordering, send a different v_space_id, strip frontmatter from the full text. A review lab's six probes also each fail a test now: a relation without lastModified, an imported note at a relation's source, provisional imported schemas, and rows sent before what they reference. Production files are unchanged.

Loom video

No video. This PR changes only a test file.

Scope check

  • Ran $scope-check against ENG-1986 and the final diff.
  • Scope beyond Done When: None. This PR covers the tests clause of Done When. The refactor itself is in PRs 2 to 6.

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.
  • Ran Review Lab (DiscourseGraphs/review-lab at 01b07f3) on 2b14ca1c: one P3 finding (F-B6), listed under Risk; nothing blocks review. Review Lab page

Drive the full sync and the file-change sync against a fake Supabase
client and compare the upsert_concepts rows exactly: node type, relation
type and triple schemas, a note with its direct and full Content, and
relations. Also pin the Source slot, the skipped imported notes and
relations, and which Content an edit or a rename sends.

The relations now come from relations.json in the fake vault. The
loadRelations mock never reached the sync.
Check that every upsert_concepts call targets this space. Pin an accepted
imported relation type and triple with their origin RIDs, the node type
settings kept in source_data, and the full Content keeping the note's
frontmatter. Give each embedding a vector that identifies its text.

Name the differences upsert_concepts stores alike, so a later PR can
change only those with that reason.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
discourse-graph Skipped Skipped Nov 16, 2026 5:51am UTC

Request Review

@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

ENG-1986

@supabase

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

Compare the Source note's Concept and both its Contents exactly, so a
converter that drops an empty source_data fails. Name the id-list test
for what it checks: imported schemas are sent, imported notes and
relations are not. State the stored-alike fact in the sentConcepts
comment without the later-PR clause.
@sid597
sid597 added this pull request to stack #1624 November 13, 2026 16:26
@sid597
sid597 marked this pull request as ready for review November 16, 2026 04:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 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-16T04:05:39.187982Z 6dd9e62 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 previously deployed

1 inactive deployment
Preview — 2b14ca1c 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