4.1 KiB
Domains — two sides of one relation
A domain is an ontoref extension (ADR-012). Every domain has two sides, and they live in different places:
| Side | Where | Owns |
|---|---|---|
| Authority | code/domains/<id>/ (here) |
the contract: domain.ncl, commands.nu, repo_kinds.txt, and either a co-located ontology/ (e.g. framework/) or a schema_cmd that resolves schemas from an external project (e.g. rustelo/) |
| Consumer | .domains-ontoref/<id>/ in the consuming project |
the project's bond to the domain, plus its optional implementation spine |
The authority declares what the domain is; the consumer declares this project's
relation to it. A bond resolves against the authority (its definitions, states,
capabilities), never on the consumer edge (glossary::bond).
Consumer side — .domains-ontoref/<domain>/
One container directory, one subfolder per bonded domain. Multi-domain membership
is just multiple subfolders — it is not derived from the manifest's scalar
repo_kind (carrier-only, decided 2026-07-17; formalization-vs-adoption:
cardinality is uncapped and orthogonal to whether ontoref manages the project).
<project>/
.domains-ontoref/
rustelo/
bonds.ncl # REQUIRED — : BondSet (schema: code/ontology/schemas/bond.ncl)
ontology/schemas/*.ncl # OPTIONAL — implementation spine (federated domain schemas)
reflection/modes/*.ncl # OPTIONAL — runnable modes for this implementation
web/
bonds.ncl # a second, dependency-axis bond (a plane)
What every bonded project carries
bonds.ncl— aBondSet({ domain, bonds }), importing thebond.nclschema (the carrier is namedbondS.nclprecisely soimport "bond.ncl"resolves the schema and does not self-recurse). EachBondnames anaxis(Governance→ the project is an ontoref-node in the domain's DAG /Dependency→ it inhabits an ontoref-plane), astate(None|Linked|Node|Managed), and — by axis — aresolution(Delegate|Override|Compose) or a DDDdep_kind(+mutual,plane). This is the ONLY required file: a project may bond without being managed by ontoref (no.ontoref/spine needed).
What a managed / implementing project additionally carries
The optional implementation spine — relocated here from the deprecated flat
.{domain}.ontoref/ marker. Its shape is domain-specific (inventoried 2026-07-17):
- an app/impl declaration (
app.ncl) validated against the domain'sschema_cmdschema (e.g.website-htmx-rustelo); - federated
ontology/schemas/*.nclwhen the domain authors its schema in the consumer (e.g.DD7pasos/.librosys.ontoref/ontology/schemas/); reflection/modes/*.ncldiscovered by the mode runner (e.g.jpl/rustelo-website).
Detection
domain.nu :: project-domains recognizes membership four ways:
| kind | signal |
|---|---|
config_flag |
domain_<id> = true in .ontoref/config.ncl |
domain_origin |
domain_origin record in manifest.ncl |
impl_dir |
deprecated flat marker .{domain}.ontoref/ |
bonded_dir |
.domains-ontoref/<id>/ subfolder (the current layout) |
impl_dir and bonded_dir are detected simultaneously during the migration
window (0047); a project carrying both forms for the same id is de-duplicated
(the flat form wins until removed). New projects use .domains-ontoref/<id>/ only.
Migration
The three precedent projects still on the flat form live in independent external repos and are relocated by their maintainers, not by an in-place edit from this constellation (migration 0047 documents the consumer-run step):
DD7pasos/.librosys.ontoref/→.domains-ontoref/librosys/website-htmx-rustelo/.rustelo.ontoref/→.domains-ontoref/rustelo/jpl/rustelo-website/.rustelo.ontoref/→.domains-ontoref/rustelo/
References
code/ontology/schemas/bond.ncl— theBond/BondSetcontract.ontoref/ontology/glossary.ncl—bond,ontoref-node,ontoref-plane.ontoref/reflection/modules/domain.nu—project-domainsdetection- ADR-012 (domain extension), ADR-018/045 (level hierarchy, co-tenancy)