From 68c6fd7b2ad4b362ed3f131a197f57f6bb85968d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 28 Oct 2026 17:37:36 +0100 Subject: [PATCH] connector-spend: pin that a clock reading exactly at the window start is not behind it Co-Authored-By: Claude Opus 5.5 --- crates/model-connector/src/service.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/model-connector/src/service.rs b/crates/model-connector/src/service.rs index f831514..2837c84 100644 --- a/crates/model-connector/src/service.rs +++ b/crates/model-connector/src/service.rs @@ -3530,7 +3530,12 @@ mod tests { ); assert!(service.live.is_empty()); assert_eq!(service.window_spend(CALLER, 5), 3 * FIXTURE_USAGE_COST); - // Inside the full window the clock is not behind: an honest ceiling. + // At the window's first instant, and inside it, the clock is not + // behind: an honest ceiling. + assert_eq!( + refusal_at(&mut service, "at-start", 50_000, MAX_COST), + Refusal::SpendCeiling + ); assert_eq!( refusal_at(&mut service, "inside", 50_500, MAX_COST), Refusal::SpendCeiling