Branches, PRs & merges

Cloudrizz is versioned like real software. Changes are committed to feature branches, previewed in isolation, and merged into main through a pull request an org admin reviews. Disjoint changes auto-merge; same-file conflicts are handed to the assistant to resolve — but a human approves what ships.

Why main is protected

You can't commit straight to mainsave_version and edit_file refuse it. Work goes on a feature branch and reaches main only via a merged pull request. This keeps production deployable and gives every change a review point.

The flow

  1. Commit to a feature branch — just pick a branch name when calling save_version / edit_file and it's auto-created from main. (manage_branch (action: create) only when forking from a non-HEAD commit.)
  2. deploy_app on the branch to get a live preview URL, backed by your personal throwaway sandbox so it can't touch production data.
  3. manage_pull_request (action: open) with a clear title and description. One open PR per branch.
  4. An app admin reviews and merges — via the dashboard or merge_pull_request. If the target hasn't moved the merge fast-forwards; if it advanced but the two branches touched different files, Cloudrizz merges them automatically. Only when the same file changed on both sides do you resolve a conflict (below).

When the same file changed on both sides

If main moved on while your branch was open and you both edited the same file, merge_pull_request doesn't fail — it returns a conflict (with merged: false) listing each clashing file with three versions: the common base, the current main, and your branch. Cloudrizz never auto-resolves with AI — you reconcile each file. The loop:

  1. Read the base / main / branch contents in the conflict and write the reconciled version back to your source branch with save_version / edit_file.
  2. Call merge_pull_request again with resolvedAgainstTargetHead set to the targetHead from the conflict — that tells Cloudrizz you've reconciled against that exact state of main.
  3. If main moved again in the meantime you simply get a fresh conflict (or a 409) — nothing is merged or lost; re-resolve against the new targetHead.
Want to know in advance? manage_pull_request (action: get) returns canFastForward — false means main has diverged and the branch needs a rebase before it can merge cleanly. The dashboard PR view shows the same.

Managing the PR queue

  • manage_pull_request (action: list/get/close) — list open PRs, inspect one (with its canFastForward merge status), or close one without merging.
  • merge_pull_request — the real merge. Disjoint changes auto-merge; for same-file conflicts it hands you each file's base/main/branch versions to reconcile. Cloudrizz never AI-generates a merged result.

Previews & cleanup

Each branch (and each per-user preview) gets its own preview instance and playground sandbox. Merging a PR can tear the branch down for you, and manage_branch (action: delete) removes one on demand (its commits stay on main); abandoned previews are also cleaned up automatically after a period of inactivity. Reset your preview data anytime with reset_playground.

Roles matter: any member can propose changes, but merging to main requires admin on the app — an org owner/admin, or a member with a per-app admin grant. See the tool reference for which tools mutate.