diff --git a/.project-docs/20-architecture/system-overview.md b/.project-docs/20-architecture/system-overview.md index 63e5e82..f0f5500 100644 --- a/.project-docs/20-architecture/system-overview.md +++ b/.project-docs/20-architecture/system-overview.md @@ -26,7 +26,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 | Official Hosted Plugins | Acquired code-owned bundled Game Resource package → effective parent snapshot → code-owned Main adapter → fixed Works Square hosted route | 无设备下载、更新、Beta 或签名步骤;Renderer/Package/Pi 不持有 Provider key、model 或 URL。每次计费操作要求显式确认,child 不继承 hosted tool。历史 Hosted Web Search 不再进入当前客户端。 | | Device Packages | Conversation install tools → Main-owned inspect/preview/confirm/commit → immutable local generation → parent Skill/Pi-extension resources | 支持 npm、Git、绝对本地 Plugin 目录与 loose `SKILL.md`;没有可见安装入口、Account Library、Release、Admission 或 Marketplace Package Store。可执行 extension 拥有桌面用户权限且生命周期脚本禁用。每个 generation 包含所有显式安装且当前启用的 Skill/extension;新/idle parent 自动刷新,active parent 在 turn settled 后刷新,child 始终为空。 | | AI Design Workspace & Living Form | 一个 Workspace 的当前 Direction、Current Specification、持久 Agent Session、conversation timeline、Tasks 与 Assets | 自然对话是主创作面;Living Form 仅以“AI 已理解”的紧凑辅助摘要与可选手动调整投影服务端 Current Specification,Renderer 只持有草稿和已接受投影 | -| AI Design Input & Reconciliation | Chat、字段/集合编辑、decision、proposal、lock、Asset binding 与 restore | 全部进入同一 `design.input.apply` reducer;稳定 command/operation ID 支持 unknown-result 重放,revision conflict 刷新权威状态 | +| AI Design Input & Reconciliation | Chat、字段/集合编辑、decision、proposal、lock、Asset binding 与 restore | 全部进入同一 `design.input.apply` reducer;稳定 command/operation ID 支持 unknown-result 重放,revision conflict 刷新权威状态;待提交 chat 从同一 pending operation 临时投影,raw assistant delta 保持内部且不生成对话区进度栏 | | AI Design Gateway Routing | Main-owned Works Square V2 adapter 与 Direction event stream | Main 持有 Works Token、stream ticket、WebSocket、重试分类和错误脱敏;事件顺序与 Task progress 不构成 Specification 真值 | | AI Design Quote & Task Controls | 精确 Specification revision 编译出的不可变 Quote 与 Workspace Tasks | 客户端只展示 public output summary、warnings、expiry 与 Token Points,并以 Quote ID 确认;Provider Prompt/model/route/storage/billing atoms 不下发 | | AI Design Assets | Workspace 已完成作品或本地上传的真实 Asset | Asset 通过 typed binding 写入 Specification;生成结果经 Main-owned asset download 保存 | @@ -88,6 +88,8 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 - Main 通过 `design.input.apply`、`design.quote.request` 和 `design.generation.confirm` 访问 V2。unknown transport result 必须复用原 command/operation identity;结构化业务错误不得重放,未知上游文本不得穿透安全投影。 - Main-owned Canvas Workspace JSON 请求和 shared Works token refresh 的完整生命周期最多 30 秒,超时 abort transport 并以固定 `504 DESIGN_WORKSPACE_REQUEST_TIMEOUT` 结束 Renderer 等待。Electron `net.fetch` 失败后的 Node fetch 透明回退只允许 `GET`、`HEAD`、`OPTIONS`;PATCH/POST 等 mutation 只允许由持有显式幂等身份的上层协议决定重试,不能由底层 transport 隐式重放。该边界不改变上面的 WebSocket→REST 幂等 fallback。 - Renderer 的异步与流式结果必须核对 Workspace、Direction、revision 和 operation identity;Direction snapshot 是 Specification 真值,Task/Asset 事件只更新 Workspace resource projection。 +- 待提交 chat 可以从现有 pending operation 立即投影为明确标注“发送中/正在确认”的用户气泡,但只有服务端 canonical turn 能进入对话历史;确定失败必须恢复原草稿,不能另建一套消息状态或新业务意图。 +- `design.assistant.delta` 是未完成的内部传输状态,不是助手回复。Renderer 不得显示原始片段,也不得在对话区为它创建独立整理进度栏;右侧 Current Specification 投影继续呈现 AI 当前理解。重叠连接与重放 chunk 必须按连接 generation 和 `chunkIndex` 收敛。 - 确认生成只提交不可变 Quote ID。Task 事务已提交但事件迟到时可刷新 Workspace projection;Task progress 不得改写 Living Form 或授权新的生成操作。 - Updater feed 选择、原始错误日志、下载和安装生命周期只属于 Electron Main。Renderer 不得把缺失稳定 manifest 投影为“已是最新版”,也不得显示原始堆栈、URL、路径或错误码;并发检查共享同一错误事件时只发送一次错误状态,后续独立重试仍可重新报告。 - 图片与视频复用同一个单图来源选择器。图片 Brief 可从当前 Workspace 的已完成作品或本地上传中选择一张参考图继续生成;视频 Brief 使用同一入口绑定首帧。两条路径都必须通过现有 Workspace Asset 上传/选择契约提交一个真实 `attachmentAssetIds`,不得用本地路径或自然语言描述代替资产身份。 diff --git a/.project-docs/30-worklog/current-state.md b/.project-docs/30-worklog/current-state.md index e1a1872..9aaec3a 100644 --- a/.project-docs/30-worklog/current-state.md +++ b/.project-docs/30-worklog/current-state.md @@ -4,6 +4,25 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Integrated Through +- AI Design conversation-feedback sources + `403236115bf81e7617856cd8219b1be23f6abbb8` from task + `20260904-design-summary-separation-9c4e7a21` and + `3bda17aa3c1d034ddb3feaa08e516398e91cba0a` from task + `20260904-remove-design-progress-4e8a1c73` are integrated onto local `main` and + canonically reconciled by task `20260904-finalize-design-feedback-7c4e2a91`. A + submitted chat appears immediately as a provisional user bubble from its existing + pending operation, shows `发送中` or `正在确认`, restores the retained draft after + definitive failure, and is replaced by the canonical Workspace turn without a + second message store. Raw `design.assistant.delta` text remains internal transport + state: it is neither a finished reply nor a visible progress banner. The right-side + “AI 听懂的想法” remains the single organized-understanding projection, while + connection generation fencing and `chunkIndex` deduplication still converge repeated + streams. Current Specification, immutable Quote confirmation, server/Main contracts, + plugins, packaging, deployment, publication, and paid Provider behavior are + unchanged. Source verification passed focused/adjacent tests, typecheck, scoped + lint, production build, and both existing AI Design Electron checks individually; + the banner-removal follow-up passed its focused 10-test file, typecheck, and scoped + lint. - Conversation-first AI Design client source `fe50e4ba198649a07c5c9443f15edf7dfa2a47e6` from task `20260903-design-guided-conversation-client-8b4e1c72` is integrated onto local @@ -551,6 +570,8 @@ This file is the integrated default-branch snapshot. Feature tasks record progre AI Design Canvas 现在默认以对话和一张持续可见的“我的创作”卡服务 8-16 岁创作者;专业字段矩阵收进按需打开的“精细调整”,移动端保持对话优先并只挂载一个卡片/底部面板。Creation Card、精细调整、Quote、Task 与结果提示都只投影权威状态,已知问题按 code 转成通俗中文,未知服务端或 Provider 文本不会直接显示。一个 Workspace 仍只公开一个 current Direction、一个 persistent Agent Session 和一个 Current Specification;conversation timeline 只记录交互历史。Chat、direct edits、decision responses、proposal acceptance、locks、Asset binding 与 restore 都通过 `design.input.apply` 进入同一服务端 reducer,Renderer drafts 在 accepted 前保持本地。Main 持有 Works Token、stream ticket、WebSocket、request deadline、stable command/operation IDs 与错误脱敏;unknown result 只能复用原 identity,结构化业务错误不得重放。Generation 由服务端对 exact Specification revision 编译 immutable Quote,客户端只展示 public output plan、warnings、expiry 与 Token Points,并以 Quote ID 调用 `design.generation.confirm`;Provider Prompt、model、route、storage 和 billing atoms 不进入 Renderer。Task/Asset events 独立收敛 Workspace resources,不改写 Living Form。Development 与 packaged builds 均使用 Works Square V2,V1 DTO、local semantic adapter、mutable Quote PATCH 与 editable provider Prompt 已移除。 +新提交的 Design chat 会立即从现有 pending operation 投影为带“发送中”或“正在确认”的临时用户气泡,服务端确认的 canonical turn 到达后再替换它;确定失败时原草稿重新出现在输入框。`design.assistant.delta` 只作为内部传输与收敛状态,不显示原始片段,也不在对话区生成独立整理进度栏;右侧 Current Specification 摘要继续承担“AI 当前听懂的内容”。重复连接和事件按 connection generation 与 `chunkIndex` 收敛。 + Canvas 侧栏提供“获取灵感”进入 Prompt Museum。列表、筛选、分页、详情、作者/来源/许可证和图片地址全部由服务端经 Main-owned Host API 提供,客户端不打包静态数据集;服务端相对媒体只允许固定 `/api/image-prompt-museum/{entry}/media/{thumbnail|number}` 形状,并由 Main 注入 Works Bearer、执行一次 401 刷新、可信 raster MIME 与 10 MiB 上限后转为 Renderer data URL;credential-free HTTPS CDN 图片保持直连。图片失败只显示卡片内占位,不阻断卡片或详情;缺少来源 URL 时显示纯文本。“使用此 Prompt”只把原文带回当前 Canvas 输入框,不自动发送。该模块不是投稿、点赞、评论或排行榜社区。客户端契约已就绪,但不据此宣称 Works Square 内容后台和生产数据已经部署。`pnpm run dev` 现在默认使用云端 Canvas 适配器,本地适配器只能通过显式开发命令启用;产品 UI 只保留中文。 密码登录提供可选“记住密码”。该记录与七天登录会话分离,只在正式安装包且系统安全存储可用时由 Electron Main 加密落盘;Renderer 仅在登录页内存中接收回填,不写 Zustand/localStorage,Works Square 也不持久化桌面密码。退出登录和短信登录不删除记录,成功的未勾选密码登录会清除旧记录。未打包开发版禁用该选项,避免未签名 Electron 调试进程触发 macOS 钥匙串。 diff --git a/.project-docs/30-worklog/tasks/20260904-finalize-design-feedback-7c4e2a91.md b/.project-docs/30-worklog/tasks/20260904-finalize-design-feedback-7c4e2a91.md new file mode 100644 index 0000000..60890ce --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260904-finalize-design-feedback-7c4e2a91.md @@ -0,0 +1,89 @@ +# Task: Finalize AI Design conversation feedback integration + +## Identity + +- Task ID: 20260904-finalize-design-feedback-7c4e2a91 +- Mode: Integration +- Branch: main +- Worktree: D:\Datas\OthersProjects\makelore +- Base commit: 3bda17aa3c1d034ddb3feaa08e516398e91cba0a +- Owner: codex-root +- Status: Ready for Integration + +## Scope + +- Reconcile the already integrated AI Design conversation-feedback sources + `403236115bf81e7617856cd8219b1be23f6abbb8` and + `3bda17aa3c1d034ddb3feaa08e516398e91cba0a` into canonical current state, + architecture, and business rules. +- Record the final behavior: submitted user messages appear immediately with honest + pending status, raw assistant deltas remain internal, and the main conversation has + no assistant-progress banner because the right-side Current Specification projection + owns the organized understanding. +- Preserve the three adopted foreign untracked task records byte-for-byte. Do not add, + edit, move, stash, reset, clean, or commit them. +- Do not change product code, Works Square server, Electron Main/API contracts, + generation, billing, plugins, navigation, packaging, publication, remote history, or + paid Provider behavior. + +## Intent And Constraints + +- The user explicitly authorized recovery of the prior integration lock and made the + final presentation decision that the central progress banner is redundant and must + be removed rather than restyled. +- Client `main` already contains both source records and product changes at exact base + `3bda17aa3c1d034ddb3feaa08e516398e91cba0a`; this task performs canonical integration + only, so the document drift boundary does not need to cross another task's record. +- ADR-007 remains accepted. Current Specification is still server authority, its + right-side projection remains auxiliary UI, provisional user messages remain pending + projections, and only canonical turns enter conversation history. +- The newer source narrows the older optional progress presentation: raw assistant + deltas stay internal and invisible. The user's explicit instruction resolves that + semantic conflict. +- Concurrent Task Gate and Integration Planning Gate passed. Relevant source tasks are + Ready for Integration; other active work remains isolated and does not alter this + exact final behavior. + +## Outcome + +- Canonically recorded both integrated conversation-feedback sources on client `main` + at product frontier `3bda17aa3c1d034ddb3feaa08e516398e91cba0a`. +- The main conversation no longer renders raw assistant delta text or an independent + “AI 正在整理你的想法” progress banner. The right-side Current Specification summary + is the single organized-understanding surface. +- Immediate provisional user bubbles, `发送中` / `正在确认`, canonical turn replacement, + draft recovery, connection-generation fencing, and `chunkIndex` deduplication remain + intact. +- Updated canonical current state, system architecture, and business rules without + changing ADR-007, product code, server/Main contracts, immutable Quotes, navigation, + plugins, packaging, billing, or remote history. +- The earlier root lock and one transient wrong-base integration lock were recovered + under the user's explicit authorization. Each uncommitted document edit was restored + before release; the three adopted foreign files remained unchanged throughout. + +## Verification + +- Product source commit `3bda17a` has exact parent + `403236115bf81e7617856cd8219b1be23f6abbb8`; its changed paths are limited to the + source task record, `DesignConversationPane`, and its focused test. +- Root focused Renderer test passed: `pnpm exec vitest run + tests/unit/image-canvas-page.test.tsx` → `1 file / 10 tests`. +- Root TypeScript `pnpm exec tsc --noEmit` passed. +- Root scoped ESLint for the changed component and test passed. +- Root product paths matched source `3bda17a` exactly and `git diff --check` passed + before canonical documentation. +- The earlier conversation-feedback source retains its adjacent 51-test, + production-build, and individual Electron evidence; this final integration did not + repeat those broader checks for a presentation-only removal. + +## Follow-ups + +- Build and publish a new Makelore client version before expecting installed users to + receive this UI change. Packaging, deployment, publication, and remote push are not + part of this integration. + +## Promotion Candidates + +- Applied the two source promotion candidates to `current-state.md`, + `system-overview.md`, and `business-rules.md` using the user's final presentation + decision. No unresolved promotion candidate remains. diff --git a/.project-docs/40-domain/business-rules.md b/.project-docs/40-domain/business-rules.md index c6f3541..485e381 100644 --- a/.project-docs/40-domain/business-rules.md +++ b/.project-docs/40-domain/business-rules.md @@ -99,6 +99,8 @@ - AI Design 必须以自然对话帮助用户描述清楚需求:先提取和复述已明确内容,每次最多推进一个真正影响作品的问题。客户端 Current Specification 投影是辅助摘要和可选手动调整,不得把内部字段、缺项或普通 Decision Prompt 变成用户必须逐项填写的表单。 - 每个 mutation 使用稳定 command 与 semantic operation identity。transport-unknown 只能重放原命令;business rejection、timeout 或用户再次点击不能自动生成新的业务意图。 - Direction projection 是 Specification 真值。event cursor、assistant delta、Task progress 与 Asset event 只用于传输/资源收敛,不得推进或覆盖 canonical specification revision。 +- 用户提交 chat 后,客户端可以立即把同一个 pending operation 投影为临时用户气泡,并明确显示“发送中”或“正在确认”;只有服务端返回的 canonical turn 才进入 conversation timeline。确定失败时必须让原草稿重新可编辑,不得把临时投影持久化为第二条消息。 +- `design.assistant.delta` 只用于内部传输和结果收敛;原始片段不得作为完成的助手回复展示,对话区也不得为其增加独立的整理进度栏。AI 当前整理出的设计理解由右侧 Current Specification 投影承载;连接重叠或事件重放按 connection generation 与 `chunkIndex` 去重收敛。 - Main 只向 Renderer 投影已知错误码的固定中文提示,未知上游错误文本必须脱敏为通用提示;Works Token、stream ticket、provider internals 留在 Main/服务端。 - AI 绘画 Workspace JSON 请求与 shared Works token refresh 必须覆盖取凭据、发请求和读取响应 body 的完整 30 秒 deadline;即使底层 transport 忽略 abort,调用方也必须确定性结束为 `504 DESIGN_WORKSPACE_REQUEST_TIMEOUT` 并释放共同等待者。Electron-to-Node 透明 fallback 仅允许 `GET`/`HEAD`/`OPTIONS`;mutation 不得因 transport failure 被隐式重放,任何重试必须由上层显式幂等合同授权。 - `design.quote.request` 必须绑定 exact current Specification revision 并返回 immutable Quote;任何 production-meaning edit 都需要新 revision 与新 Quote。