Skip to content

feat: git-backed version control for app mutations#6227

Merged
vincent0426 merged 5 commits into
mainfrom
safe-do/app-git-version-control
Feb 21, 2026
Merged

feat: git-backed version control for app mutations#6227
vincent0426 merged 5 commits into
mainfrom
safe-do/app-git-version-control

Conversation

@vincent0426
Copy link
Copy Markdown
Contributor

@vincent0426 vincent0426 commented Feb 21, 2026

Summary

  • Add app-git-service.ts — initializes a git repo in ~/.vellum/apps/ and exports commitAppChange() for fire-and-forget commits
  • Hook every mutation in app-store.ts (create, update, delete, writeAppFile, editAppFile) to auto-commit with descriptive messages
  • .gitignore excludes *.preview (large base64) and */records/ (user data)
  • Add comprehensive tests verifying commits are created for each mutation type

Original prompt

Implement PR 1: App Git Service — Auto-commit on every app mutation. Create app-git-service.ts as a thin wrapper around WorkspaceGitService, hook into all app-store mutation functions with fire-and-forget commits, and add tests.

🤖 Generated with Claude Code


Open with Devin

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>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

- 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.
@vincent0426
Copy link
Copy Markdown
Contributor Author

@codex review

devin-ai-integration[bot]

This comment was marked as resolved.

The app git repo should initialize lazily on first app mutation,
not on every daemon start. Most sessions never create apps.
@vincent0426
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vincent0426 vincent0426 merged commit 36c75f6 into main Feb 21, 2026
1 check failed
@vincent0426 vincent0426 deleted the safe-do/app-git-version-control branch February 21, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant