Harden OOXML gate against reference-integrity breaks #202

Merged
weichen merged 1 commits from feature/pptx-gate-reference-integrity into main 2026-10-15 02:33:10 +00:00
Owner

Why

第二起坏 PPTX 实测穿透已合入的登记门禁:部件齐全但引用断裂(presentation/母版漏声明 xmlns:r、sldIdLst 12 页只配 1 条关系、[Content_Types] 只 Override slide1)——原「部件存在性」检查对此三缺陷全盲。生成侧实证为后台任务溢出后 Agent 回退手拼,且生成实例未部署第一版门禁。

What

  • ooxmlgate.go 升级为五维校验:容器合法、必备部件、引用链完整(原有)、全包严格命名空间(声明集合法,兼容 urn: 等 scheme 与任意位置声明)、sldIdLst/sldMasterIdLst/sldLayoutIdLst 与关系表双向一致(断链/多余/缺失/重复都点名)、[Content_Types] 对全部结构部件的 Override 覆盖与类型精确匹配。
  • 第二类事故合成夹具(三缺陷可独立隔离)+ 13 类断链变体;真实业务内容不入仓。
  • tool.run_python v3:kit 路线失败重试仍走 kit,任何失败不构成手拼理由。

Evidence

  • 升级后门禁对真实坏件拒绝(点名 xmlns:r)、对手工修复件与 kit 产物放行,三连实测。
  • tools 包全量测试绿;组合 make test + make build 于同步后 HEAD 双绿(收据见 Dev 任务卡)。

Impact

  • register_artifact 对「部件齐全但引用断裂」形态由放行改为拒绝并点名断裂引用;合法 kit 产物与修复包不受影响。
  • P0(dev 部署)随本 PR 合入后执行。

Refs

  • Dev 任务 feature/pptx-gate-reference-integrity(组合 PR 随后)
## Why 第二起坏 PPTX 实测穿透已合入的登记门禁:部件齐全但引用断裂(presentation/母版漏声明 xmlns:r、sldIdLst 12 页只配 1 条关系、[Content_Types] 只 Override slide1)——原「部件存在性」检查对此三缺陷全盲。生成侧实证为后台任务溢出后 Agent 回退手拼,且生成实例未部署第一版门禁。 ## What - `ooxmlgate.go` 升级为五维校验:容器合法、必备部件、引用链完整(原有)、**全包严格命名空间**(声明集合法,兼容 urn: 等 scheme 与任意位置声明)、**sldIdLst/sldMasterIdLst/sldLayoutIdLst 与关系表双向一致**(断链/多余/缺失/重复都点名)、**[Content_Types] 对全部结构部件的 Override 覆盖与类型精确匹配**。 - 第二类事故合成夹具(三缺陷可独立隔离)+ 13 类断链变体;真实业务内容不入仓。 - tool.run_python v3:kit 路线失败重试仍走 kit,任何失败不构成手拼理由。 ## Evidence - 升级后门禁对真实坏件拒绝(点名 xmlns:r)、对手工修复件与 kit 产物放行,三连实测。 - tools 包全量测试绿;组合 make test + make build 于同步后 HEAD 双绿(收据见 Dev 任务卡)。 ## Impact - register_artifact 对「部件齐全但引用断裂」形态由放行改为拒绝并点名断裂引用;合法 kit 产物与修复包不受影响。 - P0(dev 部署)随本 PR 合入后执行。 ## Refs - Dev 任务 feature/pptx-gate-reference-integrity(组合 PR 随后)
weichen added 1 commit 2026-10-15 02:25:28 +00:00
Harden OOXML gate against reference-integrity breaks
ci / vet-and-test (pull_request) Successful in 58s
0a57853154
Why: A second broken pptx passed the shipped gate despite being unopenable
in Office: parts were all present but presentation.xml and the master used
an undeclared xmlns:r prefix, sldIdLst listed 12 slides while the rels file
wired only one, and [Content_Types].xml overrode only slide1. The prior
part-existence checks cannot see any of these; the generating instance also
predated the first gate deployment.

Evidence: The upgraded gate rejects the real broken file (undeclared
xmlns:r) and 16 synthetic break cases spanning both incident classes, while
passing the manually repaired package and kit output; python round-trip on
the repaired deck extracts all 12 slides. Full-suite receipt follows on the
task card.

Impact: register_artifact now enforces strict namespace declarations across
every XML part, bidirectional consistency between id-lists and relationships
(presentation and masters), and per-part content-type overrides. Error
messages name the broken reference. run_python prompt v3 adds that failed
kit attempts must retry through the kit, never fall back to hand assembly.

Refs: Dev task feature/pptx-gate-reference-integrity
weichen merged commit 9793a778be into main 2026-10-15 02:33:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#202