(source_manifest: dict[str, Any])
| 59 | |
| 60 | |
| 61 | def source_section_ids(source_manifest: dict[str, Any]) -> set[str]: |
| 62 | ids: set[str] = set() |
| 63 | for section in source_manifest.get("sections", []) or []: |
| 64 | if isinstance(section, dict): |
| 65 | sid = normalize_whitespace(str(section.get("section_id", ""))) |
| 66 | if sid: |
| 67 | ids.add(sid) |
| 68 | for page in source_manifest.get("pages", []) or []: |
| 69 | if not isinstance(page, dict): |
| 70 | continue |
| 71 | for sid in page.get("section_ids", []) or []: |
| 72 | cleaned = normalize_whitespace(str(sid)) |
| 73 | if cleaned: |
| 74 | ids.add(cleaned) |
| 75 | return ids |
| 76 | |
| 77 | |
| 78 | def total_pages(source_manifest: dict[str, Any]) -> int: |
no test coverage detected