记录图生图与更新器集成状态

This commit is contained in:
2026-08-13 15:48:02 +08:00
parent e22137469c
commit 5ae9ef7d73
10 changed files with 65 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
| 真机预览 | 项目空间 | Main → Owner preview / `play_url` | 核对 app、version、release 和同源 HTTPS`runtime_url` 仅一版本兼容回退 |
| AI 编程首次发送 | ChatPanel 当前 Agent | Renderer Store → Host API → Main → OpenCode session / prompt | 新建 session 已知为空时直接提交 prompt不在关键路径等待空历史历史未知或普通历史会话仍按默认路径加载消息 |
| AI 编程模型代理错误 | OpenCode provider 请求 | Main Host AI proxy → Works 模型上游 | 配额耗尽保持独立终止态;只有明确的分组上游饱和才投影为 OpenCode 终止状态,通用限速仍保留 `429` |
| 客户端更新检查 | 设置页 | Renderer update store → IPC → Main AppUpdater → 目标 feed | Main 记录并重抛原始错误Renderer 只显示去重、脱敏的单条提示,稳定源缺包不伪装为最新版 |
| 设计会话创建/切换 | AI 绘画页面或侧栏 | Renderer API → Main → Workspace Conversation API | 新会话属于现有 Workspace读取独立消息、Brief、Quote 和 `turnRevision` |
| 设计消息与确认 | 当前 Conversation | Main → 持久 Agent Gateway Session → Conversation 快照 | 请求和流式结果同时绑定 Workspace + Conversation |
| 设计单图来源选择 | 当前 Workspace 已完成图片 / 本地图片 | 现有 Asset 上传或选择 → `attachmentAssetIds` → 当前 Conversation Turn | 图片 Brief 用作图生图参考图;视频 Brief 用作首帧;只提交一个真实 Workspace Asset ID |
@@ -32,12 +33,14 @@
- 注销和退出会关闭本地事件流并清除本机 Conversation Session-id 缓存;服务端持久 Session 保留,下一次访问从 Conversation API 重新读取。
- AI 编程 Store 的 `sessionMessagesBySessionId` own-key 是加载状态契约:键缺失表示历史未知,存在且值为 `[]` 表示已知为空。只有后者可使用不读取历史的快速选择;普通历史会话选择继续刷新消息。
- Main Host AI proxy 可为固定 OpenCode 重试契约做窄化的内部状态投影:配额耗尽投影为 `402`,明确上游分组饱和的 `429` 投影为终止 `400`,其他 `429` 原样保留;升级 OpenCode 时必须重新验证该契约。
- Main AppUpdater 持有 feed、原始异常、下载和安装状态设置页只消费状态投影。一次 electron-updater `error` 事件覆盖的并发检查不会在 Renderer 重复发错,但独立的后续检查仍有自己的报告生命周期。
## External Interfaces
- Works Square 项目创建、版本上传、构建状态、Owner 状态与 Release preview API。
- 本机 Host API 的发布与真机预览路由;发布路由要求 Renderer capability。
- 本机 Host API 的 OpenCode session、history 与 prompt 路由,以及 Main-owned AI 模型代理。
- Main-owned electron-updater IPC 与 Works Square 平台/架构稳定 feed正式安装产物发布不由 Renderer 控制。
- 服务端安全投影后的公共 `play_url`;只接受同源 HTTPS、精确 App 路径和可信版本状态。
- Works Square Workspace/Conversation API、每个 Conversation 的 Agent Gateway Session 与单次 WebSocket ticket。

View File

