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64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
"""Frozen broad-language provenance and shared language abilities.

This is catalog construction metadata, not a host-owned runtime router.  The
source snapshot is frozen so checkpoint geometry never changes because a
network service, package installation, or another repository changed.
"""
from __future__ import annotations

import hashlib
import re


LINGUIST_LANGUAGE_SOURCE_SCHEMA = (
    "nnf.resynthesis.github_linguist_language_source.v1"
)
LINGUIST_LANGUAGE_SOURCE_REPOSITORY = (
    "https://github.com/github-linguist/linguist"
)
LINGUIST_LANGUAGE_SOURCE_COMMIT = (
    "e9fe3c9f230cd9220afcd057f75702de4d7700c9"
)
LINGUIST_LANGUAGE_SOURCE_PATH = "lib/linguist/languages.yml"
LINGUIST_LANGUAGE_SOURCE_FILE_SHA256 = (
    "8642e45ad18a62225ec367992d508af916b9caf41ee9b274863621965c4ba794"
)
LINGUIST_LANGUAGE_SOURCE_NAMES_SHA256 = (
    "ec2877045e403b74946bfb03bb49223e3291781d7d7ec1bad0a98ab8e0141624"
)
LINGUIST_LANGUAGE_SOURCE_RECORD_COUNT = 815


def _names(rows: str) -> tuple[str, ...]:
    return tuple(row for row in rows.splitlines() if row)


