Let the agent manage project history

DHUM / DATA 70600 ยท Class 4

Last week's homework folders

  • The agent worked in a folder of your own files
  • Some of you had files changed or deleted
  • There was no earlier copy to go back to

One request, many changed files

  • An agent can change many files in one step
  • Codex has no undo command
  • OpenAI says to save a version before and after each task
one requestthe agentindex.htmlapp.jsstyles.cssdata.jsonREADME.md

Saved versions of a file and of a project

essay.docx

essay-v2.docx

essay-final.docx

essay-final-2.docx

  • Most of us have saved essays this way
  • Git does it for the whole project folder
  • Each saved version is a commit
  • Each commit has a short message about what changed
"first working version""add borough filter""fix phone layout""add map"Each circle is a commit of the whole folder. The words under it are its message.

Commits and branches

  • A branch is a separate line of work
  • It starts from a commit
  • Codex sometimes makes one on its own when it starts a task
a commit a commit the version that works the main line of work a branch: new work go back

Codex and project history

In a folder with no history

Codex suggests read-only mode.

It can look at files but not edit them.

The review pane

Shows what changed in each file.

Can put a file back.

Needs history, and offers to set it up.

Saving a version

Codex asks for approval first.

Files a save covers

  • Changes since the last commit are not saved yet
the project foldercovered by each commitindex.htmlapp.jsstyles.cssdata.jsonnot covereda databasea file inDownloads

Commit messages and new conversations

  • A new conversation remembers nothing from the last one
  • It can read the history
  • It learns what was done and why from the commit messages
this conversationmakes commitsthe history"first working version""add borough filter""fix phone layout""add map"a new conversationreads them

Project history as a research record

commit 4f2a9c1

Author: Your Name

Date: Thu Sep 24, 7:05 PM

 

Add a map of requests by borough

  • You can see how the project was made, in order
  • Who made each change, and when
  • Each commit has an ID you can cite
  • Zenodo can archive a version from GitHub with a DOI

Git and GitHub

  • Git keeps the history in the project folder
  • If you delete the folder, the history goes too
  • GitHub is a website that keeps a copy
this computerthe project folderfiles and their history (git)GitHuba copy on a websiteClass 5

Going back to a saved version

  • The folder returns to that version
  • Later commits are still kept
  • After a bad run, some people go back and ask again
"first working version""add borough filter""fix phone layout""add map"the folder nowstill kept, and you can return to them

Finding the change that broke something

  • The agent goes back through the saved versions
  • It tests each one
  • The first version that fails has the change that broke it
works"first working version"works"add borough filter"works"fix phone layout"broken"add map"broken"add legend"the change that broke it

Several tasks at once

  • The Codex app can run tasks at the same time
  • Each task gets its own copy and branch
  • The results are combined afterward
  • If two tasks change the same lines, someone has to choose
the main line of worktask 1: add a map (copy 1)task 2: new colors (copy 2)combined

Homework

  • Add something ambitious to your project from last week
  • Have the agent save a version first
  • If the change goes badly, go back