Eight lessons, two and three quarter hours
- Your first landing, 20 minutes
- Changes and stacks, 25 minutes
- Rebasing and conflicts, 25 minutes
- History and annotate, 20 minutes
- Search, 15 minutes
- Approvals, 20 minutes
- Take it back, 20 minutes
- Workspaces and their paths, 20 minutes
Every lab runs on a development forge: af-server --dev, on your own machine.
Start the forge
$ af-server --dev
...It signs you in as its administrator, unseals its own vault, and keeps its data in af-dev. The second terminal loads what it wrote:
$ source ~/af-dev/dev/env1. A change, landed
There is no staging step: af records your edits in the change.
$ af workspace add ~/one
Workspace at /home/you/one
Paths: **
main has no landing yet
$ cd ~/one
$ af new -m "Add a readme"
Working on change ospxxlxkwruzwxnwwsupwvtlwozypxvx at commit 88d929ceed6d7f963cd64af223e914cddeaba8dd7c2cb5849860d5841764f872
$ printf 'Atoll Forge\n' > README
$ af submit
Submitted commit 79633d28973c61b66eb00e20d2273610cef9f6b5183497db96be3f910d186fc6, 1 edit in its last snapshot$ af status
Change ospxxlxkwruzwxnwwsupwvtlwozypxvx (landed) at commit 79633d28973c61b66eb00e20d2273610cef9f6b5183497db96be3f910d186fc61. What the forge checked
The landing scan holds back secrets and regulated data:
$ af new -m "Add a billing fixture"
Working on change yqzvymqnlmxpxwqkyxmoqmtlqqnwtprk at commit de19a91b6b92517bfe6dc70dc4d9d8510b4ec3b72367f5ee646b4c53a05412b2
$ printf 'card: 4111111111111111\n' > billing.txt
$ af submit
Submitted commit 230ee75b9fdc403a0cb094de0811663e386d326f1cc9fb1496dcfdd764b1c08b, 1 edit in its last snapshot$ af status
Change yqzvymqnlmxpxwqkyxmoqmtlqqnwtprk (submitted) at commit 230ee75b9fdc403a0cb094de0811663e386d326f1cc9fb1496dcfdd764b1c08b
Based on landing 1
Landing waits for: clearance
The landing scan found 1 thingOnly a person with the approver role can clear it, with a reason; the secret is real, so take it back:
$ af abandon
Abandoned change yqzvymqnlmxpxwqkyxmoqmtlqqnwtprk2. A stack
af new while a change is open starts the next change on top of it:
$ af new -m "Add a greet function"
Working on change opkownwpwvowmsuyormuquypmvkkxpyl at commit a7b180f15f0075271c1f5c726fad65a48334cf565e72ed508e00d87ad662020a
$ printf 'def greet(name):\n return "Hello, " + name\n' > greet.py
$ af new -m "Greet the user"
Working on change kputltlxltovsnounrpsvwuvloxutuyx at commit 1b746afa3d4c4d7cc6d7f3fde91a3161f6addb462a08b512447ea78741141dae
$ printf 'from greet import greet\nprint(greet("you"))\n' > main.py
$ af log -r 'main..@'
@ kputltlx dev@localhost 2026-11-25T06:24:18Z a4f7575a
│ Greet the user
○ opkownwp dev@localhost 2026-11-25T06:24:18Z aaf74146
│ Add a greet function
~2. Fix the change below
Edit where you are, then move the edit down with af squash. Both changes are rewritten; their IDs stay:
$ printf 'def greet(name):\n return "Hello there, " + name\n' > greet.py
$ af squash greet.py
Rewrote change opkownwpwvowmsuyormuquypmvkkxpyl at commit 10e93c1bb67fe5ab00c8b5c7a86abcdda75495425374c05764455a39bbe17d2e
Rewrote change kputltlxltovsnounrpsvwuvloxutuyx at commit 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73Submit from the top, and the stack lands together:
$ af submit
Submitted commit 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73, 0 edits in its last snapshot$ af status
Change kputltlxltovsnounrpsvwuvloxutuyx (landed) at commit 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73
Based on landing 13. Follow main
A second workspace, a second person. Main moves under it; af sync rebases its change onto main’s latest:
$ af workspace add ~/two
Workspace at /home/you/two
Paths: **
At landing 3, 3 files written
$ cd ~/two
$ af new -m "Greet in French"
Working on change xwuoymykspploovvzszpulnkxtpkopkz at commit 5b5ff9e006204c9d909fd31dc161ea78b35a6f89579e769f79c0153f4ae47c29
$ printf 'def greet(name):\n return "Bonjour, " + name\n' > greet.py
$ cd ~/one
$ af new -m "Greet in German"
Working on change xsszxnpvywxpylmtpolsppnkwsopuzmv at commit ecd892adf953ccd4bc7857878c0988aaf35757613edea1390a9ece79fe4d03d6
$ printf 'def greet(name):\n return "Hallo, " + name\n' > greet.py
$ af submit
Submitted commit 466c0feb88b9049746b5802009295dfd45028a637629a0339f821208ced5fd92, 1 edit in its last snapshot$ af status
Change xsszxnpvywxpylmtpolsppnkwsopuzmv (landed) at commit 466c0feb88b9049746b5802009295dfd45028a637629a0339f821208ced5fd92
Based on landing 33. A conflict, as data
$ cd ~/two
$ af sync
At landing 4: 1 file written, 0 deleted
$ af resolve --list
greet.py 2-sided conflict
$ cat greet.py
def greet(name):
<<<<<<< conflict 1 of 1
%%%%%%% diff from: kputltlx 65e98150 "Greet the user" (parents of rebased revision)
\\\\\\\ to: xsszxnpv 466c0feb "Greet in German" (rebase destination)
- return "Hello there, " + name
+ return "Hallo, " + name
+++++++ xwuoymyk 48ca08e0 "Greet in French" (rebased revision)
return "Bonjour, " + name
>>>>>>> conflict 1 of 1 ends3. Resolve it
Write the file as it should be, and the conflict is gone:
$ printf 'def greet(name):\n return "Bonjour, " + name\n' > greet.py
$ af status
Change xwuoymykspploovvzszpulnkxtpkopkz (open) at commit e1aa733fd030d2b7892f3b4797ff3265b1df445cf6291ed1cda5f0255f2aa1df
Based on landing 4
Landing waits for: scan
$ af submit
Submitted commit e1aa733fd030d2b7892f3b4797ff3265b1df445cf6291ed1cda5f0255f2aa1df, 0 edits in its last snapshot4. History
Revsets select commits, and af file annotate names the change behind each line:
$ af log -r 'files(greet.py)'
@ xwuoymyk dev@localhost 2026-11-25T06:24:18Z e1aa733f
│ Greet in French
○ xsszxnpv dev@localhost 2026-11-25T06:24:18Z 466c0feb
╷ Greet in German
○ opkownwp dev@localhost 2026-11-25T06:24:18Z 10e93c1b
│ Add a greet function
~$ af file annotate greet.py
opkownwp dev 2026-11-25 06:24:18 1: def greet(name):
xwuoymyk dev 2026-11-25 06:24:18 2: return "Bonjour, " + name5. Search
The forge searches main for you, from its index, whatever your workspace holds:
$ af search 'return'
greet.py:2: return "Bonjour, " + name$ af search -f '\.py$'
greet.py
main.py6. Approvals
Ask for a person, and the change waits for one:
$ af new -m "Raise the retry limit"
Working on change xnkkqrlxnsuwlqxxrvwtztzlxztunwts at commit 4f5b9dff295ea1eb091e31798efde9bca01a4bbe8f73bd6512d34031526859a0
$ printf 'retries = 10\n' > limits.toml
$ af require @ --reason "the on-call team owns this limit"
change xnkkqrlxnsuwlqxxrvwtztzlxztunwts now waits for that approval
$ af change @
state: Open
latest: 9c1e5a7b3d2f4e6a8b0c1d3e5f7a9b2c4d6e8f01cffa0a97a96ee2d6bae6f2bb
may land: no
waits for: approver
waits for: scan6. Whose approval counts
You need the approver role. Then your own counts, unless the forge requires another person, and every report lists it as an exception.
$ af approve-change @
Error: PermissionDenied: only a person who holds approver approves a change
[1]
$ af grant dev@localhost approver --reason "teaching the track"
done: it took effect at once, on your word as an administrator
$ af approve-change @
approved commit 9c1e5a7b3d2f4e6a8b0c1d3e5f7a9b2c4d6e8f01cffa0a97a96ee2d6bae6f2bb of change xnkkqrlxnsuwlqxxrvwtztzlxztunwts7. Take it back
A landing is never rewritten: af revert makes a change that reverses it, to land through the gate. af edit moves the workspace to it:
$ af revert -r 'main' | tee ~/revert.out
Started change vtwvnmsyzumlyrtlrxlnslprwptnwnrl at commit 244c29f6de22878fb623c5cdef0f603abe40d86de0ce24cedd1009f36ec4f9a9
$ export REVERT=$(sed -n 's/^Started change \([k-z]*\) .*/\1/p' ~/revert.out)
$ af edit $REVERT
Working on change vtwvnmsyzumlyrtlrxlnslprwptnwnrl at commit 244c29f6de22878fb623c5cdef0f603abe40d86de0ce24cedd1009f36ec4f9a9
$ cat greet.py
def greet(name):
return "Hallo, " + name8. Workspaces and their paths
A workspace holds the paths it names. af sparse changes them, as jj sparse does, snapshotting first so no edit is lost:
$ af sparse list
**
$ af sparse set --clear --add '*.py'
Added 0 files, removed 1 file
$ ls
greet.py
main.py
$ af sparse reset
Added 1 file, removed 0 filesA path you add comes as your landing holds it: af sync brings newer ones.
Where to go next
- The lessons, each with exercises and a knowledge check.
- Using af: a guide for each task.
- How it works: changes, workspaces, testing, permissions.