A correctness and reliability release, recommended for everyone running the storage
core (shadow or authoritative mode), above all with Postgres, several nodes, or agents
that can push. It also switches the default bundled git to the v2.56.0 release.
Fixes
- A rejected push update could be recorded in the database (authoritative, two or
more nodes). git hands the updates of a non-atomic push that it rejected for a wrong
old value to the reference-transaction hook. When a reference had moved away and back
on another node, the old value matched the database but not this node's copy: the
client was told [remote rejected] (incorrect old value provided) while the database
kept the update, and the node's copy diverged until the reference was written again.
The whole push is now refused in that case, as for a stale create since 0.4.1. Shadow
mode logs and counts it, and never refuses.
- What a refused non-atomic push leaves behind is now documented exactly. git runs a
non-atomic push as two transactions, deletions first. A refused deletion fails the
first and nothing lands; a refused create or update fails the second, after the
deletions git accepted have landed. The client gets
fatal: in 'prepared' phase, update aborted by the reference-transaction hook (SSH)
or a hang-up (smart HTTP), with no status per reference (LIMITATIONS).
- Postgres connection churn failed writes under load. The store used database/sql's
defaults (unbounded open connections, 2 idle), so a busy node opened about two new
connections per changeset; with 200 concurrent writers 919 of 2000 changes failed with
connection resets. The pool is now bounded and reused: 0 failures in the same runs.
This is a reliability fix; on a single busy repository the speed gain is small
(2-11% lands/min).
- Reference names git can't hold side by side (a directory/file pair such as
refs/heads/a and refs/heads/a/b). A create that conflicts with an existing name is
refused alone by the update hook, with the reason on the client's terminal; the
database checks again at commit; a node's catch-up no longer stops on a legal history
in which one name of a pair was deleted before the other was created.
- Agents could reach reserved or decoy references through a symbolic branch.
Symbolic branches are now judged by their written target on RPC write paths,
first_parent_ref and the start point are read exactly, and agents cannot create or
update references under the decoy namespaces.
New
graft storage delete-conflicting-ref REF EXPECTED_TARGET (RPC
DeleteConflictingReference, authoritative mode only) repairs a repository that
already holds such a pair: it deletes one side, only if it still has the expected
value, as an ordinary changeset that every node applies.
- Postgres pool settings under
[graft.storage]: database_max_open_conns (32),
database_max_idle_conns (same as max open), database_conn_max_idle_time (5m),
database_conn_max_lifetime (30m). Keep the sum over all nodes below the server's
max_connections, with room for a graceful upgrade, when a node briefly runs two
pools. Setting them with SQLite is a startup error. See CONFIGURATION.
- Metric
graft_storage_prepared_step_seconds{kind,step} splits the time under the
repository's write lock into record, local read, pack, commit and durability.
- Conformance harness: stock git against gitai in every storage mode, now a CI step.
- Design: DB-first writes (doc/graft/design/dbfirst-writes.md, with a TLA+ model).
A plan to lift the per-repository write bound for server-side writes; nothing of it
is enabled in this release.
Changes
- Default bundled git is the v2.56.0 release (was 2.55.0-rc1). The test suites pass
with it; in the land-path benchmark the median p99 changed by +7.4% (within run-to-run
noise), throughput unchanged (BENCH).
Upgrade
No data migration. With Postgres, check the new pool limits against your server's
max_connections (defaults: 32 per node). The 0.4.1 advice on references over 1024
bytes still applies.
详细ChangeLog
A correctness and robustness release, recommended for everyone, above all for deployments in shadow or authoritative storage mode and for those where agents can push. It also brings the policy reload that landed after 0.4.0. See "Upgrade" for what changes for clients.
Reference name limit
Reference names and symbolic reference targets over 1024 bytes are refused.
RPCs answer InvalidArgument. A push refuses only that reference, unless the
push is atomic. Existing references over the limit can still be read and deleted.
- An object pool's names under
refs/remotes/origin/ may be 15 bytes longer,
which is what its refspec adds to a source name. The allowance goes by the
repository's path, so a repository at a pool-shaped path has it too.
- A repository holding such a reference fails with a permanent error, until the
reference is deleted, when forking, creating or updating a replica, creating or
fetching into an object pool, restoring a backup, FetchBundle,
CreateRepositoryFromBundle and RewriteHistory.
- Importing such a repository into the storage core answers FailedPrecondition
before anything is registered or uploaded, and names the first few references.
A repository with an incomplete registration from an earlier failed import is
refused the same way: run the commands below on the node, with writers stopped,
and import again to resume.
- One such reference on a remote fails the whole of a mirror's
FetchRemote.
UserLand on a branch name over the limit reports this limit.
To find such references (the second command covers an unborn HEAD) and delete one:
git -C <repository> for-each-ref --format='%(refname) %(symref)' | LC_ALL=C awk 'length($1) > 1024 || length($2) > 1024'
git -C <repository> symbolic-ref -q HEAD | LC_ALL=C awk 'length($0) > 1024'
git -C <repository> update-ref --no-deref -d <reference>
Keep --no-deref: without it, deleting a symbolic reference deletes its target.
In an object pool the first command also lists the allowed names of 1025 to 1039
bytes under refs/remotes/origin/. The DeleteRefs RPC and a push that deletes
the reference work too, where the repository's writes are allowed. A symbolic
reference other than HEAD that points at nothing is not checked when a
repository is created from a copy.
Check your repositories before upgrading a storage-core deployment: a node
rebuilt from a database that already holds such a name still writes it through
git. Delete those references first.
Fixes
- A refused create could overwrite a branch in the database (shadow and
authoritative). When two pushes raced to create one branch, the loser was told
it was rejected while the database kept its commit. A push that creates an
existing branch is now refused. Until a fuller fix, the whole push is refused,
so other references of a non-atomic push don't land in that case. Other rejected
updates of a non-atomic push are not addressed in this release.
- Writes stalled after a failed git transaction (authoritative). A repository's
write turn stayed held for up to 10 s when git failed a prepare, because git
reports neither commit nor abort then. Every writer behind it waited. The turn now
ends with the git process, on update-ref, in-process updates and atomic pushes over
SSH and smart HTTP. New metric
graft_storage_ref_admission_released_unreported_total. Smart HTTP's
PostReceivePack now returns when receive-pack exits, even if the client's
stream is still open.
- Cancelled commands left git's reference lock behind. A cancelled context sent
SIGKILL, so git could not clean up, and the next writer failed with "reference is
already locked" until housekeeping removed the lock after an hour. Commands now get
SIGTERM, and SIGKILL to the process group after 10 s if it outlives that. A process
that traps SIGTERM and exits 0 now returns success after cancellation, so callers
must check their context. A lock left by an out-of-memory kill or a crash can still
block writers for up to an hour.
- Concurrent proposal sweeps failed each other. One sweep now runs at a time per
branch, bounded at 5 s after a land. New metric
graft_land_proposal_sweep_timeouts_total. The file tickets of a land are released
before its sweep.
- Writers could fail when housekeeping removed a loose object directory. Gitaly's
own writers now re-create it. Pushes of fewer than 100 objects can still fail, rarely,
inside git; a retry succeeds, and nothing is corrupted (LIMITATIONS).
New
- The policy reloads without a restart. SIGUSR1 reloads the standalone policy
from the configuration file. The swap is atomic; an invalid file keeps the old
policy. See CONFIGURATION.
graft policy check FILE validates a policy and, with -repo, replays recent
changesets against it. Exit 0 when it denies nothing, 1 when it would deny updates,
2 when invalid.
Docs and CI
- README and BENCH now agree and state what was measured. Benchmarks were not
repeated for this release, so the effect of these fixes on throughput is not measured.
- STORAGE.md records two measurements that ended in "don't build": sharing directory
fsyncs, and moving reftable compaction out of the write path.
- LIMITATIONS was checked against the code, claim by claim.
- More tests no longer depend on the speed of the machine.
Upgrade
Check for over-limit references first (above). No configuration or data migration.
详细ChangeLog
Operators can create repositories from the CLI and the SDK. Branch names are
read exactly in every RPC, and agents can no longer write the server's own
references in any mode. Reftable housekeeping no longer fails on busy
repositories. Some error codes change; see "Upgrade".
New
graft repo create and SDK Repo.Create. An operator, with the
shared token, creates a repository:
graft repo create demo.git --initial-commit --branch feature/demo.
The repository can be cloned straight away. The command converges: run it
again after a failure and it does only what is missing. It never adds a
commit to a repository that already has references, and it refuses when
HEAD points to another branch. Agent tokens are refused. In authoritative
mode the repository is registered with the storage core; in shadow mode the
command prints the graft storage import step. QUICKSTART no longer needs
git init and git push.
Security
-
Branches are read by their exact names in every operations RPC:
UserFFBranch, UserMergeBranch, UserDeleteBranch, UserUpdateSubmodule,
UserCherryPick, UserRevert, UserApplyPatch, UserRebaseConfirmable and the
default branch. Before, git's revision rules let another reference answer
for a branch, such as refs/tags/refs/heads/x or a tag named like an
existing branch. Any client that could push a tag could use that to choose
the commit an operation started from.
-
Start points (start_branch_name of cherry-pick and revert, the remote
branch of a rebase) follow git, with one difference: an existing branch
beats a tag or a refs/x of the same name. Also:
- a full object ID is that commit;
refs/... is read exactly;
heads/, tags/ and remotes/ names follow git;
- a reflog entry needs the reference's own reflog;
<rev>:path is refused.
The local and the start-repository paths give the same answers.
-
Agents never write refs/graft/, in every mode. The reservation was
enforced by the reference-transaction hook only in standalone mode. It is
now an invariant of the server. SSHService/SSHUploadArchive can no longer
be opened to agents: git's upload-archive ignores hidden references, so it
could read refs/graft/ by name. The layers are described in
AGENT-SECURITY.md, with end-to-end tests that push as an agent and drive
the real hook in both modes.
Fixes
- Reftable housekeeping on busy repositories.
git pack-refs exits with
a lock or "concurrently modified" error when a writer races it. That
failure is harmless (git itself ignores it), but it failed the whole
OptimizeRepository, so the commit-graph and later steps were skipped.
It is now recorded as packed_refs=skipped, with a warning, and
housekeeping continues; every other error stays fatal.
- Stale reftable table locks (
<table>.ref.lock, left by a killed git) are
removed after the same grace period as tables.list.lock. Before, they
blocked compaction forever.
- A detached HEAD in
FindDefaultBranchName (head only) is a
FailedPrecondition, not an Internal error.
Measured, not built
STORAGE.md has two new sections, both measured and both ending in "don't
build":
- Where the upload time goes. A file-bucket upload costs two fsyncs.
Sharing the directory fsync would save at most 4.3 ms, and it is worse for
large packs. The long tails in use come from the disk being shared with
the database: put the bucket on another device.
- Inline compaction stays. Without git's inline reftable compaction, 50
writers are 2.6x slower and reads 4x slower.
CI
- Tests that pass only on gotestsum's re-run are now shown as warnings on
the run page, and their output is kept as an artifact. Before, they left
the job green and invisible.
- New legs run the reference-heavy packages on reftable.
- Five timing-dependent tests now assert their property without the wall
clock.
Upgrade
Error codes that change:
- A contended repository lock in CreateRepository, CreateFork,
CreateRepositoryFrom*, CreateObjectPool, ReplicateRepository and backup
restore: Internal → FailedPrecondition "repository is already locked".
- UserCreateBranch refused by access checks: Internal → PermissionDenied.
- A revision passed as a branch name (
main~1) now fails as not found when
the branch is read.
gitaly_housekeeping_tasks_total has a new status skipped for
packed_refs. On reftable, these events used to count as failures.
Configuration:
- An
agent_rpcs entry that names gitaly.SSHService/SSHUploadArchive now
stops the server at startup. Remove it.
No data migration.
详细ChangeLog
A fix release: one correctness fix in landing, Windows support for the CLI and
the SDK, fewer fsyncs on the land path, and the measured results of AI conflict
resolution.
Fixes
UserLand resolves its branch by its exact name (#6, thanks
@LosaLosSantos). It read the branch with git's revision rules, so a missing
refs/heads/x could resolve to a tag or a remote-tracking reference named
like it, and a land onto a branch that does not exist could be answered
already_landed. Every branch read of UserLand (decision, batching,
pre-resolution, verification, the moved-reference check) now looks up
refs/heads/<branch> exactly, as UserCommitFiles already did.
New
- The CLI and the SDK run on Windows (#7, thanks @LosaLosSantos). Storage
relative paths are built with / on every system (on Windows they broke a
regular expression and every program importing the SDK panicked at start),
and graft no longer imports the Unix-only changelog package. A CI job
builds graft.exe and the SDK on Windows and runs the workspace tests. The
server stays Linux-only.
Faster
- Fewer fsyncs on the land path (#4, thanks @Trigodil, with maintainer
fixes). A file-bucket upload fsyncs only the directories not yet known to be
durable, and the storage-core watermark of a dirty repository is written
without fsync and made durable by the durable step, outside git's reference
lock and before the repository's marker goes. Measured on one WSL2 machine,
authoritative mode, SQLite, file bucket, 10 writers (four paired runs):
lands per minute about 1,234 -> 1,650, Preparing phase mean about 36 -> 20 ms.
The gain depends on the cost of fsync on the disk.
- Operators: never remove or replace a directory of a file bucket while a
server uses it (the directory cache relies on it; STORAGE.md).
- New metric
graft_storage_preparing_step_seconds{step,kind} (record, walk,
pack, upload) for authoritative writes.
AI conflict resolution: measured
Two writers from different vendors that produce the same resolution, checked by
the project's own tests (or build/tsc) on the exact tree, as verify.command
does, were wrong in (Wilson upper bound in brackets):
|
with the project's tests |
with build or tsc only |
without tests |
| Go |
7.7% (16.8%), replicated on fresh conflicts |
build: 6.8% (14.9%) |
only where it builds |
| Python |
3.2% (7.2%) |
- |
abstaining on semantic conflicts: 5.9% (9.2%) |
| TypeScript |
4.1% (8.6%) |
tsc: 4.9% (9.7%) |
not verified |
Python and TypeScript are judged against an AI reference (Claude) with a written
rubric, calibrated blind on known errors, not a human one; TypeScript without
tests is not verified. Details and every protocol in PLAN10 15.15-15.24.
Upgrade
No configuration or data change from 0.3.0.
详细ChangeLog
gitai 0.3.0 makes the storage core complete (checkpoints, garbage collection,
hydration that always finishes), makes writes faster, and gives conflicts a
full path: the server resolves what it can prove, and everything else reaches
the agent as a package with proposals.
Upgrade: read this first
- Storage core (
[graft.storage]): stop every node, upgrade every node, then
start them. The first node migrates the database and pack keys change
format; a v0.2.x node cannot run on the migrated database. There is no
downgrade past the migration: going back means restoring the database and
the bucket from a backup. A binary that finds a newer database refuses to
start and says so.
sync_timeout of 55 minutes or more now needs gc_grace above
sync_timeout + gc_margin; such configurations fail at startup with a
message that says what to raise.
- New defaults in authoritative mode: checkpoints on (hourly), garbage
collection off.
- New in every mode:
[graft.review] max_open_reviews (default 1000).
- Conflict resolvers. A resolved file must say whether it comes from a
rule (origin: "rule") or a model; anything unmarked is treated as a
model's answer. A command strategy that calls a model must set
origin = "model". graft-resolve's rerere entries written by v0.1/v0.2 are
never replayed; clear the store to reclaim them.
- Upgrade
graft-resolve and the server together. A graft-resolve of
this release gives no model's resolution to a server that does not announce
the capability proposal (and, with agree_with, hold); the file stays
unresolved and no model is called. An older graft-resolve against this
server answers without origin, so even its rules' answers become proposals
that land only if verify.command passes. If you must keep a v0.2.0
graft-resolve for a while, set inline_timeout = "0s": it ignores
rules_only and may call a model in the lane until the server detects it.
- Verification runs model-written code. With a
verify.command, every
resolution is verified on the exact tree it would land, including a model's.
Run the command in a container with no network, a read-only mount and no
credentials (RESOLVE.md has an example).
graft.land.batch.max_size is now at most 100: a larger value is rejected at
startup, since the update of a batch records the identity of every member.
- SDK:
Land retries Unavailable for merge and fast-forward lands, up
to 5 times with jittered backoff; LandResult reports the retries. Turn it
off with LandOptions.RetryUnavailable.
What is new
Storage core
- Checkpoints: a self-contained pack of a repository at a sequence.
Hydration starts from the newest one; building one never blocks a write.
- Garbage collection of covered changeset packs, superseded checkpoints,
packs of writes that died, and removed repositories, including leaks left
by older versions. Every age decision uses the database clock.
- Hydration that always finishes: rounds keep their progress and fetch 8
packs at a time; a large checkpoint is seeded in the background.
| Checkpoint pack |
v0.3.0: fresh after |
v0.2.0, same content |
| 300 MB |
3.6 s |
— |
| 1 GB |
8.2 s |
never (every round Unavailable) |
Faster writes
UserCommitFiles in 6 git processes instead of 10-15 (one reader, one
tree writer, lazy trees, exact branch resolution). 50 agents × 20 changes:
|
v0.2 |
v0.3.0 |
| p50 |
217 ms |
177 ms |
| p95 |
486 ms |
358 ms |
| p99 |
600 ms |
444 ms |
- Authoritative mode: the database commit is the durable point, so git
writes references without fsync and a background step makes them durable a
second later. SQLite, 50/100 agents: lands/min 677-972 → 1411-1673.
- Changelog group commit: concurrent writes share one fsync, in order.
Conflicts
- The conflict package: every conflicting file with its three sides, its
hunks and the reason it was not resolved; the CLI writes it to a directory
and re-lands the agent's resolution with --resolved.
- Proposals: a model's resolution reaches the agent as a proposal, with a
report of what the server checked ("drops THEIRS' change at line 40").
- A model's resolution lands by itself only if the project's tests pass on
the exact tree. Without a verify.command, it is always a proposal.
- Rules resolve in the lane, models and verification outside it. Without
a verify.command, the lane asks graft-resolve for the rules only
(rules_only) and lands their answers in the same batch as the other
changes, as 0.2.0 did, within inline_timeout (default 1s) per batch
attempt. A model's call, and any verification, run outside the lane, so
other agents keep landing meanwhile.
- Lands waiting on a hot file take turns. A land whose resolution went
stale queues for its file instead of resolving again after every landing,
so every land a rule can resolve lands. On the README benchmark with the
deterministic resolver (50 agents, 250 changes, 20% conflicting): 250 of
250 land, each in one round, 1,245-1,806 lands/min, p99 2.0-3.4 s; 0.2.0 on
the same machine: 1,871 lands/min, p99 2.1 s.
- Two models must agree (
agree_with, opt-in): a second model from
another vendor resolves the same file; if the two differ, or a composition
check finds a dropped or duplicated change, the file is held and goes to the
agent. On 487 held-out files of 13 open-source repositories
(openai/gpt-6-luna with z-ai/glm-5.3-flash): 59.8% landed, and at most
15.5% of those were judged wrong by independent reviewing models (Wilson
upper bound 20.1%). Conflicts from merged agent PRs are harder (43-52%
wrong): keep verify.command on. There is no default model; you pick the
model and the provider your code is sent to.
Not verified in this release
- S3, GCS and Azure buckets (all tests used file and memory buckets).
- Nodes on different hosts, a real power loss (simulated), non-Linux hosts,
and a downgrade (unsupported).
- The turns of lands on a hot file hold within one server process; with
several nodes landing on one branch they do not span nodes.
- With a
verify.command, resolutions on one branch are verified one at a
time, each on its own tree: the cost grows with the verification time.
详细ChangeLog
gitai 0.2.0 makes landing much faster and fixes correctness bugs found while doing it.
Landing is 7 to 9 times faster
Measured with examples/graft/demo/acceptance-phase4.sh on one machine (a 16-core laptop under WSL2): agents land 5 changes each on one branch, 20% of the changes conflict on purpose, seed 1. "Classic" is the same server with batching off: every agent rebases and retries its own compare-and-swap, up to 20 attempts.
| 50 agents, 250 changes |
classic |
gitai 0.2.0 |
| changes landed |
100-101 |
200 |
| attempts per landed change |
27 |
1.0 |
| lands per minute |
240-272 |
1,862-2,544 |
| p99 latency |
6.3-7.0 s |
1.5-1.8 s |
At 100 agents gitai lands 392 of 500 changes at 1,422-1,686 per minute (classic: 115-121 at about 206 per minute). The changes gitai does not land are the planned conflicts, because these runs use no conflict resolver. With the deterministic resolver of examples/graft/demo/resolve.toml (--mode land-resolve), every conflict was resolved: 250 of 250 changes landed at 50 agents and 500 of 500 at 100. Ranges are two runs; see BENCH.md.
What changed, root causes first (PLAN8.md):
- Objects of a batch are written once and made durable once, as one pack, instead of being fsynced about three times each.
- The landing decision comes from one range listing instead of nine git processes per change, and the single and batched land paths now share one implementation.
- Every git command spawned a second
git rev-parse just to choose attr.tree; the object format is now read from the repository config.
Fixes
- Landing decisions are exact when committer dates are skewed (clients setting old timestamps, agents with clocks behind).
git rev-list base..head is not exact in that case; an already landed commit could be refused or merged again. The same exposure in the repository rebase todo list (UserRebaseConfirmable, RebaseToRef) is fixed too. A decision costs a fixed number of git processes, whatever the size of the history.
- Writing objects into a repository no longer fails when housekeeping removes an empty object directory at the same moment ("finalizing object file: ... no such file or directory").
UserSquash no longer reports success with an empty commit when the merge fails for a reason other than a conflict.
Upgrading
No configuration changes. go install github.com/feder-cr/git-ai/...@v0.2.0 works with the module path of the project (v0.1.0 still carried the old path).
Known limitations
- In authoritative storage mode, concurrent writes to one repository queue on one reference lock (see STORAGE.md); a fairer queue is planned for 0.3.0, with garbage collection of packs and checkpoints.
- The storage core still has no garbage collection of packs and no checkpoint compaction.
- A lost batch attempt leaves one unreferenced pack until housekeeping prunes it.
The full list is in LIMITATIONS.md.
详细ChangeLog
First public release of gitai, an MIT-licensed, vendor-neutral, agent-scale version control server: a Git for coding agents.
gitai is a fork of Gitaly that implements the ideas described in Anthropic's article Redesigning source control. It is an independent project, not affiliated with or endorsed by Anthropic or GitLab. Repositories stay normal Git repositories and upstream Gitaly RPCs keep working.
Highlights
- Standalone mode for agents: per-agent tokens, an RPC allowlist and branch policies, without GitLab.
- Landing without a merge queue:
UserLand rebases and lands with a compare-and-swap; concurrent lands on one branch are batched; conflicts can be resolved automatically through a vendor-neutral resolver protocol (any LLM provider, or none).
- Server-side history and data:
ObjectService for partial fetches, derived data (graph, changed paths), blame, path history and code search computed on the server.
- Changeset log: every accepted reference update with its operation and actor, listable and watchable.
- Review service with semantic approval rules (comment-only changes can need fewer approvals), post-merge verification with automatic bisect and revert, "superfan" monitoring agents, and tiered object caching.
- Storage core: repository state in SQLite or PostgreSQL as a write-ahead log of changesets with a compare-and-swap per reference, packs in object storage (file, S3, GCS, Azure via gocloud), and server nodes as rebuildable caches. Shadow mode runs it alongside the classic storage; authoritative mode lets any node serve and hydrate any repository.
Getting started
git clone https://github.com/feder-cr/git-ai.git
cd git-ai
make build
examples/graft/quickstart.sh
See the README, the Quickstart and, for the storage core, STORAGE.md.
Known limitations
- Git still runs on a local copy of each repository; "stateless" means that a node can rebuild that copy from the database and object storage.
- The storage core has no garbage collection of packs and no checkpoint compaction yet.
- Authoritative storage mode is not supported behind Praefect.
- S3, GCS and Azure buckets have not been tested against real services yet (file and in-memory buckets are).
- Interfaces may still change before 1.0.
The full list is in LIMITATIONS.md.
详细ChangeLog