@@ -20,6 +20,8 @@
| `src/stores/opencode.ts` | OpenCode runtime、session、消息缓存与提交状态 | `sessionMessagesBySessionId` 键缺失表示未知,存在空数组表示已知为空;普通选择默认刷新历史 |
| `electron/api/routes/ai-proxy.ts` | Main-owned 模型代理、凭据边界与上游响应投影 | 仅对明确上游分组饱和做终止态兼容投影,通用限速保持 `429` |
| `shared/opencode-error-details.ts` | OpenCode 上游饱和错误的窄化共享分类 | 不以通用 `rate_limit_exceeded` 单独判定饱和 |
| `electron/main/updater.ts` | 目标 feed 解析、electron-updater 生命周期与原始诊断 | 缺少稳定 manifest 保持错误;事件/Promise 重复失败按检查实例去重 |
| `src/components/settings/UpdateSettings.tsx` | 更新状态、重试与用户可读错误展示 | 只显示一条简洁中文提示;技术诊断统一回退到本地化通用文案 |
| `shared/image-workspace.ts` | AI 绘画 Workspace、Conversation、Task、Asset 与事件共享契约 | Conversation 状态与 Workspace 任务归属必须分离 |
| `electron/api/routes/image-workspace.ts` | AI 绘画 Host API 与本地事件流投影 | Renderer 只通过该路由访问 Main-owned workspace adapter |
| `electron/image-workspace/works-square-workspace.ts` | Works Square 多 Conversation 云端适配器与 Gateway 事件映射 | 使用服务端持久 Session本地清理不 DELETE 远端 Session |
@@ -43,6 +45,7 @@
- `works-cloud-deploy.json` 是兼容文件名;不得因名称重新引入自动部署协调语义。
- `runtime_url` 是一个客户端版本的迁移回退;删除前必须确认服务端和存量数据稳定提供 `play_url`
- `ai-proxy.ts` 的上游饱和状态投影依赖当前固定 OpenCode 的重试语义和窄化错误文案;升级 runtime 或调整上游错误格式时必须复核,不能把所有 `429` 统一终止。
- `electron/main/updater.ts` 的稳定源错误归一化必须保持窄化:只识别 Works Square 对应 manifest 的 404不得吞掉其他 feed/网络/签名错误Renderer 的脱敏边界不能取代 Main 原始日志。
- 多 Conversation 事件处理必须区分对话快照与 Workspace 任务更新;不得用任务时间戳推进 Conversation 流水位,也不得让旧会话的迟到流覆盖当前会话。
- `closeEventSessions` 只负责本地流和缓存生命周期;远端 Conversation Session 是服务端持久资源。
- 单图来源选择器当前仍由精确中文 quick reply 触发,并以 Brief medium 判断图生图或视频首帧用途;扩展更多输入用途前应先把消息协议升级为结构化 action/purpose避免展示文案与行为继续耦合。

View File

