feat(cli): opt-in pre-push reminder for unconsolidated staging#3
Merged
Conversation
Add a read-only `staging-status` command (count of staged findings for a branch; always exits 0) and an opt-in, non-blocking pre-push git hook that nudges you to run /save-knowledge when you push a branch with findings that were never consolidated. `install --git-hook` wires it idempotently, chaining onto any existing hook; plain install prompts before touching .git/hooks. No-op when the CLI is not on PATH.
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
Closes the gap where findings staged during a session never get consolidated because the push happened outside the agent (so the agent's PR-time consolidation flow never ran).
domain-memory staging-status [--branch name] [--json] [--quiet]— read-only count of unconsolidated findings on a branch. Never opens the SQLite index, always exits 0. The engine behind the hook.install --git-hookwrites a non-blocking.git/hooks/pre-pushthat prints a one-line nudge when the branch you push still has staged findings. Plaininstallprompts before touching.git/hooks.Design decisions
.git/hooksis per-clone and may conflict with husky /core.hooksPath, so installing is gated behind a prompt (or--git-hookfor non-interactive).domain-memoryCLI is not onPATH(npx-only users).check-driftin the hook is left for a follow-up.Tests
staging-status.test.ts— count per branch, branch isolation, no-branch resolution, always-exit-0, JSON output.writers.test.ts—writeGitHookskip-no-git, creates executable hook, idempotency, chaining onto a foreign hook.install --git-hookwrites an executable hook, a realgit pushfires the reminder and is not blocked.All workspaces: typecheck clean, tests green (CLI 70, server 83, web 22).