_PROGRAMMING_NAMES = _names(
    """1C Enterprise
4D
ABAP
ABAP CDS
AGS Script
AIDL
AL
ALGOL
AMPL
ANTLR
APL
ASL
ASP.NET
ATS
ActionScript
Ada
Agda
Aiken
Alloy
Alpine Abuild
AngelScript
Answer Set Programming
Apex
Apollo Guidance Computer
AppleScript
Arc
AspectJ
Assembly
Asymptote
Augeas
AutoHotkey
AutoIt
Awk
B (Formal Method)
B4X
BAML
BASIC
BQN
Ballerina
Batchfile
Beef
Befunge
Berry
BibTeX Style
Bicep
Bison
BitBake
BlitzBasic
BlitzMax
Bluespec
Bluespec BH
Boo
Boogie
Brainfuck
BrighterScript
Brightscript
C
C#
C++
C2hs Haskell
C3
CAP CDS
CLIPS
CMake
COBOL
CQL
CUE
CWeb
Cadence
Cairo
Cairo Zero
CameLIGO
Cangjie
Cap'n Proto
Carbon
CartoCSS
Ceylon
Chapel
Charity
ChucK
Circom
Cirru
Clarion
Clarity
Classic ASP
Clean
Click
Clojure
Clue
CodeQL
CoffeeScript
ColdFusion
ColdFusion CFC
Common Lisp
Common Workflow Language
Component Pascal
Cool
Crystal
Csound
Csound Document
Csound Score
Cuda
Curry
Cycript
Cypher
Cython
D
DIGITAL Command Language
DM
DTrace
Dafny
Dart
Daslang
DataWeave
DenizenScript
Dhall
Dockerfile
Dogescript
Dune
Dylan
E
ECL
ECLiPSe
EQ
Earthly
EdgeQL
Eiffel
Elixir
Elm
Elvish
Elvish Transcript
Emacs Lisp
EmberScript
Erlang
Euphoria
F#
F*
FIRRTL
FLUX
Factor
Fancy
Fantom
Faust
Fennel
Filebench WML
Filterscript
Flix
Fluent
Forth
Fortran
Fortran Free Form
FreeBASIC
FreeMarker
Frege
Futhark
G-code
GAML
GAMS
GAP
GCC Machine Description
GDB
GDScript
GDShader
GLSL
GSC
Game Maker Language
Genero 4gl
Genie
Genshi
Gentoo Ebuild
Gentoo Eclass
Gherkin
Gleam
Glimmer JS
Glimmer TS
Glyph
Gnuplot
Go
Golo
Gosu
Grace
Grammatical Framework
Groovy
Groovy Server Pages
HCL
HIP
HLSL
Hack
Harbour
Hare
Haskell
Haxe
HiveQL
HolyC
Hurl
Hy
HyPhy
IDL
IGOR Pro
IL Assembly
ISPC
Idris
ImageJ Macro
Imba
Inform 7
Ink
Inno Setup
Io
Ioke
Isabelle
Isabelle ROOT
J
JCL
JFlex
JSONiq
Jac
Jai
Janet
Jasmin
Java
Java Server Pages
Java Template Engine
JavaScript
JavaScript+ERB
JetBrains MPS
Jison
Jison Lex
Jolie
Jsonnet
Julia
Julia REPL
Just
KCL
KFramework
KRL
Kaitai Struct
KakouneScript
KerboScript
KoLmafia ASH
Koka
Kotlin
LFE
LLVM
LOLCODE
LSL
LabVIEW
Lambdapi
Langium
Lasso
Lean
Lean 4
Leo
Lex
LigoLANG
LilyPond
Limbo
Linear Programming
Linker Script
Liquidsoap
Literate Agda
Literate CoffeeScript
Literate Haskell
LiveCode Script
LiveScript
Logos
Logtalk
LookML
LoomScript
Lua
Luau
M
M4
M4Sugar
MATLAB
MAXScript
MLIR
MQL4
MQL5
MUF
Macaulay2
Makefile
Mako
Mathematical Programming System
Max
MeTTa
Mercury
Meson
Metal
MiniD
MiniZinc
Mint
Mirah
Modelica
Modula-2
Modula-3
Module Management System
Mojo
Monkey
Monkey C
Moocode
MoonBit
MoonScript
Motoko
Motorola 68K Assembly
Move
Myghty
NASL
NCL
NMODL
NSIS
NWScript
Nasal
Nearley
Nemerle
NetLinx
NetLinx+ERB
NetLogo
NewLisp
Nextflow
Nickel
Nim
Nit
Nix
Noir
Nu
NumPy
Nushell
OCaml
OMNeT++ MSG
OMNeT++ NED
Oberon
ObjectScript
Objective-C
Objective-C++
Objective-J
Odin
Omgrofl
Opa
Opal
Open Policy Agent
OpenCL
OpenEdge ABL
OpenQASM
OpenRC runscript
OpenSCAD
OverPy
OverpassQL
Ox
Oxygene
Oz
P4
PDDL
PEG.js
PHP
PLSQL
PLpgSQL
POV-Ray SDL
Pact
Pan
Papyrus
Parrot
Parrot Assembly
Parrot Internal Representation
Pascal
Pawn
Pep8
Perl
PicoLisp
PigLatin
Pike
Pkl
PogoScript
Polar
Pony
Portugol
Power Query
PowerBuilder
PowerShell
Praat
Pro*C
Processing
Procfile
Prolog
Promela
Propeller Spin
Puppet
PureBasic
PureScript
Pyret
Python
Python console
Q#
QML
QMake
Qt Script
Quake
QuakeC
QuickBASIC
Quint
R
RAScript
REALbasic
REXX
RPC
RPGLE
Racket
Ragel
Raku
Rascal
ReScript
Reason
ReasonLIGO
Rebol
Red
Redcode
Redscript
Ren'Py
RenderScript
Rez
Ring
RobotFramework
Roc
Rocq Prover
Rouge
RouterOS Script
Ruby
Rust
SAS
SMT
SQF
SQLPL
SWIG
Sage
Sail
SaltStack
Scala
Scenic
Scheme
Scilab
Self
ShaderLab
Shell
ShellSession
Shen
Sieve
Singularity
Slang
Slash
Slice
SmPL
Smali
Smalltalk
Smarty
Smithy
Snakemake
Solidity
SourcePawn
Squirrel
Stan
Standard ML
Starlark
Stata
SuperCollider
SurrealQL
Sway
Swift
SystemVerilog
TI Program
TL-Verilog
TLA
TSQL
TSX
TXL
Tact
Talon
Tcl
Tcsh
Teal
Terra
Thrift
Toit
Tree-sitter Query
Turing
TypeScript
TypeSpec
Typst
Unified Parallel C
Unix Assembly
Uno
UnrealScript
Untyped Plutus Core
UrWeb
V
VBA
VBScript
VCL
VHDL
Vala
Verilog
Vim Script
Visual Basic .NET
Visual Basic 6.0
Volt
Vyper
WDL
WGSL
WebAssembly
WebIDL
Whiley
Witcher Script
Wolfram Language
Wollok
Wren
X10
XC
XProc
XQuery
XS
XSLT
Xmake
Xojo
Xonsh
Xtend
YARA
Yacc
Yul
ZAP
ZIL
Zeek
ZenScript
Zephir
Zig
Zimpl
eC
fish
hoon
jq
mIRC Script
mcfunction
mupad
nesC
ooc
q
sed
wisp
xBase"""
)

_DATA_NAMES = _names(
    """2-Dimensional Array
ABNF
ASN.1
Adblock Filter List
Adobe Font Metrics
Altium Designer
Ant Build System
ApacheConf
Avro IDL
Browserslist
BuildStream
C-ObjDump
CIL
CODEOWNERS
COLLADA
CSON
CSV
Cabal Config
Caddyfile
Checksums
Cloud Firestore Security Rules
CoNLL-U
Cpp-ObjDump
Cue Sheet
Cylc
D-ObjDump
DNS Zone
Darcs Patch
Debian Package Control File
Diff
DirectX 3D File
Dotenv
E-mail
EBNF
Eagle
Easybuild
Ecere Projects
EditorConfig
Edje Data Collection
FIGlet Font
FlatBuffers
Formatted
GEDCOM
GN
Gemfile.lock
Gerber Image
Git Attributes
Git Commit
Git Config
Git Revision List
Glyph Bitmap Distribution Format
Go Checksums
Go Module
Go Workspace
Godot Resource
Gradle
Gradle Kotlin DSL
Graph Modeling Language
GraphQL
Graphviz (DOT)
GtkRC
HAProxy
HOCON
HTTP
HXML
Hosts File
INI
IRC log
Ignore List
JAR Manifest
JSON
JSON with Comments
JSON5
JSONLD
Java Properties
Jest Snapshot
KDL
KiCad Layout
KiCad Legacy Layout
KiCad Schematic
Kickstart
Kusto
LTspice Symbol
Lark
Linux Kernel Module
M3U
Maven POM
Microsoft Developer Studio Project
Microsoft Visual Studio Solution
MiniYAML
MiniZinc Data
NEON
NL
NPM Config
Nginx
Ninja
OASv2-json
OASv2-yaml
OASv3-json
OASv3-yaml
ObjDump
Object Data Instance Notation
OpenAPI Specification v2
OpenAPI Specification v3
OpenStep Property List
OpenType Feature File
Option List
Pickle
Pip Requirements
PlantUML
Prisma
Proguard
Protocol Buffer
Protocol Buffer Text Format
Public Key
Pure Data
Python traceback
RBS
RON
ROS Interface
RPM Spec
Raw token data
Readline Config
Record Jar
Redirect Rules
Regular Expression
Robots Exclusion Rules
SELinux Policy
SPARQL
SQL
SSH Config
STAR
STL
STON
SVG
ShellCheck Config
Simple File Verification
Soong
SpiceDB Schema
Spline Font Database
SubRip Text
Survex data
TMDL
TOML
TSPLIB data
TSV
TextGrid
TextMate Properties
Tor Config
Turtle
Type Language
Unity3D Asset
Valve Data Format
Wavefront Material
Wavefront Object
Web Ontology Language
WebAssembly Interface Type
WebVTT
Wget Config
Win32 Message File
Windows Registry Entries
World of Warcraft Addon Data
X BitMap
X Font Directory Index
X PixMap
XCompose
XML
XML Property List
XPages
YAML
YANG
Zmodel
cURL Config
crontab
desktop
dircolors
edn
iCalendar
nanorc
pkg-config
vCard"""
)

_MARKUP_NAMES = _names(
    """API Blueprint
Antlers
Astro
BibTeX
Bikeshed
Blade
Blueprint
Bru
CSS
Closure Templates
Cooklang
D2
EJS
Ecmarkup
Edge
Genero per
Go Template
HTML
HTML+ECR
HTML+EEX
HTML+ERB
HTML+PHP
HTML+Razor
Haml
Handlebars
Jinja
Jupyter Notebook
Kit
Latte
Less
Liquid
MDX
MTML
Marko
Mask
Mermaid
Mustache
Nunjucks
Pic
PostCSS
PostScript
Pug
RAML
RUNOFF
Rich Text Format
Riot
Roff
Roff Manpage
SCSS
SRecode Template
Sass
Scaml
Slim
Slint
StringTemplate
Stylus
SugarSS
Svelte
TeX
Tea
Terraform Template
Twig
Velocity Template Language
Vento
Vim Snippet
Vue
YASnippet
kvlang
mdsvex
templ"""
)

_PROSE_NAMES = _names(
    """AsciiDoc
Creole
Gemini
Gettext Catalog
Markdown
Muse
Org
Pod
Pod 6
RDoc
RMarkdown
Sweave
Texinfo
Text
Textile
Vim Help File
Wikitext
reStructuredText"""
)

LINGUIST_LANGUAGE_NAMES_BY_TYPE: tuple[
    tuple[str, tuple[str, ...]],
    ...,
] = (
    ("programming", _PROGRAMMING_NAMES),
    ("data", _DATA_NAMES),
    ("markup", _MARKUP_NAMES),
    ("prose", _PROSE_NAMES),
)
LINGUIST_LANGUAGE_SOURCE_TYPE_COUNTS = tuple(
    (source_type, len(names))
    for source_type, names in LINGUIST_LANGUAGE_NAMES_BY_TYPE
)
LINGUIST_LANGUAGE_SOURCE_RECORDS = tuple(
    (name, source_type)
    for source_type, names in LINGUIST_LANGUAGE_NAMES_BY_TYPE
    for name in names
)

# These aliases preserve established Resynthesis dimensions when Linguist uses
# a long name, renamed language, or multiple concrete OpenAPI encodings.
_SOURCE_PACK_ID_ALIASES: tuple[tuple[str, str], ...] = (
    ("Cap'n Proto", "language_capnproto"),
    ("Common Workflow Language", "language_cwl"),
    ("LLVM", "language_llvm_ir"),
    ("M", "language_mumps"),
    ("Makefile", "language_make"),
    ("OASv2-json", "language_openapi"),
    ("OASv2-yaml", "language_openapi"),
    ("OASv3-json", "language_openapi"),
    ("OASv3-yaml", "language_openapi"),
    ("Open Policy Agent", "language_rego"),
    ("OpenAPI Specification v2", "language_openapi"),
    ("OpenAPI Specification v3", "language_openapi"),
    ("Protocol Buffer", "language_protobuf"),
    ("Reason", "language_reasonml"),
    ("Rocq Prover", "language_coq"),
    ("SMT", "language_smtlib"),
    ("Sage", "language_sagemath"),
    ("Standard ML", "language_sml"),
    ("TLA", "language_tla_plus"),
    ("TeX", "language_latex"),
    ("Unified Parallel C", "language_upc"),
    ("Visual Basic .NET", "language_vbnet"),
    ("Visual Basic 6.0", "language_visual_basic"),
    ("Wolfram Language", "language_wolfram"),
)
_SOURCE_PACK_ID_ALIAS_BY_NAME = dict(_SOURCE_PACK_ID_ALIASES)


def linguist_language_pack_id(source_name: str) -> str:
    """Return the frozen canonical NoNE family ID for one source language."""

    alias = _SOURCE_PACK_ID_ALIAS_BY_NAME.get(source_name)
    if alias is not None:
        return alias
    normalized = (
        source_name.casefold()
        .replace("c++", "cpp")
        .replace("c#", "csharp")
        .replace("f#", "fsharp")
        .replace("f*", "fstar")
        .replace("q#", "qsharp")
    )
    slug = re.sub(r"_+", "_", re.sub(r"[^a-z0-9]+", "_", normalized))
    return f"language_{slug.strip('_')}"


LINGUIST_LANGUAGE_SOURCE_PACK_RECORDS = tuple(
    (linguist_language_pack_id(name), name, source_type)
    for name, source_type in LINGUIST_LANGUAGE_SOURCE_RECORDS
)
LINGUIST_LANGUAGE_SOURCE_PACK_IDS = tuple(
    family_id
    for family_id, _name, _source_type in (
        LINGUIST_LANGUAGE_SOURCE_PACK_RECORDS
    )
)
LINGUIST_LANGUAGE_UNIQUE_SOURCE_PACK_IDS = tuple(
    dict.fromkeys(LINGUIST_LANGUAGE_SOURCE_PACK_IDS)
)
LINGUIST_LANGUAGE_SOURCE_PACK_IDS_SHA256 = hashlib.sha256(
    "\n".join(LINGUIST_LANGUAGE_SOURCE_PACK_IDS).encode("utf-8")
).hexdigest()

# This ordered prefix is the last model-emitted native language graph that was
# preserved in the immutable full-corpus build receipt before a staging copy
# replaced the canonical source.  It is catalog identity, not a trained-
# capability claim.  Keeping the digest beside the rows makes another partial
# source replacement fail at import instead of silently shrinking checkpoint
# geometry.
NATIVE_LANGUAGE_PACK_PREFIX_SCHEMA = (
    "nnf.resynthesis.native_language_pack_prefix.v1"
)
NATIVE_LANGUAGE_PACK_PREFIX_IDS = _names(
    """language_python
language_go
language_java
language_ruby
language_php
language_dotnet
language_native
language_c
language_cpp
language_rust
language_csharp
language_fsharp
language_visual_basic
language_javascript
language_typescript
language_swift
language_objective_c
language_kotlin
language_scala
language_dart
language_lua
language_perl
language_r
language_julia
language_matlab
language_sas
language_sql
language_html
language_css
language_graphql
language_bash
language_powershell
language_haskell
language_ocaml
language_clojure
language_elixir
language_erlang
language_scheme
language_common_lisp
language_prolog
language_groovy
language_fortran
language_assembly
language_cuda
language_opencl
language_webassembly
language_zig
language_nim
language_apex
language_verilog
language_systemverilog
language_vhdl
language_cobol
language_ada
language_pascal
language_tcl
language_solidity
language_move
language_hcl
language_nix
language_abap
language_actionscript
language_apl
language_awk
language_ballerina
language_basic
language_chapel
language_clojurescript
language_coffeescript
language_coldfusion
language_coq
language_crystal
language_cython
language_d
language_delphi
language_eiffel
language_elm
language_factor
language_fennel
language_fish
language_forth
language_gdscript
language_gleam
language_glsl
language_hack
language_html_css
language_idris
language_jsonnet
language_k
language_labview
language_latex
language_lean
language_less
language_llvm_ir
language_logo
language_make
language_mlir
language_mojo
language_mumps
language_openscad
language_oz
language_plsql
language_pony
language_protobuf
language_purescript
language_qml
language_racket
language_raku
language_reasonml
language_rego
language_roc
language_scratch
language_scss
language_shell
language_sml
language_sparql
language_stata
language_stylus
language_terraform
language_toml
language_typst
language_v
language_vala
language_vbnet
language_wasm
language_wgsl
language_wolfram
language_xml
language_xslt
language_yaml
language_zeek
language_agda
language_alloy
language_ansible
language_arm_assembly
language_asyncapi
language_bicep
language_cairo
language_capnproto
language_circom
language_cmake
language_cue
language_cwl
language_dhall
language_dockerfile
language_flatbuffers
language_gnu_m4
language_isabelle
language_jq
language_jsonata
language_mermaid
language_meson
language_mips_assembly
language_nextflow
language_ninja
language_noir
language_openapi
language_pkl
language_plantuml
language_postscript
language_puppet
language_riscv_assembly
language_smtlib
language_snakemake
language_svelte
language_thrift
language_tla_plus
language_tsx
language_vue
language_vyper
language_wdl
language_x86_assembly
language_yang
language_smiles
language_smarts
language_smirks
language_selfies
language_group_selfies
language_bigsmiles
language_inchi
language_cml
language_cif
language_mmcif
language_pdb_format
language_molfile_sdf
language_rxnfile
language_xdl_chemistry
language_lammps_input
language_gromacs_topology
language_openmm_xml
language_gaussian_input
language_orca_input
language_cp2k_input
language_quantum_espresso_input
language_vasp_poscar
language_amber_topology
language_charmm_input
language_sbml
language_cellml
language_sedml
language_antimony
language_bngl
language_kappa_biology
language_biopax
language_neuroml
language_sbol
language_libsbgn
language_pharmml
language_nmtran
language_mlxtran
language_fhirpath
language_cql_clinical
language_fhir_shorthand
language_arden_syntax
language_gello
language_aql_openehr
language_cdisc_odm
language_cdisc_define_xml
language_bids
language_nwb
language_adql
language_stan
language_bugs
language_jags
language_webppl
language_church
language_anglican
language_turing_julia
language_gen_julia
language_pymc
language_ampl
language_gams
language_minizinc
language_flatzinc
language_jump_julia
language_essence
language_zimpl
language_modelica
language_octave
language_scilab
language_maple
language_maxima
language_gap
language_form
language_sagemath
language_triton
language_halide
language_taichi
language_tvm_relay
language_sycl
language_hip
language_openacc
language_openmp
language_upc
language_upcxx
language_x10
language_ispc
language_ptx
language_spirv
language_openqasm
language_openpulse
language_qir
language_qsharp
language_quil
language_quil_t
language_cqasm
language_netqasm
language_braket_ir
language_silq
language_acl2
language_dafny
language_fstar
language_mizar
language_metamath
language_pvs
language_whyml
language_boogie
language_hol
language_z_notation
language_nf_core
language_galaxy_workflow
language_autoprotocol
language_opentrons
language_sila2
language_antha
language_urdf
language_sdf_robotics
language_xacro
language_ros_launch
language_netcdf_cdl
language_hdf5_ddl
language_gmsh_geo
language_abaqus_input
language_ansys_apdl
language_fenics_ufl
language_openfoam_dictionary
language_geant4_macro
language_epics_db"""
)
NATIVE_LANGUAGE_PACK_PREFIX_IDS_SHA256 = hashlib.sha256(
    "\n".join(NATIVE_LANGUAGE_PACK_PREFIX_IDS).encode("utf-8")
).hexdigest()
_NATIVE_LANGUAGE_PACK_PREFIX_ID_SET = frozenset(
    NATIVE_LANGUAGE_PACK_PREFIX_IDS
)
BROAD_LANGUAGE_PACK_IDS = (
    NATIVE_LANGUAGE_PACK_PREFIX_IDS
    + tuple(
        family_id
        for family_id in LINGUIST_LANGUAGE_UNIQUE_SOURCE_PACK_IDS
        if family_id not in _NATIVE_LANGUAGE_PACK_PREFIX_ID_SET
    )
)
BROAD_LANGUAGE_PACK_IDS_SHA256 = hashlib.sha256(
    "\n".join(BROAD_LANGUAGE_PACK_IDS).encode("utf-8")
).hexdigest()

LANGUAGE_ABILITY_SET_SCHEMA = "nnf.resynthesis.language_ability_set.v1"
LANGUAGE_ABILITY_AXES: tuple[tuple[str, str], ...] = (
    ("syntax_parse", "lex, parse, and recover concrete syntax"),
    ("grammar_parser_generation", "author and validate grammars and parsers"),
    ("formatter_roundtrip", "format without semantic loss and round-trip forms"),
    ("lint_static_analysis", "lint and perform static defect analysis"),
    ("semantic_analysis", "resolve names, scope, effects, and semantics"),
    ("type_contract_check", "check types, contracts, invariants, and schemas"),
    ("compile_link", "compile, link, and diagnose toolchain failures"),
    ("compiler_ir_lowering", "lower and inspect compiler intermediate forms"),
    ("interpret_execute", "interpret or execute with environment grounding"),
    ("build_dependency_resolution", "build and resolve dependency graphs"),
    ("package_release", "package, version, sign, and publish artifacts"),
    ("unit_integration_test", "design and run unit and integration tests"),
    ("property_fuzz_test", "property-test, fuzz, and minimize counterexamples"),
    ("bug_reproduction_minimization", "reproduce and minimize reported failures"),
    ("failure_triage_root_cause", "triage evidence and isolate root causes"),
    ("debug_trace", "debug state and trace execution across boundaries"),
    ("profile_optimize", "profile and optimize time, memory, and I/O"),
    ("performance_portability", "preserve performance across target platforms"),
    ("concurrency_memory_model", "reason about concurrency and memory ordering"),
    ("security_taint_audit", "audit trust boundaries, taint, and unsafe behavior"),
    ("vulnerability_disclosure_remediation", "prepare disclosure and remediation"),
    ("supply_chain_reproducibility", "verify dependencies and reproducible builds"),
    ("ffi_cross_language_interop", "bridge ABIs, FFI, and foreign runtimes"),
    ("protocol_network_interop", "implement and validate network protocols"),
    ("refactor_migrate", "refactor and migrate while preserving behavior"),
    ("legacy_modernization", "understand and modernize legacy systems"),
    ("patch_review_validation", "draft, review, test, and validate patches"),
    ("code_generation_drafting", "draft implementation before committed action"),
    ("documentation_examples", "write accurate documentation and examples"),
    ("localization_text_processing", "process text, encodings, and localization"),
    ("api_schema_compatibility", "evolve APIs and schemas compatibly"),
    ("query_data_model", "reason over queries, indexes, and data models"),
    ("database_transaction_consistency", "preserve transaction consistency"),
    ("serialization_exchange", "validate serialization and exchange formats"),
    ("markup_render_accessibility", "render markup with accessibility checks"),
    ("config_policy_validation", "validate configuration and policy languages"),
    ("formal_proof_model_check", "prove properties and model-check state spaces"),
    ("binary_reverse_engineering", "inspect binary and disassembly representations"),
    ("numerical_stability_units", "validate precision, units, and dimensions"),
    ("probabilistic_inference_optimization", "validate inference and optimization"),
    ("chemical_structure_reaction_validation", "validate chemical structures and reactions"),
    ("systems_biology_simulation", "validate mechanistic biology simulations"),
    ("clinical_regulatory_validation", "validate clinical and regulatory logic"),
    ("workflow_provenance_orchestration", "orchestrate reproducible workflows"),
    ("laboratory_robotics_control", "validate laboratory and robot control"),
    ("scientific_data_mesh_geometry", "validate scientific arrays, meshes, and geometry"),
    ("simulation_boundary_conditions", "validate simulator inputs and boundaries"),
    ("accelerator_parallel_lowering", "lower and verify parallel accelerator kernels"),
    ("hardware_hdl_verification", "simulate and verify digital hardware"),
    ("quantum_circuit_pulse_validation", "validate circuits, pulses, and quantum IR"),
    ("data_visualization_reporting", "produce reproducible scientific reports"),
    ("provenance_evidence_uncertainty", "preserve provenance and explicit uncertainty"),
    ("deployment_observability_operations", "deploy and operate observable systems"),
)
LANGUAGE_ABILITY_AXIS_IDS = tuple(
    ability_id for ability_id, _description in LANGUAGE_ABILITY_AXES
)
LANGUAGE_ABILITY_AXIS_IDS_SHA256 = hashlib.sha256(
    "\n".join(LANGUAGE_ABILITY_AXIS_IDS).encode("utf-8")
).hexdigest()

