forming / System Design Archive

Content Pipeline

Content Pipeline 把 Vault 同步、写作、网页编辑、发布、运行时和文件层拆开:Syncthing / Obsidian Sync 负责把本机 Obsidian Vault 同步到 Linux /home/vault,OpenList 是统一公开内容入口,Runtime MarkdownObject Index 负责把可公开的 Obsidian Markdown 投影到 Feed / Reader / Search / Graph。Astro posts 不再作为公开文章系统。当前 Content Source Base 明确为 E:\Vaults\Obsidian = authoring truth,/home/vault/Obsidian = server hot mirror,OpenList /openlist/Obsidian/docs = public content access layer,content-index.json = frontend projection index,Astro = UI shell。

Obsidian Authoring TruthSyncthingLinux /home/vault/Obsidian Hot MirrorOpenList Content Control PlaneRuntime Content IndexMarkdownObjectProjection LayerGit MirrorAstro Content CollectionsPagefind Index
Inspiration

借鉴对象

  • Syncthing
  • Obsidian Sync
  • TinaCMS
  • Decap CMS
  • Quartz 4
  • Flowershow
  • Logseq Publish
  • Obsidian Publish
Rejected

拒绝的方案

  • 把 Obsidian Vault 直接当网站源,因为私人笔记、草稿、附件和碎片会混入公开站点。
  • 把 OpenList 当 CMS,因为它是文件层,不负责 slug、draft、SEO、RSS、标签和构建校验。
  • 把 MySQL 当文章正文真源,因为正文更适合 Git 版本控制,数据库应该承担运行时状态。
  • 用 MyBlog API 上传 data/image 来补 Obsidian 附件同步,因为这会制造第二套文件真源和删除冲突。
  • 从零重写 Quartz / Flowershow 已经覆盖的 Markdown compiler、wikilink、backlink、graph publish 和基础 digital garden search。
  • 同时接入 TinaCMS 和 Decap CMS,因为两个编辑面会制造并行写入路径和权限模型漂移。
Runtime

