retrofit0.10.0-wip.8

retrofit reconcile

Close concurrent forks in the oplog by rebasing onto a linear tail

Usage:
  retrofit reconcile [<fork-selector>] [flags]

Flags:
      --accept-dirty                write the requested order even when no clean order exists (dirty tail; resolve with op revise)
      --all                         reconcile every leaf fork in line order (per-leaf atomic write); with --clean, refuses fork-nested (exit 1) on oplogs containing multiple truly-independent forks; run reconcile <fork-selector> --clean per fork in that case
      --allow-sealed-rewrite opid   [sealed history] attest each Seal this run would demote or replace, by its full opid (repeatable, comma-separated); a value attests the Seal it names and selects nothing, and a Seal left unnamed refuses seal-removal-refused
      --clean                       write only if a clean order exists; refuse otherwise
  -h, --help                        help for reconcile
      --help-all                    show extended help (vocabulary, semantics, caveats)
      --keep                        bias: prefer the first-seen block order (default when bias is meaningful)
      --schema <name>               registered schema <name> (resolves via the chain when omitted)
      --swap                        bias: prefer the second-seen block order

Global Flags:
      --as string        output mode: text | json (default "text")
  -C, --chdir string     treat <dir> as the working directory for the entire run
      --config string    retrofit.toml path (overrides discovery; also accepts $RETROFIT_CONFIG)
  -f, --file string      oplog file path; selects a registered [[schema]] path (overrides discovery)
      --no-consolidate   render every advisory occurrence instead of collapsing repeats
  -q, --quiet count      suppress the advisory tier on stderr; stack (-qq) to drop it whole (errors and results still print)
  -v, --verbose          reveal info-tier advisories on stderr

Docs: https://docs.retrofit.sh/current/commands/retrofit-reconcile/

retrofit reconcile --help-all adds:

Extended help:

Forks and what reconcile does about them:

A fork is two or more ops sharing the same prev=, a branch point with
more than one successor. Forks arise the usual way branches diverge:
two git branches each run `op add` onto the same op, and the
merge=union .gitattributes rule concatenates both appends into one
file. The result is a valid oplog with a non-linear tail: every op is
still there, but replay order across the branch point is ambiguous.

`retrofit reconcile` closes forks by rebasing onto a linear tail: it
picks an order for the divergent blocks and rewrites prev= so the
chain is single again (opids are unaffected). It
is non-interactive: the flags carry the decision, along three
independent axes:

  bias        --keep / --swap
              Prefer the first-seen block order, or the second-seen.
              Meaningful only alongside an explicit mode flag.

  strictness  --clean / --accept-dirty
              --clean writes only if a conflict-free linear order
              exists; it refuses otherwise. --accept-dirty writes the
              requested order even when one block's ops depend on the
              other's, producing a dirty tail, one whose replay order
              was forced rather than derived. Resolve a dirty tail
              with `op revise`.

  selection   <fork-selector> / --all
              Reconcile one named fork (positional argument), or every
              leaf fork in line order. `--all --clean` refuses on
              oplogs containing multiple truly-independent forks
              (fork-nested); run `reconcile <fork-selector> --clean`
              per fork instead.

A fork of three or more blocks closes two blocks at a time, in line
order: each step closes the result so far with the next block, --swap
reverses the order except at a step with one sealed side, which is
written Seal-first (seal-forces-order refuses a bias only when every
step is such a step), and the run refuses at the first step that does
not close, writing nothing. Under --accept-dirty the fold closes each
step as --clean does until the first step with no clean order, then
writes the requested order from there on (exit 2), reporting every
later step unchecked; `op revise` mends the linear result. A fold whose
every step closes clean refuses --accept-dirty (flag-not-applicable).

Refusal codes specific to fork resolution:

  fork-straddles-seal    a Seal attests ops from more than one block,
                         so no order preserves its digest. Remove the
                         spanning Seal with `op unseal` on a reconciled
                         oplog.
  fork-concurrent-seals  both blocks carry a Seal. Pass --keep or
                         --swap to choose which release is written
                         first; the other block's Seals are removed,
                         which the demotion attestation flag gates.
  seal-forces-order      exactly one block carries a Seal, so that
                         block is written first and a bias flag has
                         nothing left to choose.
  fork-selector-unknown  the given <fork-selector> matches no fork in
                         the current oplog.
  fork-restart-roots     the blocks are two histories of one schema,
                         each rooted at its own CreateSchema: one side
                         restarted the oplog (`import --force`). No
                         mode clears it; take the restarted side and
                         re-add the other side's ops on it.

`validate` reports forks (read-only); `reconcile` resolves them
(mutates the oplog). Run `retrofit validate` first to see what a bare
`reconcile` would find before choosing a mode flag.

Before 1.0, any release may change behavior; the release notes list what changed.