Skip to content

Commit b961527

Browse files
LICENSE and CONTRIBUTING.md for gitagent 2; installer URL points at main
The MIT licence from main, a contributing guide for the Rust workspace (build, tests without keys, the four checks, the benchmark guard, profile switches, 1.x compatibility, the crates), Contributing and License sections in the README, and the install command now fetches the script from main, since no v2 branch exists.
1 parent ffa2b5c commit b961527

3 files changed

Lines changed: 117 additions & 1 deletion

File tree

‎CONTRIBUTING.md‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributing to gitagent
2+
3+
Thanks for helping. This guide covers gitagent 2, the Rust binary on this branch.
4+
5+
## Getting started
6+
7+
1. Fork the repository and clone your fork:
8+
```sh
9+
git clone https://github.com/<your-username>/gitagent.git
10+
cd gitagent
11+
```
12+
2. Install Rust. The toolchain is pinned in `rust-toolchain.toml`, so `rustup` picks the right version on its own.
13+
3. Build and test:
14+
```sh
15+
cargo build
16+
cargo test --workspace
17+
```
18+
19+
The tests need no network and no API keys. A scripted provider replays model replies from YAML (`--model scripted:<file>`), and the provider adapters are tested against local mock servers. To try a change by hand:
20+
21+
```sh
22+
cargo run -p gitagent-cli -- -d path/to/agent -m scripted:path/to/script.yaml
23+
```
24+
25+
## Before you open a pull request
26+
27+
Run all four; CI runs the same:
28+
29+
```sh
30+
cargo fmt --all
31+
cargo clippy --workspace --all-targets -- -D warnings
32+
cargo test --workspace
33+
bash scripts/integrity-audit.sh
34+
```
35+
36+
- **The benchmark guard must pass.** `bench_prompt_and_tools_match_the_published_run` fails if the system prompt or the tool list sent to the model in `--bench` mode changes at all. Features for agent folders, the console or the SDKs must never reach benchmark mode. If a change to the benchmark setup is intended, say so in the pull request; it needs a measured run before it is merged.
37+
- **Behaviour that changes results is a profile switch.** Add it to `profiles/*.yaml`, off by default, and describe it in `docs/HOW-IT-WORKS.md`.
38+
- **Agents written for gitagent 1.x must keep working.** Tool names, hook scripts, `agent.yaml` fields and SDK options from 1.x are accepted; if you change how one is read, keep the 1.x form working and cover it with a test.
39+
40+
## Project structure
41+
42+
The workspace is split into crates under `crates/`:
43+
44+
| Crate | What it does |
45+
|---|---|
46+
| `cli` | The `gitagent` binary: flags, the console, the IPC protocol, subcommands (`init`, `validate`, `install`, `plugin`, `schedule`, `learn`) |
47+
| `core` | The agent loop, sub-agents, the `plan` tool, workflows, approvals and the audit log |
48+
| `loader` | Reads agent folders and configuration into one spec: `agent.yaml`, identity files, skills, tools, hooks, memory, knowledge, workflows, schedules, plugins, environments, compliance |
49+
| `provider` | Model adapters: Anthropic, OpenAI, Google, OpenAI-compatible, and the scripted provider for tests |
50+
| `tools` | Built-in tools: shell, files, edits, memory, skills |
51+
| `terminal` | Persistent shells on a pseudo-terminal |
52+
| `shaper` | Shapes command output before the model sees it |
53+
| `context` | Masking and compaction of the conversation |
54+
| `guards` | The stop check, the time budget and the loop detector |
55+
| `hooks` | Hook scripts and their protocol |
56+
| `mcp` | The Model Context Protocol client |
57+
| `record` | Trajectories, counters and events |
58+
| `repo` | Repo mode: clones, branches, commits, pushes |
59+
| `sandbox` | Landlock and seccomp for the agent's shell |
60+
| `learn` | Offline learning of lessons from finished runs |
61+
| `sdk` | The Rust library interface |
62+
63+
The Python and TypeScript clients live under `clients/` and talk to the binary over the IPC protocol (`gitagent --ipc`).
64+
65+
## Guidelines
66+
67+
- **No unsafe code.** The workspace forbids it.
68+
- **Small dependencies.** Prefer a few lines of code to a new crate.
69+
- **Test what you change.** Unit tests next to the code, end-to-end tests in `crates/cli/tests/`.
70+
- **One concern per pull request.** Keep it focused and reviewable.
71+
- **Write docs in plain language.** Short sentences, one idea each.
72+
73+
## Commit messages
74+
75+
A short subject saying what changed, then a body saying why when it is not obvious:
76+
77+
- `Parallel tasks: the plan tool and a live task board`
78+
- `Hooks that crash are a warning, as in 1.x`
79+
- `Repo mode reuses an earlier clone of the same repository`
80+
81+
## Reporting issues
82+
83+
Search the existing issues first. Include what you ran, what you expected, what happened, `gitagent --version`, and your operating system. A trajectory (`trajectory.json` from the run's output folder) helps most.
84+
85+
## License
86+
87+
By contributing, you agree that your contributions are licensed under the [MIT License](./LICENSE).

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 GitAgent Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This is gitagent 2, the Rust binary. Agents, hooks, schedules and client code wr
3636
## Install
3737

3838
```sh
39-
curl -fsSL https://raw.githubusercontent.com/open-gitagent/gitagent/v2/scripts/install.sh | sh
39+
curl -fsSL https://raw.githubusercontent.com/open-gitagent/gitagent/main/scripts/install.sh | sh
4040
```
4141

4242
This installs the binary for your system (Linux x86_64/arm64, macOS arm64/x86_64) into `~/.local/bin`; set `INSTALL_DIR` to change that. To build from source you need Rust (the version is pinned in `rust-toolchain.toml`):
@@ -298,6 +298,10 @@ gitagent learn --model anthropic:claude-opus-5-5 --from bench/jobs/<job> [--from
298298

299299
It learns only from tasks in the `dev` list of `bench/split.json`. Review the diff of `prompts/lessons.md` before committing it; set `lessons: false` in a profile to leave lessons out.
300300

301+
## Contributing
302+
303+
Contributions are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to build, test and send a change.
304+
301305
## Development
302306

303307
```sh
@@ -311,3 +315,7 @@ The tests need no network or keys: a scripted provider replays model replies fro
311315
- `BLUEPRINT.md`: what is built and why.
312316
- `TASKS.md`: the milestones.
313317
- `docs/DEVIATIONS.md`: where the implementation differs from the blueprint, and why.
318+
319+
## License
320+
321+
[MIT](./LICENSE)

0 commit comments

Comments
 (0)