let pole_type  = [| 'Yang, 'Yin, 'Spiral |] in
let level_type = [| 'Axiom, 'Tension, 'Practice, 'Project, 'Moment |] in
let axis_type  = [| 'Substance, 'Act, 'Seam, 'Unspecified |] in

# Edge kinds — reconciled to the vocabulary actually used in core.ncl (G-2,
# 2026-07-09). The prior enum listed four kinds never used (ValidatedBy, FlowsTo,
# CyclesIn, LimitedBy) and omitted four in active use (Contradicts, DependsOn,
# Implies, Resolves); the edge records were bare (uncontracted) so the divergence
# stayed dormant. This enum is now the single source of the edge vocabulary,
# mirrored by Rust EdgeType and by defaults/edge-inverses.ncl.
let edge_type  = [|
  'Complements,
  'Contains,
  'Contradicts,
  'DependsOn,
  'Implies,
  'ManifestsIn,
  'Resolves,
  'SpiralsWith,
  'TensionWith,
|] in

# Edge weight is a qualitative salience, not a metric — the data has always used
# symbolic values ('High/'Medium/'Low); the schema (and Rust) previously typed it
# as Number, a dormant lie now corrected (G-2).
let weight_type = [| 'High, 'Medium, 'Low |] in

# Warrant — the evidence on whose authority a node exists (Z39.19 warrant, typed).
# Additive with a default so every existing node validates unchanged
# (formalization-vs-adoption); it is an AUDIT surface (see `validate ontology`),
# never a required field — a required warrant would be ceremony-capture (adr-029).
# The evidence itself lives in reflection (emergence.log, interviews); the node
# CITES it, it does not duplicate it (ontology-vs-reflection).
let warrant_kind = [| 'Adr, 'Emergence, 'Interview, 'Session, 'External |] in
let warrant_ref  = {
  kind | warrant_kind,
  ref  | String,
  note | String | default = "",
} in

{
  Pole             = pole_type,
  AbstractionLevel = level_type,
  Axis             = axis_type,
  EdgeType         = edge_type,
  Weight           = weight_type,
  WarrantKind      = warrant_kind,
  WarrantRef       = warrant_ref,

  Node = {
    id              | String,
    name            | String,
    pole            | pole_type,
    level           | level_type,
    description     | String,
    invariant       | Bool         | default = false,
    artifact_paths  | Array String | default = [],
    adrs            | Array String | default = [],
    axis            | axis_type    | default = 'Unspecified,
    warrant         | Array warrant_ref | default = [],
  },

  Edge = {
    from   | String,
    to     | String,
    kind   | edge_type,
    weight | weight_type | default = 'Medium,
    note   | String | default = "",
  },

  CoreConfig = {
    nodes | Array { id | String, name | String, pole | pole_type, level | level_type, description | String, invariant | Bool, artifact_paths | Array String, adrs | Array String, axis | axis_type, warrant | Array warrant_ref },
    edges | Array { from | String, to | String, kind | edge_type, weight | weight_type, note | String },
  },
}
