Skip to content

refactor(thread-chat): 按 Issue 34 重建 Conversation 领域模型 - #41

Draft
hifizz wants to merge 32 commits into
p0-resume-messagesfrom
codex/issue-34-thread-chat-domain-model
Draft

refactor(thread-chat): 按 Issue 34 重建 Conversation 领域模型#41
hifizz wants to merge 32 commits into
p0-resume-messagesfrom
codex/issue-34-thread-chat-domain-model

Conversation

@hifizz

@hifizz hifizz commented Aug 21, 2026

Copy link
Copy Markdown
Owner

目标

基于 #34 的 ADR,将旧 ThreadTree JSON 权威模型迁移为 Project → Conversation → Thread 的规范实体模型,并让前端、API、Generation、Artifact/研究与计费只访问 canonical repositories。

完成的迁移链

  • define-conversation-domain-model
  • normalize-conversation-persistence
  • migrate-generation-lifecycle
  • add-conversation-command-api
  • normalize-conversation-client-state
  • retire-thread-tree-authority
  • 六个 OpenSpec changes 按依赖顺序归档,主 specs 已同步

本地数据处置

  • 在任何 reset/drop 前创建完整本地 custom dump
  • pg_restore 到隔离临时库并验证 28 张表源/恢复指纹一致
  • dump SHA-256:5278aafc7f9d4bf01607133c09dfff7a9846f9543a68d7ee482097337f2cf078
  • 恢复验证 ID:local-restore-f6e6289ecb5b
  • 19 棵 legacy Tree 被确认为本地测试数据,按 approved reset 删除,未导入
  • 备份与验证文件继续保留在本地 .local-backups/,不进入 Git
  • usage_recordsexternal_usage_records 历史账本保留

运行时与数据库

  • 删除旧 branch-tree routes、repositories、Tree store/persist/reconcile 和重复领域模型
  • /thread-chat/[conversationId]、canonical bootstrap、稳定实体 ID 与 normalized client 生效
  • /api/chat 保留 linear chat;旧 ThreadTree payload 明确返回 410
  • canonical Generation 支持文本、Stop/恢复、Markdown Artifact 与联网研究
  • 0014_reflective_diamondback.sql 显式删除四张 legacy/cutover 表,没有 CASCADE
  • 172 个运行时文件扫描,旧 authority 引用 0
  • Drizzle 当前 23 张表,db:generate 报告 No schema changes

验收

  • OpenSpec strict:30/30
  • typecheck、lint(0 error)、Webpack production build:通过
  • domain 8/8;Generation unit 7/7;client 14/14;authority/recovery 12/12;command contract 5/5;canonical E2E 30/30
  • PostgreSQL persistence / Generation / command API:26 / 52 / 69 项断言
  • 真实 HTTP + 邮箱认证 + 本地 PostgreSQL + glm-5.3 + Artifact/feedback/delete:38 项断言
  • Ego Browser:A → B → C、真实 GLM 5.3、Artifact 抽屉、联网研究与来源、刷新恢复:通过
  • drain:active Generation、pending billing、pending outbox 全部为 0
  • 健康审计:legacy 表不存在、runtime reference 0、token mismatch 0
  • 首个 canonical 写入后的恢复计划只允许 canonical → canonical 前滚,拒绝恢复 legacy 权威

详细证据:docs/architecture/issue-34-local-cutover-final-verification-2026-08-24.md

合并状态

PR 继续保持 Draft,等待 GitHub/Vercel CI 全部完成以及最终人工 review。该 PR 的 base 仍为 p0-resume-messages;合并后再由 PR #30 将整个 P0 分支合入 main

Closes #34

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
thread-chatbot Ready Ready Preview Aug 24, 2026 6:45am

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 21, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt

cr-gpt Bot commented Aug 23, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

hifizz added 2 commits August 24, 2026 13:53
React 19.2 warns because next-themes 0.4.6 renders its bootstrap script again on the client, where React-created script elements do not execute.\n\nPatch both CJS and ESM builds so ThemeScript remains in SSR output but returns null on the client. This follows upstream pacocoursey/next-themes#386 while pacocoursey/next-themes#385 remains open and no fixed release is available.\n\nRemove the patch after upgrading to an upstream release that contains the fix.
@cr-gpt

cr-gpt Bot commented Aug 24, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

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