To Do
=====
tomtit cert 70
+_ species (ie no calltype)
Tui/Bellbird
silvereye/pipipi
rifleman/tomtit+contact/Tieke


Go through birdnet categories sample and try to work out what they are


Look at kiwi dataset

New Dataset

test database line update with index+fk v fk only

Read audio tool (pointless atm as most models can't use it)

Bounding Box script.py

to one hot encoded csv for opensoundscape (because python is so slow, and I would have to convert to raven selection.txt first)

day  -> civil sunrise to !!civil sunset!!
claude --resume "reject-reserved-key-bindings"

multi label in tui. How?? also cli

Clip from wav when no .data file—skraak save image????

find morepork mewing sound for dataset

segment unstructured import into batches of 10000 files to keep within buffer limits, structured imports should be fine as we are talking 1 sd card (24/7 its 16000 max)

ingest my training datasets 

buy a drive to backup mac ~

Update tools could allow setting active to false?? Currently do not

Make freebird to .data tool

npm install -g @mariozechner/pi-coding-agent


SKILLS
======

project/.claude/skills for most then link to project/.agents/skills for pi with:
find .claude/skills -type f -exec bash -c 'mkdir -p "$(dirname ".pi/skills/${1#.claude/skills/}")" && ln -s "$PWD/$1" "$PWD/.pi/skills/${1#.claude/skills/}"' _ {} \;

pi-specific are in ~ somewhere (ok because keeps them seperate) if installed with eg: $pi install npm:@tmustier/pi-ralph-wiggum

call-library: currently have a hard copy in .claude symlinked to .pi 


Labels in opensoundscape multi-species model
=====================
ausbit1       Australasian Bittern
bluduc1       Blue Duck                                                              
comcha        Common Chaffinch
comred        Redpoll (Common)
dunnoc1       Dunnock
eurbla        Eurasian Blackbird
eursta        European Starling
fernbi1       New Zealand Fernbird
grskiw1       Great Spotted Kiwi/Roroa
gryger1       Gray Gerygone/Grey Warbler
kea1          Kea
liskiw1       Little Spotted Kiwi/Kiwi pukupuku                                                    
lotkoe1       Long-tailed Koel/Cuckoo                                                       
morepo2       Morepork
nezbel1       New Zealand Bellbird
nezfan1       New Zealand Fantail/Piwakawaka
nezkak1       New Zealand Kaka
nezpig2       New Zealand Pigeon/Kereru                                                    
nezrob3       South Island Robin/Kakaruai
nibkiw1       North Island Brown Kiwi/Kiwi-nui
okbkiw1       Okarito Brown Kiwi/Rowi
parake        parakeet sp./Kakariki                                                          
pipipi1       Pipipi/Brown Creeper
riflem1       Rifleman
saddle3       South Island Saddleback?Tieke
shbcuc1       Shining Bronze-Cuckoo
silver3       Silvereye
sobkiw2       Southern Brown Kiwi (South I.)/Tokoeka
soioys1       South Island Oystercatcher
soiwre1       South Island Wren
sonthr1       Song Thrush
spocra2       Spotless Crake
tomtit1       Tomtit/Miromiro
tui1          Tui
varoys1       Variable Oystercatcher                                                 
weka1         Weka
yellow2       Yellowhammer
weta          Weta (not bird)
cangoo1       Canada Goose


# Active DB Labels      ebird_code
------------------      ----------
Australasian Bittern    ausbit1         x
Bellbird                nezbel1         x
Chaffinch               comcha          x
Crake_Spotless          spocra2         x
Cuckoo_Shining          shbcuc1         x
Duck_Blue_Whio          bluduc1         x
Dunnock_Hedge_Sparrow   dunnoc1         x
Eurasian Blackbird      eurbla          x
European Starling       eursta          x
Fantail                 nezfan1         x
Fernbird                fernbi1         x
Haast Tokoeka           sobkiw2         x
Kaka                    nezkak1         x
Kea                     kea1            x
Kereru                  nezpig2         x
Kiwi pukupuku           liskiw1         x
Kiwi_Nth_Is_Brown       nibkiw1         x
Long-tailed Koel        lotkoe1         x
Morepork                morepo2         x
Oystercatcher_Variable  varoys1         x
Parakeet                parake          x
Pipipi                  pipipi1         x Brown Creeper
Redpoll                 comred          x
Rifleman                riflem1         x
Robin_Sth_Is            nezrob3         x
Roroa                   grskiw1         x
Rowi                    okbkiw1         x
S. Fiordland Tokoeka    sobkiw1         x
Saddleback_Sth_Is       saddle3         x
Silvereye               silver3         x
South Island Oystercatcher    soioys1   x
South Island Wren       soiwre1         X
Thrush_Song             sonthr1         x
Tomtit                  tomtit1         x
Tui                     tui1            x
Warbler_Grey            gryger1         x
Weka_spp                weka1           x
Yellowhammer            yellow2         x
Check
Don't Know
Fake Kiwi
Korero Gecko                            x
Question
Weta                                    x
Noise

Keybindings 
===========
see ~/.skraak/config.json

TUI cmd
=======
skraak calls classify --folder . --filter opensoundscape-multi-1.0 --species comcha

David's Kiwi Workflow
=====================

- cp data to main drives
- backup audio
- skraak import bulk to get files into db
- Run opensoundscape models on audio
- skraak calls from-preds to make .data files
- Run julia DFMN model (also LSK model for Inge)
- skraak calls classify TUI for kiwi on 1 model
- use minimax to check "Don't Know"
- skraak calls propogate on other models
- use minimax on cert 70 Kiwi and maybe Don't Know
- skraak calls classify on remaining cert 70 Kiwi
- skraak calls classify --sample 10 on cert 90 Kiwi
- skraak calls push-certainty on remaining cert 90 Kiwi if all good
- use minimax skill /detect-anomalies to correct problems
- skraak calls classify to resolve certainty mismatches
- skraak calls summarise
- run skill /data-mapping
- run skill /import-segments

Code stuff
==========

time ./skraak calls from-preds --csv /media/david/SSD4/Twenty_Four_Seven/R620/2024-05-06/preds9_opensoundscape-multi-1.0_2025-07-22.csv > /media/david/SSD4/Twenty_Four_Seven/R620/2024-05-06/preds9_opensoundscape-multi-1.0_2025-07-22.json

for item in a
    try
        jsonfile = replace(item, ".csv" => ".json")
        run(pipeline(`skraak calls from-preds --csv $item --gap-multiplier 3 --min-detections 1`, jsonfile))
    catch e
        @error "skraak failed on $item" exception=(e, catch_backtrace())
    end
end


model = "/media/david/SSD2/Secondary_Models/DFMN_Inge/model_DFMN1-5_CPU_epoch-9-0.9737-2024-10-25.jld2"
labels = Dict(1 => "Duet", 2 => "Female", 3 => "Male", 4 => "Don't Know")
## Check this logic in the code
predict(a, model, labels)

model = "/media/david/SSD2/Secondary_Models/LSK/model_GSK_LSK_DFM_FT_IngeDFMN_1-5_1-0_CPU_epoch-9-0.9745-2025-01-13.jld2"
labels = Dict(1 => "GSK", 2 => "GSK", 3 => "GSK", 4 => "LSK", 5 => "LSK", 6 => "LSK")
## Needed to change the logic
predict(a, model, labels)

model = "/media/david/SSD2/Secondary_Models/DFMN_Pomona/model_DFMN1-5_Pomona3_CPU_epoch-18-0.9785-2025-03-02.jld2"
labels = Dict(1 => "Duet", 2 => "Female", 3 => "Gecko", 4 => "Male", 5 => "Don't Know")
## Check this logic in the code
predict(a, model, labels)


## Change the date
for item in x
    try
        jsonfile = "$item/segment_summary_2026-05-07.json"
        run(pipeline(`skraak calls summarise --folder $item`, jsonfile))
    catch e
        @error "skraak failed on $item" exception=(e, catch_backtrace())
    end
end

skraak calls summarise --folder ./recordings --brief

# print brief summary to repl
for item in a
   try
       run(pipeline(`skraak calls summarise --folder $item --brief`))
   catch e
       @error "skraak failed on $item" exception=(e, catch_backtrace())
   end
end

# save brief summary to cwd
open("/home/david/summary_2026-04-17.jsonl", "w") do f
   for item in a
       try
           run(pipeline(`skraak calls summarise --folder $item`, `jq 'del(.segments)'`, f))
       catch e
           @error "skraak failed on $item" exception=(e, catch_backtrace())
       end
   end
end


OLLAMA
======
ollama run gemma4:e4b
ollama launch pi --model gemma4:e4b # don't do this, it alters pi config

ollama run qwen3.5:9b # uninstalled

ollama list

ollama rm <model-name>
ollama rm qwen3.5:9b

R620/2024-05-06 only
Run Through Gemma


        Opensoundscape    Hand Classified         BirdNET     Hand Classified
        ==============    ===============         =======     ===============
comcha         X                X                                   X
eurbla         X                X                                   X
gryger1        X                X                   none?           X       White-throated Sparrow (auto), Gray Gerygone
nezfan1        X                                                    X       NZ Fantail
tomtit1    V. Bad            garbage                                X
nezrob1                         X                                   X       SI Robin (no types)
kereru
rifleman
silvereye
bellbird 
tui
nezkak1  V. Bad(gecko, wing)                                    V Bad, ongoing bellbird
weka1    V. Bad(noise)                              none
morepo2  many Gecko                                             Also Gecko 
lotkoe1         X               X                                   X



  ┌──────┬───────────────────────────┬───────┐
  │ Rank │          Species          │ Count │
  ├──────┼───────────────────────────┼───────┤
  │ 1    │ White-throated Sparrow    │ 5163  │ Gryger
  ├──────┼───────────────────────────┼───────┤
  │ 2    │ New Zealand Bellbird      │ 3812  │
  ├──────┼───────────────────────────┼───────┤
  │ 3    │ Superb Lyrebird           │ 3645  │ nezbel1+territorial
  ├──────┼───────────────────────────┼───────┤
  │ 4    │ Common Crossbill          │ 3247  │
  ├──────┼───────────────────────────┼───────┤
  │ 5    │ Javan Shortwing           │ 2824  │
  ├──────┼───────────────────────────┼───────┤
  │ 6    │ Grey Gerygone             │ 2286  │ Gryger
  ├──────┼───────────────────────────┼───────┤
  │ 7    │ Yellow-bellied Flycatcher │ 1018  │
  ├──────┼───────────────────────────┼───────┤
  │ 8    │ Tui                       │ 1004  │
  ├──────┼───────────────────────────┼───────┤
  │ 9    │ Common Redpoll            │ 949   │
  ├──────┼───────────────────────────┼───────┤
  │ 10   │ Winter Wren               │ 932   │
  ├──────┼───────────────────────────┼───────┤
  │ 11   │ Blue-backed Manakin       │ 784   │
  ├──────┼───────────────────────────┼───────┤
  │ 12   │ Hermit Thrush             │ 762   │
  ├──────┼───────────────────────────┼───────┤
  │ 13   │ Blue Whistling-Thrush     │ 728   │
  ├──────┼───────────────────────────┼───────┤
  │ 14   │ Eastern Wood-Pewee        │ 712   │
  ├──────┼───────────────────────────┼───────┤
  │ 15   │ Common Nightingale        │ 678   │
  ├──────┼───────────────────────────┼───────┤
  │ 16   │ Red-breasted Flycatcher   │ 678   │
  ├──────┼───────────────────────────┼───────┤
  │ 17   │ New Zealand Kaka          │ 639   │
  ├──────┼───────────────────────────┼───────┤
  │ 18   │ Common Firecrest          │ 608   │
  ├──────┼───────────────────────────┼───────┤
  │ 19   │ New Zealand Fantail       │ 583   │ X
  ├──────┼───────────────────────────┼───────┤
  │ 20   │ Tomtit                    │ 570   │ X
  ├──────┼───────────────────────────┼───────┤
  │ 21   │ Eurasian Golden Oriole    │ 548   │
  ├──────┼───────────────────────────┼───────┤
  │ 22   │ Musician Wren             │ 526   │
  ├──────┼───────────────────────────┼───────┤
  │ 23   │ White-browed Warbler      │ 497   │
  ├──────┼───────────────────────────┼───────┤
  │ 24   │ Cedar Waxwing             │ 487   │
  ├──────┼───────────────────────────┼───────┤
  │ 25   │ Iberian Chiffchaff        │ 473   │
  ├──────┼───────────────────────────┼───────┤
  │ 26   │ Common Redstart           │ 461   │
  ├──────┼───────────────────────────┼───────┤
  │ 27   │ European Greenfinch       │ 454   │
  ├──────┼───────────────────────────┼───────┤
  │ 28   │ Wood Thrush               │ 432   │
  ├──────┼───────────────────────────┼───────┤
  │ 29   │ Pheasant Cuckoo           │ 427   │
  ├──────┼───────────────────────────┼───────┤
  │ 30   │ Western Wood-Pewee        │ 399   │
  └──────┴───────────────────────────┴───────┘


skraak calls summarise --folder . > call_summary.json

# mapping.json for my big kiwi dataset
{
  "Kiwi":       {"species": "Kiwi"},
  "Geese": {"species": "__NEGATIVE__"},
  "Kaka":        {"species": "__NEGATIVE__"},
  "Kea":        {"species": "__NEGATIVE__"},
  "LTC":        {"species": "__NEGATIVE__"},
  "Morepork":        {"species": "__NEGATIVE__"},
  "Not":        {"species": "__NEGATIVE__"},
  "Plover":        {"species": "__NEGATIVE__"}
}

# make csv to use for training big kiwi dataset
skraak calls clip-labels --folder . --mapping ./mapping.json \
       --clip-duration 5 --clip-overlap 0 --min-label-overlap 0.25 --final-clip full \
       --output ./clip_labels.csv



Lets manually execute this loop once, when we are happy we will design a ralph loop together to loop through remaining BirdNET classes /grill-me

# Retrieve BirdNET List from folder /media/david/SSD4/Twenty_Four_Seven/R620/2024-05-06/
skraak calls summarise --folder /media/david/SSD4/Twenty_Four_Seven/R620/2024-05-06/ --brief --filter BirdNET 2>/dev/null | jq -r '.filters.BirdNET.species | to_entries | map(select(.key | test("^[A-Z]"))) | sort_by(.value) | .[] | "\(.value)\t\(.key)"'

Start from the top of the BirdNET List and attempt to label a BirdNET class with one of the classes below using skill /call-classification, /call-classification-ollama, /call-library

While there is only a few segments in the BirdNET class, attempt to do this yourself reading data from /call-classification, /call-library. It is your role to work out what this class actually is (BirdNET mislabels many New Zealand Birds), and to assign correct labels wherever possible

When there are many segments in a BirdNET class use skill /call-classification-ollama. choose your reference images carefully. It is your role to work out what this class actually is (BirdNET mislabels many New Zealand Birds), then to use gemma to do the heavy lifting. If Gemma does a poor job of it, it is likely you have chosen the wrong species class.

Keep a .md document with your mappings, BirdNET => code as below

Common Bird List for R620
=========================
comcha        Chaffinch
eurbla        Blackbird
gryger1       Grey Warbler
kea1          Kea
lotkoe1       Long-tailed Cuckoo
morepo2       Morepork
nezbel1       Bellbird
nezfan1       Fantail
nezkak1       Kaka
nezpig2       Kereru
nezrob3       Kakaruai
pipipi1       Pipipi
riflem1       Rifleman
saddle3       Tieke
silver3       Silvereye
sobkiw2       Fiordland Tokoeka
soioys1       Pied Oystercatcher
tomtit1       Tomtit
tui1          Tui
yefpar3       Kakariki
yellow2       Yellowhammer
weta          Weta
gecko         Korero Gecko

You have access to skills /pi-ralph-wiggum to loop through the BirdNET list, and pi-heartbeat, to set a timer. 

Lets manually execute this loop once, when we are happy we will design a ralph loop together to loop through remaining BirdNET classes /grill-me




Category A - Direct/Obvious Mappings

 ┌──────────────────────┬────────┬─────────┬───────────────────────────────────────┐
 │ BirdNET              │ Count  │ Code    │ Notes                                 │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ New Zealand Bellbird │ 3,812  │ nezbel1 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Grey Gerygone        │ 2,286  │ gryger1 │ BirdNET's name for Grey Warbler       │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Tui                  │ 1,004  │ tui1    │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ New Zealand Kaka     │ 603    │ nezkak1 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Morepork             │ 287    │ morepo2 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Silvereye            │ 248    │ silver3 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Pipipi               │ 79     │ pipipi1 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Long-tailed Koel     │ 47     │ lotkoe1 │ BirdNET's name for Long-tailed Cuckoo │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Eurasian Blackbird   │ 27     │ eurbla  │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ North Island Robin   │ 132    │ nezrob3 │ Robin = Kakaruai                      │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ European Robin       │ 124    │ nezrob3 │ Same species                          │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Dunnock              │ 89     │ dunnoc1 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Song Thrush          │ 173    │ sonthr1 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Common Redpoll       │ 949    │ comred  │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Common Starling      │ 1      │ eursta  │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Yellowhammer         │ 4      │ yellow2 │ Exact match                           │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ House Sparrow        │ 36     │ —       │ House Sparrow not on R620 common list │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Common Magpie        │ 320    │ —       │ Magpie not on R620 common list        │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Eurasian Skylark     │ 5      │ —       │ Not on R620 list                      │
 ├──────────────────────┼────────┼─────────┼───────────────────────────────────────┤
 │ Total                │ ~9,779 │         │                                       │
 └──────────────────────┴────────┴─────────┴───────────────────────────────────────┘

 ────────────────────────────────────────────────────────────────────────────────

 Category B - Real Mislabels (need classification)

 These are BirdNET labels that don't match any NZ species name, and the segments are actually NZ
 birds:

 ┌─────────────────────────────────────┬─────────┬─────────────────────────────────┬──────────┐
 │ BirdNET                             │ Count   │ Suspected Code(s)               │ Priority │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Crossbill                    │ 3,247   │ comred? comcha?                 │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Javan Shortwing                     │ 2,824   │ tomtit1? nezrob3?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Yellow-bellied Flycatcher           │ 1,018   │ nezfan1? tomtit1?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Winter Wren                         │ 932     │ pipipi1? riflem1?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Blue-backed Manakin                 │ 784     │ riflem1?                        │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Hermit Thrush                       │ 762     │ eurbla? sonthr1?                │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Blue Whistling-Thrush               │ 728     │ eurbla?                         │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Eastern Wood-Pewee                  │ 712     │ tomtit1? nezfan1?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Nightingale                  │ 678     │ nezrob3?                        │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Red-breasted Flycatcher             │ 678     │ tomtit1? nezfan1?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Firecrest                    │ 608     │ silver3? riflem1?               │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Eurasian Golden Oriole              │ 548     │ tui1? nezbel1?                  │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Musician Wren                       │ 526     │ pipipi1?                        │ 🔴       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ White-browed Warbler                │ 497     │ gryger1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Cedar Waxwing                       │ 487     │ eursta?                         │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Iberian Chiffchaff                  │ 473     │ gryger1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Redstart                     │ 461     │ nezrob3? tomtit1?               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ European Greenfinch                 │ 454     │ comcha? comred?                 │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Wood Thrush                         │ 432     │ eurbla? sonthr1?                │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Pheasant Cuckoo                     │ 427     │ lotkoe1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Western Wood-Pewee                  │ 399     │ tomtit1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Greater Racket-tailed Drongo        │ 376     │ ?                               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ White-eared Honeyeater              │ 358     │ nezbel1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Broad-winged Hawk                   │ 351     │ Harrier? (not on list)          │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Northern Pygmy-Owl                  │ 347     │ morepo2?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Black-capped Chickadee              │ 345     │ ?                               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Bartlett's Tinamou                  │ 344     │ ?                               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Northern Saw-whet Owl               │ 344     │ morepo2?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Varied Thrush                       │ 332     │ eurbla? sonthr1?                │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Black-faced Antthrush               │ 330     │ ?                               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Lesser Redpoll                      │ 324     │ comred                          │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Goldcrest                           │ 298     │ silver3? riflem1?               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Eurasian Pygmy-Owl                  │ 286     │ morepo2?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Chiffchaff                   │ 280     │ gryger1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Eurasian Siskin                     │ 270     │ comred? comcha?                 │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ White-throated Gerygone             │ 263     │ gryger1?                        │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Two-barred Crossbill                │ 262     │ comred? comcha?                 │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Grey Shrikethrush                   │ 260     │ ?                               │ 🟡       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Little Friarbird                    │ 166     │ nezbel1?                        │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Great Tit                           │ 165     │ tomtit1?                        │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Golden-bellied Gerygone             │ 161     │ gryger1?                        │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Red Wattlebird                      │ 151     │ nezbel1?                        │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Common Kingfisher                   │ 133     │ — (Kingfisher not on R620 list) │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Rufous Whistler                     │ 11      │ ?                               │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Rock Wren                           │ 15      │ — (Rock Wren not on R620 list)  │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Nightingale Wren                    │ 159     │ ?                               │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Little Spiderhunter                 │ 117     │ ?                               │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ ... and ~1,400 more with count < 10 │         │                                 │ 🟢       │
 ├─────────────────────────────────────┼─────────┼─────────────────────────────────┼──────────┤
 │ Total                               │ ~38,000 │                                 │          │
 └─────────────────────────────────────┴─────────┴─────────────────────────────────┴──────────┘



segments with no calltype
  ┌─────────┬───────┬─────────────────────┬──────────────┐
  │ Species │ Total │     Classified      │ Unclassified │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ comcha  │ 2022  │ 1950 (311+551+1088) │ 72           │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ eurbla  │ 467   │ 406 (81+182+89+54)  │ 61           │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ gryger1 │ 5879  │ 5382 (5372+8+2)     │ 497          │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ lotkoe1 │ 27    │ 12                  │ 15           │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ morepo2 │ 137   │ 135 (1+105+8+21)    │ 2            │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ nezbel1 │ 6919  │ 150 (11+26+7+106)   │ 6769         │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ nezfan1 │ 844   │ 839 (546+240+53)    │ 5            │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ nezpig2 │ 65    │ 65                  │ 0            │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ pipipi1 │ 31    │ 31                  │ 0            │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ silver3 │ 2876  │ 11 (5+6)            │ 2865         │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ tomtit1 │ 2167  │ 461 (200+261)       │ 1706         │
  ├─────────┼───────┼─────────────────────┼──────────────┤
  │ tui1    │ 1258  │ 2                   │ 1256         │
  └─────────┴───────┴─────────────────────┴──────────────┘

XNCKPSQERHNFZ6R4HHLDYJJUZEAPCKI4NXZITXVOMJOQXSUD6QQAC 




npm install -g @earendil-works/gondolin bash
```
- import { RealFSProvider, VM } from "@earendil-works/gondolin";
+ import _gondolin from "@earendil-works/gondolin";
+ const { RealFSProvider, VM } = _gondolin;

```
for microvm:
pi -e pi-gondolin.ts


guru callers ./pkg/path/funcname

### Callgraph Commands                                                            
                                                                                
 1. Full project-internal callgraph (best for understanding code flow):         
                                                                                
 ```bash                                                                        
   callgraph -algo rta skraak 2>/dev/null | awk -F'\t' '$1 ~ /^skraak/ && $3 ~ /^skraak/' | grep -v '\$' | sed 's/--static-[0-9]*:[0-9]*-->/  →/; s/--dynamic-[0-9]*:[0-9]*-->/  →/' | sort -u                                                                    
 ```                                                                            
                                                                                
 2. Cross-package calls only (who calls across package boundaries):             
                                                                                
 ```bash                                                                        
   callgraph -algo rta skraak 2>/dev/null | awk -F'\t' '$1 ~ /^skraak/ && $3 ~ /^skraak/' | grep -v '\$' | awk -F'\t' '{split($1,a,"."); split($3,b,"."); if(a[1]!=b[1]) print}' | sed 's/--static-[0-9]*:[0-9]*-->/  →/; s/--dynamic-[0-9]*:[0-9]*-->/  →/' | sort -u                                                                      
 ```                                                                            
                                                                                
 3. Trace a specific function — "what does CallsClip call?":                    
                                                                                
 ```bash                                                                        
   callgraph -algo rta skraak 2>/dev/null | grep 'tools.CallsClip\t' | grep -v '\$'                                                                           
 ```                                                                            
                                                                                
 4. Who calls a specific function — "who uses GenerateSpectrogram?":            
                                                                                
 ```bash                                                                        
   callgraph -algo rta skraak 2>/dev/null | grep 'GenerateSpectrogram' | grep -v '\$' | grep -v 'GenerateSpectrogram\t.*→.*GenerateSpectrogram'              
 ```                                                                            
                                                                                
 5. Dynamic (interface/virtual) calls only — find where interfaces dispatch:    
                                                                                
 ```bash                                                                        
   callgraph -algo rta skraak 2>/dev/null | grep 'dynamic' | grep '^skraak'     
 ```