feat(autoupdate): sweep immediately on channel-binary change #97

Merged
Claude-Run merged 1 commit from feat/VS-75-immediate-autoupdate-on-channel-change into main 2026-07-01 23:30:11 +02:00
Member

VS-74 shipped the scheduled auto-update sweep but only covered AC1's "on a schedule" half: a fresh channel binary was picked up on the next tick, up to one intervalsecs late. This wires the immediate-on-change trigger.

AgentBinaryRefresher::refresh_now now returns a RefreshOutcome (fetch report plus catalog_changed), computed by comparing the served id->hash fingerprint before vs after the hot-swap, so a no-op reload (same bytes) does not fire. AgentBinaryRefresherHandle carries a shared tokio Notify: every refresh site (boot periodic task, admin force-refresh, live settingsupdate rebuild) shares the one handle and calls notify_changed() on a changed refresh. A single listener spawned in vervain_web::start (agent_autoupdate::spawn_change_trigger) awaits the signal and runs run_sweep, which is unchanged and already re-checks enabled and applies batchsize, so the kill switch and pacing are honored. Notify coalesces, so a change coinciding with a scheduled tick collapses to at most one extra sweep.

Tests: catalog fingerprint detects content/add/removal changes and treats identical bytes as unchanged; the change trigger pushes to a behind agent on signal when enabled and is a no-op when the kill switch is off.

#VS-75

VS-74 shipped the scheduled auto-update sweep but only covered AC1's "on a schedule" half: a fresh channel binary was picked up on the next tick, up to one intervalsecs late. This wires the immediate-on-change trigger. AgentBinaryRefresher::refresh_now now returns a RefreshOutcome (fetch report plus catalog_changed), computed by comparing the served id->hash fingerprint before vs after the hot-swap, so a no-op reload (same bytes) does not fire. AgentBinaryRefresherHandle carries a shared tokio Notify: every refresh site (boot periodic task, admin force-refresh, live settingsupdate rebuild) shares the one handle and calls notify_changed() on a changed refresh. A single listener spawned in vervain_web::start (agent_autoupdate::spawn_change_trigger) awaits the signal and runs run_sweep, which is unchanged and already re-checks enabled and applies batchsize, so the kill switch and pacing are honored. Notify coalesces, so a change coinciding with a scheduled tick collapses to at most one extra sweep. Tests: catalog fingerprint detects content/add/removal changes and treats identical bytes as unchanged; the change trigger pushes to a behind agent on signal when enabled and is a no-op when the kill switch is off. #VS-75
feat(autoupdate): sweep immediately on channel-binary change
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m0s
Create release / Create release from merged PR (pull_request) Has been skipped
909ed0bc4f
VS-74 shipped the scheduled auto-update sweep but only covered AC1's "on a schedule" half: a fresh channel binary was picked up on the next tick, up to one intervalsecs late. This wires the immediate-on-change trigger.

AgentBinaryRefresher::refresh_now now returns a RefreshOutcome (fetch report plus catalog_changed), computed by comparing the served id->hash fingerprint before vs after the hot-swap, so a no-op reload (same bytes) does not fire. AgentBinaryRefresherHandle carries a shared tokio Notify: every refresh site (boot periodic task, admin force-refresh, live settingsupdate rebuild) shares the one handle and calls notify_changed() on a changed refresh. A single listener spawned in vervain_web::start (agent_autoupdate::spawn_change_trigger) awaits the signal and runs run_sweep, which is unchanged and already re-checks enabled and applies batchsize, so the kill switch and pacing are honored. Notify coalesces, so a change coinciding with a scheduled tick collapses to at most one extra sweep.

Tests: catalog fingerprint detects content/add/removal changes and treats identical bytes as unchanged; the change trigger pushes to a behind agent on signal when enabled and is a no-op when the kill switch is off.

#VS-75
Claude-Run deleted branch feat/VS-75-immediate-autoupdate-on-channel-change 2026-07-01 23:30:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!97
No description provided.