From c4a8f9488de5746351361625f8b52a950deab31a Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 3 Oct 2026 01:39:50 -0700 Subject: [PATCH] docs: M5d-2 given tests: unused import and leftover-held scheduler_heartbeat imported scheduler::{self} without using it, which clippy -D warnings would fail at task 06. The live-previous cron tick now asserts a held leftover stays started. Co-Authored-By: Grok 4.6 --- docs/plans/M5d2/07-loopd-scheduler-cron.md | 6 +++--- docs/plans/M5d2/files/crates/loopd/tests/scheduler_cron.rs | 6 ++++++ .../M5d2/files/crates/loopd/tests/scheduler_heartbeat.rs | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/plans/M5d2/07-loopd-scheduler-cron.md b/docs/plans/M5d2/07-loopd-scheduler-cron.md index 8d6e297..b206e07 100644 --- a/docs/plans/M5d2/07-loopd-scheduler-cron.md +++ b/docs/plans/M5d2/07-loopd-scheduler-cron.md @@ -102,6 +102,6 @@ Do not change heartbeat behaviour. Do not add a sleep. ## What the given tests pin A due job creates `job-mail-…` on slot 1 with the time line and the prompt; a job not due -does nothing; a live previous run (Started + `hold`) is `SkippedJob` with no request; leftover -`started` is `failed` on the first tick (the due job may then run); speaker is `None`; two due -minutes make two sessions. +does nothing; a live previous run (Started + `hold`) is `SkippedJob` with no request and the +ledger still says `started` (not `failed`); leftover `started` is `failed` on the first tick +(the due job may then run); speaker is `None`; two due minutes make two sessions. diff --git a/docs/plans/M5d2/files/crates/loopd/tests/scheduler_cron.rs b/docs/plans/M5d2/files/crates/loopd/tests/scheduler_cron.rs index c4356f7..35b05a5 100644 --- a/docs/plans/M5d2/files/crates/loopd/tests/scheduler_cron.rs +++ b/docs/plans/M5d2/files/crates/loopd/tests/scheduler_cron.rs @@ -110,6 +110,12 @@ fn a_live_previous_run_skips_the_tick() { }] ); assert!(server.requests_to(CHAT).is_empty()); + let text = home.read("jobs/runs.jsonl"); + assert!(text.contains("started"), "{text}"); + assert!( + !text.contains("failed"), + "a leftover still held is not closed as failed: {text}" + ); drop(held); } diff --git a/docs/plans/M5d2/files/crates/loopd/tests/scheduler_heartbeat.rs b/docs/plans/M5d2/files/crates/loopd/tests/scheduler_heartbeat.rs index 303250e..af3788f 100644 --- a/docs/plans/M5d2/files/crates/loopd/tests/scheduler_heartbeat.rs +++ b/docs/plans/M5d2/files/crates/loopd/tests/scheduler_heartbeat.rs @@ -6,7 +6,7 @@ use bxcore::{SessionId, Timestamp}; use loopd::channel::Context; use loopd::llama::Client; use loopd::memory::NoMemory; -use loopd::scheduler::{self, Scheduler, TickWork}; +use loopd::scheduler::{Scheduler, TickWork}; use loopd::tools::Registry; use std::sync::Arc; use support::{FakeServer, Home, Reply, ScriptedPort};