bespex

Tutorial

When a turn is done: Changes

Purpose: You look at what the AI changed, comment on individual lines, commit and push the result, and go back to an earlier state if you need to.

Your session reports finished. Now it’s time to look at what it did. That is what the Changes tab in the deck is for. It shows you the way your work takes: from the changes that exist only in your folder, through commits on your computer, to the server. Along the way you check what the AI changed, tell it what is still missing, and secure the result.

The way in three stations

For each git repository in your project, the tab shows a way of its own. At the top is the name of the repository with its branch, on the right a short summary, for example “5 open · 2 commits not pushed”. Below it follow three stations, connected by a line at the left edge:

The Changes tab with the way of orbit-api: at the top "Not committed" with 11 files and the button "Commit…", below it the files grouped by the sessions "Config defaults" and "Per-client rate limit for orders", then "Committed, not pushed" with one commit and the button "Push", then the remote branch "origin/feature/rate-limit" with "Earlier states: commits and 9 snapshots", below that the way of a second repository, docs

  1. Not committed are changes that exist only in your project folder. Git doesn’t know them yet.
  2. Committed, not pushed are commits that are saved on your computer but not on the server yet.
  3. The last station is the remote, that is, the branch on the server, as of your last fetch.

The further down your work stands, the safer it is. The Git basics explain exactly what the terms commit, push and fetch mean. If your project has several repositories, for example one for the code and one for the documentation, there is a way of its own for each, one below the other.

What the AI changed

Under Not committed are the changed files, grouped by the AI sessions that have changed them since the last commit. Each group carries the sign and title of its session. If you changed files yourself, they stand in a group of their own without a session. In the station’s header you see how many files and lines have changed and how many of them you have already viewed.

Each file stands in a row with its git state, its path and the number of added and removed lines. The circle on the right shows whether you have already viewed the change. This is how you work through file by file:

  • A click on the row unfolds the file’s diff, that is, the old and the new state side by side. Removed lines are red, added lines green.
  • A double click opens the file in Dirq if it is installed, and ticks it off as viewed.
  • A right click opens the row’s menu. There you find, among other things, Show in tree, the references and Discard changes, which puts the file back to the state of the last commit.

If the file has been changed again since you last looked, the circle shows it, and you look at it once more.

When you point at the header of a session group with the mouse, its tools appear: Report in Marq shows everything you asked the session and what it answered at the end of each turn. With the Dirq symbol you open its files in Dirq, Copy reference puts a pointer to its changes on the clipboard, and Second opinion has another AI check its work (see chapter 7). @ai 3 done on the header of the group counts the @ai comments this session has worked through since the commit.

Commenting on a line

If something in the diff catches your eye, you tell the AI right at that place. To do this, point at a line in the unfolded diff. A small speech bubble symbol appears at its line number. A click on it opens a field below the line in which you write your comment. Removed lines cannot be commented on, because they are no longer in the file.

An unfolded diff of src/routes/orders.rs with red and green lines, below it a comment field with the text "Please also cover the case without a client ID here.", the note "Goes into the file as an @ai comment over this line; name the file in the chat." and the buttons "Cancel" and "Write into the file"

Write into the file puts your comment into the file as an @ai comment above the line, the way you know it from the previous chapter. It stays there until the AI has worked through it and deleted it. So that it does, you name the file to it in the chat, most easily with Copy reference with comments from the file’s menu. Comments you write in Dirq end up in the file in the same way.

Look at this

Some changes deserve a second look: a disabled test, a new dependency, a forgotten test output. CodeDeck looks for these in every change and shows a flag with the number of findings on the header of a session group. A click on it unfolds the list.

The unfolded list "Look at this" of the session Config defaults: under "Please check" a deleted folder and a disabled test, under "Reaches beyond the file" a new dependency and a file that is now executable, under "Tidy up before the commit" a debug output and a new TODO, each with file, line and a short explanation

The findings are sorted by urgency. Each one names the file and the line, shows the place that stands out and explains in one sentence why it stands out. A finding is dealt with as soon as you have looked at it, asked about it or found it fine. What is checked? at the bottom right lists all the rules CodeDeck looks for. You find the same flags on the files in the Files column.

A session’s turn

The button Turn on a session’s card brings you here and shows exactly what the session changed in its last turn. To do this, CodeDeck compares two snapshots. A snapshot is a backup of your project files that you can return to later. CodeDeck creates one before a session writes for the first time in a turn, and another one when the turn is over. The snapshots are kept in your git repository without changing your branch or your commits.

In the same way you can compare any two states: click a commit or snapshot while holding Ctrl, or choose Compare when you point at it. The comparison appears at the top of the tab until you close it.

Commit

When you are happy with the changes, you secure them with a commit. To do this, click Commit… in the header of the station Not committed. A field opens for the commit message, in which you write in one sentence what has changed.

The open commit field of orbit-api: "Commit message for orbit-api", on the right the button "Commit", below it the note "2 files are staged already (by you or an AI). The commit takes all 11 files all the same. · 11 not viewed"

With Ctrl+Enter or the button Commit you create the commit. It always takes all changes of the repository. If you or an AI have already staged individual files, the note below the field says so in plain words, so that nothing surprises you. It also says how many files you haven’t viewed yet.

Afterwards your commit stands under Committed, not pushed. A click on a commit unfolds it and shows its files. As long as a commit isn’t pushed yet, you can correct its message with Change message when you point at it.

Push and remote

With Push in the header of the second station you send your commits to the server. Only then are they safe there too. If your branch doesn’t exist on the server yet, the button is called Publish.

The last station shows the branch on the server as of your last fetch. When you point at it with the mouse, Fetch appears, which checks whether there is anything new on the server, and Pull, which gets the new commits. Pull only works when there is something new there and you have nothing unpushed yourself.

Going back to an earlier state

Sometimes something goes wrong, and you want to go back to a state before the AI changed something. To do this, unfold Earlier states below the last station. There are your commits and the snapshots of the last few days, sorted by day.

“Earlier states: commits and 9 snapshots”: at the top the filter "Snapshots of" with "all sessions", "Config defaults" and "Per-client rate limit for orders", below it under "Today" a stack "7 snapshots", commits and the snapshots "After: Tighten the config defaults" with a flag and "Before: Tighten the config defaults" with an anchor, below that "Yesterday" and "Tuesday" with more commits

The signs tell you when a snapshot was made: the anchor marks the state before a turn, the flag the state after a turn, and a curved arrow a state that CodeDeck saved before going back. When three or more snapshots follow one another, CodeDeck groups them into a stack that you unfold with a click. With Snapshots of you show only the snapshots of a particular session.

A click on a snapshot shows which files have changed since then. With Go back to here… you go back. CodeDeck asks first and explains what will happen.

An unfolded snapshot "Before: Tighten the config defaults" with date and session, below it the question "Puts 11 files back as they were in orbit-api; files that are new since then are deleted. What is there now is kept as a snapshot first, so you can come back to it." with the buttons "Cancel" and "Go back", below that the files concerned

With Go back, CodeDeck puts the files back to this state. Before that it saves the current state as a snapshot, so you can always go forward again. Snapshots are kept for 14 days, at most 50 per repository. For everything that should stay longer, there is the commit.

Try it out

After a finished turn, open the session’s changes with Turn on its card. Unfold the diff of a file, click the speech bubble symbol at a line and write a comment into the file. Give the session the reference with comments in the chat and wait until it is finished. Then look at the files until all circles are ticked, and create a commit with Commit…. Finally, unfold Earlier states and look at which snapshots CodeDeck created in this turn.

More on this

  • Changes: diffs, comments, “viewed” and external viewers in detail.
  • Snapshots: when CodeDeck saves, where the snapshots are kept and how long they stay.
  • Git basics: commit, push, fetch and pull for beginners.