v0.1.1: require explicit repo selection + safe, bounded tool responses - #1
Open
JonZavialov wants to merge 2 commits into
Open
v0.1.1: require explicit repo selection + safe, bounded tool responses#1JonZavialov wants to merge 2 commits into
JonZavialov wants to merge 2 commits into
Conversation
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.
Motivation
Description
set_repo_root { path }which resolves a path to the git toplevel viagit -C <path> rev-parse --show-topleveland stores that repo root in server memory, andget_repo_rootwhich returns the currently active repo root. (src/server.ts,src/exec-git.ts).{ isError: true, code: "SEGMINT_NO_REPO", message: "..." }when none is set; server still allows a safe startup fallback only if process cwd is already inside a repo (no wild scanning). (src/server.ts, gating added to all tools).execGit/tryExecGitacceptcwd, addedresolveGitRoot/tryResolveGitRoot, andhistory,show,diff,blame,changespipelines acceptcwdand use it consistently. (src/exec-git.ts,src/history.ts,src/show.ts,src/diff.ts,src/blame.ts,src/changes.ts).src/limits.tswithtruncateArrayandcapChanges, and surfacedtruncated: boolean+omitted_count: numberin affected tool outputs (files, changes, hunks, blame lines) with deterministic truncation at 200 entries. Tools now includerepo_rootwhere applicable. (src/limits.ts, updatedsrc/server.tsoutputs).set_repo_rootflow, updated E2E tool listing, unit tests for truncation helpers andset_repo_rooterror handling, and an integration test for fresh repo HEAD edge case. (tests/e2e/repo-selection-safety.test.ts, updatedtests/e2e/mcp-server.test.ts,tests/unit/limits.test.ts,tests/unit/server-repo-root.test.ts,tests/integration/status-empty-repo.test.ts).set_repo_root/get_repo_root, first-run verification steps, Claude Desktop example (cwd optional), and explicit anti-drift guidance; bumped package to0.1.1.Testing
npm run build; successful.npm run test:e2e; all E2E tests passed.npm run test:coverage; test suite and coverage thresholds passed (build, E2E, integration and unit suites green and global branch coverage >= 95%).repo_status,list_changes,log,show_commit,diff_between_refs,blame,group_changesagainst a configured repo root;SEGMINT_NO_REPObehavior when started outside a git repo; truncation helper behavior and fresh-repo HEAD edge case.Codex Task