Module 01 · 10 min
How AlbertCode SWE works
The service on your computer, the agent you talk to, and the governed loop every change goes through.
By the end of this module you can
- Explain what runs on your computer, and what the model you connect does
- Put the steps of a governed change in order, with your two approvals
- Say where a change is built, and how to undo one you have accepted
AlbertCode SWE is an engineering workflow around a model you choose. It runs as a small service on your own computer, and you talk to it from the terminal, the browser or your editor. They all see the same tasks, sessions and settings. The model does the reasoning, and AlbertCode SWE handles the plan, the isolated copy, the tests, the reviews and the approvals.
The service and the agent
The first command you run starts the service in the background. It keeps running between sessions, so you can start a task in the browser and follow it in the terminal, and a run keeps going when you close a window. albertcode stop stops the service, and the next albertcode starts it again.
Albert is AlbertCode SWE's agent, the one you talk to. Everything you type is one of two things:
- A question. Albert reads the repository and answers. Nothing is changed.
- A change. It goes through the loop below.
Albert tells the two apart from your words. To decide for it, start a request with /plan (a governed change) or /do (a direct change).
The governed loop
A governed change, the default, always goes the same way:
Plan ─▶ ① you approve the plan ─▶ Build ─▶ Verify ─▶ Review ─▶ ② you accept the diff ─▶ Applied- Plan. Albert reads the repository and writes a plan: the goal, the files it expects to change and how, the steps, how it will test the change, the risk, and how to undo it. Nothing is written yet.
- Approval 1. You approve the plan, or reject it and say what you want instead. Rejecting discards the task.
- Build. Albert makes the change in an isolated copy of your repository, never in your working tree.
- Verify. Your project's own tests and checks run in the copy:
pytest, your npm scripts,go test,cargo test,dotnet testand so on.albertcode doctorshows which of these tools AlbertCode SWE can find. - Review. At the thorough pace (the default), independent reviews check the finished change for security and quality. At the fast pace they are skipped.
- Approval 2. You see the diff, what passed and what failed, and the reviews. Accept it, discard it, or ask for changes in the same chat.
- Applied. Accepting copies the change into your files.
Git is your undo
Accepted changes are ordinary edits in your working tree. Review them with git diff, commit them, and undo them with Git. You can throw away a task you have not accepted with Discard in the browser, or with albertcode rollback <task>, which deletes its isolated copy.
More than one agent
One task can use several agents. Each has less authority than Albert, and every step it takes is recorded on the task, like Albert's own:
- Questions. Albert can ask up to four questions at once. The agents that answer can only read: they cannot change anything, and they cannot start agents of their own.
- Work items. A change made of independent parts can be split into up to six work items. Each item's agent may change only that item's files, within what the contract allows.
- Reviews. At the thorough pace, the security review and the quality review run at the same time. Each reads the finished change in a fresh conversation of its own that cannot change anything.
How AlbertCode SWE works has the details.
The code is yours to check
AlbertCode SWE is free to install and use, including at work, and it doesn't charge for model usage: you use your own provider account, or a local model. Checking what it produces is up to you. AI output can be wrong, incomplete or insecure, so review and test every change before you accept it, and again before you deploy it (FAQ).
Practise
Put the governed loop in order
A governed change always goes the same way. Put its steps in the order they happen.
- 1You approve the plan (approval 1)
- 2Your project's own tests and checks run in the copy
- 3You accept the diff (approval 2)
- 4Independent reviews read the finished change
- 5Albert reads the repository and writes a plan
- 6Albert builds the change in an isolated copy
- 7The change is copied into your files
Your first governed change
Use a Git repository you can safely change. This is the whole loop, start to finish.
- 1
Go to your project folder (
cd your-project) and start AlbertCode SWE:albertcode - 2
Ask a question first, and notice that nothing changes:
What does this project do, and where are the tests? - 3
Ask for a small change as a governed one. Use a one-line fix of your own, or the guide's example:
/plan Add rate limiting to the login endpoint - 4
Read the plan: its goal, the files, the steps, the test plan and how to roll it back. Then approve it.
- 5
Before you accept, check in another terminal that your own files are still untouched:
git diff - 6
Accept the change and run
git diffagain: the change is now an ordinary edit. Commit it, or undo it with Git. - 7
When you are done, stop the background service:
albertcode stop
Check your understanding
6 questions. Answer 5 correctly to complete the module. Checked here, in your browser.