retrofit op seal
Seal the unsealed tail of the oplog. The Seal covers every op from
the first unsealed op through the current tail; subsequent edits to
those ops are detected by `retrofit validate`.
Tail-append only: sealing a sub-range of the unsealed tail is out
of scope.
The run seals each schema in its scope: each --schema names one, and
with no --schema every registered schema is in scope (the working
directory and default_schema do not narrow it). It writes all of
their Seals or none: a refusal in one schema writes nothing to any.
A schema in scope with no unsealed tail is skipped. A run over
several schemas opens its report with its scope and prints one
"sealed" line per schema. --compact takes one schema.
A range that declares reference data seals only when every reference
record it covers is witnessed, and only when every declared product
born in it that a fresh build cannot route rows into has a record of
its own (reference-rows-uncaptured): a JoinTable's product, a
SplitTable's pieces and its source, a MergeTable's into table, an
InlineTable's survivor, and an UnjoinTable child that carries no key.
The op moves the source's rows into the product in every migrated
database, so a fresh build needs them captured. A CopyTable clone, an
ExtractTable child and an UnjoinTable keyed child need none: their
rows are the source's at the op, which a fresh build routes into them.
A data record whose anchor-op names no live op in the log refuses the
seal as data check does (data-file-anchor-unresolved). A record whose
anchor was revised or removed moves with retrofit data reanchor; after
a regenerated log, or to pick the opid yourself, re-pin it with
retrofit data repin. Then seal.
Run with --help-all for recovery guidance (e.g. removing a Seal
authored on the wrong branch).
Synopsis
Usage:
retrofit op seal [flags]
Options
Flags:
--compact string compact the tail to this frontier file, then seal it, in one write
-h, --help help for seal
--help-all show extended help (vocabulary, semantics, caveats)
--reason string optional reason text recorded on the Seal
Global options
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)
--schema <name> registered schema <name> (resolves via the chain when omitted)
-v, --verbose reveal info-tier advisories on stderr
Docs: https://docs.retrofit.sh/wip/commands/retrofit-op-seal/
retrofit op seal --help-all adds:
Extended help:
If you authored a Seal on the wrong git branch and want to keep
its covered ops, recover with:
retrofit op unseal
This removes the most-recent Seal record and keeps the covered ops as
the unsealed tail, ready to edit or re-seal.
For an intentional destructive rewind that discards the Seal and the
ops it covers, use:
retrofit op truncate --drop-seals 1