docs(core): scope the unit-identifier scrub to what it actually removes - #670
Open
yuzi-co wants to merge 1 commit into
Open
docs(core): scope the unit-identifier scrub to what it actually removes#670yuzi-co wants to merge 1 commit into
yuzi-co wants to merge 1 commit into
Conversation
Greptile SummaryThe PR narrows the documentation for
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/openlogi-core/src/config/device.rs | Documentation-only clarification accurately scopes identifier scrubbing and resolves the previously reported description of raw-HID keys. |
Reviews (2): Last reviewed commit: "docs(core): scope the unit-identifier sc..." | Re-trigger Greptile
`DeviceIdentity::without_unit_identifiers` was documented as removing per-unit identifiers before a model snapshot is persisted. It removes them from the identity body only. The configuration key has to be stable and unique per physical unit, so `DeviceStableId::runtime_key` embeds an identifier directly: `direct:` and `unknown:` keys carry the device's own serial number or unit id, `raw:` keys carry an OS-node- or serial-derived route identity, and a `receiver:` key carries the receiver's UID. A saved config therefore still names the identifier the doc claimed had been removed. Stripping the body is only effective for `receiver:` keys, where the key names the receiver and pairing slot rather than the paired device. That is also the only key shape the scrub is exercised against: the `persisted_identity_strips_per_unit_identifiers` test uses `receiver:test:slot:1`, and `docs/config.example.toml` contains `receiver:` keys exclusively. Comment text only; no behavior change.
yuzi-co
force-pushed
the
docs/unit-identifier-scrub-scope
branch
from
August 19, 2026 15:59
f900af7 to
be61ab3
Compare
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.
Summary
DeviceIdentity::without_unit_identifiersis documented as:It removes them from the identity body. The saved file still names them, because a device's configuration key has to be stable and unique per physical unit and
DeviceStableId::runtime_keyembeds an identifier directly:So a real config contains, for one mouse:
The field is blanked; the same four bytes appear in hex in the table name and again in
selected_device. On the config I checked this against, the device's unit id occurs 5 times in the file and the receiver's UID 6 times.raw:keys carry a route identity rather than a device identity.runtime_keywrites whateverDeviceRoute::RawHid::identityholds, andtransport.rs::device_identitybuilds that asserial:<serial>when the node reports one andid:<os node>otherwise. Persistence filters throughraw_identity_is_physical, which acceptsserial:andstable:and rejects the transientid:form - so a persistedraw:key does write a real serial number into the key whilewithout_unit_identifiersclearsmodel_info.serial_number.Where the scrub does work
receiver:keys.receiver:<uid>:slot:<n>names the receiver and pairing slot, not the paired device, so clearing the body genuinely keeps the device's identifiers out of the file. (The receiver's own UID is still there.)That is also the only shape the scrub is exercised against:
persisted_identity_strips_per_unit_identifiersusesreceiver:test:slot:1docs/config.example.tomlcontainsreceiver:aabbccdd:slot:Nkeys exclusively - nodirect:orraw:example anywhereThe tested shape and the documented shape are both the shape where the scrub is effective. The shapes where it is a no-op are neither.
Change
Doc comment only. It now states that the body is stripped, and that the config key still carries an identifier - the device's own serial number or unit id for
direct:andunknown:keys, an OS-node- or serial-derived route identity forraw:keys, and the receiver's UID forreceiver:keys - withreceiver:the one shape where stripping is effective. No behavior change, no signature change.Not addressed here
Whether the current split is the intended privacy posture is a maintainer call, and any alternative (hashing the identifier into the key) would invalidate every existing config. This PR only stops the comment from overstating the guarantee. Related: #667, which proposes correlating a receiver-keyed entry with a direct-keyed entry for the same physical device -
model_info.unit_idis the natural correlator and is zeroed at this boundary, so that fix cannot read it from disk.Provenance
Introduced in #604 (
fix(config): harden schema and persistence). That PR's description does not mention unit identifiers, serials, or privacy.Testing
Rebased onto master (
df5b7c8) and re-run on the rebased tip:cargo fmt --all -- --check- cleancargo clippy --workspace --all-targets -- -D warnings- cleancargo test --workspace- cleanRUSTDOCFLAGS="-D warnings" cargo doc -p openlogi-core --no-deps --document-private-items- 5 unresolved-link errors, all pre-existing in thebindingmodule and identical on master; the newruntime_keyintra-doc link resolvesRUSTDOCFLAGS="-D warnings" cargo doc -p openlogi-hid -p openlogi-hidpp -p openlogi-hidpp-derive --no-deps --document-private-items- fails on the pre-existingAsyncHidChannel::supports_short_long_hidpplink inopenlogi-hid/src/transport.rs, a file this PR does not touch; green with docs(hid): stop linking a cfg-gated type so rustdoc passes on Windows #661 cherry-picked on top