cli: install git→kai import hooks by default; milestone bridge stays opt-in#37
Merged
Conversation
…opt-in The bridge bundled two directions behind one opt-in. Split them: - git→kai (post-commit/merge/checkout/rewrite hooks importing commits as snapshots) is now on by default, gated by bridge.auto_import (default true). This direction never writes to git; it is what keeps the graph from drifting, and without it every non-kai commit now surfaces staleness annotations the user must clear by hand. Precedent already existed: init installs pre-commit/pre-push unconditionally. - kai→git (milestones become commits) keeps the bridge-enabled sentinel and stays opt-in via kai init --git-bridge — kai must not author commits in the user's history by default. The hook imports now run in a backgrounded subshell so git returns immediately (measured: the import adds ~0 to commit latency; a lost import self-heals via the watch daemon or inline catch-up, which is what makes defaulting this on safe now). post-rewrite buffers stdin before backgrounding — git closes the pipe when the hook exits. Hook version bumped to v6 so doctor --fix rolls existing installs forward. Also: init tests now force --no-remote — a logged-in developer running the suite was silently signing up temp-dir-named repos on kaicontext.com on every full test run.
🔍 Kai reviewNote Reviewing this change… The verification result will appear here shortly. |
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.
Answers "should we default to git bridge?" by splitting the two directions the bridge bundled behind one opt-in:
git→kai import: now default ON
The post-commit/merge/checkout/rewrite hooks (importing commits as snapshots) install on plain
kai init, gated by new configbridge.auto_import(default true;falseboth skips installation and makeskai bridge importa no-op).Why this is the right default:
stale-suspectannotations the user must clear by hand; default hooks make those effectively never appear.git commitlatency is unchanged (measured: bare commit 30ms; with kai hooks ~0.77s, all of it the pre-existing pre-commit hook — the import adds ~a fork). A lost import self-heals via the watch daemon or inline catch-up.kai doctor --fixrolls existing installs forward.kai→git milestones: stays opt-in
kai init --git-bridgekeeps its sentinel and now means only this direction. Kai must not author commits in the user's git history by default.Also fixed: test suite was creating real repos on kaicontext.com
The
runInittests never set--no-remote, so a logged-in developer's localgo test ./cmd/kai/silently signed up temp-dir-named repos (e.g.jschatz1/001) and pushed to them on every full run. All init tests now forceinitNoRemote.Verified
Plain
kai init --no-remoteinstalls all four import hooks;kai bridge statusreports the milestone direction disabled; commit latency measured unchanged; a plaingit commitconverges the graph in the background within seconds. New tests pin the default-on/opt-out gating, the backgrounding, and the stdin buffering. Fullcmd/kai+internal/configsuites green.🤖 Generated with Claude Code