{ id = "0017", slug = "level-hierarchy-strategy", description = "Declare level identity in manifest.ncl and strategy field in reflection modes (ADR-018). Required at Domain (level 2) and Instance (level 3) to enable observable traversal via ore mode resolve.", check = { tag = "Grep", paths = [".ontology/manifest.ncl"], pattern = "level\\s*=\\s*\\{", }, instructions = " ## Level hierarchy and mode resolution strategy (migration 0017) Implements ADR-018: three-level hierarchy with per-mode resolution strategy. This makes domain boundaries explicit and mode traversal observable. ### Step 1 — Declare level identity in .ontology/manifest.ncl Inside the manifest record, add a `level` field. The value depends on what this project IS in the hierarchy: # Level 2 — project domain (e.g. provisioning, personal): level = { index = 'Domain, name = \"\", # e.g. \"provisioning-domain\" parent = \"ontoref-base\", }, # Level 3 — domain instance (e.g. a concrete workspace or infra project): level = { index = 'Instance, name = \"\", # e.g. \"myorg-provisioning\" parent = \"provisioning-domain\", # matches the domain's level.name }, ontoref itself declares no level field — 'Base is the implicit default. ### Step 2 — Add strategy to reflection modes in reflection/modes/*.ncl Each mode at level 2+ must declare how it relates to the parent level's mode. # Mode is fully implemented here — traversal stops: strategy = 'Override, # Mode is not implemented here — traverse to parent for execution: strategy = 'Delegate, # Mode accumulates contributions from all levels (lower level wins conflicts): strategy = 'Merge, # Mode inherits specific steps from the parent, overrides the rest: strategy = 'Compose, extends = [\"step-id-from-parent\", \"other-step-id\"], Implicit absence (no strategy field at level 2+) is treated as 'Delegate with a Soft validation warning from ore validate modes --check strategy-declared. ### Step 3 — Verify (once ore validate modes is available) ore validate modes --check level-declared ore validate modes --check strategy-declared ore validate modes --check delegate-chain ### Step 4 — For strategy transitions: bind to state.ncl When a mode's strategy is expected to change as the project matures, declare a dimension in state.ncl. Example — a mode currently delegating that will eventually override: { id = \"build-docs-strategy\", description = \"build-docs mode resolution strategy: Delegate → Override\", current_state = \"Delegate\", desired_state = \"Override\", catalyst = \"implement project-specific doc generation\", blocker = \"doc generation not yet implemented for this domain\", }, When the implementation is complete: update current_state = \"Override\" in state.ncl AND update strategy = 'Override in the mode NCL. This makes the transition an observable FSM event (tracked in git, visible via ore describe state). ", }