Closing the first actual metadata run #
closeFirstMetadataRun executes one head fusion per remaining member of the actual first
run, then hides its survivor once. Mismatch and empty input retain the entire raw State.
The collapse theorem tracks global renaming, including repeated names outside the selected
positions. Recovery uses that collapse; forwarding a group-consistent assignment preserves
EVERY old name. This original operation is a step toward the full compiler of
#3091, not the all-runs driver.
Close only the first consecutive equal-key run. The ACTUAL run tail funds the private fold; binary key magnitudes never count iterations. The certificate is the literal sequence of existing fusions and one final hide, with no chosen replacement table.
The executed fold globally collapses the selected names, removes exactly that prefix, and emits the literal final restriction with its unconditional raw entry bound. This needs only actual list alignment, not acceptance, arity or distinct names.
Each executed fusion and the single hide internally preserve the full checker.
Rows, every indexed relation/scope-width pair, occurrences and residual port count are preserved exactly as the raw first-run program specifies. No semantic guard is used.
No new variable name is invented: every raw output name is selected from the original body or boundary, including names that were repeated outside the selected positions.
ONE output assignment pulls back through the actual global collapse and determines both source truth and the exact residual ordered word. All selected source values agree.
A satisfying assignment already constant on the actual selected names forwards UNCHANGED on EVERY natural name, including unused names. Equality is a necessary source constraint, not inferred from arbitrary values assigned to eliminated output names.