Private
Public Access
0
0

last progress before ending last session

This commit is contained in:
2026-05-17 12:40:10 -04:00
parent a5c0569417
commit a55a1200a0
3 changed files with 68 additions and 16 deletions
+18 -3
View File
@@ -129,9 +129,24 @@ def _summarise_generic(path: Path, content: str) -> str:
line_count = len(lines)
suffix = path.suffix.lstrip(".").upper() or "TEXT"
parts = [f"**{suffix}** — {line_count} lines"]
preview = lines[:8]
if preview:
parts.append("preview:\n```\n" + "\n".join(preview) + "\n```")
# Heuristic for C-style languages
important_lines = []
for line in lines[:200]:
trimmed = line.strip()
if not trimmed or trimmed.startswith("//") or trimmed.startswith("/*") or trimmed.startswith("*"):
continue
if re.match(r'^\s*(class|struct|namespace|enum|template|void|int|float|double|char|bool|virtual|static|inline|extern|#define|#include)\b', line):
important_lines.append(trimmed)
if len(important_lines) >= 15:
break
if important_lines:
parts.append("Key elements / Outline:\n- " + "\n- ".join(important_lines))
else:
preview = [l for l in lines[:10] if l.strip()]
if preview:
parts.append("preview:\n```\n" + "\n".join(preview) + "\n```")
return "\n".join(parts)
_SUMMARISERS: dict[str, Callable[[Path, str], str]] = {