LANGUAGE_ABILITY_IDS_BY_SOURCE_TYPE: tuple[
    tuple[str, tuple[str, ...]],
    ...,
] = (
    (
        "programming",
        (
            "syntax_parse",
            "grammar_parser_generation",
            "formatter_roundtrip",
            "lint_static_analysis",
            "semantic_analysis",
            "type_contract_check",
            "compile_link",
            "compiler_ir_lowering",
            "interpret_execute",
            "build_dependency_resolution",
            "package_release",
            "unit_integration_test",
            "property_fuzz_test",
            "bug_reproduction_minimization",
            "failure_triage_root_cause",
            "debug_trace",
            "profile_optimize",
            "performance_portability",
            "concurrency_memory_model",
            "security_taint_audit",
            "binary_reverse_engineering",
            "vulnerability_disclosure_remediation",
            "supply_chain_reproducibility",
            "ffi_cross_language_interop",
            "protocol_network_interop",
            "refactor_migrate",
            "legacy_modernization",
            "patch_review_validation",
            "code_generation_drafting",
            "documentation_examples",
            "api_schema_compatibility",
            "provenance_evidence_uncertainty",
            "deployment_observability_operations",
        ),
    ),
    (
        "data",
        (
            "syntax_parse",
            "grammar_parser_generation",
            "formatter_roundtrip",
            "lint_static_analysis",
            "type_contract_check",
            "property_fuzz_test",
            "bug_reproduction_minimization",
            "failure_triage_root_cause",
            "security_taint_audit",
            "patch_review_validation",
            "documentation_examples",
            "api_schema_compatibility",
            "query_data_model",
            "database_transaction_consistency",
            "serialization_exchange",
            "config_policy_validation",
            "provenance_evidence_uncertainty",
        ),
    ),
    (
        "markup",
        (
            "syntax_parse",
            "grammar_parser_generation",
            "formatter_roundtrip",
            "lint_static_analysis",
            "semantic_analysis",
            "type_contract_check",
            "unit_integration_test",
            "property_fuzz_test",
            "bug_reproduction_minimization",
            "patch_review_validation",
            "documentation_examples",
            "localization_text_processing",
            "api_schema_compatibility",
            "serialization_exchange",
            "markup_render_accessibility",
            "provenance_evidence_uncertainty",
        ),
    ),
    (
        "prose",
        (
            "syntax_parse",
            "formatter_roundtrip",
            "lint_static_analysis",
            "bug_reproduction_minimization",
            "patch_review_validation",
            "code_generation_drafting",
            "documentation_examples",
            "localization_text_processing",
            "data_visualization_reporting",
            "provenance_evidence_uncertainty",
        ),
    ),
)


_source_names = tuple(name for name, _source_type in LINGUIST_LANGUAGE_SOURCE_RECORDS)
if (
    len(_source_names) != LINGUIST_LANGUAGE_SOURCE_RECORD_COUNT
    or len(_source_names) != len(set(_source_names))
    or hashlib.sha256(
        "\n".join(sorted(_source_names)).encode("utf-8")
    ).hexdigest()
    != LINGUIST_LANGUAGE_SOURCE_NAMES_SHA256
    or set(LINGUIST_LANGUAGE_SOURCE_PACK_IDS)
    != set(LINGUIST_LANGUAGE_UNIQUE_SOURCE_PACK_IDS)
    or len(NATIVE_LANGUAGE_PACK_PREFIX_IDS) != 298
    or len(NATIVE_LANGUAGE_PACK_PREFIX_IDS)
    != len(set(NATIVE_LANGUAGE_PACK_PREFIX_IDS))
    or NATIVE_LANGUAGE_PACK_PREFIX_IDS_SHA256
    != "11ee56c6ef37fb2ced4bc95959cbd1f4eccbb8b1c04aa6143bdb95aefb6b5cfc"
    or len(BROAD_LANGUAGE_PACK_IDS) != 936
    or len(BROAD_LANGUAGE_PACK_IDS) != len(set(BROAD_LANGUAGE_PACK_IDS))
    or BROAD_LANGUAGE_PACK_IDS[: len(NATIVE_LANGUAGE_PACK_PREFIX_IDS)]
    != NATIVE_LANGUAGE_PACK_PREFIX_IDS
    or BROAD_LANGUAGE_PACK_IDS_SHA256
    != "dfd7e29914ff5764539d36db1882b14356127d1048d2c1e2a20e80c87662a1d8"
    or len(LANGUAGE_ABILITY_AXIS_IDS)
    != len(set(LANGUAGE_ABILITY_AXIS_IDS))
):
    raise RuntimeError("frozen broad-language catalog provenance is invalid")