Repository navigation
fix: report the latest distill outcome without timestamp ties - #135
Merged
Merged
Conversation
…135, worker: codex gpt-6.1-sol) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015hgmcKdqHGU2isq8wv1ypU
puretensor
force-pushed
the
codex/review-ptask-distill-outcome-order
branch
from
October 15, 2026 08:16
bb8d396 to
922daad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: fix: report the latest distill outcome without timestamp ties
Severity: med
Failure scenario: record a successful
distill.runat12:00:00.100000Z, thendistill.failedat12:00:00.200000Z.GET /metricsreportspt_distill_last_run_ok 1even though the latest run failed. The query truncates both timestamps to whole seconds and treats the tie as success, suppressing the current-failure signal.Select the latest recorded outcome by the journal's monotonic id. This preserves the no-failures default, reports the later failure, and clears the gauge on a subsequent successful run.
Regression:
crates/ptask-server/tests/distill_outcome_order.rsdrives the actual HTTP router over a disposable SQLite database, covering the initial state, success followed by failure within one second, and subsequent recovery.Exact red/green command (same command before and after the fix):
Against unchanged
origin/mainproduction code:test result: FAILED. 0 passed; 1 failed(gauge 1 instead of 0). With this fix:test result: ok. 1 passed; 0 failed.Gate: ran
cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace --locked. Formatting passes. Clippy has only the two recorded baselineclippy::nonminimal_boolerrors incrates/ptask-cli/tests/terminal_safety.rs:78andcrates/ptask-cli/src/ui.rs:946(exit 101). Existing assertions are unchanged. The separately executedcargo test --workspace --lockedpasses (exit 0). All runs use an isolated HOME, restricted PATH, andCARGO_TARGET_DIR=$PWD/target; no native-ml feature build.