---
title: "The developer track"
description: "The teaching deck for the developer track, following its eight lessons slide for slide, with a live demo of each on one development forge."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.forge.workreef.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The developer track

<div class="outline-only">

> **This is a deck**
>
> [Present it](https://docs.forge.workreef.dev/decks/developer-track/) full screen; the arrow keys or the space bar move between slides, and printing gives one slide a page. It follows the [developer track's lessons](https://docs.forge.workreef.dev/learn/#developer) slide for slide; each demo runs against the real binaries each time the book is built, on one forge from start to end.

</div>

## Eight lessons, two and three quarter hours

1. Your first landing, 20 minutes
2. Changes and stacks, 25 minutes
3. Rebasing and conflicts, 25 minutes
4. History and annotate, 20 minutes
5. Search, 15 minutes
6. Approvals, 20 minutes
7. Take it back, 20 minutes
8. Workspaces and their paths, 20 minutes

Every lab runs on a development forge: `af-server --dev`, on your own machine.

## Start the forge

```console server
$ 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:

```console check
$ source ~/af-dev/dev/env
```

## 1. A change, landed

There is no staging step: `af` records your edits in the change.

```console check
$ 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
```

```console eventually
$ af status
Change ospxxlxkwruzwxnwwsupwvtlwozypxvx (landed) at commit 79633d28973c61b66eb00e20d2273610cef9f6b5183497db96be3f910d186fc6
```

## 1. What the forge checked

The landing scan holds back secrets and regulated data:

```console check
$ 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
```

```console eventually
$ af status
Change yqzvymqnlmxpxwqkyxmoqmtlqqnwtprk (submitted) at commit 230ee75b9fdc403a0cb094de0811663e386d326f1cc9fb1496dcfdd764b1c08b
Based on landing 1
Landing waits for: clearance
The landing scan found 1 thing
```

Only a person with the approver role can clear it, with a reason; the secret is real, so take it back:

```console check
$ af abandon
Abandoned change yqzvymqnlmxpxwqkyxmoqmtlqqnwtprk
```

## 2. A stack

`af new` while a change is open starts the next change on top of it:

```console check
$ 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:

```console check
$ 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 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73
```

Submit from the top, and the stack lands together:

```console check
$ af submit
Submitted commit 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73, 0 edits in its last snapshot
```

```console eventually
$ af status
Change kputltlxltovsnounrpsvwuvloxutuyx (landed) at commit 65e981504b1881eaa83342719508e4a5a3494f36a95b83891aaf0894d9ebca73
Based on landing 1
```

## 3. Follow main

A second workspace, a second person. Main moves under it; `af sync` rebases its change onto main's latest:

```console check
$ 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
```

```console eventually
$ af status
Change xsszxnpvywxpylmtpolsppnkwsopuzmv (landed) at commit 466c0feb88b9049746b5802009295dfd45028a637629a0339f821208ced5fd92
Based on landing 3
```

## 3. A conflict, as data

```console check
$ 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 ends
```

## 3. Resolve it

Write the file as it should be, and the conflict is gone:

```console check
$ 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 snapshot
```

## 4. History

Revsets select commits, and `af file annotate` names the change behind each line:

```console eventually
$ 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
~
```

```console check
$ 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, " + name
```

## 5. Search

The forge searches main for you, from its index, whatever your workspace holds:

```console eventually
$ af search 'return'
greet.py:2:    return "Bonjour, " + name
```

```console check
$ af search -f '\.py$'
greet.py
main.py
```

## 6. Approvals

Ask for a person, and the change waits for one:

```console check
$ 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: scan
```

## 6. 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**.

```console check
$ 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 xnkkqrlxnsuwlqxxrvwtztzlxztunwts
```

## 7. 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:

```console check
$ 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, " + name
```

## 8. 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:

```console check
$ 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 files
```

A path you add comes as your landing holds it: `af sync` brings newer ones.

## Where to go next

- The [lessons](https://docs.forge.workreef.dev/learn/#developer), each with exercises and a knowledge check.
- [Using af](https://docs.forge.workreef.dev/af/conflicts/): a guide for each task.
- [How it works](https://docs.forge.workreef.dev/concepts/changes/): changes, workspaces, testing, permissions.

Source: https://docs.forge.workreef.dev/learn/decks/developer-track/index.mdx
