commits[] append-onlyDIS-044 made the RGA tie-break the merged commit INDEX, and wmerge_commits (dog/WEAVE.c:645-687) infers that index by re-deriving a topo order from two sorted lists — an O(n^2) ready-test plus a smaller-hashlet tie-break for concurrent heads. The weave stores no parent edges by design (dog/WEAVE.h:133-134): graf owns the DAG and already walks the closure in topo order (be/shared/weave.js build). So libdog reconstructs DAG knowledge it deliberately does not keep, from a shadow of it, on every merge. The cost is a full renumbering: WEAVEMerge permutes commits[] and remaps every token's ins/rms through ra/rb, so an index is not a stable name across a merge. Move the ordering contract to the API and the table becomes append-only.
The weave's commit table serves two roles that only one of them needs order.
commits[] (dog/WEAVE.h:75,118), removers likewise (:119).dog/WEAVE.c:691-695), so the index must be a causal rank.weavescope is one bit per slot (dog/WEAVE.h:131), so slots must stay dense small integers — this constrains any redesign.WEAVEScope takes a reachable commit-id set supplied by graf (dog/WEAVE.h:133-135).Specify the order as an API contract, then make the table append-only.
commits[] becomes append-only: parent a's slots keep their numbers, b's non-shared ids append.wmerge_commits and the ra remap go away; rb shrinks to a dedup-aware offset.The contract moves outward, so the failure mode moves outward with it.
commits[] semantics touches the 'C' column of the 'W' blob: needs a version gate or a proven-compatible layout.Split identity from rank; the caller owns rank.
(commits[inserter], ordinal) and WEAVEIdHash are untouched — this changes numbering, not identity.Callers first, WEAVE second.
WEAVEMerge's remap pass end to end — this ticket is a proposal until that is done.be/shared/weave.js build supply the rank explicitly.WEAVEMerge and WEAVENext call for order compliance.commits[], delete wmerge_commits, drop the ra remap.'C' column change, or prove the layout unchanged.