chore(repo): 将生产源码基线同步回 main #1

Merged
WuYongJie merged 265 commits from codex/production-48-20261030 into main 2026-10-30 16:39:58 +08:00
Collaborator

Summary

main 停留在 2026-08-11,实际生产源码已到 2026-10-22,另有未提交源码。本 PR 将生产历史和已核实的服务器改动完整收回主线,使后续接手、修复和发布使用可追溯的源码基线。

保留原有提交历史,不重写或强制覆盖旧分支。与生产原始快照相比,app/、components/、lib/、services/ 的业务源码无差异。

Source and rollback

  • 原 main:e2a8f2dda3f190f78529b4419f295a356476c74b;回退标签 main-before-production-sync-20261030。
  • 生产源码:codex/canvas-image-429-deploy-1001 / 439fd56fe120fdb9f855b50fa4df9ce2e71bb72a。
  • 已核对的运行构建 ID:QhoygcZ4-x42PwCgCEj1d。
  • 原有 19 个修改文件、6 个新增源码文件按原始内容保存到提交 03b8a0deb0e8310128a3854ba26d82d896f0ddd1,标签 production-snapshot-48-20261030。25 个文件的 SHA256 与服务器一致。
  • 另保留原始源码/补丁 ZIP 和 Git 恢复 bundle。历史分支均保留。

Scope

  • 回填已在生产运行的 UI / API / Agent 源码,不新增业务行为。
  • Documentation / CI / repository hygiene。
  • 恢复默认 Next 类型目录,移除服务器历史构建目录引用。
  • 用 .gitattributes 统一源码换行;忽略本地构建、模型配置备份和临时目录。
  • 使用锁定的 Biome CLI;修正检查脚本的换行兼容性。
  • 将 Playwright 环境设置和公共 source map 清理改为 Windows/Linux 通用的 Node 入口。
  • 将超时测试的旧预期对齐已存在的生产 300 秒下限,保留独立模型超时覆盖断言。
  • 增加源码基线与发布约定。存储迁移脚本仅归档,未执行任何数据迁移。

Required Verification

  • pnpm check:branch:相对 main ahead 265 / behind 0,无冲突标记。
  • pnpm build:完整生产编译、TypeScript 检查和 postbuild 均通过;未跳过类型检查。
  • pnpm test:helpers:590 passed / 1 skipped。
  • pnpm test:canvas-agent:107 passed / 10 skipped(需要独立数据库环境的用例未使用生产数据库执行)。
  • Agent 适配器 fixture:29 项通过;模型网关测试:6 项通过。
  • 公共 source map 清理:2 项测试通过,验证保留运行资产并拒绝越出工作区的目录。
  • 本轮调整的脚本/配置独立 Biome 检查通过;日志脱敏、品牌、CI、环境示例、凭据、元数据、测试入口、受控产物检查通过。
  • pnpm check:quality 全库检查未通过:当前 Windows 工作区有 997 项历史 lint / 格式诊断,涉及既有 Error 写法、CSS Modules 解析及测试规则等。本次没有放宽 Biome 规则或批量重写生产业务代码来掩盖这些问题,其余检查已独立执行。
  • 原生 Agent / 沙箱端到端 fixture 未运行:需要额外的原生运行时和隔离环境;本次执行了模拟端口的调度与模型网关回归。
  • 本地 pnpm dev / 路由冒烟未执行:执行环境自动审批拒绝启动本地验证服务,仅返回 blocked by policy,没有详细原因。

生产构建另保留了 4 条既有动态文件匹配范围警告,后续可独立优化。

Release Readiness

  • 未提交真实密钥、环境文件、模型配置备份、Cookie 或 Authorization 值;新增可达历史对象扫描未发现凭据。
  • 未纳入服务器历史构建、备份目录或本地验证产物。
  • 应用业务源码与归档的生产状态一致,未改变 /api/chat ���接口定位或新增公开路由。

本 PR 合并只更新源码仓库。仓库工作流均为手动触发、仓库没有 webhook;已核查的项目 crontab 未发现自动拉取部署项,PM2 watch 关闭。服务器源码、运行分支、环境和服务保持原样;没有部署、重启或执行数据迁移。

历史 lint 债务与生产用户反馈的问题,后续从恢复后的 main 单独建分支处理。

