Skip to content

[FIX] Count a passed datetime as overdue in the morning digest - #143

Merged
puretensor merged 2 commits into
mainfrom
grok/review/morning-digest-overdue
Oct 25, 2026
Merged

puretensor merged 2 commits into
mainfrom
grok/review/morning-digest-overdue

Conversation

@puretensor

Copy link
Copy Markdown
Owner
  • Seat: grok-4.7 / xhigh (adversarial review wave 7, 2026-10-25)

  • Category: [FIX]

  • Problem / Opportunity: The 07:00 London digest asks the filter for today | overdue, then splits that list by comparing the raw deadline text with today's date. A datetime sorts after the date-only string "YYYY-MM-DD", so an instant that has already passed is filed under DUE TODAY. A deadline overdue cannot read (julianday is NULL, including a 10-character string that only looks like a date) is filed there too. docs/dsl.md says those rows are overdue.

  • Evidence: On the unfixed split, with the deadline written by SQL after create (create normalises an offset into UTC and hides the comparison):

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin CARGO_TARGET_DIR=/tmp/ptask-target-digest cargo +1.98.1 test -p ptask-bot --lib morning_digest_counts_a_passed_datetime -- --test-threads=8 --nocapture
thread 'digest::tests::morning_digest_counts_a_passed_datetime_on_todays_date_as_overdue' panicked at crates/ptask-bot/src/digest.rs:251:9:
a datetime already past must be overdue even when its text starts with today, got:
☕ pTask digest 2026-10-25

📅 DUE TODAY (1)
  PT-1 [normal] missed earlier today 2026-10-25T00:00:00+14:00
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 23 filtered out; finished in 0.03s

2026-10-25T00:00:00+14:00 is 10:00 UTC the previous day. SQLite agrees the instant is before noon UTC:

The same split files not-a-date and abcd-ef-gh under DUE TODAY (abcd-ef-gh sorts after 2026-10-25):

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin CARGO_TARGET_DIR=/tmp/ptask-target-digest cargo +1.98.1 test -p ptask-bot --lib morning_digest_counts_an_unreadable -- --test-threads=8 --nocapture
📅 DUE TODAY (1)
  PT-1 [normal] deadline we cannot read not-a-date
test result: FAILED. 0 passed; 1 failed; ... finished in 0.03s
env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin HOME=$(mktemp -d) CARGO_TARGET_DIR=/tmp/ptask-target-digest cargo +1.98.1 test -p ptask-bot --lib morning_digest_counts_a_dash_shaped -- --test-threads=1 --nocapture
📅 DUE TODAY (1)
  PT-1 [normal] deadline shaped like a date abcd-ef-gh
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 25 filtered out; finished in 0.04s

The overdue arm in crates/ptask-core/src/filter.rs is julianday IS NULL, or a 10-character date before today, or a longer datetime whose julianday is before now. docs/dsl.md states the same rule.

  • Change: morning_row_is_overdue keeps a real YYYY-MM-DD date on the date-only rule (due all day). Any other deadline is overdue once dates::parse_iso_to_utc says its instant is before now, and overdue when that parse fails. An empty deadline stays under DUE TODAY, so a row included only because due_at is today is unchanged. Version 3.51.6 in the workspace package, the six internal requirements, Cargo.lock, and docs/gen/pt.1.

  • Verification: On this branch, toolchain 1.98.1:

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin HOME=$(mktemp -d) RUSTUP_TOOLCHAIN=1.98.1 CARGO_TARGET_DIR=/tmp/ptask-target-digest cargo +1.98.1 test -p ptask-bot --locked -- --test-threads=8
test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.39s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin RUSTUP_TOOLCHAIN=1.98.1 CARGO_TARGET_DIR=/tmp/ptask-target-digest bash scripts/ci-version-check.sh
version-check: workspace, lockfile, internal requirements, and manpage agree on 3.51.6

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin RUSTUP_TOOLCHAIN=1.98.1 CARGO_TARGET_DIR=/tmp/ptask-target-digest bash scripts/generated-artifacts.sh --check
generated-artifacts: checked-in files match the CLI

env PATH=/usr/bin:/bin:/home/puretensorai/.cargo/bin HOME=$(mktemp -d) RUSTUP_TOOLCHAIN=1.98.1 CARGO_TARGET_DIR=/tmp/ptask-target-digest cargo +1.98.1 clippy -p ptask-bot --locked --all-targets -- -D warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.24s

The workspace suite, native-ml, and the dashboard sidecar were not run.

  • Risk & rollback: Only the morning-digest partition changes. Evening recap, the filter SQL, and task storage are untouched. Revert is one commit: v3.51.6: count a passed datetime as overdue in the morning digest.

puretensor and others added 2 commits October 25, 2026 05:37
The 07:00 split compared the raw deadline text with today's date. A
datetime sorts after that date, so an instant that had already passed
was filed under DUE TODAY, and so was a deadline the overdue filter
cannot read.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@puretensor
puretensor force-pushed the grok/review/morning-digest-overdue branch from 1dd1a13 to bfcc58c Compare October 25, 2026 05:39
@puretensor
puretensor merged commit 3b8243d into main Oct 25, 2026
5 checks passed
@puretensor
puretensor deleted the grok/review/morning-digest-overdue branch October 25, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant