Document genoffice DOCX round-trip tradeoffs - #150
Conversation
原 cli/FastOCR(→MeasureOCR)為研究儀器、非文件工具,遷至 ~/Developer/bestOCR/repos/measureOCR;GitHub repo 同步改名 PsychQuant/measureOCR(舊 URL 轉址)。macdoc PDF 工具的 OCR 能力 不變——照常經 published package ocr-swift 取用。
Genspark 的 AI-native office suite,shallow clone 至 reference/genoffice/。 不是競品(無 MCP / CLI / public API,AI 綁自家雲端),但 packages/ 下的 engine 是純 TS、無 Electron 依賴,是唯一同時涵蓋 docx + xlsx + pptx + pdf 的現代 開源對照組。 三個對照點: - xlsx 缺口(file-parse/src/xlsx.ts)——macdoc 唯一缺的 OOXML 主格式 - patch-narrowly round-trip(docx-engine/src/patch.ts)——與 ooxml-swift op log 同目標、不同解法的第三種參考(python-docx 直接 mutate、genoffice 保留原 bytes 窄幅重生、macdoc op log 重放) - pptx 功能廣度(smartart / custgeom / animation)——pptx-swift 擴充 checklist 含 Apache-2.0 / ee\/ 另授權的移植注意事項,以及 snapshot-sync 開發模式的 成熟度警語。
Not merged — this branch and
|
only on main |
only on this branch |
|---|---|
7. 對 #142 的旁證(verify 後修正版) |
Word-canonical 邊界:躲掉還是踩到 — with five sub-sections: root namespace 雲, rsid/w14:paraId/w14:textId, xml:space, pPr, rPr |
9. 誠實邊界 |
最終判斷, 不宜直接移植的部分 |
Even the titles differ (genoffice round-trip 對照:substring-splice vs op log vs mutate-tree vs genoffice DOCX 窄幅修補與 macdoc round-trip 對照).
main's exclusive material is the verification round — patch.ts line references, the UTF-16 code-unit index detail, the test invariants. The branch's exclusive material includes the Word-canonical boundary analysis, which is directly relevant to #131.
Why I stopped
Merging this needs an editorial decision: which structure survives, and which passages from the other get folded in. Both are your research notes on the same investigation, and a mechanical resolution would either clobber the verified refinements on main or produce a stitched-together union that reads as neither.
Three ways out, none of which I should pick for you:
- Close this PR.
mainalready carries a verified version; the branch's extra material gets ported deliberately, in its own change, where the Word-canonical section can be aimed at Word-canonical forms 對齊 — 讓真實 Word 文件升級 DSL channel(format-alignment step 2) #131. - Rebase and reconcile by hand — keep
mainas the base and fold in the branch's sections, resolving each overlap. - Replace — decide the branch version is the better document and let it supersede, re-applying the verify-round corrections on top.
The other two conflicting hunks (reference/README.md) are the same shape: main already has a pointer note to the doc that this branch also adds, worded differently.
Unrelated, but in this diff
The branch also carries ae6aa3f chore: MeasureOCR 遷出至 bestOCR umbrella(submodule 解除) — .gitmodules and cli/FastOCR removals plus a CLAUDE.md edit. Whether that is still wanted is a separate question from the docs; CLAUDE.md on main has moved since (it now records the MeasureOCR migration in prose).
Meanwhile
#139's ### Blocking block was stale — it still named PR #152 and #153, both merged today. Updated: the real remaining gate is PR #151, whose leader #135 waits on owner-provided authority.
Summary
Verification
git diff --cached --checkbefore commitRefs #143