sd-notify 0.5 drops the unset_environment bool from notify() (we always
passed false; the unset variant is a separate function we never used).
toml 1.x is API-compatible for our Config deserialization and its MSRV
is exactly 1.85, matching the project floor. zbus stays on 5.x: v6
requires rustc 1.89, past the Ubuntu 24.04 toolchain this repo commits
to. Resolver locked all updated deps at Rust-1.85-compatible versions.
The code default stays 30 s for configs that omit the key, but 30 s
false-locks with the companion beacon (event gaps of 25-60 s are
routine). Docs now say explicitly that shipped configs must set 60+.
Two false locks with the phone present: missing_after=30 sat below the
realistic worst-case event gap (beacon counter rotation every 10s times
2-20% duty sampling, with frozen-RSSI dedupe collapsing catches inside
one window), and the connect probe ran while our own discovery
duty-cycling was active, where attempts stall or abort with
le-connection-abort-by-local.
Probe now stops discovery first and retries (2x6s); sample config and
handoff document the sampling math. Local config additionally raises
rssi_lock to -85, where nearby-phone readings were pinning.
Option A adds the Gitea Debian registry as an apt source (updates land
with apt upgrade), option B installs a release .deb directly; both share
the same per-user setup steps.
cargo-deb metadata produces a .deb with the binary, the packaged user
unit variant, man page and example config; arm64 cross-builds as a
static musl binary via an isolated rustup and rust-lld (recipe in
README). Add MIT LICENSE for the package copyright.
After locking, wait for the session to come back (logind Unlock,
ScreenSaver ActiveChanged, or a new session after re-login) and post a
notification saying the phone left Bluetooth range and how long ago.
On by default, off with unlock_notice = false. Hidden test-notice
subcommand exercises the path without a real lock.
The event stream was invisible at the default log level: only state
changes were logged, so a healthy or silent beacon feed looked the
same in the journal. Summarize sighting count, last RSSI and state
per minute at INFO — zero updates in a report now exposes a silent
stretch immediately.
With the beacon app advertising reliably from a foreground service and
rotating its payload, the pause-tolerant 120s missing_after is no longer
needed: 30s/15s restores a ~40s lock after leaving while the 10s connect
probe keeps guarding against silent stretches. Third-party beacon apps
still warrant 120s; the comments now say which tier applies.
Kotlin/Compose foreground service advertising a connectable legacy
advertisement at ~1 Hz with a counter that rotates in ServiceData every
10s: changed payload values make BlueZ emit PropertiesChanged even when
the RSSI repeats, keeping the daemon's freshness clock fed for a
stationary phone. Running from a foreground service with a battery
optimization exemption defeats the advertising pauses that caused the
false locks. Replaces third-party beacon apps; the daemon needs no
changes. Verified with a real Gradle build (AGP 8.13.2, Kotlin 2.3.21,
compileSdk 36).
Distill the session findings (BlueZ RSSI dedupe, beacon pauses, MSRV
pinning, scan-only decision) so future agents and humans don't have to
rediscover them. AGENTS.md carries the rules, docs/HANDOFF.md the
history and open threads.
Beacon apps pause advertising while the phone sits still, so the 30s
default for missing_after_secs false-locked. Ship 120s plus comments
explaining the beacon pauses and the 10s pre-lock connect probe;
presence_timeout_secs 30 pairs with the duty escalation.
The phone's beacon app pauses advertising for stretches while in range,
which is what the 3s probe could not bridge. Give the controller a 10s
window to find the phone, and log probe outcomes at INFO/WARN so the
journal explains every lock decision.
BlueZ dedupes identical RSSI values, so a stationary phone can go quiet
in the event stream while in range. At the 2% present duty cycle the
~1Hz beacon was caught less often than presence_timeout, causing
Present/Suspect flapping and locks after 60s of silence with the phone
at -60 dBm.
- Present: step up to the Suspect duty once the last sighting ages past
half of presence_timeout, without leaving Present
- Lock path: attempt a 3s LE connect to the phone first; success cancels
the lock and returns to Present, failure locks as before