-
Notifications
You must be signed in to change notification settings - Fork 184
Fix communicate-score cycle-boundary sentinel resets #447
Copy link
Copy link
Closed
Description
Summary
workflow::communicate-score can re-inject incorrectly around cycle transitions because the resolved-this-cycle guard is not fully wired through the framework's cycle-boundary reset points.
Repro
- Let
workflow::communicate-scoreinject and resolve it. - Trigger a follow-up scan / reconcile pass.
- The workflow gate can re-evaluate after
previous_plan_start_scoresis cleared. - In objective-only or PRR-style flows,
sync_communicate_score_needed()may re-inject unexpectedly unless a separate resolved-this-cycle sentinel survives the same cycle.
Root cause
The guard logic needs two pieces:
- a
communicate_score_resolved_this_cyclesentinel checked bysync_communicate_score_needed() - a boundary reset helper that clears that sentinel only at true cycle boundaries
Without both halves wired consistently, one of two bad outcomes happens:
- the item re-injects after resolve + rescan in the same cycle, or
- the sentinel survives too long and suppresses the next real cycle
Proposed fix
- gate
sync_communicate_score_needed()oncommunicate_score_resolved_this_cycle - set the sentinel when the workflow item is injected
- clear it at the same true cycle boundaries as the other workflow sentinels:
- force-rescan reset
- plan-start score seeding
- queue-drain / plan-start clear
- trusted review import
Regression coverage
Add focused tests for:
- helper-level clearing of
clear_communicate_score_sentinel() - score seeding clearing all workflow sentinels
- force-rescan clearing all workflow sentinels
- queue-drain clearing all workflow sentinels
- trusted import clearing all workflow sentinels
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels