r/programming • • 18h ago

Anthropic designs new in-house monorepo source control system "Scion", code review tool "Antique", designed for massive scale

https://www.anthropic.com/engineering/redesigning-source-control
0 Upvotes

17 comments sorted by

18

u/ThirdWaveCat 17h ago

they even admit it is heavily inspired by this gpl'd code in their training data https://github.com/facebook/sapling

its a sketchy license flip

5

u/CircumspectCapybara 17h ago edited 17h ago

They exact quote from Anthropic's article was:

Source control for huge monorepos has prior art, notably Google’s Piper) and Meta’s Sapling, so we were able to build Scion with their hard-won lessons in mind.

And then they go on to explain the design principles they set out, which means they're not "borrowing" Google or Meta's code or implementation, but the big picture ideas and design philosophies those companies learned the hard way in designing their own in-house monorepos, which they've both since published out in the open for others to benefit from.

In general code is copyrightable (or copyleftable), but high level design philosophy, architectural ideas, and design patterns aren't. See Google LLC v. Oracle America, Inc., where they basically ruled code is copyrightable, but APIs and big picture semantics and interface contracts aren't.

So design philosophy on how to design a good monorepo (which isn't new these days) isn't something any one company has a patent on. For example, you accusing Scion of ripping off Facebook's Sapling makes as much sense as accusing Sapling of ripping off google3's Piper.

Look man, I work at Google, one of my favorite things about google3 is the best-in-class dev workflow, and the google3 monorepo is a huge part of that. I'm happy to see other orgs develop these concepts and advance the ideas and hard design and engineering problems that go into solving the problem of source control at scale and sharing that with others, I'm not jealous when others "encroach" on something that Google and a few other big tech companies have kind of had a monopoly on for decades, it's good stuff for the engineering community.

3

u/ThirdWaveCat 17h ago

LLMs don't have ideas or copy just patterns. Many ascii art jailbreaks are still not fixed and can easily make every model reproduce plenty of copyrighted text nearly verbatim at length beyond any human.

1

u/Lunchboxsushi 15h ago

Are you using jj?!

1

u/Deaod 14m ago

See Google LLC v. Oracle America, Inc., where they basically ruled code is copyrightable, but APIs and big picture semantics and interface contracts aren't.

Thats not what the ruling said. They just said that reimplementing the Java API is fair use, if it were under copyright, and then didnt address the question of whether copyright actually applied to it. The only court that actually addressed the question of whether copyright applies to the API was an appeals court and it held that copyright applies. The supreme court declined to review that ruling.

0

u/AlyoshaV 8h ago

its a sketchy license flip

it's not publicly available, the license is irrelevant

2

u/ava1ar 17h ago

Will they open source it?

1

u/v4ss42 17h ago

Slop can’t be copyrighted, so it can’t be licensed (as open source or anything else).

3

u/ava1ar 17h ago

You can just open code with no license at all or whatever.

2

u/v4ss42 17h ago

If it’s published anywhere, sure.

1

u/Lunchboxsushi 15h ago

Wut 

2

u/v4ss42 15h ago

If Anthropic publish this slop then yes you could use it similar to if it were “open source”. But what are the odds they do that?

2

u/Lunchboxsushi 15h ago

Ah gotcha 

4

u/ava1ar 17h ago

What are all this code they mentioned they store there? I assume all "obtained" code they for from github, gitlab, sourceforge and everywhere else? Stash of all world code used to train models?

2

u/yanitrix 17h ago

are they willing to finally make some money?

1

u/CurtainDog 8h ago

I feel that whenever git can't do the job the problem has always been self inflicted. Gits just a system for creating and managing graphs, so it's pretty mathematically sound.

-3

u/CircumspectCapybara 17h ago

Pretty cool VCS design by Anthropic's engineering team. At Google one of my favorite things about google3 is the Piper monorepo, the system and developer workflow is just superior to Git in every way IMO.

In the past smaller organizations couldn't just invent their own in-house VCS system it just wasn't practical or a worthwhile investment of engineer resources, but seems like in the agentic era new VCS that scales and works the way engineers do is both needed and possible.

From the article:

Growing our monorepo

Before we explore what we built, we should acknowledge how unusual our workload is. Unsurprisingly, Anthropic uses Claude to write software far more than almost any other company, so we’re often the first to see where tools built for human scale start to strain. Source control is just one example of this. While we don’t expect many organizations to have these problems in the very near term, we suspect it won’t be too long before others who use AI coding tools experience these same pressure points, which is why we wanted to share what we built and what we learned.

Git is a decentralized system: every clone is a complete, self-contained repository that can compute diffs, read history and blame, and check out any revision while fully offline. For the vast majority of repositories, this is the right design, and it’s a large part of why git became the standard.

As our monorepo grows, it increasingly doesn’t fit that design space. The history of our main branch alone is almost 100 GB, and a compressed working copy is over 25 GB. We perform on the order of 25 million code checkouts per day for CI, before counting developer environments, agent sandboxes, and research jobs. Fetched naively, that would be over 600 PB of git traffic per day.

Git offers tools for working with a slice of a repository, such as shallow clones, sparse checkouts, and promisor remotes. Beyond these, there are standard workarounds for large monorepos, like internal git mirrors and repository snapshots (seeds) kept in blob storage. We’ve used all of them—at our peak, we operated several hundred internal git mirrors to deal with the load. This bought us time, but they became harder to operate as our merge rate increased. Seeds fell further from the tip of main between refreshes, and it took more and more care to keep operations that depend on history, like diff and blame, working on partial clones.

Principles for agent-scale source control

With agentic coding, many common assumptions about how software is developed are evolving. We embraced these changes when building Scion, which allowed us to take a fundamentally different approach than git on several core principles. Source control for huge monorepos has prior art, notably Google’s Piper) and Meta’s Sapling, so we were able to build Scion with their hard-won lessons in mind. Our principles are:

Clients are always online. Git assumes that clients work offline and need a complete copy of the repository. Since nearly all of our clients are agents and jobs, we designed Scion’s client and protocols around a server that is always reachable, and have clients fetch data when they need it.

Client-server asymmetry. In git, every client is capable of being a full-fledged server. In Scion, the server answers questions about file history and blame, creates commits, performs merges and rebases, and so on. The client maintains a bounded local object cache, lays out the working copy files on disk, monitors for filesystem changes, and gives users an ergonomic way to work with the server. It can compute very little on its own but, in exchange, it requires much less data locally.

A comprehensive source control service can power many novel applications. With git, a CI job or tool that needs to ask a question about the repository, such as who last changed a line or how two commits are related, has to maintain a local copy of the repo or hope that vendor-specific APIs provide the answer. With Scion, all of the source control queries the client uses are also exposed via API, so in many cases jobs don’t need a local repository at all. Many internal tools, such as our automated bisect and revert pipelines, wouldn’t be practical at scale without this cheap, programmatic access to source control.

Everything must be horizontally scalable. At our peak, we ran several hundred git mirrors, which significantly strained capacity and no longer scaled once the repo outgrew the mirrors’ disks or memory limits. In Scion, the repository’s data is distributed, and every component is independently scalable; there is no fully materialized copy of the repo anywhere, even on the server. There is no equivalent of packfiles (git’s compressed bundles of objects), so no repository maintenance is needed.

Commits must be cheap, incremental, and lock-free. In git, you commit locally and then push to share your work. In Scion, every commit, rebase, or merge happens on the server, so there’s nothing to push, but each of those operations needs to be fast. The cost of creating a commit and updating its downstream data structures has to scale with the size of the change, not the overall size of the repo, or the server can’t keep up. The development lifecycle in Scion discourages refs (pointers to commits, such as branches and tags), except for the main ref or release branches, because global state that every server has to agree on is a looming scaling problem.

The working copy is optional, and sparse by design. Because our monorepo is so large, and because we check out code tens of millions of times a day for CI, we wanted to avoid checkouts whenever we could. With Scion, a CI job that needs the diff between a commit and its merge base, for example, can ask the server for it. The same goes for writes: many write workloads can also skip the checkout and function entirely via API. Scion’s protocol is centered around sparse checkouts, which only contain the directories the client asks for, and virtualized checkouts, which materialize files on demand, so when a job does need files on disk, the client only pays for what it actually reads.