@@ -420,7 +420,7 @@ pub fn get_escalation(conn: &Connection, escalation_id: &str) -> Result<Escalati
420420 .with_context(|| format!("escalation not found: {escalation_id}"))
421421}
422422
423- // ── Seed from HEARTBEAT.md ─── ────────────────────────────────────────────────
423+ // ── Seed default system tasks ────────────────────────────────────────────────
424424
425425/// Default system tasks that are always seeded and cannot be deleted.
426426const DEFAULT_SYSTEM_TASKS: &[&str] = &[
@@ -429,36 +429,18 @@ const DEFAULT_SYSTEM_TASKS: &[&str] = &[
429429 "Monitor system health (Ollama, memory, connections)",
430430];
431431
432- /// Seed default system tasks + any tasks from HEARTBEAT.md into SQLite.
432+ /// Seed default system tasks into SQLite.
433433/// Skips tasks whose title already exists. Returns the count of newly created tasks.
434- pub fn seed_from_heartbeat (conn: &Connection, workspace_dir: &Path ) -> Result<usize> {
434+ pub fn seed_default_tasks (conn: &Connection) -> Result<usize> {
435435 let mut count = 0;
436436
437- // 1. Always seed the default system tasks
438437 for title in DEFAULT_SYSTEM_TASKS {
439438 if !task_title_exists(conn, title)? {
440439 add_task(conn, title, TaskSource::System, TaskRecurrence::Pending)?;
441440 count += 1;
442441 }
443442 }
444443
445- // 2. Also import from HEARTBEAT.md if it exists
446- let heartbeat_path = workspace_dir.join("HEARTBEAT.md");
447- if let Ok(content) = std::fs::read_to_string(&heartbeat_path) {
448- let tasks: Vec<&str> = content
449- .lines()
450- .filter_map(|line| line.trim().strip_prefix("- "))
451- .filter(|s| !s.is_empty())
452- .collect();
453-
454- for title in tasks {
455- if !task_title_exists(conn, title)? {
456- add_task(conn, title, TaskSource::System, TaskRecurrence::Pending)?;
457- count += 1;
458- }
459- }
460- }
461-
462444 Ok(count)
463445}
464446
@@ -699,35 +681,21 @@ mod tests {
699681 }
700682
701683 #[test]
702- fn seed_from_heartbeat_imports_tasks () {
684+ fn seed_default_tasks_creates_system_tasks () {
703685 let conn = test_conn();
704- let dir = tempfile::tempdir().unwrap();
705- std::fs::write(
706- dir.path().join("HEARTBEAT.md"),
707- "# Tasks\n\n- Check email\n- Monitor skills\n",
708- )
709- .unwrap();
710686
711- let count = seed_from_heartbeat (&conn, dir.path() ).unwrap();
712- assert_eq!(count, 2 );
687+ let count = seed_default_tasks (&conn).unwrap();
688+ assert_eq!(count, DEFAULT_SYSTEM_TASKS.len() );
713689
714690 // Second seed should not duplicate
715- let count2 = seed_from_heartbeat (&conn, dir.path() ).unwrap();
691+ let count2 = seed_default_tasks (&conn).unwrap();
716692 assert_eq!(count2, 0);
717693
718694 let tasks = list_tasks(&conn, false).unwrap();
719- assert_eq!(tasks.len(), 2 );
695+ assert_eq!(tasks.len(), DEFAULT_SYSTEM_TASKS.len() );
720696 assert!(tasks.iter().all(|t| t.source == TaskSource::System));
721697 }
722698
723- #[test]
724- fn seed_from_missing_heartbeat_returns_zero() {
725- let conn = test_conn();
726- let dir = tempfile::tempdir().unwrap();
727- let count = seed_from_heartbeat(&conn, dir.path()).unwrap();
728- assert_eq!(count, 0);
729- }
730-
731699 #[test]
732700 fn recurrence_roundtrip() {
733701 assert_eq!(
0 commit comments