| 1 | from __future__ import annotations |
| 2 | |
| 3 | from pathlib import Path |
| 4 | |
| 5 | NO_CONTINUITY_MESSAGE = "_No learned continuity capsule has been recorded yet._" |
| 6 | |
| 7 | |
| 8 | def render_continuity(continuity_file: Path) -> str: |
| 9 | from scripts.sanitize_repo_content import _escape_untrusted_boundaries |
| 10 | |
| 11 | if not continuity_file.exists(): |
| 12 | return NO_CONTINUITY_MESSAGE |
| 13 | |
| 14 | content = continuity_file.read_text(encoding="utf-8").strip() |
| 15 | if not content: |
| 16 | return NO_CONTINUITY_MESSAGE |
| 17 | return _escape_untrusted_boundaries(content) |