feat(install): vouch install-mcp claude-code --global#532
Merged
Conversation
phase 2 of global vouch: install once, every project gets capture and recall — while the data stays strictly per project. --global writes the user-level wiring under ~/.claude/ (hooks, /vouch-* commands, a machine-wide-worded CLAUDE.md fence) and registers vouch as a user-scope mcp server (top-level mcpServers in ~/.claude.json). declared by a manifest global: block, so other hosts opt in as pure manifest work. no kb is ever bootstrapped by a global install: each session resolves the nearest project .vouch/, and a folder without one never captures anywhere — its session opens with a one-line "run vouch init" note from the session-start banner, and vouch serve now starts without a kb on the stdio transport (per-tool-call errors instead of a machine-wide failed server in every non-vouch folder). coexistence with per-project installs is guarded three ways: the global settings template is byte-for-byte the project one (claude code collapses duplicate hook commands; a sync test freezes the pairing), capture dedups on the event's tool_use_id (exact, window-free), and every hook command (capture observe / answer / finalize / finalize-all / banner, context-hook, recall, ingest-codex) resolves the kb from the hook payload's cwd — VOUCH_PROJECT_DIR keeps precedence, and a payload naming a nonexistent cwd refuses capture rather than falling back to the process cwd and landing in the wrong kb. installer hardening from review: manifest dst containment is now lexical, so a dotfiles-managed symlinked ~/.claude (or CLAUDE.md) is written through instead of aborting; a global target of "." is rejected; a regular file squatting ~/.claude is a clean error; a malformed existing settings.json reports as failed (vouch is not wired) instead of "already present".
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
phase 2 of global vouch — the headline feature: install once, every project gets capture + recall, while the data stays strictly per project.
vouch install-mcp claude-code --globalwrites the user-level wiring under~/.claude/(hooks,/vouch-*commands, a machine-wide-worded CLAUDE.md fence) and registers vouch as a user-scope MCP server (top-levelmcpServersin~/.claude.json). declared by a manifestglobal:block, so cursor/codex/openclaw follow as pure manifest work. a global install never bootstraps a KB: each session resolves the nearest project.vouch/; a folder without one never captures anywhere — its session opens with a one-line "runvouch init" note from the session-start banner, andvouch servenow starts without a KB on the stdio transport (per-tool-call errors instead of a machine-wide failed server in every non-vouch folder).coexistence with per-project installs, guarded three ways: the global settings template is byte-for-byte the project one (claude code collapses duplicate hook commands; a sync test freezes the pairing); capture dedups on the event's
tool_use_id(exact, window-free — survives drifted wiring); and every hook command (capture observe/answer/finalize/finalize-all/banner, context-hook, recall, ingest-codex) resolves the KB from the hook payload'scwd—VOUCH_PROJECT_DIRkeeps precedence, and a payload naming a nonexistent cwd refuses capture rather than falling back to the process cwd and landing in the wrong KB.installer hardening from review: manifest dst containment is now lexical, so a dotfiles-managed symlinked
~/.claude(orCLAUDE.md) is written through instead of aborting; a global target of.is rejected; a regular file squatting~/.claudeis a clean error; a malformed existing settings.json reports as failed (vouch is not wired) instead of "already present".review: a 24-agent adversarial pass confirmed 18 findings — the biggest being the
vouch servefail-fast that would have shown a permanently failed MCP server in every KB-less folder machine-wide — all fixed and pinned by tests (13 new across install/capture/hooks). full gate green locally: 1550 passed, mypy clean, ruff clean. live-probed in a fake home: global install idempotent; a hook fired from/with only the payload cwd routes into the right project's KB; the sametool_use_iddelivered twice records once; a KB-less folder captures nowhere and its banner prints thevouch inithint;vouch servestarts cleanly with no KB.🤖 Generated with Claude Code