Skip to main content
Glama
README.md
<p align="center">
  <img src="assets/logo.svg" alt="Ajia Harness Logo" width="76" height="76" />
</p>

<h1 align="center">Ajia Harness</h1>

<p align="center">
  English | <a href="README.zh-CN.md">简体中文</a>
</p>

<p align="center">
  <strong>Deterministic CLI Agent Harness &amp; Human Approval Gate for Google Antigravity.</strong><br/>
  Worktree isolation · Contract guardrails · Adversarial review · Native MCP App Control Tower
</p>

<p align="center">
  <img src="assets/demo.gif" alt="Ajia Harness Control Tower and Decision Brief" width="100%" />
</p>

---

## Why Ajia Harness?

- **Official-CLI Compliant**: Calls local `codex` / `claude` CLIs directly with your own login—no credential scraping, no relay proxy, no ToS bypass.
- **Worktree isolation.** Each write task runs in its own Git worktree until its changes are merged.
- **Contract Guardrails**: Host-enforced `allowed_paths`, `forbidden_paths`, and trusted `verify_commands`—auto-rework on violations.
- **Merge policy.** The default `coder` role enables automatic review. Low-risk changes that pass the configured checks and AI review can merge without a click. Changes escalated for human approval wait for your decision in the control tower.
- **Zero-Config Plugin**: Auto-bootstraps venv & daemon on first use, zero telemetry.

---

## Key Features & Inspirations

- **Worktree Bootstrap** *(inspired by [T3 Code](https://github.com/pingdotgg/t3code))*: `.worktreeinclude` + `on_worktree_create` hooks for `.env` & ignored deps.
- **Round Checkpoints** *(inspired by [T3 Code](https://github.com/pingdotgg/t3code))*: Private Git ref snapshots (`refs/ajia-checkpoints/...`) with one-click rollback.
- **Incremental Prechecks** *(inspired by [OpenCode](https://github.com/anomalyco/opencode))*: Changed-file-only static checks (`py_compile`, `ruff`, `tsc`) before full tests.
- **Live Activity Stream** *(inspired by [OpenCode](https://github.com/anomalyco/opencode))*: Real-time timestamped reads, edits, commands, and review steps.
- **Token & Cache Ledger** *(inspired by DeepSeek Harness)*: Per-round Coder/Reviewer token usage, cache hit rate, and stage duration.
- **Review pipeline.** Path checks, hooks, prechecks, Git commit hook preflight, host verification, and read-only AI review feed the merge decision.

---

## Quick Start

**Requirements**: Python 3.11+ (`uv` optional) · Git · Authenticated `codex` or `claude` CLI

Read-only tasks and automatic AI review require Codex. Claude supports write tasks in an isolated worktree.

```bash
agy plugin install https://github.com/TsaiWinky/ajia-harness
```

To review a write task yourself and require your approval before merge, pass `auto_review: false` to `start_cli_task`:

```json
{"role": "coder", "auto_review": false, "repo_root": "/path/to/repo", "prompt": "Add a test for empty input"}
```

**Customization**: Copy [`agents.example.json`](agents.example.json) to `${PLUGIN_DATA}/agents.json` for custom models, `repo_verify_commands`, `repo_prechecks`, or hooks. Override defaults via `AJIA_HARNESS_PORT`, `CODEX_BIN`, or `CLAUDE_BIN`.

---

## Development & License

- **Tests**: `pytest -v` · `node web/tests/goals_inline.cjs`
- **Build UI**: `cd mcp_app && pnpm install --ignore-scripts && node build.mjs`
- **License**: [MIT](LICENSE) · Third-party notices in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)