branch

preview

Preview promoting one branch into another, reporting conflicts without mutating either branch.

strata branch preview

wire branch_preview

Previews promoting the `source` branch into the `target` branch: it derives the branch point from the recorded fork lineage, runs a three-way comparison, and reports the conflicts a promotion would hit - entries both branches changed differently since the branch point. Preview is read-only: it mutates neither branch.

Each conflict reports what the selected `strategy` would do - `strict` refuses (`refused`), `source_wins` overwrites the target with the source value. A preview with no conflicts is clean and a promotion under `strict` would apply. Preview covers the capabilities a promotion applies - key-value, JSON, and vectors; events and graphs are diff-only and never appear as promotion conflicts. Branches with no shared fork lineage are rejected with `invalid_argument.engine.branch_point`.

Status commands return a scalar or compact status payload and do not mutate database state.

To see the complete help for this command, run:

strata branch preview --help

Example

Preview promoting a fork into the branch it came from.

strata kv put config basestrata branch fork default experimentstrata command run --command-json '{"branch":"experiment","key":"Y29uZmln","type":"kv_put","value":"dHVuZWQ="}'  # change on the forkstrata branch preview experiment default --strategy strict  # a clean preview - no conflicting changes on default

Parameters

NameTypeRequiredDescription
sourcestringyesThe branch whose changes would be promoted.
targetstringyesThe branch that would receive the promotion.
strategyPromotionStrategynoConflict-resolution strategy to evaluate the preview under.one of: strict, source_wins

Returns

StatusResponse<BranchPreviewItem>

  • dataBranchPreviewItem
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

← All 10 Branches commands

agents: this page as markdown → /docs/reference/branch/preview.md