A forge where agents snapshot their work every few seconds writes a great deal that nobody needs a month later, and now and then something that must not be kept at all, such as a password. Atoll Forge keeps what matters for good, collects the rest after a window, and purges what must go without rewriting history.
Kept for good
main’s history: every landing and every file it held.- The final state of every change, landed or abandoned.
- Every record: receipts, the log they are in, and the log of reads. Nothing ever deletes them, so a receipt from years ago still verifies.
Collected after a window
Each repository is collected as jj collects one: what is still needed is marked, and what is not, and older than a grace period, is deleted. Each repository’s leader runs it every hour, for that repository’s objects alone.
What goes:
- The snapshots of a finished change but its last, once the window has passed since it landed or was abandoned. While a change is open, every commit of it stays.
- Commits the forge rewrote, such as a change’s commits from before a rebase, on the same terms.
- Operations older than the window. The operation log is cut as a shallow clone cuts history: the oldest kept operations keep their IDs, so every receipt in the window still names an operation that exists. An undo can take back only an operation still in the log.
Nothing written less than a grace period ago is collected, so an upload in progress never loses what it relies on, and a snapshot that names contents already collected is refused, not stored broken.
| Setting | Default | af-server option |
|---|---|---|
| How long a finished change’s snapshots and operations are kept | 14 days | --retention-window |
| How long anything newly written is kept, whatever names it | 14 days | --gc-grace |
| How often each repository is collected | 1 hour | --gc-every |
Purging contents
Sometimes contents must go for good: a committed secret, or personal data someone has the right to have erased. Rewriting history would give every later commit a new ID and break every receipt and workspace that names one. Instead, Atoll Forge purges as Mercurial’s hg censor does: the contents’ bytes go, and every commit keeps its ID. A commit’s ID depends on its tree’s, and a tree’s on its files’ IDs, never on their bytes, so every commit, operation and receipt stays valid.
Start a development forge, and land a file with a password in it, then a change that takes the password out:
$ af-server --dev
...$ source ~/af-dev/dev/env
$ af workspace add ~/demo
Workspace at /home/you/demo
Paths: **
main has no landing yet
$ cd ~/demo
$ af new -m "Add the settings"
Working on change zzywooyxwlmovvovruxwsqurrxyqmlpm at commit 3e3d5cfd2b1d56d2b0fe8d9a43bd1b0a2c0a9e6e787bbaa1b14553c9e1a99204
$ printf 'user=deploy\npassword=hunter2\n' > settings.ini
$ af submit
Submitted commit 4ec0b52d1d8a205e178b17912a013cde2a64c2a80c9deb1d476a839b30692069, 1 edit in its last snapshot$ af main
4ec0b52d1d8a205e178b17912a013cde2a64c2a80c9deb1d476a839b30692069$ af new -m "Take the password out"
Working on change lwtqwtzrqoypokxltsnkxzmzzrnnmuss at commit 9c9ed0e1d6d06bb6c0e5fd3b0b8a8b9e7ef17bcd43126c0bd355b819d7f4110c
$ printf 'user=deploy\n' > settings.ini
$ af submit
Submitted commit a35c6be5beee94842412c9ebb4b59d09a1d08bc6b9d8735050644fd44e5de78a, 1 edit in its last snapshot$ af main
a35c6be5beee94842412c9ebb4b59d09a1d08bc6b9d8735050644fd44e5de78aA purge names the path and, with a revset, the commits whose contents of it go. Contents that main or an open or submitted change still holds are refused: land their removal first, as hg censor refuses a head. main’s own settings.ini is refused, and the one with the password is purged:
$ af purge settings.ini -r 'main' --reason "a password was committed"
Error: the contents are current: main holds them at settings.ini; land their removal first
[1]
$ af purge settings.ini -r 'main-' --reason "a password was committed"
purges 33b349f4fedd9a9be90d90b9de78a6c14f4da1f6d90d5e5bda2062d596fea4ae
done: it took effect at once, on your word as an administratorThe commit is still there with its ID, and still names the file, but its contents are gone. Every read says so, and why. af file show names the file withheld and the record that approved the purge, as jj’s file show names a file it may not read:
$ af file show settings.ini -r 'main-'
Error: settings.ini at 4ec0b52d1d8a205e178b17912a013cde2a64c2a80c9deb1d476a839b30692069 is withheld: the contents 33b349f4fedd9a9be90d90b9de78a6c14f4da1f6d90d5e5bda2062d596fea4ae were purged, as the organization's record 4 approved: they are neither read nor stored again
[1]$ af show -r 'main-'
Commit ID: 4ec0b52d1d8a205e178b17912a013cde2a64c2a80c9deb1d476a839b30692069
Author : Developer <dev@localhost> (2026-11-25T04:08:09Z)
Parents : 0000000000000000000000000000000000000000000000000000000000000000
Add the settings
A settings.iniWho may purge
An administrator asks, naming the repository, the path, the commits and a reason, and the purge takes effect on their word, which compliance reports list as an exception; a forge that requires a second administrator holds it until another approves. The reason is kept for good in the organization’s log, so it must not repeat what was purged.
What a purge does
- The contents go from the repository, wherever a file of it holds them. Other repositories keep their own copies; each has its own storage.
- They never come back. Reading them fails, and uploading them, a snapshot naming them, or reverting the landing that removed them is refused.
- Every reader is told. The forge names each withheld path, with why, wherever it would have sent the file.
af file showrefuses as above.af diffsays a side’s contents are withheld in place of its lines, so a purged file never reads as emptied. A workspace leaves the file out, as jj’s working copy leaves out a file it may not read, andaf statuslists it until something else is there. A runner names it in its output before the job runs. - They are erased from every node’s files. Each database zeroes what a delete frees. As a purge reaches each node, the node removes the contents from its code search index, rewriting each of the index’s files that held them, so no part of the index keeps the text, then empties its write-ahead logs and cuts its Raft log past the purge, deleting the files of the cut entries. Afterwards no file of any node holds a byte of the contents.
- The build cache is emptied, since a build output from a tree that held the contents may hold them too.
What a purge cannot reach: every workspace that checked the file out keeps its copy, as a clone keeps what hg censor erased later. A file’s name and a commit’s description cannot be purged.
Next
- What the forge records: the receipts and logs that are kept for good.
af purgeandaf-serverin the reference.