Skip to content

Document genoffice DOCX round-trip tradeoffs - #150

Open
kiki830621 wants to merge 3 commits into
mainfrom
idd/143-genoffice-roundtrip-docs
Open

Document genoffice DOCX round-trip tradeoffs#150
kiki830621 wants to merge 3 commits into
mainfrom
idd/143-genoffice-roundtrip-docs

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Summary

  • document genoffice docx-engine's no-op identity path, substring-splice edit path, and ZIP payload boundary
  • compare its guarantees and failure modes with ooxml-swift/macdoc and python-docx
  • record Word-canonical edge cases, render-fidelity limits, and practices worth borrowing
  • link the full research note from the reference index

Verification

  • git diff --cached --check before commit
  • pinned-source assertions: genoffice commit, TypeScript line/test counts, save/patch/test anchors
  • relative Markdown link targets verified
  • changed-content privacy and secret-pattern scan passed
  • docs-only change; no Swift or upstream TypeScript test suite was required or run

Refs #143

原 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 開發模式的
成熟度警語。
@kiki830621

Copy link
Copy Markdown
Member Author

Not merged — this branch and main hold two different write-ups, not a draft and its revision

Asked to merge this after mergeable settled. It settled to CONFLICTING, and the conflict is not the ordinary kind.

docs/genoffice-roundtrip-comparison.md already exists on main

Landed by two direct commits, both tagged (#143):

1a43e59  2026-08-14  docs: genoffice round-trip 對照筆記 — substring-splice vs op log vs mutate-tree (#143)
1289739  2026-08-14  docs: verify in-scope fixes for genoffice round-trip 筆記 (#143)

So #143's output reached main by the direct-commit path while this PR was open. That alone would be routine — except the two versions have since diverged in both directions:

main   : 210 lines
branch : 314 lines
lines only on main   : 169
lines only on branch : 237

Neither is a subset of the other.

They are not the same document

Zero shared section headings:

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:

  1. Close this PR. main already 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.
  2. Rebase and reconcile by hand — keep main as the base and fold in the branch's sections, resolving each overlap.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant