Skip to content

PackageInspector 的 relationship Id 不做 XML entity 解碼——Id="rId6" 與 reader 解碼後的 rId6 比不上(follow-up finding from che-word-mcp#199 verify) #137

Description

@kiki830621

Problem

PackageInspector.imageRelationshipIds(inRels:) / referencedRelationshipIds(inPart:) 以正則直接抓屬性字面值(\bId\s*=\s*(["'])([^"']*)\1),不做 XML entity 解碼;而 DocxReader 走 NSXML,attribute(forName: "Id")?.stringValue 是解碼後的值。同一個 relationship Id="rId6":reader 端是 rId6、inspector 端是 rId6

任何把兩邊放在一起比的 consumer 都會錯:che-word-mcp#199 的 list_images 用 inspector 的 orphanImageRelationshipIdsgetImages() 的列判定孤兒,entity 寫法的孤兒會被標 referenced: yes(security lens 實測,Direct Mode)。save gate 的 baseline 比對(qualified part:id 集合差集)兩邊都來自 inspector,所以內部一致,但同一 rel 在 reader 與 inspector 的名字不同仍是坑。

Type

bug

Expected

inspector 回傳的 id(orphanImageRelationshipIds / orphanImageRelationshipRefs.id)與 referencedRelationshipIds 的比對值都經標準 XML entity 解碼(&#NN; / &#xHH; / 五個預定義 entity),與 NSXML 讀出的值一致。

Actual

原始字面值;6 不會變成 6


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

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