Expand description
newt-git — the embedded git engine for newt agents.
Wraps grit-lib (a pure-Rust, from-scratch
git reimplementation, MIT) behind the GitCaveats
OCAP surface. Every operation takes the already-composed &GitCaveats and fails
closed; results are this crate’s own structured serde models, converted at the
grit-lib boundary — so grit-lib’s pre-1.0 API churn is contained to this one crate
and never leaks into the rest of the workspace.
Scope: LOCAL ops — reads (open/status/log/diff) and writes
(add/commit/branch), each gated by the matching GitCaveats axis and
fail-closed without it. Network ops (clone/fetch/push) are deferred (PR5) —
fail-closed under the OCAP deviation ratchet, riding the SSH transport. We depend
ONLY on the MIT grit-lib, never the GPL-2.0 grit-legacy.
Structs§
- Author
- Commit authorship — supplied by the caller (e.g. from the agent identity).
- Commit
Info - One commit’s metadata.
- Diff
Report - The set of files a diff touched.
- File
Change - A single changed path.
statusis git’s status letter (M/A/D/R/C/…). - GitEngine
- An embedded git engine bound to one repository.
- Local
GitTool - The on-disk
GitEngineadapted to newt-core’sGitToolseam. The binary constructs one per session (root = workspace, author = the resolved agent identity) and injects it into the agent loop;execute_tool’sgitarm callsdispatch. A freshGitEngine::openper call keeps it stateless and cheap (no long-lived handle across turns). - Rebase
Report - Outcome of a rebase.
- Rebase
Step - One entry in a structured rebase plan.
- Status
Report - Working-tree status — the porcelain facts, no presentation.
Enums§
- Diff
Spec - Which diff to compute.
- GitError
- Errors from the embedded git engine.
- Rebase
Action - What a rebase step does with its commit.