Repository navigation
fix(memory): device-fence PAL finding auto-close + harden device identity - #187
Merged
Merged
Conversation
…tity
Track C adversarial hardening of the 3.0 surface.
HIGH — palSyncFindings auto-closed findings by source-tag + scope only, with no
origin_device predicate. Since the finding id was derived from sourceTag+dedupKey
(repo-independent), it was identical across machines on a shared/synced store, so
a scan on device B that didn't see device A's open finding would permanently
close A's security blocker; two repos sharing a basename also collided.
- fold scope into the finding id (distinct rows per repo)
- scope by absolute project root, not basename (findings-track, health-track)
- device-fence the auto-close (origin_device = thisDevice OR NULL); legacy
NULL-origin rows stay reconcilable by any device
- re-attribute origin on reopen so the observing device is reminded
A cleared finding now lingers until the owning device re-scans — fail-safe.
MEDIUM — deviceId() was sha256(hostname+user): guessable by a peer on a shared
store and unstable across hostname churn (silently orphaning a device's items).
Now prefers a random id persisted to <memoryDir>/device-id (0600); validates the
KIT_DEVICE_ID override against [A-Za-z0-9_-]{1,64}; hostname hash is last resort.
Also restores the `## [3.0.0]` CHANGELOG header dropped by the #186 Unreleased
edit (the 3.0.0 block was orphaned under [Unreleased]).
3 new regression tests; full suite 1979 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
This was referenced Jun 30, 2026
Merged
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.
What
Track C — adversarial hardening of the new 3.0 surface. Two findings in the device-coupled PAL, both fixed here.
HIGH — finding auto-close was device-blind (a real security blocker could be silently cleared across devices)
palSyncFindingsauto-closed findings purely bysource-tag + scope, with noorigin_devicepredicate. AndfindingPalIdderived the id from onlysourceTag + dedupKey(repo-independent), so on a shared/synced store the finding id was identical across machines. Consequence: akit checkon device B that didn't see device A's open finding would permanently close A's blocker — the exact inverse of what device-coupling is meant to guarantee. As a bonus bug, two different repos that merely shared a directory basename reconciled into each other's findings.Fix:
findings-track.ts,health-track.ts)origin_device = thisDevice OR origin_device IS NULL(legacy pre-v5 NULL-origin rows stay reconcilable by any device)A genuinely-cleared finding now lingers until the owning device re-scans — fail-safe (a stale reminder, never a dropped blocker).
MEDIUM — device identity was a guessable hostname hash
deviceId()wassha256(hostname+user): guessable by any peer on a shared store (enabling cross-device surface/suppression of items) and unstable across hostname churn (a DHCP lease or rename would silently orphan a device's own items). Now:<memoryDir>/device-id(0600) — unguessable, survives hostname driftKIT_DEVICE_IDoverride against[A-Za-z0-9_-]{1,64}(malformed → ignored, not trusted)Also
Restores the
## [3.0.0] - 2026-06-30CHANGELOG header that an earlier[Unreleased]edit (shipped in #186) accidentally dropped, which had orphaned the entire 3.0.0 release block under[Unreleased].Tests
3 new regression tests: device B does NOT close device A's finding on a shared store (and the owning device still can); same finding in two repos → two rows; legacy NULL-origin findings reconcilable by any device. Full suite 1979 green, prettier clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code