## Summary `main` 停留在 2026-08-11,实际生产源码已到 2026-10-22,另有未提交源码。本 PR 将生产历史和已核实的服务器改动完整收回主线,使后续接手、修复和发布使用可追溯的源码基线。 保留原有提交历史,不重写或强制覆盖旧分支。与生产原始快照相比,`app/`、`components/`、`lib/`、`services/` 的业务源码无差异。 ## Source and rollback - 原 `main`:`e2a8f2dda3f190f78529b4419f295a356476c74b`;回退标签 `main-before-production-sync-20261030`。 - 生产源码:`codex/canvas-image-429-deploy-1001` / `439fd56fe120fdb9f855b50fa4df9ce2e71bb72a`。 - 已核对的运行构建 ID:`QhoygcZ4-x42PwCgCEj1d`。 - 原有 19 个修改文件、6 个新增源码文件按原始内容保存到提交 `03b8a0deb0e8310128a3854ba26d82d896f0ddd1`,标签 `production-snapshot-48-20261030`。25 个文件的 SHA256 与服务器一致。 - 另保留原始源码/补丁 ZIP 和 Git 恢复 bundle。历史分支均保留。 ## Scope - [x] 回填已在生产运行的 UI / API / Agent 源码,不新增业务行为。 - [x] Documentation / CI / repository hygiene。 - 恢复默认 Next 类型目录,移除服务器历史构建目录引用。 - 用 `.gitattributes` 统一源码换行;忽略本地构建、模型配置备份和临时目录。 - 使用锁定的 Biome CLI;修正检查脚本的换行兼容性。 - 将 Playwright 环境设置和公共 source map 清理改为 Windows/Linux 通用的 Node 入口。 - 将超时测试的旧预期对齐已存在的生产 300 秒下限,保留独立模型超时覆盖断言。 - 增加源码基线与发布约定。存储迁移脚本仅归档,未执行任何数据迁移。 ## Required Verification - [x] `pnpm check:branch`:相对 `main` ahead 265 / behind 0,无冲突标记。 - [x] `pnpm build`:完整生产编译、TypeScript 检查和 postbuild 均通过;未跳过类型检查。 - [x] `pnpm test:helpers`:590 passed / 1 skipped。 - [x] `pnpm test:canvas-agent`:107 passed / 10 skipped(需要独立数据库环境的用例未使用生产数据库执行)。 - [x] Agent 适配器 fixture:29 项通过;模型网关测试:6 项通过。 - [x] 公共 source map 清理:2 项测试通过,验证保留运行资产并拒绝越出工作区的目录。 - [x] 本轮调整的脚本/配置独立 Biome 检查通过;日志脱敏、品牌、CI、环境示例、凭据、元数据、测试入口、受控产物检查通过。 - [ ] `pnpm check:quality` 全库检查未通过:当前 Windows 工作区有 997 项历史 lint / 格式诊断,涉及既有 Error 写法、CSS Modules 解析及测试规则等。本次没有放宽 Biome 规则或批量重写生产业务代码来掩盖这些问题,其余检查已独立执行。 - [ ] 原生 Agent / 沙箱端到端 fixture 未运行:需要额外的原生运行时和隔离环境;本次执行了模拟端口的调度与模型网关回归。 - [ ] 本地 `pnpm dev` / 路由冒烟未执行:执行环境自动审批拒绝启动本地验证服务,仅返回 `blocked by policy`,没有详细原因。 生产构建另保留了 4 条既有动态文件匹配范围警告,后续可独立优化。 ## Release Readiness - [x] 未提交真实密钥、环境文件、模型配置备份、Cookie 或 Authorization 值;新增可达历史对象扫描未发现凭据。 - [x] 未纳入服务器历史构建、备份目录或本地验证产物。 - [x] 应用业务源码与归档的生产状态一致,未改变 `/api/chat` ���接口定位或新增公开路由。 本 PR 合并只更新源码仓库。仓库工作流均为手动触发、仓库没有 webhook;已核查的项目 crontab 未发现自动拉取部署项,PM2 watch 关闭。服务器源码、运行分支、环境和服务保持原样;没有部署、重启或执行数据迁移。 历史 lint 债务与生产用户反馈的问题,后续从恢复后的 `main` 单独建分支处理。
WuYongJie added 265 commits 2026-10-30 16:28:17 +08:00
- Starter/toolbox presets no longer seed fake generated results; demo
  fallback media URLs in tool actions now fail with honest guidance
- Delete dead demo scene components, fake director console, demo
  history constants and unreachable submit toast fallbacks
- Smart edit dialog accepts desktop drag-and-drop video files
- Raise media upload client timeout to 10 minutes and surface
  friendly timeout errors instead of raw 'signal timed out'
