refactor(node): delegate scheduler correlation check to the canonical predicate - #2846
Merged
trunk-io[bot] merged 1 commit intoJul 28, 2026
Conversation
… predicate The event-stream scheduler's `is_correlated` inlined the same three-key check (`request_id` / `goal_id` / `goal_status`) that `dora_message` already exposes as `carries_pattern_correlation`. That canonical function's own doc asks callers to keep it the single definition so the send-side, node-receive-side, and daemon-debug layers can never disagree on what "pattern-correlated" means. The scheduler is the one place that had drifted into a private copy. Today the two are identical, so there is no active bug — but if a fourth correlation key were ever added to `carries_pattern_correlation`, the scheduler would keep treating those messages as non-correlated and could evict them under queue pressure, silently breaking the service/action request-response contract this code exists to protect (dora-rs/adora#145). Delegate to `carries_pattern_correlation` and drop the duplicated key list. `REQUEST_ID`/`GOAL_ID`/`GOAL_STATUS` remain imported for the per-key log message in `log_correlation_drop`. Validation: `cargo test -p dora-node-api` (existing scheduler eviction tests), `cargo clippy`, and `cargo fmt --check` pass. This change was generated by Claude (Claude Code), an AI assistant. It is machine-generated and should be reviewed carefully before merging. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D2eu6P1CvTvoKdK9fK3ZSd
Contributor
|
😎 Merged successfully - details. |
Collaborator
Author
No issues found. Generated by Claude Code |
phil-opp
marked this pull request as ready for review
July 28, 2026 10:42
trunk-io
Bot
deleted the
claude/dreamy-bardeen-90d0pc-scheduler-correlation-dedup
branch
July 28, 2026 12:02
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.
Issue
The event-stream scheduler's
is_correlatedinlined the same three-key check (request_id/goal_id/goal_status) thatdora_messagealready exposes ascarries_pattern_correlation. That canonical function's own doc explicitly asks callers to keep it the single definition, so the send-side, node-receive-side, and daemon-debug layers can never disagree on what "pattern-correlated" means.The scheduler is the one place that had drifted into a private copy. The two are identical today, so there is no active bug — but if a fourth correlation key were ever added to
carries_pattern_correlation, the scheduler would keep treating those messages as non-correlated and could evict them under queue pressure, silently breaking the service/action request-response contract this eviction logic exists to protect (dora-rs/adora#145).Fix
Delegate
is_correlatedtocarries_pattern_correlationand drop the duplicated key list.REQUEST_ID/GOAL_ID/GOAL_STATUSremain imported for the per-key structured fields inlog_correlation_drop.Validation
cargo test -p dora-node-apipasses, including the existing scheduler eviction tests.cargo clippy ... -D warningsandcargo fmt --all --checkpass.🤖 Generated with Claude Code
https://claude.ai/code/session_01D2eu6P1CvTvoKdK9fK3ZSd
Generated by Claude Code