Skip to content

fix(cindy-make): 完善个人版制作、测试与失败恢复流程 - #4778

Merged
MagicLizi merged 7 commits into
mainfrom
fix/cindy-make-workflow-20260920
Sep 20, 2026
Merged

MagicLizi merged 7 commits into
mainfrom
fix/cindy-make-workflow-20260920

Conversation

@MagicLizi

@MagicLizi MagicLizi commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

完善 Cindy Make 从准备源码、确认官方更新冲突、启动隔离测试版到生成个人版的完整流程。解决生成失败后个人源码残留合入、测试窗口关闭后进程未回收、Windows 打包强制重编 node-pty 失败,以及制作结果、版本对比和任务提醒不一致的问题;同时修复从 release/beta 标签克隆时缺少本地 main 导致的构建失败。

变更类型

  • fix 缺陷修复
  • docs / test / chore 文档、测试或工程维护

范围

  • 关联 Issue / 需求:维护者要求整理本地 Cindy Make 改动,统一个人版与正式版打包策略,并完善制作过程和结果展示。
  • 本 PR 包含:源码准备共用状态、官方更新冲突确认与取消、失败生成的可恢复回滚、制作历史和每轮需求、构建阶段记录、隔离测试生命周期、版本启动交接、任务红绿点和冲突任务标题、node-pty 预编译件完整性验证及五语文案。
  • 明确不包含:服务端改动、数据库 schema/migration、插件批准状态、Mobile 原生配置或运行时指纹变更。
  • 用户可见变化:版本概览把本地和线上 main 合并展示;前置弹窗通过右上角关闭并按阶段确认;测试按钮统一为“启动隔离测试版”,生成按钮统一为“生成个人版”;测试窗口启动后前置、关窗退出并保留登录设置;失败或中断保留任务提醒。
  • 是否存在 breaking change:无;新增进度和状态字段兼容旧记录,旧测试源码保持原有启动能力。

UI 变化

  • 引用的设计规范:docs/design-rules/DESIGN.md §2(版本对比语义颜色)、§4 Dialog & Modal(前置弹窗关闭例外)、§5(布局与点击目标)、§10(Light/Dark 语义 token)、§11(五语文案)、§14(键盘、关闭和焦点交互)。本次设计文档同步记录维护者已确认的局部例外。
  • Desktop 使用现有 Button、ConfirmDialog、主题与任务提醒机制,五种语言同步;Light/Dark 均使用语义 token。
  • 未新增截图或录屏;已有多语真实资源渲染测试。Light/Dark 实机视觉验收未完成,不把样式复用等同于实测。

怎么验证的

自动验证

  • pnpm test:unit:related:对齐最新 main 后再次通过(551 项仓库脚本测试通过,Desktop 相关单测通过;子进程去除宿主 XDT_* 变量并使用 Git Bash)。
  • pnpm --filter desktop run --if-present typecheck:对齐最新 main 后再次通过。
  • pnpm --filter desktop exec vitest run --project git-integration --maxWorkers=1 src/main/cindy-make/tests:首次发现个人版测试旧断言及标签克隆缺本地 main,已修复。其余 5 个集成文件通过。
  • pnpm --filter desktop exec vitest run --maxWorkers=1 src/main/cindy-make/tests/personalBuild.git-integration.test.ts src/main/cindy-make/tests/personalBuild.test.ts src/main/localDb/tests/sessionActiveTurn.test.ts:修复后 3 文件、60 个用例通过(含个人版真实 Git 8 项)。
  • pnpm check:i18n / pnpm check:i18n-glossary:通过(仅存量提示)。
  • pnpm check:design-colors --base-ref main --worktree:无新增违规。两处 rounded-xl 报告按 DESIGN §5 判为普通内容容器/对话框 12px,未改变形状。
  • pnpm check:design-inventory:通过。
  • pnpm check:dco:通过,1 个提交已签名。
  • Windows node-pty 回归测试 18 项及构建辅助模块类型检查通过。
  • git diff --check:通过。

手工验证

