Skip to content

PackageInspector.stripComments<!--.*?--> 對未閉合 <!-- 呈二次退化——5 KB 的 .docx 讓檢查跑一分鐘(follow-up finding from che-word-mcp#199 verify) #138

Description

@kiki830621

Problem

PackageInspector.stripComments<!--.*?-->.dotMatchesLineSeparators)對每個 word/**/_rels/*.rels 與其 part 做註解剝除。part 內若有大量未閉合<!--,每個開頭都讓 lazy .*? 掃到檔尾:實測 40 / 80 / 160 KB 的 rels part → 4.4 / 16.7 / 62.3 s(二次);一個 5.3 KB 的 .docx(chart rels part 內塞未閉合 <!--DocxReader 永遠不會 parse 它、但 inspector 每次都掃)展開後 62 s 牆鐘。inspector 明文「不是 parser、不驗 well-formedness」,所以這條輸入不會被擋在前面。

che-word-mcp 的 save gate 早就經 writeData(scratch 序列化)餵它,raw-channel parts 也會原樣搬運註解;che-word-mcp#199 的 list_images Direct Mode 是第一條把原始磁碟位元組直接餵進來的唯讀路徑,DA 實測卡住整個 actor server。che-word-mcp 端會先做線性預掃(<!-- 多於 --> 就拒絕檢查)當緩解,但根因在這裡。

Type

bug

Expected

註解剝除改成線性掃描(找 <!-- 後找下一個 -->,找不到即視為到檔尾一次結束),或對 part 大小/註解數設上限並在報告裡具名(與 #130 的 IO 上限同族)。

Actual

二次退化,可被小檔觸發。


Source: surfaced during /idd-verify che-word-mcp#199 (Step 5b follow-up triage). Verify report: PsychQuant/che-word-mcp#218 (comment)
Refs PsychQuant/che-word-mcp#199, #130

Current Status

Phase: needs-fix
Last updated: 2026-09-06 by idd-verify (R3 → fix round 3 landed; R4 running) — unattended /idd-all, cluster PR #141

Key Decisions

Blocking

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions