On this page

Read versions, residency, and recorded code๏ƒ

Prerequisites: recording setup and room authority. MutationResearch organizes version history. A ResearchSet has its own lanes, residency, journal, and snapshots; another set can investigate the same live world without sharing that organization.

Separate place, lifecycle, and purpose๏ƒ

Lane state answers whether the lane is open, joined, or archived. Lane type names the kind of work. Residency identifies the lane holding a declared version inside one set. A campaign attributes work across lanes.

The campaign lesson demonstrates an important default: an omitted campaign on an eligible write inherits the ambient campaign. Clear it to stop that attribution. An omitted campaign on a history query instead leaves the read unfiltered.

Read at the grain of the question๏ƒ

Question

Starting read

What happened recently?

research_recent

Where is this version recorded?

research_residency

What code was recorded?

research_source

What is in one module?

research_module

Which top-level pieces exist?

research_parts, then research_part

What changed between versions?

research_diff or research_part_diff

Comparisons use recorded material so two versions can remain distinct. Current disk text cannot stand in for both versions of a historical diff. Select the strategy explicitly when text, structural shape, and individual parts would answer different questions. Foresight reads require custody to be available.

Room commands operate over their supported set surface. The plural-set lesson uses the public MutationResearch/ResearchSet APIs to select independent sets explicitly; do not assume every room command accepts set_name.

The workflow in code๏ƒ

These are the core steps from the saved example. Use its complete linked script for all class definitions and setup.

  1def main() -> None:
  2    # THE TWO ENUMS. Different questions, so different types.
  3    states = [state.name for state in md.LaneState]
  4    types = [kind.name for kind in md.LaneType]
  5    print("LaneState (lifecycle):", states)
  6    print("LaneType  (intent):   ", types)
  7    assert set(states) == {"open", "joined", "archived"}
  8    assert set(types) == {"development", "experiment", "production", "test"}
  9
 10    # THE LADDER, third subsystem to use it (aether 07, crystallizer 17).
 11    # AETHER-HOSTED, and reached the same way as md.Crystallizer() and
 12    # md.Nexus(): Aether builds all three roots when it boots, so this call
 13    # is a LOOKUP, not a construction. One process, one Aether, one research
 14    # root under it - there is no free-standing research world to make.
 15    research = md.MutationResearch()
 16    assert research.activated is False
 17    print()
 18    print("start - configured:", research.is_configured,
 19          "activated:", research.activated)
 20
 21    config = research.create_configuration()
 22    config.with_defaults().finalize()
 23    assert config.activated is False, "finalize seals; it does not enable"
 24    config.activate()
 25    research.activate(config)
 26    assert research.activated is True
 27    print("activated via the caller-driven ladder (not nexus's shortcut)")
 28
 29    # A RESEARCH SET is one named body of history.
 30    research_set = research.create_research_set("promotion-history")
 31    assert isinstance(research_set, md.ResearchSet)
 32    assert research_set.name == "promotion-history"
 33    assert "promotion-history" in research.list_research_set_names()
 34    print()
 35    print("research set:", research_set.name, "| id:", research_set.set_id)
 36
 37    # Every set opens with a default lane, so history has somewhere to go
 38    # before you have made any decisions about structure.
 39    default_lane = research_set.default_lane
 40    assert default_lane is not None
 41    assert research_set.lane_names(), "a set always has at least one lane"
 42    print("lanes:", research_set.lane_names())
 43
 44    # LANE TYPE ENFORCEMENT IS A CHOICE, and it is readable.
 45    enforcement = research_set.lane_type_enforcement
 46    assert isinstance(enforcement, bool)
 47    research_set.set_lane_type_enforcement(True)
 48    assert research_set.lane_type_enforcement is True
 49    research_set.set_lane_type_enforcement(enforcement)
 50    print("lane_type_enforcement is a knob, currently:", enforcement)
 51
 52    # RESIDENCY. One spell, one lane, one answer - and a miss is None
 53    # rather than an exception, the same honest-absence shape as
 54    # ConduitCloud.find_conduit_id_by_name (intermediate 37).
 55    assert research_set.residence_of("no-such-spell") is None
 56    print()
 57    print("residence_of() on an unknown spell -> None, not an exception")
 58
 59    # THE READ SURFACE, ON A SET NOTHING HAS BEEN REGISTERED INTO. An
 60    # empty record is PRESENT AND EMPTY, not absent - which is the shape
 61    # you have to be able to tell apart from "no record at all".
 62    heads = research_set.heads()
 63    assert isinstance(heads, dict)
 64    assert "default" in heads, heads
 65    assert heads["default"] is None, heads
 66    print()
 67    print("heads() on a fresh set ->", heads)
 68    print("  the default lane is THERE with a tip of None. Open-but-empty")
 69    print("  and absent are different facts, and melder spells them")
 70    print("  differently: a missing key means `not open`, a None value")
 71    print("  means `open, nothing in it yet`")
 72
 73    walked = research_set.walk("default")
 74    assert isinstance(walked, list) and walked == [], walked
 75    print("walk('default') ->", len(walked),
 76          "rows - somewhere for history to go before any has happened")
 77    print("  (history / campaign_view are driven in expert 29 and 15,")
 78    print("   where there is something recorded to read)")
 79
 80    # CAMPAIGNS - group work across lanes without threading an id around.
 81    assert research.active_campaign is None
 82    research.set_active_campaign("q3-promotion")
 83    assert research.active_campaign == "q3-promotion"
 84    print()
 85    print("active campaign:", research.active_campaign)
 86    research.clear_active_campaign()
 87    assert research.active_campaign is None
 88    print("cleared - campaigns are explicit at both ends")
 89
 90    # ANCESTRY IS STAGED FIRST. Declaring parents is a separate, visible
 91    # step from recording the entry that uses them.
 92    assert research.staged_ancestry is None
 93    research.stage_ancestry(["parent-a", "parent-b"])
 94    assert research.staged_ancestry == ["parent-a", "parent-b"]
 95    print()
 96    print("staged ancestry:", research.staged_ancestry)
 97    research.clear_staged_ancestry()
 98    assert research.staged_ancestry is None
 99    print("cleared - a half-built lineage is visible, never auto-attached")
100
101    print()
102    print("state is lifecycle, type is intent - a lane carries both")
103    print("residency means one spell, one lane, one answer to 'where is it'")

Runnable examples๏ƒ

All expert examples ยท Level contents ยท Full contents

Canonical page source