@@ -17,6 +17,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展
| Play URL Projection | 校验服务端公共播放地址 | 只接受同源 HTTPS 和精确 `/apps/{app_id}/`;优先 `play_url``runtime_url` 仅一版本回退 |
| Device Preview | 核对本地绑定、远端版本和 Release | 待审使用短时 Owner preview已发布使用安全投影后的 `play_url` |
| Built Artifact Preflight | 在上传前对最终 built snapshot 做桌面/移动 UX fail-fast | Main 使用临时 loopback origin 与 Electron WebContents/CDP不使用 Playwright、不生成可信证明 |
| App Updater | Main 选择平台/架构 feed、驱动 electron-updater 并记录原始诊断 | Renderer 只接收状态和脱敏后的单条用户提示;稳定源缺包保持错误 |
| AI Design Workspace | 保存项目身份、Conversation 列表、生成任务和资产 | 任务和资产在切换 Conversation 后继续可见 |
| AI Design Conversation | 保存消息、Brief、Quote、`turnRevision` 与服务端 Agent Session 绑定 | 同一 Workspace 内互相隔离Session 由服务端持久化 |
| AI Design Image Source Picker | 当前 Workspace 已完成图片或本地上传 | 图片 Brief 绑定图生图参考图;视频 Brief 绑定首帧;提交一个真实 Asset ID |
@@ -38,6 +39,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展
- AI 绘画中,一个 Workspace 可包含多条 Conversation消息、Brief、Quote 和 `turnRevision` 属于 Conversation生成任务和资产属于 Workspace。新建 Conversation 不得隐式创建新 Workspace。
- 每条 Conversation 复用服务端持久 Agent Gateway Session。客户端不得在注销或退出时 DELETE 该 Session只关闭本地事件流并清除本机 Session-id 缓存,重新访问时从 Conversation API 刷新。
- Renderer 的异步与流式状态必须同时校验 Workspace + Conversation 身份;项目任务事件只按 Workspace 归并,避免切换会话时丢失任务或接收迟到消息。
- Updater feed 选择、原始错误日志、下载和安装生命周期只属于 Electron Main。Renderer 不得把缺失稳定 manifest 投影为“已是最新版”也不得显示原始堆栈、URL、路径或错误码并发检查共享同一错误事件时只发送一次错误状态后续独立重试仍可重新报告。
- 图片与视频复用同一个单图来源选择器。图片 Brief 可从当前 Workspace 的已完成作品或本地上传中选择一张参考图继续生成;视频 Brief 使用同一入口绑定首帧。两条路径都必须通过现有 Workspace Asset 上传/选择契约提交一个真实 `attachmentAssetIds`,不得用本地路径或自然语言描述代替资产身份。
- 当前兼容协议仍通过精确 quick reply `从作品列表选择图片` 打开选择器,并由当前 Brief medium 区分用途;仅 `medium === image` 使用图生图语义,`video`、null 或缺失 medium 保持视频首帧语义。该展示文案耦合不得扩散到更多用途,后续应升级为结构化 action/purpose。

View File

@@ -14,6 +14,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
- `5b44864`Main-owned 本地 npm/Vite 构建、同字节 Electron 双视口预检、source+built 双归档与 artifact contract 上传。
- `08da976` / `0ee5254`AI 编程首次发送已知空 session 快速路径与明确上游饱和终止态投影。
- `809364e` / `88281b8` / `7a807a2`AI 绘画单参考图图生图选择/上传交互、最新客户端主线集成及旧版 Brief medium 缺失兼容。
- `f05b9d4` / `e221374`Updater 稳定源缺包诊断与用户错误脱敏修复,以及当前 `main` 上的图生图最终合并提交。
## Current Focus
@@ -23,6 +24,8 @@ AI 绘画的一个 Workspace 可包含多条 Conversation。消息、Brief、Quo
AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗余历史读取prompt 可直接进入 Host API普通历史会话仍刷新消息。Main AI proxy 只把明确的上游分组饱和投影为当前 OpenCode 的终止状态,配额耗尽保持独立终止态,通用限速继续保留 `429`
Updater 仍由 Electron Main 选择目标 feed、记录原始诊断并保持失败语义。正式稳定源缺少对应平台 manifest 时设置页只显示一条简洁中文提示并允许重试不把缺包误报为已是最新版也不向普通界面暴露堆栈、URL、路径或错误码签名产物发布和真实升级安装仍属于外部 Release Gate。
## Recently Completed
- 2026-08-08合并登录续期、一键发布和真机预览发布成功后保存精确 app/version/review 映射Renderer 不接触 Token、ZIP 或本地路径。
@@ -34,6 +37,7 @@ AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗
- 2026-08-12发布架构反转为 Main-owned 本地构建;固定 npm 11.6.2 按项目 lockfile 安装并执行项目 ViteElectron 预检最终上传同字节产物,再上传 source+built 双归档和严格 contract。服务端仅校验并固化不可信字节不再承担项目 Vite 构建。
- 2026-08-12AI 编程新 session 的首条 prompt 不再被已知空历史读取阻塞;明确上游分组饱和会快速终止,通用 `429` 仍保持原有限速语义。
- 2026-08-13AI 绘画把原视频首帧选择器泛化为单图来源选择器;图片 Brief 可选择项目作品或上传本地图作为图生图参考图,视频及未决 medium 保持历史首帧行为,成功提交后关闭弹窗。
- 2026-08-13Updater 对 Works Square 稳定源缺少 Windows/macOS manifest 保持错误状态,在 Main 日志保留原始诊断,并在设置页去重、脱敏为可操作的中文提示;未发布任何新安装包。
## In Progress
@@ -65,6 +69,7 @@ AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗
- 客户端对最终构建字节的 loopback 检查没有可信 receipt且不复刻生产 opaque-origin服务端必须独立重算 source/built/contract、校验不可变 Release人工审核仍不可绕过。如未来需要不可绕过的 runtime gate必须引入可信 verifier 并绑定精确构建产物。
- AI proxy 的明确饱和 `429 → 400` 是与当前 OpenCode 重试契约匹配的内部投影;升级 OpenCode 或上游饱和错误文案变化时必须复核。不得把通用 `429` 或仅含 `rate_limit_exceeded` 的响应误分类为终止饱和。
- AI 绘画单图选择器仍精确匹配 quick reply `从作品列表选择图片`,用途再从当前 Brief medium 推断;本地化或协议文案变化可能破坏入口。扩展更多素材输入前应升级为结构化 action/purpose。
- Updater 源码错误提示不能代替发布正式签名产物;稳定 feed 缺 manifest 必须保持失败Renderer 不得展示原始堆栈、URL、路径或错误码。升级链只有在旧版本完成发现、下载、重启和安装 smoke 后才可视为生产就绪。
## Last Updated

