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
+3 -1
View File
@@ -960,8 +960,10 @@ def test_heartbeat_retains_recent_messages_by_default():
("<!--\nmulti-line\ncomment\n-->\n", False), # block comment, not tasks
("<!-- single line -->\n", False),
("## Active Tasks\n\n- water the plants\n", True),
("## Completed\n\n- water the plants\n", False),
("## Active Tasks\n\n### Garden\n\n- water the plants\n", True),
("## Notes\n\nsome random note\n", False),
("stray text before any heading\n## Active Tasks\n\n- task\n", True),
("stray text before any heading\n", False),
],
)
def test_heartbeat_has_active_tasks(content, expected):