Skip to content

fix(console): emit the saturating state for growing backlog - #12

Closed
albertovincenzi wants to merge 2 commits into
fix/live-pacing-statefrom
fix/saturating-backlog-state
Closed

fix(console): emit the saturating state for growing backlog#12
albertovincenzi wants to merge 2 commits into
fix/live-pacing-statefrom
fix/saturating-backlog-state

Conversation

@albertovincenzi

Copy link
Copy Markdown
Collaborator

Dependency

Stacked on #11 because saturating is the growing form of its live pacing state. Review this PR as the additional trend detector only.

Problem

The Vue console had complete UI branches for saturating, but the server never emitted that value. “Needs attention” and “growing backlog” were therefore unreachable regardless of queue growth.

Fix

  • retain the previous backlog sample per graph;
  • emit saturating when a non-zero live backlog grows between samples;
  • hold a growth observation for 15 seconds to bridge depth-cache and UI polling cadence;
  • clear it immediately when backlog decreases or drains;
  • add deterministic clock-controlled unit tests for growth, hold, expiry, and drain.

Review notes for Alice

The first sample is deliberately only pacing: one depth value cannot establish a trend. The tracker is per Gate process and advisory; admission remains entirely broker-driven. A decrease clears saturation immediately so recovery is visible without waiting out the hold.

State priority is downsaturatingpacingflowing.

Verification

  • cargo test -p gate-server obs::tests::
  • cargo clippy -p gate-server --all-targets -- -D warnings
  • cargo fmt --all -- --check

albertovincenzi and others added 2 commits September 4, 2026 23:06
One sample above the last latched the state for fifteen seconds. Stacked on the
live-backlog change, `backlog` now sums every stage source, so a graph that is
working is essentially never at zero and moves between polls — 100, 120, 100,
120 re-latches on every upward reading and pins a healthy graph in the
Overview's "needs attention" list, warn-coloured, for as long as it is busy.

`StatusDot` calls the state "backlog growing faster than the drain". Two
consecutive increases is the shortest sequence that can tell that from jitter,
and the cadence is not ours to trust either: four views poll this route, a
legacy-route navigation samples out of band, and two open tabs double the rate.

Also: nothing ever removed an entry from the sample map, and the key is a graph
name. `retain` is called from the one route that samples.

Claude-Session: https://claude.ai/code/session_012K8u7BEJyd6nDNMCQAgH3z
@alice-viola

Copy link
Copy Markdown
Contributor

Landed on master via #67 (merge commit 944ee9b) as part of the 62-PR integration — this PR's head commit 67bc33a is an ancestor of master. GitHub could not mark it merged automatically because its base is fix/live-pacing-state, not master. Closing as landed.

@alice-viola alice-viola closed this Sep 7, 2026
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.

2 participants