运行方式

  • Authoring Truth 是 Windows E:\Vaults\Obsidian;Linux /home/vault/Obsidian 只是 runtime hot mirror,对应完整 Obsidian Vault:docs、image、.obsidian、canvas、PDF 和附件必须一起同步。
  • Vault 同步已进入 active 状态:Windows E:\Vaults\Obsidian 通过 Syncthing folder obsidian-vault 双向同步到 Linux /home/vault/Obsidian,两端 idle 且 needBytes=0。
  • OpenList 是 content control plane / 统一公开内容入口和文件访问层,不是 CMS,不决定文章 existence;文章对象仍由 Runtime MarkdownObject projection 决定,公开来源链接必须使用 /openlist/Obsidian/docs/...。
  • Authoring Truth 是本机 E:\Vaults\Obsidian;服务器 /home/vault/Obsidian 是 Syncthing 热镜像和 projector 扫描输入;前端公开 source identity 必须走 OpenList /openlist/Obsidian/docs/...,不得展示 /home/vault 裸路径。
  • 网页编辑目标是 Git-backed / Vault-backed CMS:编辑提交必须回写同一个 Vault working copy,而不是创建数据库文章副本。
  • 文章真源已收束:public-data/runtime/content-index.json 是唯一公开文章 Runtime Projection Truth;旧 Astro posts collection 已移除,不再参与文章路由、RSS、Pagefind、分类、标签、专题或 Knowledge Graph。
  • Quartz 4 / Flowershow 是 Markdown 与 Digital Garden 底座候选:MyBlog 可以吸收或接入它们的 transform / backlink / graph / search / publish 能力,但当前不整体替换 Astro Presentation Shell。
  • Runtime Content Index 当前由 tools/build-runtime-content-index.mjs 生成:public-data/runtime/content-index.json 保留完整投影,apps/web/public/runtime/content-index.json 是前端构建 metadata index;正文、预渲染 html 和 toc 进入 apps/web/public/runtime/articles/*.json 单篇 detail payload。通用列表、首页、标签、分类、RSS 和 Graph 只能读 metadata;Reader Drawer 和 /posts/[slug]/ 才按 detailPath 读取单篇正文。
  • 当前进入 Stabilization Sprint:先稳定 Syncthing / Linux Vault、MarkdownObject schema 和 Quartz Runtime Layer;AppFlowy、Immich、Directus、Meilisearch 都保持 target / skeleton,不启动新 runtime。
  • Runtime Feature Registry 当前由 public-data/runtime/features.json 和 apps/web/public/runtime/features.json 承载,只声明当前 active runtime surface 的 authority、truth、producer 与 consumers,不登记旧文章兼容系统。
  • 当前已实跑链路是 Obsidian local vault E:\Vaults\Obsidian -> Syncthing -> Linux /home/vault/Obsidian hot mirror -> OpenList /openlist/Obsidian public file access -> server-side chokidar -> Runtime MarkdownObject Index -> /srv/myblog/site/runtime/content-index.json -> SSE -> Feed / Reader refresh;Git mirror / TinaCMS / Decap CMS 仍是后续编辑面。
  • Runtime projection 的核心链路是 scan /home/vault/Obsidian/docs -> default include all public Markdown -> filter draft/private/published:false -> normalize -> MarkdownObject -> content-index.json -> /posts/[slug] -> Feed / Reader / Search / Graph projection。当前临时策略是“都显示”,后续再加细规则;kind 从 frontmatter 或路径派生,visibility 从 frontmatter/private/drafts 派生,wikilinks/assets/backlinks 进入 relations。Obsidian 内容变更不得触发 Astro build、Pagefind、scp 或全站 deploy。
  • Frontend card contract:ArticleCard、首页 Runtime Feed、/posts/ 和 /posts/[slug]/ 的展示标签只读 MarkdownObject.card.chips;tags/categories 是搜索、分类、RSS 和 Graph metadata,不再由卡片组件临时派生展示标签。
  • Markdown Presentation Truth 是 apps/web/src/lib/markdown/pipeline.ts 与 .prose-shell:Runtime MarkdownObject 使用 GFM table、Obsidian callout、table wrapper、rehype-pretty-code/Shiki、heading slug 和 prose typography。
  • 首页 / 是 Runtime MarkdownObject 的主发现面:所有当前 active runtime articles 必须进入 .home-feed-grid,作为和原首页一致的 .home-feed-card 小卡片,而不是只取前几篇、只生成详情页或只放到 /posts/。
  • 首页 runtime 抽屉只读取 metadata index 建立入口,打开阅读器后按 /runtime/articles/*.json 读取 article.html;浏览器端简易 Markdown renderer 不是 authority,不能重新引入为第二套正文渲染系统。
  • /posts/[slug]/ 是唯一公开文章详情路由;它由 Runtime MarkdownObject metadata 生成,并按 detailPath 读取单篇正文 payload。
  • /posts/ 页面只展示 Runtime MarkdownObject。
  • Runtime 文章页的 metadata 采用 Editorial Metadata Line:日期 / 阅读时间 / 分类 / 标签以小字宽字距文本呈现,不使用 badge、chip 或按钮式标签。
  • Normalize Layer 必须处理 frontmatter、slug、draft、Obsidian 双链、附件路径、标签归一化和公开资源迁移。
  • 文件夹路径生成 folderTags 与 collectionId;frontmatter tags 生成 explicitTags;finalTags 是两者去重合并。
  • README 是项目合同真源;architectureCodex.ts 记录这套分层为什么存在以及后续维护边界。
Tradeoff

取舍

  • 多一层 Publish Pipeline 会比直接同步慢一步,但换来公开边界、构建稳定性和隐私隔离。
  • 把 Vault 同步交给 Syncthing / Obsidian Sync 会减少自研成本,但 MyBlog 需要清楚区分“文件已同步”和“内容已发布”。
  • Runtime Index 能让 Obsidian 同步内容更快进入 Feed,但必须继续过滤 draft/private/embed,避免把整个 Vault 裸露为公开站点。
  • 移除 Astro posts 公开入口会让新增文章 slug 需要下一次 Astro build 才产生静态页面,但换来唯一公开文章路由。
  • TinaCMS 更适合现代可视化编辑,Decap CMS 更轻;P1 必须二选一,不能同时接入。
  • Quartz / Flowershow 作为 substrate 比继续自研 Markdown/Graph 基础更稳,但本轮只吸收 Markdown rendering system,不整体替换前端、首页、Reader、OpenList 或视觉系统。
Future Direction

后续方向

  • Syncthing / Linux Vault 文件真源层已完成首轮实跑验收;下一步不是启动 AppFlowy、Immich、Directus 或 Meilisearch,而是固化 MarkdownObject schema 与 Quartz Runtime Layer。
  • 固化 MarkdownObject schema:id、slug、sourcePath、visibility、relations、attachments、html、toc、projection 必须有稳定校验。
  • 建立 content-vault Git mirror 时必须以 E:\Vaults\Obsidian 或 /home/vault/Obsidian 热镜像为源,不能从 retired legacy /夸克网盘/obsidian 回流。
  • 优先评估 TinaCMS 管理 content-vault 的 Markdown / MDX / JSON;Decap CMS 作为低成本备选。
  • 做 Markdown、backlink、graph 或 digital garden search 升级前,先评估 Quartz / Flowershow 能否作为底座或 transform provider。
  • 把 Runtime Content Index 接入 RSS、Pagefind、Knowledge Index 和 Graph 的统一对象读取层。
  • 让 features.json 成为文章、Store Runtime、Command Runtime、Graph Runtime 后续接入前的显式开关和 authority registry。
  • 增加内容发布校验:私有附件引用、未迁移 embed、敏感路径和重复 slug 直接阻断 runtime projection。
  • 让 Publish Pipeline 产出 Knowledge Object manifest,供 Graph、Search、Timeline 复用。
  • 把 folderTags 映射为 Collection / Topic,让 history/korea 这类路径自动生成稳定知识合集。