# Changelog All notable changes to ontoref are documented here. ADRs referenced below live in `adrs/` as typed Nickel records. --- ## [Unreleased] ### Rust doc authoring pattern — canonical `///` convention #### `#[onto_api]` — `description` now optional - `description = "..."` parameter is no longer required when a `///` doc comment exists above the handler. The proc-macro reads the first `///` line as the fallback description. - Same fallback applied to `#[derive(OntologyNode)]` — `///` first line used when `description` attribute is absent. - `ontoref-daemon/src/api.rs`: 42 handlers migrated — `description = "..."` removed from all `#[onto_api]` blocks, canonical `///` first line added above each handler. #### `sync diff --docs --fail-on-drift` - New `--fail-on-drift` flag on `sync diff`: exits 1 when any crate `//!` has drifted from its ontology node description. Intended for pre-commit enforcement; without the flag, the command remains non-destructive and returns the table as before. #### mdBook `crates/` chapter - `generator.nu`: two helpers added — `read-crate-module-doc` (parses `//!` from `lib.rs`/`main.rs`) and `count-pub-coverage` (ratio of documented pub items). - `render-mdbook` generates `docs/src/crates/.md` per workspace member: `//!` content, pub item coverage badge, feature flags from `Cargo.toml`, and which practice nodes list the crate as primary `artifact_paths`. Missing `//!` renders a warning block. - `SUMMARY.md` gains a `# Crates` section with links to all generated pages. #### Pre-commit hooks - `.pre-commit-config.yaml`: `docs-links` hook runs rustdoc broken-link check (`RUSTDOCFLAGS` with `-D rustdoc::broken-intra-doc-links`) on `.rs` changes. - `.pre-commit-config.yaml`: `docs-drift` hook runs `sync diff --docs --fail-on-drift` on `.rs` changes. #### Agent and developer directives - `.claude/CLAUDE.md`: `### Documentation Authoring (Rust)` section added — three-layer table, four authoring rules, agent discovery commands (`describe workspace`, `describe features`, `sync diff --docs`), crate registration procedure. #### Migration - `0012-rust-doc-authoring-pattern`: consumer projects receive the `### Documentation Authoring (Rust)` section for their `CLAUDE.md` and optional pre-commit hooks (`docs-links`, `docs-drift`). --- ### Mode guards, convergence loops, and manifest coverage enforcement #### Mode schema extension (ADR-011) - **Guard type** added to `reflection/schema.ncl`: pre-flight executable checks with `Block` (abort) or `Warn` (continue) severity. Guards run before any step — the protocol pushes back on invalid state instead of failing silently mid-execution. - **Converge type** added to `reflection/schema.ncl`: post-execution convergence loop with `condition` command, `max_iterations` cap, and `RetryFailed`/`RetryAll` strategy. Modes iterate until a condition is met rather than running once blindly. - Both types exposed in `reflection/defaults.ncl` as `Guard` and `Converge`. - Reference implementation: `sync-ontology.ncl` gains 3 guards (ontology-exists, nickel-available, manifest-capabilities) and converge (iterate until zero drift, max 2 iterations). - `coder-workflow.ncl` gains guard (coder-dir-exists) and new `novelty-check` step (anti-slop Jaccard overlap detection between pending entries and published+QA). - Nushell executor (`reflection/nulib/modes.nu`): guard execution before steps, convergence loop after steps. - Rust types: `Guard`, `GuardSeverity`, `Converge`, `ConvergeStrategy` in `ontoref-reflection/src/mode.rs`. - Rust executor: guards evaluated pre-execution (Block returns error, Warn logs), convergence loop post-execution. - Backward compatible: `guards` defaults to `[]`, `converge` is optional. All 19 existing modes export unchanged. #### Manifest capability completeness (19 capabilities) - `.ontology/manifest.ncl` expanded from 3 to 19 declared capabilities covering the full action surface: protocol spec, daemon API, reflection modes, run/step tracking, Agent Task Composer, backlog graduation, notifications, coder process memory, QA store, form system, template generation, describe query layer, drift detection, quick actions, protocol migration, config surface, search bookmarks, project onboarding, web presence. - `audit-manifest-coverage` function in `reflection/modules/sync.nu`: cross-references Practice nodes, reflection modes, and daemon UI pages against declared capabilities. - `sync manifest-check` exported command for pre-commit hooks and CI. - `validate-project.ncl` gains 6th validation category: `manifest-cov`. - Pre-commit hook `manifest-coverage`: fires on `.ontology/`, `reflection/modes/`, `reflection/forms/` changes. - SessionStart hook (`session-context.sh`): shows manifest coverage status at session start. - Agent consumption mode description updated in manifest. #### Bug fixes - `find-unclaimed-artifacts` in `sync.nu`: fixed absolute vs relative path comparison for modes and forms. `path relative-to $root` applied before `starts-with` check. 19 phantom MISSING items resolved. - `audit-claude` session-hook check: accepts both `.claude/hooks/session-context.sh` and legacy `.claude/ontoref-session-start.sh`. - `describe mode` now shows guards and converge sections. - `scan-reflection-mode-dags` JSON output for agents now includes guards, converge, preconditions, postconditions, and step-level cmd/on_error/verify. #### Infrastructure - Justfile restructured: `justfiles/build.just`, `justfiles/test.just`, `justfiles/dev.just` added. CI recipes delegated to canonical modules. Manifest justfile convention updated to `Import` system with 5 modules. - Manifest `claude` baseline declared: `["rust", "nushell", "nickel"]` guidelines, session_hook enabled. - `.ontology/core.ncl`: `ci-pipelines` Practice node added. `reflection/forms/` added to `reflection-modes` artifact_paths. #### Migrations - `0010-manifest-capability-completeness`: consumer projects must declare ≥3 capabilities. - `0011-manifest-coverage-hooks`: consumer projects must add pre-commit and SessionStart hooks for manifest coverage. #### on+re update | Artifact | Change | |----------|--------| | `.ontology/manifest.ncl` | 3 → 19 capabilities; justfile/claude baselines declared; agent consumption mode updated | | `.ontology/core.ncl` | `ci-pipelines` node; `reflection/forms/` in reflection-modes; adr-011 in adr-lifecycle | | `.ontology/state.ncl` | protocol-maturity catalyst updated (ADR-011, 19 caps, migrations 0010-0012); self-description-coverage catalyst updated (session 2026-03-30) | | `adrs/adr-011-mode-guards-and-convergence.ncl` | New ADR: guards and converge extend mode schema rather than separate action subsystem | | Health | 43.2% → 100.0% (31 OK / 0 MISSING / 0 STALE) | --- ### Browser-style panel navigation + repo file routing Graph, search, and api_catalog pages now share a uniform browser-style navigation model: back/forward history stack with cursor-into-array semantics. File artifact paths open in external browser tabs rather than being loaded inline. #### `crates/ontoref-daemon/templates/pages/graph.html` - `.artifact-link` click handler changed from removed `openFile()` to `srcOpen()`. - `panelNav._replay` `type: "file"` case changed to `srcOpen(e.id)`. #### `crates/ontoref-daemon/templates/pages/search.html` - `openFileInPanel` async function removed entirely (was loading file content inline via `/api/file`). - `srcOpen(path)` function added: opens `{card_repo}/src/branch/main/{path}` for most files; opens `card_docs` for `.rs` files when configured. - `CARD_REPO` / `CARD_DOCS` JS constants injected via Tera (`| safe` filter required — Tera auto-escapes all `{{ }}` interpolations regardless of `