open-standards/wai/http-conformance/falsify/tick-noop.patch
Transaction Science 9786590154 wai: HTTP corpus round 4 — fetch_timed runs the session on a clock: the base ready before its refinement, the deadline from the verifying response, a refinement's whole-object 200 that never reaches the base
- wai_http_vectors: op fetch_timed (a script of base / base_once / refinement / tick
  steps, each at a time on the caller's clock) and ten timed_OS_* cases, held at
  generation to their outcomes: the base ready at the first step; deadlines that pass
  exactly at verification plus the deadline whether the clock was never told, told 0,
  stepped back before or after, or near the end of u64; a refinement 200 carrying the
  whole object with a base or enhancement byte changed, after the base is ready and
  before.
- http_verify.py: the session keeps the caller's clock (on_response carries it), the
  base and its time, frozen verified parts and a tick; a refinement's response keeps
  only its range; fetch_timed. Mutations base-at-done, tick-noop and
  refinement-unclipped each fail the timed cases; falsify/run.sh runs them.
- Falsify patches: base-ready-at-done, tick-noop, refinement-200-whole,
  response-no-clock, deadline-wraps; reuse-stale regenerated for the moved context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 02:46:20 -04:00

16 lines
910 B
Diff

# must fail: timed_OS_base_ready_first timed_OS_clock_never_ticked timed_OS_clock_saturates
# tick never abandons a refinement past its deadline (session::FetchSession::tick)
diff --git a/wai/wai-rs/src/http_binding/session.rs b/wai/wai-rs/src/http_binding/session.rs
index ec31518e..6a10e5a6 100644
--- a/wai/wai-rs/src/http_binding/session.rs
+++ b/wai/wai-rs/src/http_binding/session.rs
@@ -397,6 +397,9 @@ impl FetchSession {
/// the end of `u64` gives a deadline at `u64::MAX`.
pub fn tick(&mut self, now_ms: u64) -> Vec<u32> {
self.now_ms = now_ms;
+ if self.policy.refinement_deadline_ms.is_some() {
+ return Vec::new();
+ }
let (Some(at), Some(d)) = (self.base_ready_at(), self.policy.refinement_deadline_ms) else { return Vec::new() };
if self.result.is_some() || now_ms < at.saturating_add(u64::from(d)) {
return Vec::new();