refactor(heartbeat): remove Completed section and tighten section gating

- Remove ## Completed section from HEARTBEAT.md template; completed
  tasks should be deleted, not accumulated
- Change in_active_section from tri-state (None/True/False) to bool
  (True/False) so stray text before any ## heading no longer triggers
  heartbeat
- Add test cases for stray pre-heading text and ## Notes section
- Update docs/chat-commands.md to reference ## Active Tasks
This commit is contained in:
chengyongru
2026-05-31 15:15:37 +08:00
committed by Xubin Ren
parent 2671c8fe55
commit 15c2bd25b3
4 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ _HEARTBEAT_PREAMBLE = (
def _heartbeat_has_active_tasks(content: str) -> bool:
"""True if HEARTBEAT.md has task lines, ignoring headers, blanks and comments."""
in_comment = False
in_active_section: bool | None = None
in_active_section: bool = False
for line in content.splitlines():
stripped = line.strip()
if in_comment: