insertAllAfter
Append values as a chain starting immediately after after, minting one RgaOp.Insert per element on behalf of replica.
The bulk sibling of insertAfter, and indistinguishable from calling it in a loop: the same ids, the same after links, the same Lamport clock, the same op-set. What differs is the cost. insertAfter rebuilds ops and insertsById on every call, so appending k elements to an N-op log is k copies of N — Θ(k·N). This pays one ops + newOps and one cache build for the whole run, so it is Θ(N + k).
That is the amortisation WarpLogRecordExporter needs to stop paying a Θ(N) append per log record (#2194), and it needs no persistent data structure and no new dependency on this deliberately dependency-free module. It does not remove the Θ(N) term — one ops copy per run remains, which is #2193's Phase 3A.
When this really is an append — after is the last element of the full sequence — and this instance is already holding that order, the order is extended instead of being recomputed (#2193's Phase 3B). Any other after, or an instance holding no order, passes nothing on and the next read rebuilds once.
"Already holding" means either half: an order threaded in from the producing mutation, or one an earlier plain read forced (#2225). What it never means is computing one — see rule 2 of RgaCache.sequence.
An empty values returns this — the same instance, not a copy.
Return
the new state, and the ops to broadcast in append order.