Research
Engineering notes

Version history that only moves forward

· Nicrron Engineering

Every change to a Builder project, by the model, by hand or by a shell command, is now a commit in a git repository only Ninoo writes to. Undo, restore and revert all add new commits, so nothing in a project's history is ever rewritten.

A repository of its own

The model is free to run git in a project, so product history can't live in the project's own .git. It lives in a separate repository inside the workspace, and every git call names it explicitly. Because its directory is also called .git, everything that already ignores .git (file watchers, the agent's search tools, the code pane) ignores it too.

A commit is made at the end of every prompt, on every hand edit, on import and on publish. Committing the whole tree, not just the files the model wrote, means changes made through the shell, such as installing a package or deleting a file, are captured too. Installs, build output, caches, logs, environment files with secrets, and files over 10 MB are left out.

Forward only

Undo restores the tree of the previous version and commits it. Restoring any older version works the same way. Undoing one old change while keeping everything after it uses git revert. If later changes touched the same lines, the revert stops and says so instead of guessing.

An index of versions in Postgres lets the History list load while the workspace is asleep. The repository is archived with the workspace when it pauses and pushed to Ninoo Git, so it survives a workspace being moved.

What surprised us

  • 01Restores of workspace snapshots buffered the upload in memory with a 64 MB limit, while snapshots can be up to 512 MB. Restores now stream straight into tar.
  • 02Bash changes were invisible to the old undo, which only recorded files the model wrote. Committing the whole tree closed that gap.
Next noteOur own git server for Ninoo projects