# Branching the record and joining back **🔵 Expert · Lesson 23** BRANCHING, AND WHY A JOIN CAN REFUSE. Research lanes are melder's branches: parallel lines of versions over one world, anchored to each other, finished by joining. It looks like git until three places where it deliberately is not. A BRANCH STARTS EMPTY research_create_lane("try-a", attach_to="default", attach_at_spell_id=v1) Anchoring records ANCESTRY ONLY. No node is copied, no node is moved, and the anchor lane is untouched - the new lane begins with zero versions and a memory of where it came from. That is the opposite of a git branch, which starts AT a commit and carries the whole history with it. ANCHORING IS ALL OR NOTHING `attach_to` and `attach_at_spell_id` must be supplied together; exactly one of them raises before the lock is even taken. There is no "anchor to whatever the tip is" shorthand, because the anchor is the one fact the join later reasons about and a shorthand would let you record a different anchor than you meant. THE DEFAULT LANE TYPE IS `experiment`, NOT `development` Omit `lane_type` and you get `experiment` - deliberately NOT the default lane's `development`. A freshly cut lane is an experiment until someone says otherwise, so the safe classification is the one you get by not thinking about it. AND A JOIN IS DIVERGENCE-AWARE, WHICH IS THE WHOLE LESSON research_join("try-a", into="default") The CLEAN path requires two things at once: the source is anchored onto the receiver, AND the receiver's tip is STILL AT that anchor. Anything else - the receiver moved on, a foreign anchor, no anchor at all - is a DIVERGENT join and refuses unless you pass `force=True`. The refusal NAMES BOTH TIPS, so you are told exactly what drifted apart rather than being handed a conflict to hunt. `force=True` IS NOT A MERGE. It is an EXPLICIT SUPERSEDE, and melder is blunt about the difference: "Reconciliation-by-content is not a join concern: compose in the codegen workshop, register the multi-parent result, then join." Merging content is work you do with code, in a room, and the record only ever books the outcome. A version-control system that merges FOR you is guessing, and this one refuses to guess about your source. COLLAPSE CHOOSES HOW MUCH LINE COMES WITH IT collapse=False (default) fold the source's FULL line in collapse=True move only the TIP, leaving the rest readable in the joined source lane Residence transfers with whatever moves, and the source is marked joined - it accepts no further work afterwards. A NEW VERSION IS BOUND THE WAY THE FIRST ONE WAS. The receiver is moved by staging RuleV2 on RuleV1's index, so both are bound under one string category and binding name, ('rule', 'branch'): an index keeps its first version's binding, and bind_inactive refuses a version bound any other way (2026-10-25). ## Before you run Use the [Expert guide](../../expert/index.md) for prerequisite concepts. Run from a checkout with Melder installed and Python 3.14 free-threading selected. The collection download includes the level's local helper modules. ## Run the saved script ```bash python UX_and_AIX_experiences/04_expert/23_branching_the_record_and_joining_back.py ``` ```powershell py -3.14t UX_and_AIX_experiences/04_expert/23_branching_the_record_and_joining_back.py ``` {download}`Download this collection <../../downloads/expert-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/90d52e0a12cb0743d62568d5a19ce954a54443bc/UX_and_AIX_experiences/04_expert/23_branching_the_record_and_joining_back.py) ## Public surface research_create_lane (anchored, half-anchored and refused), research_heads, research_join with and without force, Conduit.bind_inactive to move the receiver, and the lane payload create_lane returns (a lane describe() snapshot: lane_type, anchor, nodes) ## Code ```{literalinclude} ../../downloads/04_expert/23_branching_the_record_and_joining_back.py :language: python :linenos: ``` ## Check the outcome The script contains its own assertions or demonstrated refusal paths. Run it to evaluate those checks against your installed version. The code above is taken directly from the saved file; no run output is invented here. [More expert examples](index.md) · [Level guide](../../expert/index.md) ## Related guides - [Research sets, lanes, residency, and recorded source](../../expert/research.md) - [Preview, stage, and governed change](../../expert/governed-change.md) ## API contracts - [Conduit](../../reference/api/resolution/conduit.md)