View File

@@ -11,6 +11,7 @@
| 2026-08-10 | 客户端静态发布链路收敛 | 唯一一键静态提交、旧 Compose 协调链退役、submission binding v2 与 `play_url` 安全边界 | current-state、architecture、domain、evidence、commitments |
| 2026-08-12 | Makelore 内置浏览器发布前预检 | Electron WebContents/CDP loopback UX fail-fast服务端受控构建与审核仍为唯一可信门禁 | current-state、architecture、domain、evidence、commitments |
| 2026-08-12 | Makelore 本地构建静态 Release | 固定 npm + 项目 lockfile Vite、本地同字节双视口预检、source+built+contract 双归档协议 | current-state、architecture、domain、evidence、commitments、skills |
| 2026-08-13 | 图生图与 Updater 主线集成 | 单参考图 Asset 链路、旧 Brief medium 兼容,以及稳定更新源缺包诊断/错误脱敏 | README、current-state、architecture、domain、evidence、commitments |
## Notes

View File

@@ -109,16 +109,58 @@ Gate result:
## Outcome
- Not completed.
- Completed and released the Updater feature task after two independent-review
findings were corrected. Commit `f05b9d4` preserves raw Main diagnostics and
failure semantics, de-duplicates concurrent shared errors per check, and
presents only one concise localized Renderer message.
- Created merge commit `e221374` with current `main` commit `3e90129` as first
parent and reviewed image-to-image tip `f11eb49` as second parent. The merge
was conflict-free and preserves the complete history of both lines.
- Kept source integration record
`20260813-integrate-i2i-client-main-5d9e.md` on the source branch only. It was
not modified or copied into the destination tree; this task record contains
the current integration notes.
- `main` now contains the generalized single-image picker, current-Workspace
Asset selection/upload, image-reference versus video-first-frame behavior,
and strict cloud adapter handling for omitted/null/valid/invalid Brief media.
- Promoted the already verified Updater behavior, evidence, release obligation,
and current product description into README and canonical project memory,
without claiming that a signed artifact or live update path was published.
## Verification
- Not run.
- Merge topology: `e221374` parents are `3e90129` then `f11eb49`; `main` is the
first parent and the requested source branch is the second parent.
- Combined focused unit suites: 6 files / 84 tests passed, covering Updater
Main/UI/store/sidebar and image-to-image page/cloud-adapter behavior.
- `pnpm run typecheck`: passed.
- Scoped ESLint over all affected Updater and image-to-image product/test files:
passed with no findings.
- `pnpm run build:vite`: passed for Renderer, Electron Main, and Preload; only
the repository's existing dynamic-import and chunk-size warnings were emitted.
- `pnpm test`: 1566/1569 passed. The three failures exactly match the Updater
task's recorded pre-merge baseline: missing `.opencode/agent` in
`youth-plain-language-skill.test.ts`, plus the two existing timeout/generation
failures in `opencode-manager.test.ts`. None touches this merge's files.
- `check_project_docs.py`: passed.
- `check_doc_drift.py --task-id
20260813-integrate-i2i-updater-main-c4e7a1`: passed before final review.
- `git diff --check`: passed; Git reported only the normal LF/CRLF checkout
notices when displaying diffs.
- Independent final Sol review: pending against the committed combined head.
## Follow-ups
- None recorded.
- Deploy the matching image-to-image service contract and run packaged desktop
plus live Works Square/Bailian smoke with both a generated Workspace Asset and
a locally uploaded reference.
- Replace the exact localized quick-reply trigger with a structured
action/purpose before adding another media-input mode or changing the label.
- Align the authoritative client version, publish signed/notarized updater-role
artifacts, and run discover/download/restart/install smoke from an older
stable package.
## Promotion Candidates
- None recorded.
- None. Accepted, non-conflicting source facts have been promoted by this
Integration Gate; external production gates remain explicitly pending.

View File

@@ -20,6 +20,7 @@
- 已发布作品优先读取 `play_url`,只有字段缺失时才使用一个客户端版本的 `runtime_url` 回退。公共播放 URL 必须是 Works Square 同源 HTTPS、无 userinfo/loopback、精确 `/apps/{encodeURIComponent(app_id)}/`、无 query/fragment且上游明确 `playable === true` 并提供非空版本名;否则按不可播放处理。
- `works-cloud-deploy.json` 仅是已安装客户端的数据兼容文件名,不表示客户端仍提供 cloud deployment coordinator。
- Works Square 会话按真实键盘、鼠标或触摸活动滑动续期,连续 7 天未使用才要求重新授权。
- 客户端更新检查由 Electron Main 持有。缺少当前平台正式稳定 manifest 必须保持错误并提示稍后重试或从官网下载不得宣称“已是最新版”设置页只显示一条中文用户提示原始堆栈、URL、路径和错误码只保留在 Main 日志。
- 一个 AI 绘画 Workspace 可以包含多条独立 Conversation新建 Conversation 不得创建新 Workspace。
- Conversation 持有消息、Brief、Quote 和 `turnRevision`;生成任务和资产属于 Workspace切换 Conversation 后必须继续可见。
- 每条 Conversation 使用服务端持久 Agent Gateway Session。客户端注销或退出时只关闭本地流并清除本机 Session-id 缓存,不删除服务端 Session。
@@ -35,6 +36,7 @@
- 在一个客户端兼容版本且服务端与存量数据稳定提供 `play_url` 后,移除 `runtime_url` 回退。
- 多 Conversation 客户端发布前需确认服务端迁移 `0033`、Conversation API 与持久 Session 契约已经部署。
- 图生图随客户端发布前,需确认相匹配的服务端 `image_to_image` Brief/Quote/Task 冻结、私有源图复核与 Bailian edit 执行链已部署,并使用真实 Workspace Asset 完成生产 smoke。
- Updater 生产恢复仍需对齐权威版本、发布正式签名/公证的平台产物,并从旧安装版本执行发现、下载、重启和安装 smoke源码提示修复本身不构成发布链恢复。
## Last Reviewed

View File