Windows x64:此前用共用打包脚本成功生成版本无关安装包;本轮补跑该产物启动冒烟通过。使用产物中 node-pty 的预编译文件,在 Electron 41.10.3 下验证三个 binding 加载和真实 PTY 命令执行通过。该证据验证预编译件可用性,不代表本 PR 全部界面经过实机验收。

未执行的验证

macOS/Linux 实机打包、双主题实机目检和手机端到端未执行。未新增依赖,依赖漏洞扫描不适用;本机未安装 semgrep,专项静态扫描未执行。

风险

风险分类

  • 权限 / 安全 / 用户数据
  • 协议兼容
  • 跨平台差异
  • 其他:Desktop 构建链与既有设计规范局部修订

影响与回滚

  • 影响范围:Cindy Make 的托管源码、完成卡和制作历史、隔离测试子进程、版本切换及桌面任务提醒。回滚仅针对未生成成功版本的连续合入,执行前核验分支、提交和文件树;并发修改保留现场。失败提交保留本地引用,清理进度可在下次重试恢复。
  • 回滚 / 降级方式:回退本 PR 恢复旧流程;已完成制作记录和安装包保持保留。新增持久字段为可选,不改历史 migration 或全局 system prompt。Windows/macOS 从锁定 npm 依赖使用目标平台预编译件,缺件明确报依赖不完整;Linux 保持源码编译。无新增权限或凭证复制。存量插件影响:无。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名
  • UI 改动已注明设计规范
  • 未提交凭证、令牌或授权文件
  • 已核对受影响文档并同步行为变化
  • 已确认测试结果或说明未执行原因

Unify source preparation and history presentation, confirm upstream conflicts, restore unbuilt integrations safely, and keep native task attention in sync. Preserve test profiles while reclaiming preview processes and temporary files. Reuse packaged node-pty prebuilds and validate inherited migration history for tag checkouts.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
@MagicLizi
MagicLizi requested a review from a team as a code owner September 20, 2026 15:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T17:47:29.769957Z a9686f6 New commits
🔒 Security Review Completed 2026-09-20T17:48:21.024076Z a9686f6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示) labels Sep 20, 2026
@greptile-apps

greptile-apps Bot commented Sep 20, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

暂不建议合并:迁移锁竞争会导致正常启动直接退出,测试进程停止失败还会永久阻塞继续修改或生成个人版。

Findings

  1. P1 锁竞争导致启动退出
  2. P1 停止失败永久阻塞流程
Fix with agent prompt
### Issue 1
apps/desktop/src/main/index.ts:298-302
当另一个 Cindy 进程持有本地 profile 迁移锁时,`beginDesktopDevInstance()` 会通过定时器反复等待并让出事件循环。Electron 随后可能进入 ready,而这里会直接抛出致命错误并退出。该注册屏障在 Dev 和已打包版本中都会执行,因此原本只需等待迁移锁释放的并发启动会变成启动失败。请调整启动顺序,避免可能等待的注册屏障跨过 Electron ready 边界。

### Issue 2
apps/desktop/src/main/cindy-make/testRunner.ts:320-326
如果停止测试进程时出现非 `ESRCH` 错误(例如 POSIX 进程组返回 `EPERM`),这个分支只记录失败并清除 `stopping`。但 `closed` 只能在之后收到 PTY 的 `onExit` 时结算;进程没有被终止就不会产生该回执。结果是 `stopTestForBuild()`、继续修改和生成个人版会一直等待 `job.finished`,工作目录租约和临时目录也无法释放。请为停止失败提供有界重试或明确失败结算,避免无限等待。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary

此 PR 重构并补全 Cindy Make 的源码准备、上游冲突确认、隔离测试、个人版生成失败回滚、版本启动交接和任务提醒流程,同时调整 node-pty 打包策略与五语界面。

  • 新增个人版失败生成的持久化撤回与重试恢复。
  • 统一完成卡和制作历史的测试、生成及进度记录。
  • 增加上游冲突的确认/取消流程及隔离测试进程清理。
  • 修正 release/beta 源码构建基线和版本启动的 pre-ready 分流。
  • 当前仍有启动锁竞争导致应用退出,以及测试进程停止失败导致工作流永久等待的问题。
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[准备环境与托管源码] --> B[创建 Cindy Make 任务]
  B --> C[Agent 在隔离 worktree 修改]
  C --> D{用户选择}
  D -->|隔离测试| E[启动测试进程]
  E --> F[关窗或停止并清理临时目录]
  D -->|生成个人版| G[合入 cindy-personal]
  G --> H[依赖、测试与类型检查]
  H --> I[打包并保留可运行版本]
  H -->|失败或取消| J[按 journal 撤回未发布合入]
  D -->|同步官方源码| K[隔离 rebase]
  K -->|冲突| L{确认处理?}
  L -->|确认| M[创建冲突处理任务]
  L -->|取消| N[清理候选并保留个人源码]
Loading

Reviews (1) · Last reviewed commit: "fix(cindy-make): stabilize personal buil..."

Comment thread apps/desktop/src/main/index.ts Outdated
Comment thread apps/desktop/src/main/cindy-make/testRunner.ts
@MagicLizi

Copy link
Copy Markdown
Contributor Author

独立审查完成,当前提交 f5ae7a0 未发现剩余 P0/P1。审查中发现的 release/beta 标签克隆缺少本地 main 导致构建失败已修复,并经真实 Git 测试验证。

本地提交前门禁和对齐最新 main 后的复测均通过:相关单测、Desktop 类型检查、DCO、五语文案、设计颜色与台账检查;个人版构建/数据库定向复测 60 项通过。缺少 semgrep,未声称专项静态扫描已通过。

UI 说明:尚未附最终截图或录屏,Light/Dark 实机目检和 macOS/Linux 实机验证仍待补充;现有真实语言资源渲染测试通过。两处 rounded-xl 均属于 DESIGN §5 的内容容器/对话框 12px 分类,不构成视觉违规。

@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Sep 20, 2026
Keep workspace leases and temporary files until a real PTY exit, but return a bounded stopFailed result so editing and generation cannot wait forever. Surface the actionable error in all Cindy Make entry points and remove the pre-existing startup timing guard.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
@MagicLizi MagicLizi added status:auto-fixing 已派跟进会话自动修复中(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Sep 20, 2026
POSIX process-group SIGKILL can return EPERM. Try the owned PTY process
next so a failed group signal still has a chance to produce onExit,
instead of only timing out the caller.

Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 780c32e13e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-make/versionStartup.ts
Comment thread apps/desktop/src/main/cindy-make/buildRollback.ts
@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:auto-fixing 已派跟进会话自动修复中(review-pr 自动维护,仅展示) status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Sep 20, 2026
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca5a2a8b19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/cindy-make/historyRuntime.ts Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

typeof item.commit !== 'string' ||
!/^[0-9a-f]{7,64}$/i.test(item.commit) ||
(item.tree !== undefined && !/^[0-9a-f]{40,64}$/i.test(item.tree)) ||
[item.migrationHash, item.executableHash, item.applicationHash].some(

P1 Badge 将旧协议安装包纳入成功构建的回滚保护

当前保护只扫描带 version.json 的托管版本;当被构建源码未声明启动协议时,retainPersonalVersion() 会返回 undefined,但 personalBuild.ts 仍保留已验证的安装包并将本轮视为已发布。若进程随后在 recordHistoryBuild() 前退出,下一次构建又在进入 builder 前失败,recoverHistoryBuildRollback(true) 仍会把该成功安装包对应的集成判为未生成并撤回。相较已有评论,新的证据是本次新增的扫描仍未覆盖明确支持的旧源码“查看安装包”路径;需要为这类成品留下可恢复的发布标记,或让回滚同时识别其持久化产物。

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) status:ci-running CI 还在跑(review-pr 自动维护,仅展示) labels Sep 20, 2026
@MagicLizi MagicLizi removed the status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) label Sep 20, 2026
@MagicLizi
MagicLizi merged commit d4180f4 into main Sep 20, 2026
18 checks passed
@MagicLizi MagicLizi removed the status:ci-running CI 还在跑(review-pr 自动维护,仅展示) label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants