Skip to content

feat(memory): device-couple PAL — ephemeral-session items don't nag your device - #182

Merged
sandstream merged 1 commit into
mainfrom
claude/headroom-kit-integration-cmjw7t
Jun 30, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/headroom-kit-integration-cmjw7t

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

A "blocked-on-you" item created in an ephemeral session/container (a throwaway scratch dir) persists in ~/.kit and — with the gap-#4 memory sync — can follow you to your durable device and nag forever for work that never lived there. (Seen live: PAL items scoped to tmp.qolSKAbJVy / kit-integ-check-… reminding on an unrelated machine.) This couples PAL items to where they were created.

Type of Change

  • New feature (non-breaking change that adds functionality)

Changes Made

  • Schema v5: pending_actions gains origin_device + origin_root, stamped at palAdd / palSyncFindings. origin_device = KIT_DEVICE_ID or a stable sha256(hostname+user) — an ephemeral container gets its own throwaway id, so its items can never match your laptop.
  • palList device-filters by default: only this device's items (plus legacy NULL-origin rows) surface. That flows automatically to the SessionStart/UserPromptSubmit reminders, the kit statusline ⚠ count, and kit memory pal list. --all opts back in to every device.
  • kit memory pal prune: closes this device's open items whose origin_root no longer exists (dead ephemeral/scratch dirs). Only this device's items (we can't judge another device's paths); pre-v5 rows with no origin_root are left untouched.

Testing

Test Coverage

  • Added 7 tests: stamping, default device-filter + --all, NULL-legacy visibility, prune (keep live / close dead / ignore other device), stable+overridable deviceId
  • All tests pass (npm test) — 1969 pass, 0 fail

Manual Testing

  • kit memory pal prune against this container correctly no-ops on the pre-v5 items (they carry no origin_root → not guessed at) — confirming backward-compat; new items carry origin and prune acts on them (proven by tests).

Note

Backward-compatible: legacy rows have NULL origin and always show; nothing is hidden or pruned retroactively. The two pre-existing [kit]-scoped warns still auto-close on a kit check once trivy is installed.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

…our device

You can land a "blocked-on-you" item in a throwaway container/scratch dir; today
it persists in ~/.kit and (with gap-#4 sync) can follow you to your laptop and
nag forever. This couples PAL items to where they were created.

  - schema v5: pending_actions gains origin_device + origin_root, stamped at
    palAdd / palSyncFindings. origin_device = KIT_DEVICE_ID or a stable
    sha256(hostname+user) — an ephemeral container gets its own throwaway id.
  - palList device-filters by DEFAULT: only this device's items (+ legacy
    NULL-origin rows) surface, so reminders, the statusline ⚠ count, and
    `kit memory pal list` stop nagging about another device's / an ephemeral
    session's work. `--all` opts back in to every device.
  - `kit memory pal prune`: closes THIS device's open items whose origin_root no
    longer exists (dead ephemeral/scratch dirs). Only this device's items (we
    can't judge another device's paths); pre-v5 rows (no origin_root) untouched.

Backward-compatible: legacy rows have NULL origin and always show. 7 new tests
(stamping, default device filter + --all, NULL-legacy visibility, prune
keep/close/other-device, stable+overridable deviceId). 1969 tests pass.

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 48f4984 into main Jun 30, 2026
17 checks passed
sandstream pushed a commit that referenced this pull request Jun 30, 2026
…es visible

PAL's "blocked-on-you" count only reached the AGENT (via the memory hook); the
human never saw it in the terminal unless they hand-edited settings.json. So
`kit memory install` now also wires `statusLine` → `kit statusline`, making the
setup score + open-PAL ⚠ count visible in the Claude Code status bar.

  - installStatusline / uninstallStatusline in memory/install.ts: idempotent,
    uses the same absolute kit invocation as the hooks. NEVER clobbers a user's
    existing custom statusLine — reports "foreign" and leaves it; uninstall
    removes only kit's own.
  - memInstall wires it (skip with --no-statusline); memUninstall removes it.
    Help updated.

Pairs with the device-coupled PAL count (#182), so the bar shows THIS device's
real blocked-on-you, not an ephemeral session's. 3 new install tests
(added/idempotent, never-clobber-foreign, uninstall-only-ours). Smoke: install
writes statusLine = "<abs>/kit statusline". 1972 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
sandstream added a commit that referenced this pull request Jun 30, 2026
…es visible (#183)

PAL's "blocked-on-you" count only reached the AGENT (via the memory hook); the
human never saw it in the terminal unless they hand-edited settings.json. So
`kit memory install` now also wires `statusLine` → `kit statusline`, making the
setup score + open-PAL ⚠ count visible in the Claude Code status bar.

  - installStatusline / uninstallStatusline in memory/install.ts: idempotent,
    uses the same absolute kit invocation as the hooks. NEVER clobbers a user's
    existing custom statusLine — reports "foreign" and leaves it; uninstall
    removes only kit's own.
  - memInstall wires it (skip with --no-statusline); memUninstall removes it.
    Help updated.

Pairs with the device-coupled PAL count (#182), so the bar shows THIS device's
real blocked-on-you, not an ephemeral session's. 3 new install tests
(added/idempotent, never-clobber-foreign, uninstall-only-ours). Smoke: install
writes statusLine = "<abs>/kit statusline". 1972 tests pass.


Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg

Co-authored-by: Claude <noreply@anthropic.com>
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