{
  id          = "0002",
  slug        = "adr-typed-checks",
  description = "Migrate deprecated check_hint fields in ADRs to typed check variants",
  check       = {
    tag         = "NuCmd",
    cmd         = "let adrs = (glob $\"($env.ONTOREF_PROJECT_ROOT)/adrs/adr-[0-9][0-9][0-9]-*.ncl\"); if ($adrs | is-empty) { exit 0 }; let r = (do { ^rg -l check_hint ...$adrs } | complete); if $r.exit_code == 0 { exit 1 } else { exit 0 }",
    expect_exit = 0,
  },
  instructions = "
1. Find ADRs with deprecated check_hint:
   grep -rl 'check_hint' adrs/

2. For each file found, replace check_hint with a typed check variant:

   'NuCmd    — shell command:    { tag = 'NuCmd,      cmd = \"...\",      expect_exit = 0 }
   'Grep     — pattern search:  { tag = 'Grep,       pattern = \"...\", paths = [\"...\"], must_be_empty = true }
   'Cargo    — dep check:       { tag = 'Cargo,      crate = \"...\",   forbidden_deps = [\"...\"] }
   'FileExists — file presence: { tag = 'FileExists, path = \"...\",    present = true }
   'ApiCall  — HTTP check:      { tag = 'ApiCall,    endpoint = \"...\", json_path = \"...\", expected = \"...\" }

3. Validate each edited ADR:
   nickel export --import-path \"$NICKEL_IMPORT_PATH\" adrs/adr-NNN-*.ncl > /dev/null

4. Run all ADR constraints:
   ontoref adr validate
",
}
