Repository navigation
Allow fixed calendar time for manual scheduler passes - #156
Conversation
Register a new clock test module and make the shared test state and helpers visible to it. The fake host now records the times it is queried and filters due jobs by enabled flag and next run, and gains a due_jobs_excluding variant so clock-driven scheduling can be exercised. Auto-committed-on: macbook
Add unit tests covering the schedule clock's timing behaviour so that future changes to scheduling logic are guarded against regressions. Auto-committed-on: macbook
Manual schedulers now accept an optional `now` config value that pins calendar time for due selection, run records and rescheduling without touching the machine clock, and automatic loops reject it. The contract version is bumped to 4 to advertise the new option. Auto-committed-on: macbook
…tants Extend the manual-tick clock tests so a recurring job is also due at the supplied instant and its next occurrence is computed from that fixed time, and add a test rejecting malformed calendar values. The README now documents the fixed-instant option and its contract version requirement. Auto-committed-on: macbook
Add a paused-time test asserting that the clock's sleep advances tokio's timer by the requested duration while leaving the calendar instant unchanged. Enable tokio's test-util feature in dev-dependencies so paused time is available. Auto-committed-on: macbook
Drop the unused `Clock` trait import from the schedule clock tests, since the tests no longer need it in scope. Auto-committed-on: macbook
The artifact test now supplies a fixed `now` value in the module config and checks that the recorded `started_at` and `finished_at` fields match it, so the test verifies the injected clock is actually used instead of relying on the default empty config. Auto-committed-on: macbook
Tiny Sweeper reviewTiny Sweeper reviewed this change across 5 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Could not review: crates/tinyflows-module/README.md, crates/tinyflows-module/tests/module_artifact_tests.rs Before merge
How this fits togetherflowchart LR
n0["StartScheduler<br/>changed"]:::changed
n1["every<br/>changed"]:::changed
n2["...dation_without_linking_engine_into_client<br/>changed"]:::changed
n3["Value"]:::impacted
n4["...ec_defaults_and_request_types_deserialize"]:::impacted
n5["connections"]:::impacted
n6["..._flow_directly_and_preserves_run_identity"]:::impacted
n7["...uler_lifecycle_uses_module_tick_and_drain"]:::impacted
n8["Schedule"]:::impacted
n0 -->|uses| n3
n1 -->|uses| n8
n2 -->|uses| n0
n2 -->|uses| n3
n3 -->|uses| n8
n4 -->|calls| n1
n4 -->|tests| n1
n6 -->|uses| n3
n6 -->|calls| n5
n6 -->|tests| n5
n7 -->|uses| n0
n7 -->|calls| n5
n7 -->|tests| n5
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinyflows-module/README.md, crates/tinyflows-module/tests/module_artifact_tests.rs.
$0.0079 · 647,766 in / 28,888 out · 20,544 cached (3%) · ladder/vectors-oai3, glm-5.3-flash, , deepseek-v4.1-flash · 500 embedded
critique: $0.0037 · 271,907 in / 14,096 out · 0 cached (0%) · glm-5.3-flash, , deepseek-v4.1-flash
security: $0.0021 · 274,659 in / 3,917 out · 18,368 cached (7%) · glm-5.3-flash, deepseek-v4.1-flash
tests: $0.0016 · 60,692 in / 7,917 out · 2,176 cached (4%) · glm-5.3-flash, deepseek-v4.1-flash
description: $0.0003 · 34,172 in / 584 out · 0 cached (0%) · glm-5.3-flash
What and why
Manual scheduler passes can now supply
StartScheduler.config.now, an RFC3339 calendar instant. Due-job selection, run timestamps, and recurrence use that same instant, allowing hosts and tests to process future schedules without waiting or changing the machine clock. Omitting it preserves system time; automatic poll loops reject a fixed instant.Schedule contract version 4 advertises this additive setting. Retry sleeps continue to use Tokio timers independently of calendar time.
Validation
cargo test -p tinyflows-module -p tinyflows-bus: passed (90 tests; the artifact test is separately gated by the existing script).bash scripts/verify-module-artifact.sh: passed, including a fixed-time pass through the compiled dylib and TinyBus.cargo clippy -p tinyflows-module -p tinyflows-bus --all-targets --all-features -- -D warnings: passed.cargo fmt --all -- --check: passed.Tests cover one-shot due boundaries, recurring next-run calculation, run timestamps, invalid instants, refusal of frozen automatic loops, and Tokio retry sleep with fixed calendar time. Updated the module README and the bus contract documentation.
Summary by CodeRabbit