Skip to content

gw#613/th#965: universal app-level heartbeat — 0.41.0#362

Merged
PaulFidika merged 2 commits into
masterfrom
release/gw613-heartbeat
Jul 21, 2026
Merged

gw#613/th#965: universal app-level heartbeat — 0.41.0#362
PaulFidika merged 2 commits into
masterfrom
release/gw613-heartbeat

Conversation

@PaulFidika

Copy link
Copy Markdown
Contributor

Promotes gw#613 from chaos (b256f7e + 7bb9762; version conflict resolved
0.40.7 -> 0.41.0, uv.lock re-resolved with uv lock).

Layer 2 of th#965's 3-layer liveness contract: Hello declares
heartbeat_interval_ms=10000 and the worker force-re-sends the full
StateDelta every 10s from the asyncio event loop (the pgw#610 disk-report
task promoted to the beat — never a detached thread), starting at
startup() entry and continuing through drain until the stream closes. The
hub (tensorhub PR #534, lockstep — merge in the same window) reaps after 6
consecutive misses (~60s). Disk stats ride every beat but are measured at
most every 30s behind a TTL cache. New contract §3 event-loop discipline
clause: never block the loop longer than the miss window — already true:
setup/warmup/compile/residency/GC run off-loop via _to_thread_complete /
asyncio.to_thread.

Tests: tests/test_heartbeat_gw613.py (cadence declaration, force-send
bypasses edge suppression, beats flow while a startup coroutine is parked
= the gw#612 hang shape, drain beats until close, disk TTL); full suite ex
tests/convert green on this head (437 passed / 5 skipped).

After merge: tag v0.41.0 to publish the wheel (publish.yml trusted
publishing).

🤖 Generated with Claude Code

… liveness contract (0.41.0)

Hello declares heartbeat_interval_ms=30000; the pgw#610 disk-report task is
promoted to the beat: it force-re-sends the full StateDelta every 30s from
the asyncio event loop (the control loop that owes progress, never a
detached thread), starts at startup() entry so boot hangs are covered, and
keeps beating through drain until the stream closes. Edge-triggered deltas
still flow as before; the beat is the same message re-sent unchanged.
Contract §3 rewritten to the 3-layer model (lockstep tensorhub c03a531d).
Tests: hello cadence, force-send bypasses edge suppression, beats flow
while a startup coroutine is parked (the gw#612 shape), drain keeps
beating until close.
…ing every beat

HEARTBEAT_INTERVAL_MS 30000 -> 10000 (hub reaps at 6 misses, ~60s). The
pgw#610 statvfs/ref-index scan keeps its 30s measurement cadence behind a
TTL cache so the 10s beat never turns it into a hot loop; the report still
rides every StateDelta. Contract §3 event-loop discipline clause added —
already true in 0.41.0: setup/warmup/compile/residency/GC all run off-loop
(executor._to_thread_complete / asyncio.to_thread).
@PaulFidika
PaulFidika merged commit dd4c222 into master Jul 21, 2026
1 check passed
@PaulFidika
PaulFidika deleted the release/gw613-heartbeat branch July 21, 2026 08:26
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.

1 participant