Skip to content

ENG-2372 Record the source triple's RID on triples created by Obsidian relation import - #1526

Merged
maparent merged 1 commit into
mainfrom
eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian
Oct 7, 2026
Merged

maparent merged 1 commit into
mainfrom
eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian

Conversation

@maparent

@maparent maparent commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/75

Reviewer brief

  • Size: About 415 non-test lines. The fix for new triples and the repair of existing ones share the source-triple lookup in sourceTriple.ts, so splitting them would ship that lookup without a user, or the repair without the fix that stops new bad triples.
  • Review entry points: selectSourceTripleRids in sourceTriple.ts, which picks the source triple (a Roam relation's schema is already the triple; an Obsidian relation's triple is matched with the shared rule from ENG-2373 Share the relation triple matching rule in packages/database #1527). Then repairImportedTripleRids in repairTripleRids.ts, which detects bad RIDs by the relation subtype or by matching an imported instance's RID. Then the wiring in importRelations.ts and initializeSupabaseSync.
  • Review focus: with no unique match, both paths keep the instance RID. Removing it would make isAcceptedSchema treat the imported triple as local, and sync would publish it as this space's own.
  • Testing path: unit tests for selection and detection. The Loom shows the bug reproduced with a main build (Test -informs-> Question from an Obsidian space) and then repaired by this build. The Roam path is unit-tested only.

Loom video

https://www.loom.com/share/17eeaf4cc9cc4096a26b8bb360b24f11

Scope check

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.

https://linear.app/discourse-graphs/issue/ENG-2372/record-the-source-triples-rid-on-triples-created-by-obsidian-relation


Devin Review

@vercel

vercel Bot commented Oct 7, 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 Oct 7, 2026 5:08pm UTC

Request Review

@supabase

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

@linear-code

linear-code Bot commented Oct 7, 2026

Copy link
Copy Markdown

ENG-2372

@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 found 2 potential issues.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread apps/obsidian/src/utils/sourceTriple.ts
Comment thread apps/obsidian/src/utils/repairTripleRids.ts
@maparent
maparent force-pushed the eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian branch from b7b99cd to 2167e26 Compare October 7, 2026 04:10
@maparent
maparent changed the base branch from main to eng-2373-share-the-relation-triple-matching-rule-in-packagesdatabase October 7, 2026 04:10
@maparent
maparent force-pushed the eng-2373-share-the-relation-triple-matching-rule-in-packagesdatabase branch from 5d1b689 to fc32c8c Compare October 7, 2026 04:33
@maparent
maparent force-pushed the eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian branch from 2167e26 to bc921e2 Compare October 7, 2026 04:34
@maparent
maparent requested a review from mdroidian October 7, 2026 04:49

@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.

@maparent see devin comments

Base automatically changed from eng-2373-share-the-relation-triple-matching-rule-in-packagesdatabase to main October 7, 2026 17:02
@maparent
maparent force-pushed the eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian branch from bc921e2 to dc415ea Compare October 7, 2026 17:08
@maparent
maparent merged commit ed37169 into main Oct 7, 2026
9 checks passed
@maparent
maparent deleted the eng-2372-record-the-source-triples-rid-on-triples-created-by-obsidian branch October 7, 2026 17:47

This branch was previously deployed

1 inactive deployment
Preview — dc415ea9 Deployed Oct 7, 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.

2 participants