Repository navigation
fix(hosts): audit only liveness transitions, not every heartbeat - #107
Merged
Merged
Conversation
wstein
force-pushed
the
fix/101-liveness-audits
branch
from
October 16, 2026 11:33
037889c to
a018980
Compare
Owner
Author
Every accepted heartbeat wrote an undeletable audit row (about 8,640 per host per day). Heartbeats now only renew the connection row. Replacement is audited once as host_connection_replaced inside the replacement transaction, since the old close no longer matches the slot; a rate-limit close is audited as host_heartbeat_refused. Refs: #101 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The contract said 'slot/unknown audit as for any close' and 'audit every heartbeat mutation', which is ambiguous after the replacement and heartbeat changes. List the audited liveness events and update the acceptance IDs to the real test names. Refs: #101 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rites replacing? came from in-memory state, so a failed close write dropped the entry but left the slot's connection_id, and the next open overwrote it without the replaced audit. Read the slot inside the transaction and clear connection_id on a clean close. The steady-heartbeat test now asserts hosts last_seen/lease and slot state move. Refs: #101 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
host_connected is written at authenticated socket open, not hello, and heartbeats update hosts last_seen/lease plus slot state rather than a connection row. Refs: #101 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Clean close clears connection_id so a later open is not audited as a replacement and a restart writes no reset; no test failed without it. The steady-heartbeat test also never asserted the slot returns to connected. Refs: #101 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
wstein
force-pushed
the
fix/101-liveness-audits
branch
from
October 16, 2026 12:04
a018980 to
3322b21
Compare
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #101 (owner decision H57:a): audit only liveness transitions, not every heartbeat.
host_connected(authenticated socket open),host_connection_replaced(inside the replacement transaction),host_connection_unknown(stale, disconnect, identity invalid, other close),host_heartbeat_refused(rate-limit close),host_connection_reset(restart).hosts.last_seen/lease and set the slot to connected, with no audit row.connection_id.host-enrollment.mdlists the audited events. The first authenticated heartbeat audit follows in fix(hosts): audit the first authenticated heartbeat of a connection #105.Every new test fails without the code it protects. Review: CLEAR (Opus 5.5) on b0d363a after three rounds; carried to this rebased head by identical range-diff. Final
make checkafter the stack merges (H61). Stacked on #103 (#88).🤖 Generated with Claude Code