Skip to content

fix(check) secrets FP de-noise + feat: kit panic + memory path→cluster push-surfacing - #168

Merged
sandstream merged 3 commits into
mainfrom
claude/headroom-kit-integration-cmjw7t
Jun 29, 2026
Merged

sandstream merged 3 commits into
mainfrom
claude/headroom-kit-integration-cmjw7t

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

Three independent, additive changes (one commit each, reviewable in order):

1. fix(check) — de-noise the degraded secrets-scan fallback

The basic git grep fallback (used only when trufflehog is absent) cried severity: high and flagged its own false-positive classes: test/fixture files full of deliberately-fake credentials, and all-caps identifier values that are env-var NAMES (SOCKET_SECURITY_API_TOKEN), not secrets — producing a permanent "11 potential secrets" warn on a clean repo. Now it mirrors the trufflehog branch's philosophy (unverified ⇒ medium, not high) and skips those two FP classes. The authoritative scanners (trufflehog locally + the CI gitleaks job) are unchanged and still scan everything.

2. feat: kit panic (experimental) — identity kill-switch

One-command compromise response: rotate the local identity (old key archived, its past signatures stay verifiable) → emit a signed, append-only revocation of the old key (~/.kit/revocations.jsonl, signed by the new key — asymmetric, propagates as public data) → record an identity.panic event in the tamper-evident audit log → print the platform-revocation checklist (GitHub / Anthropic / Apple / vault). kit audit verify now surfaces entries signed by a revoked key (valid as history; key no longer trusted for new signatures). New primitives: recordRevocation / loadRevocations / isRevoked / revocationStatement. Honest boundary: kit owns its keys + revocation list + audit; it only orchestrates platform-account revocation.

3. feat(memory) — path→cluster push-surfacing (design gap #3)

Pull recall can't guarantee you see a settled decision; the guardrail is now PUSH. A committed .kit/shared/clusters.json maps area → globs (zero-dep glob→regex). kit memory context [paths…|--changed] prints the active decisions for the touched areas, and the UserPromptSubmit reminder appends a bounded notice for the area(s) your working-tree changes fall into — "touch area X ⇒ see X's decisions". Superseded/reversed decisions never resurface.

Type of Change

  • New feature (non-breaking)
  • Bug fix (non-breaking)
  • Documentation update

Testing

  • Added new tests
  • All tests pass (npm test) — 1900 pass / 0 fail; run-security-check.mjs PASS (19 ok)

Verified live: kit panic rotates + writes a signed revocation + audit line + checklist; kit memory context src/memory/db.ts src/commands/panic.ts maps to areas memory/identity.

Breaking Changes

None / N/A — all additive and backward-compatible.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

claude added 3 commits June 29, 2026 18:06
The basic `git grep` fallback (used only when trufflehog is absent) cried
`severity: high` and flagged its own two dominant false-positive classes:
test/fixture files full of deliberately-fake credentials, and all-caps
identifier VALUES that are env-var NAMES (e.g. `SOCKET_SECURITY_API_TOKEN`),
not secrets. That produced a permanent "11 potential secrets" warn on a
clean repo.

Now the fallback mirrors the trufflehog branch's philosophy: it's an
UNVERIFIED scan, so it's a `medium` warn (not high), and it skips test/
fixture/mock paths + all-caps identifier values. The AUTHORITATIVE scanners
(trufflehog locally + the CI gitleaks job) still scan everything and verify
live, so this only de-noises the local stopgap — it does not weaken the gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
…tion + audit + checklist)

One-command compromise response (3.0 control-plane kill-switch):
  1. rotate the local identity (old key archived; its past signatures stay
     verifiable, new trust is the new key);
  2. emit a SIGNED, append-only revocation of the old key
     (~/.kit/revocations.jsonl), signed BY the new key — asymmetric, so it
     propagates as public data with no shared secret to leak;
  3. record an `identity.panic` event in the tamper-evident audit log (itself
     signed by the new identity);
  4. print the platform-revocation checklist for the accounts kit does NOT own
     (GitHub / Anthropic / Apple / vault) with links.

`kit audit verify` now surfaces entries signed by a now-revoked key (valid as
history; the key is no longer trusted for new signatures — informational, not a
failure). New identity primitives: recordRevocation / loadRevocations /
isRevoked / revocationStatement.

Honest boundary (printed + documented): kit owns its keys + the revocation list
+ verification + the audit record; it only orchestrates platform-account
revocation. Top-level experimental command; public surface regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Pull recall can't guarantee you see a settled decision — a bad query misses
it. The guardrail must be PUSH: touch files under an area and kit
deterministically surfaces that area's ACTIVE decisions.

- src/memory/clusters.ts: committed `.kit/shared/clusters.json` maps
  area→globs; zero-dep globToRegExp (** spans segments, * within one),
  clustersForPaths, decisionsForPaths (active only — superseded/reversed
  never resurface), changedPaths (git diff vs HEAD).
- `kit memory context [paths…|--changed]`: prints active decisions for the
  touched areas (--json for tools).
- UserPromptSubmit reminder appends a bounded (≤2 areas × ≤2 decisions)
  notice for the area(s) your working-tree changes fall into — deterministic
  "touch area X ⇒ see X's decisions", not a query lottery. Fail-open.
- Seeded .kit/shared/clusters.json for kit (dogfood: memory/identity/
  install-gate/ci-audit/secrets areas). Public surface regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit be9b582 into main Jun 29, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants