Skip to content

feat(cli): opt-in pre-push reminder for unconsolidated staging#3

Merged
mashware merged 1 commit into
mainfrom
feat/pre-push-staging-reminder
Jun 12, 2026
Merged

feat(cli): opt-in pre-push reminder for unconsolidated staging#3
mashware merged 1 commit into
mainfrom
feat/pre-push-staging-reminder

Conversation

@mashware

Copy link
Copy Markdown
Owner

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.
  • Opt-in pre-push hookinstall --git-hook writes a non-blocking .git/hooks/pre-push that prints a one-line nudge when the branch you push still has staged findings. Plain install prompts before touching .git/hooks.

Design decisions

  • Warns, never blocks — a blocked push over "you forgot to document" would violate the project's principle feat(cli): opt-in pre-push reminder for unconsolidated staging #3 (silent failures / stay out of the way). And push ≠ merge, so the reminder still arrives in time.
  • Opt-in.git/hooks is per-clone and may conflict with husky / core.hooksPath, so installing is gated behind a prompt (or --git-hook for non-interactive).
  • Idempotent + chaining — re-running keeps a single block; a foreign pre-push hook is appended to, never clobbered.
  • Graceful degradation — no-op if the domain-memory CLI is not on PATH (npx-only users).
  • Scope — staging reminder only this iteration; check-drift in 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.tswriteGitHook skip-no-git, creates executable hook, idempotency, chaining onto a foreign hook.
  • Verified end-to-end: install --git-hook writes an executable hook, a real git push fires the reminder and is not blocked.

All workspaces: typecheck clean, tests green (CLI 70, server 83, web 22).

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.
@mashware
mashware merged commit 9a6c93a into main Jun 12, 2026
1 check passed
@mashware
mashware deleted the feat/pre-push-staging-reminder branch June 12, 2026 14:07
@mashware mashware mentioned this pull request Jun 12, 2026
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.

1 participant