You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(history): future-dated ramp steps can still crowd a due pending approval out of the actionable fetch #680
Residual of #632 after PR1 (terminal rows no longer starve actionable rows): inside the actionable class, far-future ramp steps are pending with a scheduled_date months ahead and sort first under ORDER BY scheduled_date DESC, so they can fill the actionable cap and hide a pending approval dated today.
Current behaviour
GetExecutionsByStatuses (internal/config/store_postgres.go:~1375) orders scheduled_date DESC with a hard clamp of MaxListLimit (1000). Plan creation writes up to 52 pending ramp steps per plan (internal/api/handler_plans.go createPurchaseExecutionsTx). About 20 plans saturate 1000 rows. truncated is set when the cap is hit, so the loss is flagged but not prevented.
Steps to verify the gap
Create 20+ ramp plans (52 future pending steps each) plus one pending approval due today; load History: the due-today row is absent and truncated is true.
Expected behaviour
Rows that are actionable now (due, notified, scheduled with a near fire time, approved/running/paused) are fetched before future-dated unactionable ramp steps.
Proposed fix
In the SQL method added by #632 PR2 (filtered executions query): order actionable rows by proximity to now (for example ABS(EXTRACT(EPOCH FROM scheduled_date - now()))) or exclude pending rows whose scheduled_date is beyond a horizon; add a failing-first test with 20 x 52 future rows plus one due row (pgxmock SQL shape plus testcontainers integration where available).
References
Parent #632, umbrella #248, #630. Found in the #632 PR1 plan review. Severity: medium.
Activity
fix(history): fetch actionable executions separately so terminal rows…
IAmJSD commentedon Oct 16, 2026
Claiming: working on this
fix(history): sort future pending ramp steps after due rows in the ac…