Order maintenance: a total order over opaque elements that answers precedence queries in O(1) while supporting insertion and deletion.
This is the order-maintenance problem (Dietz & Sleator 1987; simplified by Bender, Cole, Demaine, Farach-Colton & Zito, ESA 2002): keep a sequence under insert_after / remove so that compare tells, in constant time, which of two live elements comes first.
The incremental rule merger uses it for cascade precedence: rules keep a stable position handle even as merges delete some and factoring inserts new shared rules, so "does rule A come before rule B?" stays O(1) instead of re-deriving list indices after every edit.
Elements are identified by a node handle returned at insertion. A handle stays valid until it is removed; using a removed handle is an error.
id n is a stable integer identity unique within the node's collection, assigned at creation and never reused. Unlike the precedence answered by compare, id is invariant under insertions and deletions elsewhere, so it can key a map or priority queue of handles.