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 <noreply@x.ai>
This commit is contained in:
2026-10-03 01:39:50 -07:00
co-authored by Grok 4.6
parent df987c3058
commit c4a8f9488d
3 changed files with 10 additions and 4 deletions
+3 -3
View File
@@ -102,6 +102,6 @@ Do not change heartbeat behaviour. Do not add a sleep.
## What the given tests pin ## 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 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 does nothing; a live previous run (Started + `hold`) is `SkippedJob` with no request and the
`started` is `failed` on the first tick (the due job may then run); speaker is `None`; two due ledger still says `started` (not `failed`); leftover `started` is `failed` on the first tick
minutes make two sessions. (the due job may then run); speaker is `None`; two due minutes make two sessions.
@@ -110,6 +110,12 @@ fn a_live_previous_run_skips_the_tick() {
}] }]
); );
assert!(server.requests_to(CHAT).is_empty()); 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); drop(held);
} }
@@ -6,7 +6,7 @@ use bxcore::{SessionId, Timestamp};
use loopd::channel::Context; use loopd::channel::Context;
use loopd::llama::Client; use loopd::llama::Client;
use loopd::memory::NoMemory; use loopd::memory::NoMemory;
use loopd::scheduler::{self, Scheduler, TickWork}; use loopd::scheduler::{Scheduler, TickWork};
use loopd::tools::Registry; use loopd::tools::Registry;
use std::sync::Arc; use std::sync::Arc;
use support::{FakeServer, Home, Reply, ScriptedPort}; use support::{FakeServer, Home, Reply, ScriptedPort};