feat: git-backed version control for app mutations#6227
Conversation
Auto-commit to a git repo in ~/.vellum/apps/ after every app create, update, delete, file write, and file edit. Commits are fire-and-forget so they never block the caller. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add initAppGit() and call it during daemon startup so the bootstrap 'Initial commit' is created before any app mutations write files, preventing the first mutation from being absorbed into the initial commit. - Remove gitignoreEnsured flag — check .gitignore rules on every commit so apps dir recreation mid-process is handled correctly.
|
@codex review |
The app git repo should initialize lazily on first app mutation, not on every daemon start. Most sessions never create apps.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bee47ffb7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // recreated while the process was running. | ||
| ensureAppGitignoreRules(appsDir); | ||
|
|
||
| const gitService = getWorkspaceGitService(appsDir); |
There was a problem hiding this comment.
Stop inheriting workspace ignore rules for app repos
commitAppChange creates the repo via getWorkspaceGitService(appsDir), and that service always normalizes .gitignore with WORKSPACE_GITIGNORE_RULES (including patterns like *.db, *.log, and logs/), not just app-specific exclusions. As a result, valid app files matching those patterns are silently excluded from staging, so mutations like writeAppFile can report success while the corresponding content never enters app history. This breaks the guarantee that app mutations are versioned and should be isolated to app-only ignore rules.
Useful? React with 👍 / 👎.
| app.pages = params.pages; | ||
| } | ||
|
|
||
| void commitAppChange(`Create app: ${params.name}`); |
There was a problem hiding this comment.
Initialize app git before first mutation is written
The first mutation writes files and only then calls commitAppChange; on a fresh repo, commitChanges() performs initialization first and absorbs those already-written files into the bootstrap Initial commit, leaving the user-facing mutation commit empty. This means the first create/update/delete after rollout is not represented as its own diff, even though initAppGit was added specifically to prevent that case. Initialize app git before mutation writes (or at startup) so the first mutation commit contains the actual change.
Useful? React with 👍 / 👎.
Summary
app-git-service.ts— initializes a git repo in~/.vellum/apps/and exportscommitAppChange()for fire-and-forget commitsapp-store.ts(create, update, delete, writeAppFile, editAppFile) to auto-commit with descriptive messages.gitignoreexcludes*.preview(large base64) and*/records/(user data)Original prompt
Implement PR 1: App Git Service — Auto-commit on every app mutation. Create
app-git-service.tsas a thin wrapper aroundWorkspaceGitService, hook into all app-store mutation functions with fire-and-forget commits, and add tests.🤖 Generated with Claude Code