Repository navigation
security: memory-hooks liveness gate (R5/#71) + shared-tier inject verification (R4/#77) - #245
Merged
Merged
Conversation
The self-playing loop (memory capture + statusline) depends on hooks in ~/.claude/settings.json. If they were installed here (durable marker present) but have since vanished, capture is silently OFF — the store looks installed but records nothing (a false green). `kit doctor` already flagged this and `kit memory uninstall` already emits an audit event; this folds the same liveness into the `kit check` security gate. New checkMemoryHooksLiveness(): skips when never installed (CI / fresh machine) and after a clean uninstall (which clears the marker), so it FAILS only on genuine silent degradation (marker present + a hook gone). Env-injected tests cover skip/pass/fail. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
…#77) recentDecisions (SessionStart recovery / touched-decisions notice) replayed curated shared entries into every session as trusted "Curated team decisions" without checking their Ed25519 signature — so a tampered or forged team entry rode in as trusted (holistic-review #77). The sign/verify machinery existed (shareEntry signs, kit memory verify verifies) but nothing verified on the inject path. New recallSafeShared(root, entries): drops a bad-sig entry ALWAYS (tamper must never be replayed), and under a committed .kit-policy.signers anchor injects ONLY org-trusted entries; with no anchor everything but tamper is kept so the common team-without-anchor case isn't broken. Wired into recentDecisions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
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.
Description
The two remaining medium items from
holistic-review-4.0.md. Both are "no false green" gaps on the memory subsystem; each was verified against current code first (parts had already landed).Changes
#71 —
kit checkgates on memory-hooks liveness (src/check-security.ts)memory hooks livenesscheck: FAILS when capture hooks were installed here (durable marker present) but have since vanished from~/.claude/settings.json(capture silently off — a false green). Skips when never installed (CI / fresh machine) and after a cleankit memory uninstall(which clears the marker), so it fails only on genuine silent degradation.kit doctorflags the same liveness, andkit memory uninstallemits amemory.hooks.uninstallaudit event. This adds the remaining "gate inkit check".#77 — shared-tier signature verification on the recall inject path (
src/memory/shared.ts,src/memory/hook.ts)recentDecisions(SessionStart recovery / touched-decisions notice) replayed curated shared entries as trusted "Curated team decisions" without checking their signature. NewrecallSafeSharedfilters before injection: abad-sig(tamper against a held key) is always dropped; under a committed.kit-policy.signersanchor only org-trusted entries are injected; with no anchor everything-but-tamper is kept (the common team-without-anchor case isn't broken).shareEntrysigns on write andkit memory verifyverifies; this adds verification on the inject path.Type of Change
Testing
npm test— 2369 pass, 0 failrecallSafeShareddrops a tampered entry (no anchor) and injects only org-trusted entries under an anchor.Breaking Changes
kit checkgains amemory hooks livenessfailure only when the capture loop silently degraded (marker present + a hook gone). Tampered/untrusted shared entries are no longer auto-injected on SessionStart.🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code