Implement ATJSON canonical content storage#1045
Draft
mdroidian wants to merge 3 commits into
Draft
Conversation
|
Updates to Preview Branch (init-atjson) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
This comment was marked as resolved.
This comment was marked as resolved.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR implements the ATJSON canonical content rollout described in:
docs/atjson-canonical-storage-scope.mddocs/atjson-canonical-storage-plan.mddocs/atjson-port-plan.mdIt stores DG ATJSON as the canonical structured representation in
Content.metadata.content, keepsContent.textas derived plain text, and preserves the existing plain-text/Markdown rows used by current Obsidian and Roam workflows.What changed
Database/storage
Content.content_typeas the representation discriminator.variantas the semantic content slice.upsert_contentconflict behavior to use(space_id, source_local_id, variant, content_type).variant = 'full'content astext/markdown; all other existing rows default totext/plain.content_local_input,my_contents, embedding view, generated DB types, and shared content query fields.FileReferencewith generatedcontent_type = 'text/markdown'so existing Markdown asset references continue to target the Markdownfullrow.upsert_contentfrom writing inline embeddings for non-text/plainrows.Shared content model
@repo/content-model.DgDocumentmodel and content-type constants.metadata.contenthelpers.Converters/renderers
App integration
direct/text/plainfull/text/markdownfull/application/vnd.discourse-graph.atjson+json; version=1full/application/vnd.discourse-graph.atjson+json; version=1.Verification
Passed:
pnpm --filter @repo/content-model testpnpm --filter @repo/content-model check-typespnpm --filter @repo/content-model lintpnpm --filter @repo/database test:atjson-contractpnpm --filter @repo/database check-typespnpm --filter @repo/database lintpnpm --filter @repo/database testpnpm --filter @discourse-graphs/obsidian testpnpm --filter @discourse-graphs/obsidian check-typespnpm --filter @discourse-graphs/obsidian lintpnpm --filter roam testpnpm --filter roam check-typespnpm --filter roam lintpnpm run buildgit diff --checkAdditional local verification:
20260517172000_atjson_content_type.sqlagainst local Supabase.metadata.contentContent.textstoring derived plain text rather than serialized JSONFileReferenceFK behaviorNotes:
git diff --checkonly reports Windows LF/CRLF warnings.Reviewer notes
This is intentionally draft-sized and should be reviewed around the main contract boundaries first:
content_type+variantuniqueness model.metadata.contentATJSON storage shape.Out of scope
This PR does not implement: