Skip to main content

AI-agent-native VCS MVP

Project description

ait

ait is an AI-agent-native version control layer on top of Git.

The MVP tracks:

  • structured intents
  • isolated attempts in Git worktrees
  • daemon-ingested tool events from agent harnesses
  • queryable evidence, file access, and commit linkage
  • verification, promote, discard, and rebase flows

Status

This repository is at 0.1.0 release-candidate quality for local dogfood use. It is local-only: metadata lives in .ait/ inside one Git repository and is intentionally not synchronized across machines.

Requirements

  • Python 3.14+
  • Git
  • SQLite from the Python standard library

Install For Development

From the repository root:

python3.14 -m venv .venv
.venv/bin/pip install -e .
.venv/bin/pip install pytest

Verify:

.venv/bin/pytest -q
.venv/bin/ait --help

Install From GitHub

After v0.1.0 is published, install the tagged release with pipx:

pipx install "git+https://github.com/m24927605/ait.git@v0.1.0"

Or install into a virtual environment:

python3.14 -m venv .venv
.venv/bin/pip install "git+https://github.com/m24927605/ait.git@v0.1.0"
.venv/bin/ait --help

Install From PyPI

The PyPI distribution name is ait-vcs because the shorter ait name is already owned by another project. The installed command is still ait.

pip install ait-vcs
ait --help

Or inside a virtual environment:

python3.14 -m venv .venv
.venv/bin/pip install ait-vcs
.venv/bin/ait --help

Quickstart

Initialize ait metadata in a Git repository:

ait init

Create an intent and attempt:

ait intent new "Fix auth expiry" --kind bugfix
ait attempt new <intent-id> --agent-id cli:human

The attempt command prints:

  • attempt_id
  • workspace_ref
  • base_ref_oid
  • ownership_token

Make changes in the attempt worktree, then commit through ait:

cd <workspace_ref>
# edit files
git add <files>
cd <repo-root>
ait attempt commit <attempt-id> -m "fix auth expiry"

Promote the attempt:

ait attempt promote <attempt-id> --to main

If main advanced while the attempt was running:

ait attempt rebase <attempt-id> --onto main
ait attempt promote <attempt-id> --to main

Inspect state:

ait attempt show <attempt-id>
ait intent show <intent-id>
ait attempt list --verified-status succeeded
ait query --on attempt 'observed.tool_calls>0'
ait blame path/to/file.py

Daemon And Harness

Start the daemon:

ait daemon start
ait daemon status

The harness API streams lifecycle and tool events to the daemon:

python examples/harness_demo.py <attempt-id> <ownership-token> .ait/daemon.sock

After the demo:

ait attempt show <attempt-id>

Expected counters include tool calls, reads, writes, commands, and file evidence under files.read and files.touched.

Universal Agent Runner

ait run wraps any CLI-based agent or command in an ait intent and attempt. It creates an isolated attempt worktree, starts the daemon, runs the command in that worktree, records the command event, and marks the attempt finished with the command exit code.

ait run --agent shell:local --intent "Try a generated change" -- \
  python -c "from pathlib import Path; Path('agent.txt').write_text('ok\n')"

The wrapped process receives:

AIT_INTENT_ID
AIT_ATTEMPT_ID
AIT_WORKSPACE_REF

Examples:

ait run --agent aider:main --intent "Fix auth expiry" -- aider src/auth.py
ait run --agent claude-code:manual --intent "Refactor query parser" -- claude

This is the shallow universal integration layer. Deeper adapters can add native file-read/write events through hooks, but ait run already gives session lifecycle, worktree isolation, exit-code verification, and command provenance for any shell-launchable agent.

Claude Code Hook Example

examples/claude_code_hook.py is a conservative Claude Code hook bridge. It creates one ait intent and attempt per Claude session, streams PostToolUse / PostToolUseFailure events through AitHarness, sends a heartbeat on Stop, and finishes the attempt on SessionEnd.

Example settings are in:

examples/claude-code-settings.json

To try it, copy the relevant hook entries into your Claude Code settings.json for this project. The hook expects ait to be importable by the Python interpreter used in the command, so run it from an installed development environment.

Current limitation: the hook records provenance, but it does not force Claude Code to edit inside the ait attempt worktree. The SessionStart hook returns the attempt workspace path as additional context. A deeper integration can use Claude Code's worktree hook path or a wrapper command to make the ait worktree the actual execution directory.

Release Checks

Before cutting a release:

git status --short
.venv/bin/pytest -q

Clean clone smoke test:

tmpdir="$(mktemp -d)"
git clone https://github.com/m24927605/ait.git "$tmpdir/ait"
cd "$tmpdir/ait"
git checkout v0.1.0
python3.14 -m venv .venv
.venv/bin/pip install -e . pytest
.venv/bin/pytest -q
.venv/bin/ait --help

The release candidate for 0.1.0 should have:

  • clean working tree
  • passing tests
  • dogfood notes updated
  • changelog updated
  • version in pyproject.toml matching the tag

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ait_vcs-0.1.3.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ait_vcs-0.1.3-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file ait_vcs-0.1.3.tar.gz.

File metadata

  • Download URL: ait_vcs-0.1.3.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ait_vcs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a9db26d5c9b07f670f83644404815fab792db8920e0a4a2bae96fa1062939d56
MD5 2340c2de312713d599ea58766e27f249
BLAKE2b-256 8f7f35c4a93dfaec75700ddd58b335d9cf4de47ec47d5e782aa99abd942856f2

See more details on using hashes here.

File details

Details for the file ait_vcs-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ait_vcs-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ait_vcs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f3110c9ea6272196e348ac367bfe61d0b7a89ba5a0cc0455b4d03047fe712da7
MD5 bedbfbb52b209811538663419281e68f
BLAKE2b-256 2e18f5d3def96721b0c248706a830126870b9ca5b8c63bd166a40d95d4d009d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page