Why: the task card still described xlsx/pptx sniff as out of scope, and
the combo test had not been written down after the merge.
Evidence: make test passed on a11fed4 (frontend 40, ui 68).
Impact: task card only.
Refs: Dev PR #96
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
- 根因:智能体经 write_artifact/fs_write_file 写出的 ".docx" 实为纯文本字节(生成侧无 OOXML 序列化),前端按扩展名派给 mammoth/JSZip 抛 "Can't find end of central directory"。本轨道只做渲染侧兜底,让存量坏文件可读、错误可解释。
|
||||
- 改动:① previewKindOf 将 `.doc`(老版二进制 Word,非 OOXML)归 binary,不再派给 mammoth;② OfficePreview 失败态文案收敛为用户可读提示(原始错误进 console);③ docxLoader 喂 mammoth 前嗅探 ZIP 魔数(PK\x03\x04),非 ZIP 按文本/markdown 回退渲染并提示;④ 父仓 .gitignore 收编 `.mimosa/`(Mimosa 插件逐会话状态目录反复弄脏树、阻塞 precheck)。
|
||||
- 非目标:不实现真正的 docx 生成(另轨道 feature/docx-generation);不动后端;不做 xlsx/pptx 的同类嗅探(它们由不同解析器路径处理,后续如出现同类报错再扩展)。
|
||||
- 非目标:不实现真正的 docx 生成;不动后端。xlsx/pptx 的 ZIP 嗅探已在本分支补上(2026-10-01);老版 .xls/.ppt 仍走原解析器。
|
||||
|
||||
## 同步记录
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
|
||||
## 结果与验证(完成后填写)
|
||||
|
||||
- 结果:已实现四项——@ui previewKindOf 将 `.doc` 归 binary(ui 83367f7);OfficePreview 失败态收敛为可读提示、原始错误进 console(同提交);frontend docxLoader 喂 mammoth 前嗅探 ZIP 魔数,非 ZIP 按文本/markdown 回退渲染(frontend cd77340);父仓 .gitignore 收编 `.mimosa/`。存量伪 docx(如「研发智能体文档处理与自举方案评审会议纪要.docx」)预览即恢复可读。
|
||||
- 验证:make test-ui(tsc --noEmit 通过 + vitest 49/49,含新增 `.doc→binary` 与错误提示两条断言);make test-frontend(vitest 33/33);frontend npx tsc --noEmit 单独复核通过。真值复现依据:JSZip.loadAsync 对纯文本字节抛出与用户截图逐字一致的报错(排查阶段已复现)。
|
||||
- 影响与剩余项:渲染层兜底不改契约;根因(生成侧无 OOXML 序列化)由兄弟任务 feature/docx-generation 处理,其合入前新产出的 .docx 仍为文本(但预览已可读不报错)。
|
||||
- 结果:UI e082889(含 origin/main 与 `.doc`→binary、Office 错误文案收敛);Frontend bfa634d(docx/xlsx/pptx 非 ZIP 按文本回退,.xls/.ppt 除外);父仓 .gitignore 含 `.mimosa/`。分支已并入 origin/main(a11fed4)。
|
||||
- 验证:合并后 UI vitest 68、Frontend vitest 40,两边 tsc 通过。Dev `make test` 通过(core、backend、frontend 40、ui 68、agent-command,2026-10-01)。
|
||||
- 影响与剩余项:伪 Office 文件预览可读。生成侧执行器在 feature/exec-interpreters,不在本 PR。合入顺序:UI #21 → Frontend #22 → Dev #96。
|
||||
|
||||
Reference in New Issue
Block a user