fix(pptx): preserve sparse chart point alignment
Fixes #220
Problem
PowerPoint charts may omit a cached numeric point for an empty data cell, or omit a category label while its numeric point remains. Compaction of either list can attach a value to the wrong category or silently drop it.
Change
Match category labels and numeric points using their declared indices. Emit rows for observed indices, including unlabeled rows with data. Treat the first level of a multi-level category cache as its indexed leaf labels. Retain higher-level captions in the existing flattened view without attaching numeric values to them.
Validation
- The schema-validated numeric-gap PPTX now keeps Week 2 empty and reports Week 3 = 27.
- The schema-validated label-gap PPTX uses a single-level multiLvlStrCache. The previous local patch reported Week 3 = 20 and dropped 27. This revision yields Week 1 = 12, an unlabeled row = 20, and Week 3 = 27.
- 300 root-package tests passed in WASI, including snapshots and fixture mutation. One local-corpus test was ignored. Workspace formatting and root-package WASI Clippy passed.
- In separate WASI build directories, converted both PPTX files with AnyDoc v0.2.4 and this patch. At WeKnora main e3fb2335, both single-level and parent-child chunking preserved the resulting rows in the text passed to embedding. In the real read_document tool with in-memory storage fixtures, querying Week 3 exposed 20 on v0.2.4 and 27 with the patch for the label-gap file. No live deployment, model, or vector database was used.
Prepared with Codex assistance.
Summary by cubic
Fixes #220 so sparse chart data in PPTX files stays aligned. Category labels and numeric points are now matched by their declared idx instead of list position, preventing values from shifting onto the wrong category or being dropped when PowerPoint omits an empty cell's entry.
Multi-level category caches now treat only the first level as indexed leaf labels, so higher-level captions remain in the output without receiving numeric values. Values can also appear on unlabeled rows when a category label is missing.