chore: add templates and arch diagrams
Some checks failed
Nickel Type Check / Nickel Type Checking (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled

This commit is contained in:
Jesús Pérez 2026-03-13 00:21:54 +00:00
parent 0396e4037b
commit d2b361420b
Signed by: jesus
GPG Key ID: 9F243E355E0BC939
7 changed files with 742 additions and 0 deletions

253
assets/architecture.svg Normal file
View File

@ -0,0 +1,253 @@
<svg viewBox="0 0 900 560" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arr-a" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#E8A838"/>
</marker>
<marker id="arr-s" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#5A6A7C"/>
</marker>
<marker id="arr-o" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#2A5080"/>
</marker>
</defs>
<!-- background -->
<rect width="900" height="560" fill="#0D1117"/>
<!-- ─────────────────────────────────────────
CONSUMER
───────────────────────────────────────── -->
<rect x="20" y="20" width="860" height="62" rx="6"
fill="#0F1623" stroke="#2A3A50" stroke-width="1.5" stroke-dasharray="6,4"/>
<text x="44" y="43"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#3A5070" letter-spacing=".1em">CONSUMER PROJECT</text>
<text x="44" y="63"
font-family="'IBM Plex Mono',monospace" font-size="12" fill="#8090A4">ontoref</text>
<text x="190" y="63"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#3A5070"> · .ontoref/config.ncl · ONTOREF_PROJECT_ROOT</text>
<!-- Consumer → Tooling -->
<line x1="280" y1="82" x2="280" y2="112"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<text x="292" y="101"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#B87000">exec · ONTOREF_PROJECT_ROOT</text>
<!-- ─────────────────────────────────────────
TOOLING LAYER
───────────────────────────────────────── -->
<rect x="20" y="116" width="548" height="192" rx="6"
fill="#111827" stroke="#E8A838" stroke-width="1.5" stroke-opacity=".6"/>
<text x="30" y="132"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#E8A838" letter-spacing=".1em">TOOLING LAYER</text>
<!-- ./ontoref -->
<rect x="40" y="148" width="138" height="46" rx="5"
fill="#1C2535" stroke="#E8A838" stroke-width="1" stroke-opacity=".5"/>
<text x="109" y="167"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="600"
fill="#E8A838" text-anchor="middle">./ontoref</text>
<text x="109" y="183"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">bash · actor detection</text>
<!-- ./ontoref → ontoref.nu -->
<line x1="178" y1="171" x2="208" y2="171"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<!-- ontoref.nu -->
<rect x="208" y="148" width="174" height="46" rx="5"
fill="#1C2535" stroke="#E8A838" stroke-width="1" stroke-opacity=".5"/>
<text x="295" y="167"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="600"
fill="#E8A838" text-anchor="middle">ontoref.nu</text>
<text x="295" y="183"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">Nushell dispatcher</text>
<!-- ontoref.nu → modules -->
<line x1="295" y1="194" x2="295" y2="220"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<!-- 16 Nushell modules -->
<rect x="40" y="220" width="506" height="72" rx="5"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1" stroke-opacity=".5"/>
<text x="293" y="240"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">reflection/modules/ · 16 Nushell modules</text>
<text x="293" y="257"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">adr · backlog · coder · describe · sync · store · services · nats · …</text>
<text x="293" y="274"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#1E3A58" text-anchor="middle">subprocess fallback: direct nickel export when daemon unavailable</text>
<!-- ─────────────────────────────────────────
RUST CRATES
───────────────────────────────────────── -->
<rect x="584" y="116" width="296" height="192" rx="6"
fill="#111827" stroke="#8090A4" stroke-width="1.5" stroke-opacity=".4"/>
<text x="594" y="132"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#8090A4" letter-spacing=".1em">RUST CRATES</text>
<!-- ontoref-ontology -->
<rect x="600" y="148" width="264" height="38" rx="4"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1"/>
<text x="732" y="164"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">ontoref-ontology</text>
<text x="732" y="178"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">.ontology/*.ncl → typed Rust structs</text>
<!-- ontoref-reflection -->
<rect x="600" y="198" width="264" height="38" rx="4"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1"/>
<text x="732" y="214"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">ontoref-reflection</text>
<text x="732" y="228"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">load + validate + execute NCL DAG modes</text>
<!-- ontoref-daemon (optional) -->
<rect x="600" y="248" width="264" height="44" rx="4"
fill="#0E1825" stroke="#2A5080" stroke-width="1" stroke-dasharray="5,3"/>
<text x="732" y="266"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#3A6A9A" text-anchor="middle">ontoref-daemon</text>
<text x="732" y="280"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#2A4A6A" text-anchor="middle">NCL cache · file watcher · actor registry · HTTP</text>
<text x="862" y="249"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#2A5080" text-anchor="end">optional</text>
<!-- modules → daemon (HTTP, optional) -->
<line x1="546" y1="258" x2="600" y2="265"
stroke="#2A5080" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#arr-o)"/>
<text x="553" y="251"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#2A4060">HTTP</text>
<!-- ─────────────────────────────────────────
INTER-ROW ARROWS
───────────────────────────────────────── -->
<!-- Modules → Protocol (nickel export) -->
<line x1="190" y1="292" x2="148" y2="338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="123" y="321"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#3A5070" text-anchor="middle">nickel</text>
<text x="123" y="332"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#3A5070" text-anchor="middle">export</text>
<!-- ontoref-reflection → Protocol (executes modes) -->
<path d="M650 308 C642 326 430 330 368 338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<!-- ontoref-ontology → Self-description (reads .ontology/) -->
<line x1="732" y1="308" x2="695" y2="338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="748" y="326"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#3A5070">reads</text>
<!-- ─────────────────────────────────────────
PROTOCOL LAYER
───────────────────────────────────────── -->
<rect x="20" y="342" width="420" height="170" rx="6"
fill="#111827" stroke="#E8A838" stroke-width="1.5" stroke-opacity=".45"/>
<text x="30" y="358"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#E8A838" letter-spacing=".1em">PROTOCOL LAYER</text>
<text x="230" y="381"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">ontology/schemas/</text>
<text x="230" y="396"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">core · gate · state · manifest (NCL defaults)</text>
<line x1="36" y1="408" x2="424" y2="408" stroke="#1E2A3A" stroke-width="1"/>
<text x="230" y="425"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">adrs/</text>
<text x="230" y="440"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">schema · constraints · lifecycle forms</text>
<line x1="36" y1="452" x2="424" y2="452" stroke="#1E2A3A" stroke-width="1"/>
<text x="230" y="469"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">reflection/schemas/ · modes/ · forms/</text>
<text x="230" y="484"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">9 schemas · 10 NCL DAG modes · 7 forms</text>
<!-- ─────────────────────────────────────────
SELF-DESCRIPTION LAYER
───────────────────────────────────────── -->
<rect x="456" y="342" width="424" height="170" rx="6"
fill="#111827" stroke="#8090A4" stroke-width="1.5" stroke-opacity=".35" stroke-dasharray="8,4"/>
<text x="466" y="358"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#8090A4" letter-spacing=".1em">SELF-DESCRIPTION · .ontology/</text>
<text x="668" y="381"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">ontoref consuming its own protocol</text>
<line x1="472" y1="393" x2="872" y2="393" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="413"
font-family="'IBM Plex Mono',monospace" font-size="11"
fill="#8090A4" text-anchor="middle">core.ncl · state.ncl · gate.ncl · manifest.ncl</text>
<line x1="472" y1="426" x2="872" y2="426" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="446"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">4 axioms · 2 tensions · 9 practices · 19 edges</text>
<text x="668" y="462"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">3 state dimensions: protocol-maturity · self-description · ecosystem</text>
<line x1="472" y1="474" x2="872" y2="474" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="493"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#2A4A6A" text-anchor="middle">ADR-001: self-describing axiom in practice</text>
<!-- ─────────────────────────────────────────
LEGEND
───────────────────────────────────────── -->
<line x1="30" y1="532" x2="52" y2="532"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<text x="57" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">active flow</text>
<line x1="145" y1="532" x2="167" y2="532"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="172" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">reads / executes</text>
<line x1="290" y1="532" x2="312" y2="532"
stroke="#2A5080" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#arr-o)"/>
<text x="317" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">optional</text>
<rect x="393" y="525" width="12" height="12" rx="2"
fill="none" stroke="#8090A4" stroke-opacity=".5" stroke-width="1" stroke-dasharray="4,2"/>
<text x="410" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">self-description</text>
<text x="878" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#1E2A3A" text-anchor="end">ontoref architecture</text>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

253
assets/architecture_0.svg Normal file
View File

@ -0,0 +1,253 @@
<svg viewBox="0 0 900 560" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arr-a" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#E8A838"/>
</marker>
<marker id="arr-s" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#5A6A7C"/>
</marker>
<marker id="arr-o" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<path d="M0 .5 L7 3 L0 5.5Z" fill="#2A5080"/>
</marker>
</defs>
<!-- background -->
<rect width="900" height="560" fill="#0D1117"/>
<!-- ─────────────────────────────────────────
CONSUMER
───────────────────────────────────────── -->
<rect x="20" y="20" width="860" height="62" rx="6"
fill="#0F1623" stroke="#2A3A50" stroke-width="1.5" stroke-dasharray="6,4"/>
<text x="44" y="43"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#3A5070" letter-spacing=".1em">CONSUMER PROJECT</text>
<text x="44" y="63"
font-family="'IBM Plex Mono',monospace" font-size="12" fill="#8090A4">ontoref</text>
<text x="190" y="63"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#3A5070"> · .ontoref/config.ncl · ONTOREF_PROJECT_ROOT</text>
<!-- Consumer → Tooling -->
<line x1="280" y1="82" x2="280" y2="112"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<text x="292" y="101"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#B87000">exec · ONTOREF_PROJECT_ROOT</text>
<!-- ─────────────────────────────────────────
TOOLING LAYER
───────────────────────────────────────── -->
<rect x="20" y="116" width="548" height="192" rx="6"
fill="#111827" stroke="#E8A838" stroke-width="1.5" stroke-opacity=".6"/>
<text x="30" y="132"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#E8A838" letter-spacing=".1em">TOOLING LAYER</text>
<!-- ./ontoref -->
<rect x="40" y="148" width="138" height="46" rx="5"
fill="#1C2535" stroke="#E8A838" stroke-width="1" stroke-opacity=".5"/>
<text x="109" y="167"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="600"
fill="#E8A838" text-anchor="middle">./ontoref</text>
<text x="109" y="183"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">bash · actor detection</text>
<!-- ./ontoref → ontoref.nu -->
<line x1="178" y1="171" x2="208" y2="171"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<!-- ontoref.nu -->
<rect x="208" y="148" width="174" height="46" rx="5"
fill="#1C2535" stroke="#E8A838" stroke-width="1" stroke-opacity=".5"/>
<text x="295" y="167"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="600"
fill="#E8A838" text-anchor="middle">ontoref.nu</text>
<text x="295" y="183"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">Nushell dispatcher</text>
<!-- ontoref.nu → modules -->
<line x1="295" y1="194" x2="295" y2="220"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<!-- 16 Nushell modules -->
<rect x="40" y="220" width="506" height="72" rx="5"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1" stroke-opacity=".5"/>
<text x="293" y="240"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">reflection/modules/ · 16 Nushell modules</text>
<text x="293" y="257"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">adr · backlog · coder · describe · sync · store · services · nats · …</text>
<text x="293" y="274"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#1E3A58" text-anchor="middle">subprocess fallback: direct nickel export when daemon unavailable</text>
<!-- ─────────────────────────────────────────
RUST CRATES
───────────────────────────────────────── -->
<rect x="584" y="116" width="296" height="192" rx="6"
fill="#111827" stroke="#8090A4" stroke-width="1.5" stroke-opacity=".4"/>
<text x="594" y="132"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#8090A4" letter-spacing=".1em">RUST CRATES</text>
<!-- ontoref-ontology -->
<rect x="600" y="148" width="264" height="38" rx="4"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1"/>
<text x="732" y="164"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">ontoref-ontology</text>
<text x="732" y="178"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">.ontology/*.ncl → typed Rust structs</text>
<!-- ontoref-reflection -->
<rect x="600" y="198" width="264" height="38" rx="4"
fill="#1C2535" stroke="#5A6A7C" stroke-width="1"/>
<text x="732" y="214"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#C0CCD8" text-anchor="middle">ontoref-reflection</text>
<text x="732" y="228"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#5A6A7C" text-anchor="middle">load + validate + execute NCL DAG modes</text>
<!-- ontoref-daemon (optional) -->
<rect x="600" y="248" width="264" height="44" rx="4"
fill="#0E1825" stroke="#2A5080" stroke-width="1" stroke-dasharray="5,3"/>
<text x="732" y="266"
font-family="'IBM Plex Mono',monospace" font-size="11" font-weight="500"
fill="#3A6A9A" text-anchor="middle">ontoref-daemon</text>
<text x="732" y="280"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#2A4A6A" text-anchor="middle">NCL cache · file watcher · actor registry · HTTP</text>
<text x="862" y="249"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#2A5080" text-anchor="end">optional</text>
<!-- modules → daemon (HTTP, optional) -->
<line x1="546" y1="258" x2="600" y2="265"
stroke="#2A5080" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#arr-o)"/>
<text x="553" y="251"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#2A4060">HTTP</text>
<!-- ─────────────────────────────────────────
INTER-ROW ARROWS
───────────────────────────────────────── -->
<!-- Modules → Protocol (nickel export) -->
<line x1="190" y1="292" x2="148" y2="338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="123" y="321"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#3A5070" text-anchor="middle">nickel</text>
<text x="123" y="332"
font-family="'IBM Plex Mono',monospace" font-size="9"
fill="#3A5070" text-anchor="middle">export</text>
<!-- ontoref-reflection → Protocol (executes modes) -->
<path d="M650 308 C642 326 430 330 368 338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<!-- ontoref-ontology → Self-description (reads .ontology/) -->
<line x1="732" y1="308" x2="695" y2="338"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="748" y="326"
font-family="'IBM Plex Mono',monospace" font-size="9" fill="#3A5070">reads</text>
<!-- ─────────────────────────────────────────
PROTOCOL LAYER
───────────────────────────────────────── -->
<rect x="20" y="342" width="420" height="170" rx="6"
fill="#111827" stroke="#E8A838" stroke-width="1.5" stroke-opacity=".45"/>
<text x="30" y="358"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#E8A838" letter-spacing=".1em">PROTOCOL LAYER</text>
<text x="230" y="381"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">ontology/schemas/</text>
<text x="230" y="396"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">core · gate · state · manifest (NCL defaults)</text>
<line x1="36" y1="408" x2="424" y2="408" stroke="#1E2A3A" stroke-width="1"/>
<text x="230" y="425"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">adrs/</text>
<text x="230" y="440"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">schema · constraints · lifecycle forms</text>
<line x1="36" y1="452" x2="424" y2="452" stroke="#1E2A3A" stroke-width="1"/>
<text x="230" y="469"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">reflection/schemas/ · modes/ · forms/</text>
<text x="230" y="484"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">9 schemas · 10 NCL DAG modes · 7 forms</text>
<!-- ─────────────────────────────────────────
SELF-DESCRIPTION LAYER
───────────────────────────────────────── -->
<rect x="456" y="342" width="424" height="170" rx="6"
fill="#111827" stroke="#8090A4" stroke-width="1.5" stroke-opacity=".35" stroke-dasharray="8,4"/>
<text x="466" y="358"
font-family="'IBM Plex Mono',monospace" font-size="10" font-weight="600"
fill="#8090A4" letter-spacing=".1em">SELF-DESCRIPTION · .ontology/</text>
<text x="668" y="381"
font-family="'IBM Plex Mono',monospace" font-size="12"
fill="#A8B4C8" text-anchor="middle">ontoref consuming its own protocol</text>
<line x1="472" y1="393" x2="872" y2="393" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="413"
font-family="'IBM Plex Mono',monospace" font-size="11"
fill="#8090A4" text-anchor="middle">core.ncl · state.ncl · gate.ncl · manifest.ncl</text>
<line x1="472" y1="426" x2="872" y2="426" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="446"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">4 axioms · 2 tensions · 9 practices · 19 edges</text>
<text x="668" y="462"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#5A6A7C" text-anchor="middle">3 state dimensions: protocol-maturity · self-description · ecosystem</text>
<line x1="472" y1="474" x2="872" y2="474" stroke="#1E2A3A" stroke-width="1"/>
<text x="668" y="493"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#2A4A6A" text-anchor="middle">ADR-001: self-describing axiom in practice</text>
<!-- ─────────────────────────────────────────
LEGEND
───────────────────────────────────────── -->
<line x1="30" y1="532" x2="52" y2="532"
stroke="#E8A838" stroke-width="1.5" marker-end="url(#arr-a)"/>
<text x="57" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">active flow</text>
<line x1="145" y1="532" x2="167" y2="532"
stroke="#5A6A7C" stroke-width="1.2" marker-end="url(#arr-s)"/>
<text x="172" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">reads / executes</text>
<line x1="290" y1="532" x2="312" y2="532"
stroke="#2A5080" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#arr-o)"/>
<text x="317" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">optional</text>
<rect x="393" y="525" width="12" height="12" rx="2"
fill="none" stroke="#8090A4" stroke-opacity=".5" stroke-width="1" stroke-dasharray="4,2"/>
<text x="410" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10" fill="#5A6A7C">self-description</text>
<text x="878" y="537"
font-family="'IBM Plex Mono',monospace" font-size="10"
fill="#1E2A3A" text-anchor="end">ontoref architecture</text>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,64 @@
# .ontology/core.ncl — Project: {{ project_name }}
# Fill in nodes that capture what is invariant and what is in tension.
#
# To use typed construction helpers, add ontology/defaults/ from the ontoref
# checkout and: let d = import "ontology/defaults/core.ncl" in
#
# Fields (node):
# id — unique kebab-case identifier
# name — human-readable label
# pole — 'Yang (active force) | 'Yin (receptive force) | 'Tension
# level — 'Axiom | 'Practice | 'Tension | 'Spiral
# description — what this node means for this project
# invariant — true if this is non-negotiable (requires ADR to change)
# artifact_paths — list of file paths that implement this node (optional)
#
# Fields (edge):
# from, to — node IDs
# kind — 'Implements | 'Resolves | 'Complements | 'Contradicts |
# 'DependsOn | 'ValidatedBy | 'ManifestsIn
# weight — 'High | 'Medium | 'Low
# note — why this edge exists (optional)
{
nodes = [
# ── Axioms (invariant = true) ─────────────────────────────────────────────
{
id = "{{ project_name }}-primary-constraint",
name = "Primary Constraint",
pole = 'Yang,
level = 'Axiom,
description = "Replace with the non-negotiable constraint that defines what this project IS.",
invariant = true,
},
# ── Tensions ──────────────────────────────────────────────────────────────
{
id = "{{ project_name }}-first-tension",
name = "First Tension",
pole = 'Tension,
level = 'Tension,
description = "Describe the core structural tension this project must navigate.",
invariant = false,
},
# ── Practices — add confirmed patterns and active systems here ────────────
],
edges = [
# Example:
# {
# from = "{{ project_name }}-primary-constraint",
# to = "{{ project_name }}-first-tension",
# kind = 'Resolves,
# weight = 'High,
# note = "Why this edge exists.",
# },
],
}

View File

@ -0,0 +1,44 @@
# .ontology/gate.ncl — Project: {{ project_name }}
# Membranes are gates that control when a project is ready to cross a boundary.
# Start with active = false. Activate only when the condition is real and enforced.
#
# To use typed construction helpers, add ontology/defaults/ from the ontoref
# checkout and: let d = import "ontology/defaults/gate.ncl" in
#
# Fields (membrane):
# id — unique kebab-case identifier
# name — human-readable label
# description — what this gate protects
# permeability — 'High | 'Medium | 'Low | 'Closed
# accepts — list of signal types: 'EcosystemRelevance | 'Adoption | 'Stability
# protects — list of strings: what this gate guards
# opening_condition — record: { max_tension_dimensions, pending_transitions, core_stable, description }
# closing_condition — string: what causes the gate to close again
# max_duration — 'Weeks | 'Months | 'Years | 'Indefinite
# protocol — 'Observe | 'Absorb | 'Challenge | 'Reject
# active — bool (false = defined but not enforced)
{
membranes = [
{
id = "{{ project_name }}-readiness-gate",
name = "{{ project_name }} Readiness Gate",
description = "Controls when {{ project_name }} is ready for external use.",
permeability = 'Low,
accepts = ['EcosystemRelevance],
protects = ["Replace with: what this gate protects"],
opening_condition = {
max_tension_dimensions = 2,
pending_transitions = 3,
core_stable = true,
description = "Replace with: measurable condition to open this gate.",
},
closing_condition = "Replace with: what causes the gate to close again.",
max_duration = 'Indefinite,
protocol = 'Observe,
active = false,
},
],
}

View File

@ -0,0 +1,52 @@
# .ontology/state.ncl — Project: {{ project_name }}
# State dimensions track WHERE the project IS vs WHERE it WANTS to BE.
#
# To use typed construction helpers, add ontology/defaults/ from the ontoref
# checkout and: let d = import "ontology/defaults/state.ncl" in
#
# Fields (dimension):
# id — unique kebab-case identifier
# name — human-readable label
# description — what this dimension measures
# current_state — string ID of where the project is now
# desired_state — string ID of where it should be
# horizon — 'Weeks | 'Months | 'Years | 'Continuous
# states — [] (or list of named states)
# transitions — list of transition records
#
# Fields (transition):
# from — source state ID
# to — target state ID
# condition — measurable condition for the transition
# catalyst — what would trigger it
# blocker — what currently prevents it
# horizon — 'Weeks | 'Months | 'Years
{
dimensions = [
{
id = "{{ project_name }}-maturity",
name = "{{ project_name }} Maturity",
description = "Overall maturity of {{ project_name }} — from initial scaffold to stable production use.",
current_state = "bootstrapped",
desired_state = "stable",
horizon = 'Months,
states = [],
transitions = [
{
from = "bootstrapped",
to = "stable",
condition = "Replace with measurable condition.",
catalyst = "What would trigger this transition?",
blocker = "What is currently blocking it?",
horizon = 'Months,
},
],
},
# Add more dimensions as the project's state space becomes clearer.
# Useful dimensions: adoption, documentation-coverage, api-stability, test-coverage
],
}

View File

@ -0,0 +1,31 @@
# .ontoref/config.ncl — ontoref configuration for {{ project_name }}
# Place this file at <project_root>/.ontoref/config.ncl
{
nickel_import_paths = [".", ".ontology", "ontology/schemas", "adrs", "reflection/requirements", "reflection/schemas"],
log = {
level = "info",
path = ".ontoref/logs",
rotation = "daily",
compress = false,
archive = ".ontoref/logs/archive",
max_files = 7,
},
mode_run = {
rules = [
{ when = { mode_id = "validate-ontology" }, allow = true, reason = "validation always allowed" },
{ when = { actor = "agent" }, allow = true, reason = "agent actor always allowed" },
{ when = { actor = "ci" }, allow = true, reason = "ci actor always allowed" },
],
},
nats_events = {
enabled = false,
url = "nats://localhost:4222",
emit = [],
subscribe = [],
handlers_dir = "reflection/handlers",
},
}

45
templates/scripts-ontoref Normal file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# scripts/ontoref — thin wrapper for projects consuming the ontoref protocol
# Set ONTOREF_ROOT to the ontoref checkout, then delegate to its entry point.
#
# Usage: ./scripts/ontoref <command> [args...]
# Alias: Add `alias ontoref="./scripts/ontoref"` to your shell profile.
#
# Required env vars (exported here):
# ONTOREF_ROOT — absolute path to ontoref checkout
# ONTOREF_PROJECT_ROOT — absolute path to THIS project root
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
readonly PROJECT_ROOT
# ── Ontoref root ──────────────────────────────────────────────────────────────
# Point to your ontoref checkout. Can be overridden via env var.
ONTOREF_ROOT="${ONTOREF_ROOT:-{{ ontoref_dir }}}"
readonly ONTOREF_ROOT
if [[ ! -f "${ONTOREF_ROOT}/ontoref" ]]; then
echo "ontoref: cannot find ontoref entry point at ${ONTOREF_ROOT}/ontoref"
echo " Set ONTOREF_ROOT to the correct path or update this script."
exit 1
fi
# ── Export project context ────────────────────────────────────────────────────
export ONTOREF_ROOT
export ONTOREF_PROJECT_ROOT="${PROJECT_ROOT}"
# Prepend project-specific paths so they take priority over any inherited
# NICKEL_IMPORT_PATH. Existing value is preserved as a fallback at the end.
_project_paths="${PROJECT_ROOT}:${PROJECT_ROOT}/.ontology:${PROJECT_ROOT}/adrs:${ONTOREF_ROOT}/adrs:${ONTOREF_ROOT}/ontology/schemas:${ONTOREF_ROOT}"
export NICKEL_IMPORT_PATH="${_project_paths}${NICKEL_IMPORT_PATH:+:${NICKEL_IMPORT_PATH}}"
unset _project_paths
# Preserve caller name for dispatcher help output
export ONTOREF_CALLER="${ONTOREF_CALLER:-./scripts/ontoref}"
exec "${ONTOREF_ROOT}/ontoref" "$@"