The private FunASR/HTDemucs audio service was already live and used by
the smart edit pipeline, but the canvas video toolbar still claimed
voice/background separation was unavailable. Add a dedicated
/api/canvas/audio-separate route (download, ffmpeg stem extraction,
remote separation, storage upload) and route the toolbar's voice and
background modes through it, replacing the stale not-connected notice.
Dropped images landed in fixed 420x280 nodes and rendered with
object-cover, cropping portraits and wide photos. Read the image's
natural size during ingestion and fit the node frame to the aspect
ratio (landscape caps height, portrait caps width) so the full
picture stays visible like the reference product.
Show the full picture inside image resource nodes instead of cropping
with object-cover; matches the reference product where node frames
adapt to the image and no content is clipped, and fixes existing
nodes created before aspect fitting was added.
Align the story script generator table and script text node with the
reference product: dark cards with subtle white borders, muted header
row, dark status pills, white primary button and dark textarea card,
replacing the previous light table chrome.
Snapshot-based undo/redo (max 50 steps) with Cmd+Z / Cmd+Shift+Z,
ignoring volatile generation progress fields. Bind the remaining
reference shortcuts: Cmd+D duplicate, Cmd+Enter generate selection,
Tab new-node palette, Cmd+F canvas node search panel, Cmd+0 fit view,
Cmd+=/- zoom, V pan-tool toggle, H hold-to-pan, plain G to group.
Expand the shortcut help panel to the full four-group layout.
The unbounded apad filter made ffmpeg pad the 3-second test clip
endlessly (a 22.9GB WAV) until the disk filled, which was the real
cause of the voice separation failures. Trim to the probed duration
and drop apad.
The P40 upscale flow (popover, HD node creation, task submission) is
fully wired; the toolbar entry had been left disabled and mislabeled
as not connected.
The share popover (publish to site, copy link) and publish modal had
no reachable entry; add a share button next to the save status,
matching the reference product's top bar.
详情替换原来把整批生图挂在浏览器保持的对话流上,切换标签页、断网或连接中断后
结果就再也回不来,前端还会继续播放按时间推算的 96% 假进度。

现在改为服务器端后台批次:提交时先落任务,再按参考图逐张生成并把每张结果写进
项目,页面刷新、切页或服务重启后都能按任务状态恢复,不再依赖前端连接。

- 新增 /api/agents/detail-replacement/batches(提交/查询、幂等去重、重试上限)
- 前端只在服务端确认批次后显示处理中,卡片显示排队/生成/完成/失败真实状态
- 去掉假进度动画;没有产品输入图时提交前直接拦截
- 服务重启后自动恢复未完成批次,长批次不再被通用 30 分钟清理误判
- 单张失败只落到该卡片并继续后续图片,已完成的图片不重复生成和扣费
- 详情替换默认模型由持续 404 的 gpt-image-2.5-flare 改回 gpt-image-2.5
新增的批次接口把一个 UUID 正则写成了 8-4-4-12(少一组 -{4}),标准 UUID 是
8-4-4-4-12。结果是任何真实项目编号和请求编号都过不了校验:查询接口恒返 400
「项目编号无效」,提交接口恒返 400「任务编号或项目编号无效」,详情替换完全无法使用。

- 校验抽成 isDetailReplacementUuid 并修正为规范的 8-4-4-4-12,路由不再自带正则
- 回归测试覆盖真实线上项目编号、浏览器生成的请求编号,以及导致故障的 8-4-4-12 形状
- 增加源码守卫,防止该路由再次出现自带的错误 UUID 正则
- 前端在项目尚未保存时给出明确提示,而不是把空编号丢给接口
Add native-style menus, search and presentation controls, typography resources, and Xmind import/export styling support.

Bundle canvas styles for preview and production, show marquee borders and selection fills, and align editor density with the project UI. Include interaction regression coverage and client comparison notes.
Handle clipboard images while editing or selecting a topic and route Insert image through the same topic attachment behavior. Read image data locally in preview mode and retain the production upload path.

Add four browser regression cases for real clipboard paste, undo/redo, export resources, canvas images, and text input isolation. Record validation in the client comparison notes.
Add native task metadata, working-day calendar settings, dependency scheduling and rich note editing. Support complete-sheet PNG export with resolution and transparency controls, preserve XMind extensions and update browser regressions.
(cherry picked from commit e6dbb612ce9902f7ef8ff193279645390a795b49)
Recover the existing 19 modified tracked files and 6 untracked source files
from the production working tree without changing their contents.

Production source HEAD: 439fd56fe120fdb9f855b50fa4df9ce2e71bb72a
Production build ID: QhoygcZ4-x42PwCgCEj1d
Captured: 2026-10-30; all 25 source file SHA256 values verified.
This is a source recovery checkpoint; no deployment was performed.
Record source and release ownership, keep source line endings consistent,
and exclude local build/config backups from version control.

Restore default Next type paths, normalize CI checks across line endings,
and use portable Playwright and postbuild entry points on Windows/Linux.
Align the stale timeout fixture with the existing production timeout policy.

Application runtime files remain identical to production-snapshot-48-20261030.
Production build and focused regressions passed; pre-existing full-repository
lint findings remain documented instead of relaxing lint rules.
WuYongJie merged commit be642948ec into main 2026-10-30 16:39:58 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunanting/ai-chatbot#1
No description provided.