(s: object)
| 1337 | # as data when embedding into pass-2's prompt: collapse newlines and |
| 1338 | # wrap in a delimited block the model is told to read as data only. |
| 1339 | def _scrub(s: object) -> str: |
| 1340 | cleaned = re.sub(r"\s+", " ", str(s or "")).strip()[:120] |
| 1341 | return (cleaned.replace("&", "&") |
| 1342 | .replace("<", "<") |
| 1343 | .replace(">", ">")) |
| 1344 | |
| 1345 | excl = "\n".join( |
| 1346 | f"- {_scrub(c.get('category'))} at {_scrub(c.get('filePath'))}: " |