# Compose a subsystem and inspect its impact Prerequisite: [research records](research.md). A composition pins a set of recorded spell versions as one named unit. Its identity follows its membership. Recompose adds or removes selected members and produces a successor; it does not erase the previous roster. ## Read the unit at the right grain Roster, history, and member differences come from the research record. Footprint, drift, and impact join the member versions to custody information. Missing custody is reported explicitly; it must not silently count as an empty dependency graph. The subsystem lesson creates three real module worlds before forming its group. Impact considers the union of member effects and distinguishes effects inside the composition from effects outside it. The membership comparison remains at subsystem grain; select changed members for deeper code comparisons afterward. ## Compose source separately `research_synthesize` selects top-level functions or classes from a donor module into a base module and returns composed source with a preview. A method is not a top-level function. The workshop lesson exercises both replacement and addition using two generated modules so the comparison has two genuinely different inputs. Staged ancestry belongs to the next fresh world entry. If the candidate is abandoned, clear that staging explicitly so an unrelated later bind cannot inherit it. ## The workflow in code These are the core steps from the saved example. Use its complete linked script for all class definitions and setup. ```{literalinclude} ../downloads/04_expert/30_composing_a_version_in_the_workshop.py :language: python :pyobject: main :linenos: ``` ## Runnable examples - [Composing a version in the workshop](../examples/expert/30-composing-a-version-in-the-workshop.md) — Expert 30 - [Compositions a subsystem as one unit](../examples/expert/14-compositions-a-subsystem-as-one-unit.md) — Expert 14 - [A subsystems blast radius](../examples/expert/32-a-subsystems-blast-radius.md) — Expert 32 [All expert examples](../examples/expert/index.md) · [Level contents](index.md) · [Full contents](../contents.md) [Canonical page source](https://github.com/Synaptic724/melder/blob/90d52e0a12cb0743d62568d5a19ce954a54443bc/docs/expert/compositions.md)