Forks a new branch anchored at a retained commit version of the source branch, giving time-travel semantics: the new branch sees exactly the data visible at that version. A version outside retained history fails with history_unavailable.engine.persistence_history.
This command has no dedicated CLI verb: the CLI expresses it as strata branch fork <SOURCE> <BRANCH> --version <VERSION> (one shared branch fork verb routes to all three fork commands, so only branch.fork owns the CLI path). It remains fully reachable through the generic wire surface — strata command run, MCP, and SDKs.
Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.
Examples
Fork a branch at an earlier commit version — a snapshot of history.
CLI
$ strata kv put greeting original # The receipt carries this commit's version.
$ strata kv put greeting updated
$ strata command run --command-json '{"branch":"snapshot","source":"default","type":"branch_fork_at_version","version":3}' # snapshot forks default's history at that version.
$ strata kv get greeting --branch snapshot
Wire
{"key":"Z3JlZXRpbmc=","type":"kv_put","value":"b3JpZ2luYWw="}
{"key":"Z3JlZXRpbmc=","type":"kv_put","value":"dXBkYXRlZA=="}
{"branch":"snapshot","source":"default","type":"branch_fork_at_version","version":3}
{"branch":"snapshot","key":"Z3JlZXRpbmc=","type":"kv_get"}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
source | string | yes | Source branch name. |
version | integer | yes | Source version. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
MutationAck<BranchItem>.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.branch_nameinvalid_argument.engine.branch_name_reservedalready_exists.engine.branchhistory_unavailable.engine.persistence_history
Invocation
- CLI: via
strata command run(no dedicated verb) - Wire type:
branch_fork_at_version