feat(tools): add read-only "git" toolset for structured repository inspection#3637
Open
dwin-gharibi wants to merge 6 commits into
Open
feat(tools): add read-only "git" toolset for structured repository inspection#3637dwin-gharibi wants to merge 6 commits into
dwin-gharibi wants to merge 6 commits into
Conversation
Contributor
Author
|
Let's just continue. @aheritier @Sayt-0 |
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.
Closes #3636
Summary
Adds a new built-in toolset,
git, giving an agent structured, read-only access to the working repository: status, log, branches, commit details, and blame. Implemented withgo-git(already a direct dependency), so it needs nogitbinary and is fully unit-testable.Tools:
git_status,git_log,git_branches,git_show,git_blame.Motivation
Coding agents constantly need git context. Today the only option is the
shelltool with rawgit, which forces the model to parse free-form porcelain, exposes the full writable shell surface, and depends on agitbinary. A dedicated read-only toolset returns clean structured output, is safe by construction, and works withoutshellor the binary.What changed
pkg/tools/builtin/git/git.gopkg/tools/builtin/git/git_test.gopkg/teamloader/toolsets/toolsets.gogitcreator.pkg/teamloader/toolsets/catalog.gogitcatalog entry (required by the drift-guard test).docs/configuration/tools/index.mdgitto the built-in toolsets table.docs/tools/git/index.mdDesign
add/commit/checkout— write ops are stateful, overlapshell, and raise permission questions; deferred to keep v1 safe.WorkingDirwithDetectDotGit.Example output
Testing
go test ./pkg/tools/builtin/git/ ./pkg/teamloader/toolsets/git_status(changed + clean),git_log(order +limit),git_branches(current marked),git_show(metadata + stats),git_blame(authorship), plus not-a-repo and missing-path error paths, and the tool-count/interface check.TestBuiltinToolsetsCatalogMatchesRegistrypasses withgitin both registry and catalog.All pass;
gofmt -landgo vetclean. (CI runstask lint/task test.)Scope / non-goals
git_showcovers commit-level diffs. Both are noted as possible future work.