Files
cthulhu/docs/tentacle-diagnostics.md
T

3.1 KiB

Tentacle diagnostics

With debug logging enabled, the reader records Tentacle activation, failure, disable, process exit and cleanup; failed requests; remote approval and lease opening; rejected remote operations; queue exhaustion; policy cancellation and lease revocation. Records identify the installed Tentacle and process session. Remote records also carry an epoch (connection generation). Revocation records include the last operation sequence and milliseconds remaining until expiry. A negative remaining duration indicates that the deadline has passed.

remote keyboard capture ended describes keyboard cleanup, not necessarily the original disconnect. Look earlier for tentacle remote revoked, queue or policy records, and tentacle child diagnostic. An expired revocation is the reader's local heartbeat watchdog; it does not by itself prove internet failure. A child network, timeout or closed reason describes its relay transport; peer means membership/origin validation failed, and protocol means a message was rejected. These are observations, not proof of which remote machine or network component caused the problem. Child diagnostics are explicitly attributed claims.

Remote's updated executable emits version 1 JSON lines on stderr. Older readers discard these. Both reader and Tentacle must be rebuilt to get relay diagnostics; rebuilding only the reader adds host diagnostics. This does not change stdout RPC or the protocol negotiation version.

A record has cthulhu_diagnostic: 1, numeric epoch and elapsed_ms, and fixed phase and reason classifications. A failed reader call can include an operation from the remote RPC vocabulary. Epoch zero means a process-level record or call without an attached generation. Connection final elapsed time is measured from the start of the connection attempt; reader-call elapsed time is that call's duration. Other records use zero when duration is not measured.

The host validates the vocabulary in internal/tentacle/diagnostics.go, rejects unknown fields and records over 1024 bytes, and retains the existing 64 KiB lifetime stderr budget. Partial final lines and ordinary stderr are discarded. Remote stops emitting after 48 KiB, with one final diagnostics/limit record, so repeated connection attempts cannot exhaust the host limit through these diagnostics alone. Restart the Tentacle to reset that budget. It never inserts arbitrary stderr into logs. Diagnostic records contain no channel keys, lease tokens, clipboard content or relay payloads. Existing speech and other debug logging can contain private content; redact logs before sharing.

Focused automated checks cover streaming/chunk boundaries, oversized and invalid records, lease lifecycle logging and token omission, and remote error categories. For live validation, use a rebuilt reader and Remote executable, connect and exchange speech/keyboard input, return with F11, then disconnect. Confirm the log contains an opening/ready/closed sequence and a host lease revocation for the same session and epoch. If an unexpected drop recurs, preserve the entire debug log before restarting, including the records preceding keyboard cleanup.