@@ -10,6 +10,7 @@ Use this index for searchable, traceable evidence records.
| 2026-08-12 | Makelore Main-owned 本地静态 Release 构建 | 本地功能与 Windows 安装产物验证通过;安装器未发布 | `30-worklog/tasks/20260812-client-built-release-makelore-7e5b.md``5b44864` | 6 files / 129 focused tests、typecheck、scoped lint、Vite build、真实 Electron 双视口 E2E 与实际 npm/Vite smoke 通过;安装器 223,547,912 bytesSHA-256 `08A0BB7BC66EE4AD8B120E8955B149951CD86AF53CC966C7973AD4D77A5815C1`,内置 npm 11.6.2 已由 packaged verifier 验证,但未上传或发布 |
| 2026-08-12 | AI 编程首次会话等待与上游饱和重试 | 本地功能验证通过;真实冷启动各阶段耗时尚未遥测 | 源任务 `20260812-first-chat-fix-b84fd29c``08da976``0ee5254` | 4 个相关单测文件 228/228、typecheck、scoped lint、Vite build 与真实 Electron E2E 通过;全量单测的 3 个失败与 `main` 基线一致,修复证明 prompt 不等待已知空历史,但不宣称消除所有 runtime 冷启动耗时 |
| 2026-08-13 | AI 绘画单参考图图生图客户端 | 本地功能验证通过;未执行安装包或真实 Provider smoke | 源任务 `20260812-design-image-to-image-client-c91e``809364e`、集成 `88281b8`、兼容修复 `7a807a2` | 25 项页面回归覆盖图片作品选择、本地上传、视频首帧及 null-medium 兼容22 项云端适配器回归覆盖 REST/WebSocket 缺失 medium 归一化与非法值拒绝typecheck、scoped lint 与 Vite build 通过,生产部署与付费生成另行验收 |
| 2026-08-13 | Makelore Updater 稳定源诊断与错误展示 | 本地功能与构建验证通过;未发布或安装正式包 | `30-worklog/tasks/20260813-makelore-updater-client-7d3a9c.md``f05b9d4` | 4 files / 37 focused tests、typecheck、scoped lint 与 `build:vite` 通过;并发共享错误只投影一次,设置页不显示技术诊断。可用本地产物未签名,真实升级链仍待 Release Owner 验收 |
## When To Add Evidence

View File

@@ -11,6 +11,7 @@ Track future-facing memory: promised follow-ups, unfinished loops, timed checks,
| 2026-08-12 | 复核 AI 编程上游饱和终止态投影 | 升级 bundled OpenCode 或上游饱和错误格式时 | 客户端/OpenCode 集成 | Pending | 重新验证 retry contract继续区分配额耗尽、明确分组饱和与通用 `429`,必要时调整或移除 `429 → 400` 内部投影 |
| 2026-08-13 | 将 AI 绘画素材选择 quick reply 升级为结构化 action/purpose | 新增第三种素材输入用途、调整本地化文案或重构 Design Message 协议时 | 客户端/服务端集成 | Pending | 用 `select_image_asset` + `image_reference | video_first_frame` 等稳定字段替代精确中文字符串匹配,并覆盖延迟 Brief 快照兼容 |
| 2026-08-13 | 完成图生图客户端与服务端生产整链 smoke | 相匹配客户端与服务端部署后 | 客户端/服务端集成 | Pending | 用当前 Workspace 已完成作品与本地上传各执行一次图生图,核对 Asset 所有权、Quote、任务创建、结果展示与下载不以本地单测替代付费 Provider 验收 |
| 2026-08-13 | 发布并验收 Makelore 稳定更新链 | 权威版本对齐且 Windows/macOS 正式产物已签名/公证后 | 客户端发布 | Pending | 将 updater-role 产物 inactive-first 发布到 Works Square核对 manifest/签名/架构后激活,并从旧稳定版执行发现、下载、重启、安装与版本确认 smoke源码错误文案不替代该验收 |
## Use