domain.yml
Each branch (a repo or project; library::branch_for names it) can register its facet
vocabulary in REMATCH_ROOT/branches/<branch>/domain.yml. Outcome records use these keys
in their facets (SPEC §Session outcome records). Cross-domain transfer reads them
(rematch transfer suggest, scope::transfer).
domain: <dotted subject path> # prefix-seekable: quant.options, repo.payments, 3d.animationfacets: [<key>, <key>, ...] # structural facet keys of this branchdomain(optional): the dottedsubject.domainprefix this branch’s outcomes use. It is also the branch’s work domain (DESIGN §6 “Domain”): a session in the branch takes it unlesspolicy.jsondeclares one for its remote (which wins), and atransfer applycopy into the branch takes it as its trigger’s domain. Lowercase dotted segments of[a-z0-9_-]; runrematch lake migrateafter changing it to re-decide recorded sessions.facets: the structural keys. Order does not matter; keys are compared exactly after trimming.
Transfer rule. transfer suggest lists a kept lesson tagged invariant from
branch A for branch B when A’s and B’s facet keys share at least two keys
(MIN_OVERLAP = 2) and B has no entry with the same name, a transfers_from link to
the lesson, or near-duplicate text. If a branch has no domain.yml, or the file lists
no facets, its keys are the distinct facet keys of its outcome records in the
ledger (outcome_facets joined to outcomes.branch). transfer apply <lesson> --branch <b> stages a provisional copy in B with lint transfer: true, which blocks
domain lessons and kind: fact entries. Workspace facts/ are dropped from the copy.
Examples
Section titled “Examples”Quant research (branches/quant/domain.yml):
domain: quant.optionsfacets: [mechanism, universe, horizon, data_snapshot]Application repo (branches/payments/domain.yml):
domain: repo.paymentsfacets: [module, change_type, test_scope]3D production (branches/exercise-rigs/domain.yml):
domain: 3d.animationfacets: [rig, exercise, bake]These three share no keys, so none of them receives the others’ lessons. A second
quant branch with facets: [mechanism, horizon, strike] overlaps quant on
mechanism and horizon (two keys), so kept invariant lessons from quant are
suggested for it.