ReadViewSDK/.planning/phases/07-wxread/07-03-PLAN.md
2026-05-22 20:04:47 +08:00

79 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
phase: 7
plan: 07-03
type: execute
wave: 3
depends_on:
- 07-01
- 07-02
files_modified:
- ReadViewDemo/ReadViewDemo/ViewController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBTextRendering/RDEPUBTextBookBuilder.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
autonomous: true
requirements:
- ATTR-01
- ATTR-02
- ATTR-03
---
# Phase 7-03: 诊断与回归证据标准化
<objective>
把 Phase 7 的自定义属性闭环变成可观测、可复现的 demo 证据,让复杂块、附件语义与分页命中规则能稳定出现在运行时诊断和回归日志中。
</objective>
<must_haves>
- Demo 或运行时日志能报告当前 native text 页面命中的分页语义与块类型摘要。
- 图片/附件语义和复杂块分类在真实样本上可见,不依赖阅读源码才能判断是否生效。
- 回归证据格式应尽量稳定,便于后续 Phase 8 / Phase 9 复用。
</must_haves>
<tasks>
<task id="07-03-01">
<type>execute</type>
<action>`RDEPUBReaderController``RDEPUBTextBookBuilder` 增加统一的 Phase 7 语义诊断摘要接口,输出当前页面或章节的块类型、附件语义、分页 hint 命中与 break reason。要求格式确定性强便于比较不同构建结果。</action>
<read_first>
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBTextRendering/RDEPUBTextBookBuilder.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
- .planning/phases/07-wxread/07-PATTERNS.md
</read_first>
<acceptance_criteria>
- 存在一个可从 native text 路径调用的语义诊断摘要接口或方法。
- 摘要至少包含块类型、附件语义或强制分页命中中的两类以上信息。
- 同一章节在同一构建下重复运行时,摘要格式稳定且可比较。
</acceptance_criteria>
</task>
<task id="07-03-02">
<type>execute</type>
<action>扩展 `ReadViewDemo/ReadViewDemo/ViewController.swift` 的样本验证输出,至少对一个图片/附件章节和一个复杂块章节打印 Phase 7 语义摘要,并保留现有 native/fixed/interactive/TXT 矩阵。必要时补充最小的控制器接线,确保 demo 能暴露这些证据。</action>
<read_first>
- ReadViewDemo/ReadViewDemo/ViewController.swift
- Sources/RDReaderView/EPUBUI/RDEPUBReaderController.swift
- Sources/RDReaderView/EPUBTextRendering/RDEPUBTextBookBuilder.swift
- Sources/RDReaderView/EPUBCore/RDEPUBReadingModels.swift
</read_first>
<acceptance_criteria>
- Demo 启动日志或显式诊断输出包含 Phase 7 语义摘要。
- 复杂块与附件样本至少各有一条可读证据,能证明语义没有在链路中丢失。
- 原有 fixed / interactive EPUB 与 TXT 路径仍保留在样本矩阵中,没有被新的 native text 诊断覆盖掉。
</acceptance_criteria>
</task>
</tasks>
<verification>
- Build and launch `ReadViewDemo` in the simulator.
- 记录复杂块样本与图片/附件样本的语义诊断摘要,确认块类型、附件语义、分页 hint 命中可见。
- 重新分页、切换主题或字号后再次记录摘要,确认格式仍稳定且基础导航语义未回归。
</verification>
<success_criteria>
- Phase 7 产出稳定的运行时证据,而不是只留下源码层推断。
- 复杂块、附件语义与分页规则在 demo 中可见。
- 后续阶段可以直接复用这些诊断输出做质量收敛和自动化回归。
</success_criteria>