ontoref-code/domains/schema.ncl
Jesús Pérez b3e3a62f91
feat(domains): two-path activation gate + both-faces slots (adr-077)
_dispatch_domain now activates a domain by EITHER a managed project's repo_kind
(adr-012) OR the presence of a bond carrier .domains-ontoref/<id>/bonds.ncl
(adr-073), with no manifest required on the bond path. The repo_kind path is
unchanged; the bond path is purely additive. domains/schema.ncl gains adrs/modes
reference-id slots so a domain carries both faces (adr-076 the-domain-scope-
carries-both-faces).
2026-07-21 11:45:25 +01:00

60 lines
2.9 KiB
Text

# domains/schema.ncl — contract for ontoref domain extension manifests.
#
# A domain is a self-contained extension loaded by ontoref when the project's
# repo_kind matches one of the domain's declared repo_kinds.
# Domains live in $ONTOREF_ROOT/domains/{id}/ and provide:
# - commands.nu → CLI commands dispatched by the bash wrapper
# - domain.ncl → this contract: declared commands, pages, requirements
# - repo_kinds.txt → plain-text list of matching repo_kind values (bash-readable)
let domain_command_type = {
id | String, # e.g. "cfp list", "career skills --tier"
description | String,
usage | String | default = "",
examples | Array String | default = [],
} in
let domain_page_type = {
id | String, # "cfp", "career"
route | String, # "/personal/cfp"
title | String,
template | String, # filename stem in domain's pages/ dir
nav_label | String | default = "",
} in
let domain_type = {
id | String,
name | String,
repo_kinds | Array String, # must match values in manifest.ncl RepoKind enum
description | String | default = "",
commands | Array domain_command_type | default = [],
pages | Array domain_page_type | default = [],
# .ontoref/ontology/*.ncl stems that must exist for commands to work.
# Enforced ONLY on the Layer-1 activation path (a managed project, repo_kind
# match); a bond-only consumer ('Linked/'Node, no .ontoref/ spine) is exempt
# (ADR-073, ADR-076 G-1=A). The dispatch gate lives in install/ontoref-global.
required_extensions | Array String | default = [],
# Both faces of the domain scope (ADR-076 the-domain-scope-carries-both-faces).
# Reference ids only — the actual .ncl content lives in the provider's spine
# (.ontoref/adrs, .ontoref/reflection/modes) or, for a bonded implementing
# consumer, in .domains-ontoref/<id>/{ontology,reflection} (bond-carrier-layout).
# A domain declaring commands/schemas but neither face collapses ontology-vs-
# reflection (schema-only = Yin capture, commands-only = Yang capture).
adrs | Array String | default = [],
modes | Array String | default = [],
commands_script | String | default = "commands.nu",
short_alias | String | default = "",
# For domains whose NCL schemas live in an external project (not ontoref itself).
# The command must print the project root path to stdout — resolved via the
# global project registry. Consumers import as:
# import "rustelo/domains/rustelo/ontology/schema.ncl"
# where the prefix is the path returned by schema_cmd.
# Empty string means the domain's schemas are co-located in ontoref's domains/ dir.
schema_cmd | String | default = "",
} in
{
DomainCommand = domain_command_type,
DomainPage = domain_page_type,
Domain = domain_type,
}