Skip to content

fix(dag): sweep freeze window covers the live watcher's actual cadence - #359

Merged
LeXwDeX merged 3 commits into
devfrom
feat/342-issue342
Aug 19, 2026
Merged

fix(dag): sweep freeze window covers the live watcher's actual cadence#359
LeXwDeX merged 3 commits into
devfrom
feat/342-issue342

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Closes#342

What

The sweep's freeze window derived solely from the current persisted config cadence. Replan can lower a running node's timeout_ms while the A1/Q2 re-time gate deliberately keeps the old watcher on its old (longer) cadence — a config-only window is then shorter than the live watcher's cycle and sweeps a healthy node mid-decision-window.

Fix: window = max(config cadence, escalateIntervalDurable(deadline_ms, started_at)).

deadline_ms is only ever written as grant time + timeout_ms — at spawn and at each deadline extension (escalations move only the counter, never the deadline; verified in projector.tsNodeTimeoutEscalated vs NodeDeadlineExtended folds). So (deadline − started_at) — the sum of the initial grant plus every extension grant — is always ≥ the last grant, and the last grant's timeout IS the live watcher's cadence. The bound over-estimates after extensions (delays detection, never causes a premature settle); missing columns (legacy rows) return 0 so the config decides alone.

Tests

Note: the 3 wall-clock-sensitive integration cases in this file fail on this loaded local machine at f25f37d7e too (pre-date this change); CI is the arbiter.

The window derived solely from the current persisted config; replan can lower
a running node's timeout_ms while the A1/Q2 re-time gate keeps the old watcher
on its old cadence, so a config-only window could be shorter than the live
watcher's cycle and prematurely settle a healthy node. deadline_ms is only
ever written as grant-time + timeout (spawn and each extension; escalations
move only the counter), so (deadline - started_at) upper-bounds the watcher's
current cadence in every shape. Window = max(config cadence, durable bound).
Closes#342
@LeXwDeX
LeXwDeX merged commit 2d7b312 into devAug 19, 2026
6 checks passed
@LeXwDeX
LeXwDeX deleted the feat/342-issue342 branch August 19, 2026 03:58
Sign up for freeto 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.

1 participant

@LeXwDeX