-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathcheck-release-binary-contract.py
More file actions
1424 lines (1318 loc) · 52.6 KB
/
Copy pathcheck-release-binary-contract.py
File metadata and controls
1424 lines (1318 loc) · 52.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
#!/usr/bin/env python3
"""Fail closed when the accepted binary-release spike contract drifts."""
from __future__ import annotations
import argparse
import ast
import hashlib
import os
import re
import shlex
import subprocess
import sys
import tempfile
from collections import Counter
from pathlib import Path
BEGIN = "<!-- release-binary-contract:begin -->"
END = "<!-- release-binary-contract:end -->"
SPEC_PATH = ".agents/specs/release-binary-matrix.md"
TEST_PATH = "tests/scripts/test_check_release_binary_contract.py"
PREFLIGHT_PATH = "scripts/agent-preflight.sh"
CI_PATH = ".github/workflows/ci.yml"
IDENTITY = "ENG-RELEASE-BINARIES"
PRIMARY_CUDA_SMS = (
"80",
"86",
"87",
"89",
"90a",
"100a",
"103a",
"110",
"120a",
"121a",
)
WORK_DEPS = {
"W1": (),
"W2": ("W1",),
"W3": (),
"W4": (),
"W5": (),
"W6": (),
"W7": ("W1", "W2", "W3", "W4", "W5", "W6"),
"W8": ("W5", "W7"),
"W9": ("W3", "W4", "W5", "W6", "W7"),
"W10": ("W1", "W2", "W5", "W6", "W7"),
"W11": ("W5", "W6", "W7"),
"W12": ("W1", "W2", "W5", "W6", "W7"),
"W13": ("W5", "W7", "W8", "W9", "W10", "W11"),
}
ANCHORS = {
".agents/engine-matrix.md": "| `ENG-RELEASE-BINARIES` |",
".agents/roadmap_v1.md": "| REL | `ROAD-V1-RELEASE` |",
# RELOCATED 2026-08-11 (ENG-NOW-DERIVED, #374). This anchor used to pin a
# per-ROW line inside .agents/NOW.md, which is one of the requirements that
# made that file a surface every PR had to keep current. The row's live
# position now lives in the row's OWN spec under `## Now` -- one writer, and
# the same place check-doc-checkpoint.py requires it.
".agents/specs/release-binary-matrix.md": "**ACTIVE; required W1-W11/W13 implemented and v0.0.2 published.**",
".agents/coordination.md": "**Server binary release W1-W13 (`ENG-RELEASE-BINARIES`, 2026-08-09,",
".agents/completed/state-events/2026-08/STATE-20260809T160000-001.md": "# W6 installed server package green",
"docs/STATUS.md": "v0.0.2 publishes eight server bundles; Windows v0.0.3-pre.1 pending",
"docs/BENCHMARKS.md": "| **Binary release (ACTIVE; Windows pre-alpha pending)** |",
}
LIFECYCLE_RECORD_MUTATIONS = (
(
".agents/engine-matrix.md",
"`ACTIVE` | `CLAIM-ENG-RELEASE-BINARIES-W1-W13` |",
"`DONE` | `CLAIM-ENG-RELEASE-BINARIES-W1-W13` |",
"engine-matrix release lifecycle",
),
(
".agents/engine-matrix.md",
"v0.0.2 published eight archive/checksum/provenance triplets plus two indexes",
"v0.0.2 publication is pending",
"engine-matrix release lifecycle",
),
(
".agents/roadmap_v1.md",
"`ACTIVE` | v0.0.2 published eight primary archive/checksum/provenance triplets",
"`DONE` | v0.0.2 published eight primary archive/checksum/provenance triplets",
"roadmap release lifecycle",
),
(
".agents/roadmap_v1.md",
"Windows W14-W16 are implemented for one PR",
"Windows v0.0.3-pre.1 is published",
"roadmap release lifecycle",
),
(
".agents/coordination.md",
"| `ACTIVE` | 2026-08-09 — required W1-W11/W13 implementation complete;",
"| `DONE` | 2026-08-09 — required W1-W11/W13 implementation complete;",
"coordination release lifecycle",
),
(
".agents/coordination.md",
"hosted ten-SM completion, full eight-tuple dry run, matching-hardware gates, rebase/merge, and tagged publication pending",
"hosted ten-SM completion, full eight-tuple dry run, matching-hardware gates, rebase/merge, and tagged publication complete",
"coordination release lifecycle",
),
(
".agents/coordination.md",
"W12 optional/non-primary |",
"W12 required/primary |",
"coordination release lifecycle",
),
(
".agents/completed/state-events/2026-08/STATE-20260809T160000-001.md",
"The row remains `ACTIVE`. W1-W4 and W7-W13 remain pending",
"The row is `DONE`. Every release gate is complete",
"state release lifecycle",
),
)
BENCHMARKS_RELEASE_ROW = (
"| **Binary release (ACTIVE; Windows pre-alpha pending)** | v0.0.2 shipped eight primary archive/checksum/provenance triplets + two indexes (26 assets) from source SHA `7020de93652ca920424a10ac5255b34810dd2f24`, run `31466516224` | "
"Windows W14-W16 implemented. **PENDING:** native hosted gates, merged-SHA ten-tuple dry run, matching-hardware evidence, v0.0.3-pre.1 publication, 32-asset audit | W12 optional/non-primary |"
)
STATUS_RELEASE_FRAGMENTS = (
"Subset; v0.0.2 publishes eight server bundles; Windows v0.0.3-pre.1 pending",
)
BACKEND_POLICY_PROSE = {
"Metal release channel": (
"| `macos-arm64-metal` | stable after M-series runtime gate |"
),
"MLX release channel": (
"| `macos-arm64-metal-mlx` | preview until its exact bundled MLX tuple "
"is runtime/correctness-gated |"
),
"Vulkan release channel": "| `linux-x86_64-glibc-vulkan` | preview |",
"musl experimental CPU-only policy": (
"| `linux-x86_64-musl-cpu-static` | experimental preview | "
"literal-static feasibility lane; CPU only; see the static boundary below |"
),
"ROCm release channel": "| ROCm/HIP | blocked |",
"external host GPU-driver boundary": "it never claims to bundle a GPU driver.",
"musl CPU-only/no-GPU boundary": (
"The one literal-static experiment is "
"`linux-x86_64-musl-cpu-static`. It is CPU-only"
),
}
BACKEND_POLICY_PROSE_MUTATIONS = (
(
"| `macos-arm64-metal` | stable after M-series runtime gate |",
"| `macos-arm64-metal` | preview |",
"Metal release channel",
),
(
"| `macos-arm64-metal-mlx` | preview until its exact bundled MLX tuple "
"is runtime/correctness-gated |",
"| `macos-arm64-metal-mlx` | stable |",
"MLX release channel",
),
(
"| `linux-x86_64-glibc-vulkan` | preview |",
"| `linux-x86_64-glibc-vulkan` | stable |",
"Vulkan release channel",
),
(
"| `linux-x86_64-musl-cpu-static` | experimental preview | literal-static "
"feasibility lane; CPU only; see the static boundary below |",
"| `linux-x86_64-musl-cpu-static` | stable | literal-static feasibility "
"lane with CUDA |",
"musl experimental CPU-only policy",
),
(
"| ROCm/HIP | blocked |",
"| ROCm/HIP | preview |",
"ROCm release channel",
),
(
"it never claims to bundle a GPU driver.",
"it bundles the GPU driver.",
"external host GPU-driver boundary",
),
(
"The one literal-static experiment is\n"
"`linux-x86_64-musl-cpu-static`. It is CPU-only",
"The one literal-static experiment is\n"
"`linux-x86_64-musl-cpu-static`. It includes GPU runtimes",
"musl CPU-only/no-GPU boundary",
),
)
PREFLIGHT_WIRING_MUTATIONS = (
(" check-release-binary-contract\n", "", "preflight CHECKERS"),
(" test_check_release_binary_contract\n", "", "preflight SUITES"),
(
'for checker in "${CHECKERS[@]}"; do',
'for checker in "${CHECKERS[@]}"; do\n continue',
"execute release CHECKERS",
),
(
'for suite in "${SUITES[@]}"; do',
'for suite in "${SUITES[@]}"; do\n continue',
"execute release SUITES",
),
("CHECKERS=(\n", "INERT_CHECKERS=(\n", "preflight CHECKERS"),
("SUITES=(\n", "INERT_SUITES=(\n", "preflight SUITES"),
)
CI_WIRING_MUTATIONS = (
(
" python3 scripts/check-release-binary-contract.py\n",
"",
"CI checker",
),
(
" python3 tests/scripts/test_check_release_binary_contract.py\n",
"",
"CI step",
),
(
" python3 scripts/check-release-binary-contract.py\n"
" python3 tests/scripts/test_check_release_binary_contract.py\n",
" if false; then\n"
" python3 scripts/check-release-binary-contract.py\n"
" python3 tests/scripts/test_check_release_binary_contract.py\n"
" fi\n",
"direct active commands",
),
(
" python3 scripts/check-release-binary-contract.py\n",
' echo "python3 scripts/check-release-binary-contract.py"\n',
"direct active commands",
),
(
" - name: Accepted binary-release design and record anchors stay in sync\n"
" run: |\n",
" - name: Accepted binary-release design and record anchors stay in sync\n"
" if: ${{ false }}\n"
" run: |\n",
"direct active commands",
),
(
" agent-record:\n",
" agent-record:\n if: ${{ false }}\n",
"direct active commands",
),
)
HUMAN_CONTRACT = {
"human primary CPU/CUDA contract": (
"The primary CPU download is one conservative-baseline, runtime-adaptive "
"binary per OS+host ABI; the primary CUDA download is one fat binary per "
"OS+host ABI containing every supported SM."
),
"human x86_64 no-AVX2 contract": (
"For x86_64, the baseline must run without AVX2: portable/SSE2 code "
"remains callable, and higher instructions live only in per-function or "
"per-TU tiers."
),
}
WORK_CONTENT = {
"W10": (
"primary Linux CUDA fat bundles for x86_64 and aarch64 host ABIs",
"each extracted archive contains all ten SMs and six exact AOT trees; "
"per-SM evidence remains independent; no host ABI is inferred from the "
"other",
),
"W12": (
"optional single-SM CUDA diagnostic/performance variants",
"generated from the same explicit matrix and evidence; never advertised "
"as the primary KISS download or used to bypass W10",
),
}
PUBLIC_PENDING_MUTATIONS = (
(
"docs/BENCHMARKS.md",
"**PENDING:** native hosted gates, merged-SHA ten-tuple dry run, matching-hardware evidence, v0.0.3-pre.1 publication, 32-asset audit",
"**SHIPPED:** Windows v0.0.3-pre.1 runtime, artifacts, and audit complete",
"docs/BENCHMARKS.md release row",
),
(
"docs/STATUS.md",
"Subset; v0.0.2 publishes eight server bundles; Windows v0.0.3-pre.1 pending",
"Supported; Windows v0.0.3-pre.1 published",
"docs/STATUS.md release row",
),
)
W10_W12_HUMAN_MUTATIONS = (
(
"optional single-SM CUDA diagnostic/performance variants",
"required primary single-SM CUDA release variants replacing W10",
"W12 deliverable",
),
(
"generated from the same explicit matrix and evidence; never advertised "
"as the primary KISS download or used to bypass W10",
"the primary KISS download; W10 may be bypassed",
"W12 exit gate",
),
)
PRIMARY_ARTIFACT_PROSE_MUTATIONS = (
(
"The primary CPU download is\none conservative-baseline, runtime-adaptive "
"binary per OS+host ABI; the primary\nCUDA download is one fat binary per "
"OS+host ABI containing every supported SM.",
"The primary CPU download is one binary per ISA; the primary CUDA "
"download is one binary per SM.",
"human primary CPU/CUDA contract",
),
(
"For x86_64, the baseline must run without AVX2: portable/SSE2 code "
"remains\ncallable, and higher instructions live only in per-function or "
"per-TU tiers.",
"For x86_64, AVX2 is required by the baseline.",
"human x86_64 no-AVX2 contract",
),
)
REQUIRED_TEST_METHODS = (
"test_repository_contract_passes",
"test_spec_identity_is_fail_closed",
"test_each_primary_cuda_sm_is_required",
"test_primary_cuda_must_stay_one_fat_binary_per_host_abi",
"test_per_sm_cuda_must_not_become_primary",
"test_primary_cpu_must_stay_one_adaptive_binary_per_host_abi",
"test_x86_64_baseline_must_not_require_avx2",
"test_each_exact_machine_field_is_fail_closed",
"test_work_table_has_explicit_deps_column",
"test_each_work_dependency_edge_is_pinned",
"test_each_human_work_row_id_occurs_exactly_once",
"test_optional_w12_does_not_block_w13",
"test_each_required_record_anchor_is_fail_closed",
"test_release_lifecycle_and_honesty_are_fail_closed",
"test_public_release_rows_remain_pending",
"test_human_w12_is_optional_and_cannot_replace_w10",
"test_human_primary_artifact_contract_matches_machine_block",
"test_unknown_machine_fields_are_fail_closed",
"test_each_human_work_dependency_is_pinned",
"test_primary_cuda_mutation_inventory_literal_is_pinned",
"test_work_dependency_mutation_inventory_literal_is_pinned",
"test_each_semantic_inventory_consumer_is_pinned",
"test_each_semantic_inventory_consumer_body_is_pinned",
"test_checker_guard_map_keysets_are_exact",
"test_required_mutation_test_inventory_is_pinned",
"test_backend_policy_machine_fields_are_required",
"test_backend_policy_prose_is_fail_closed",
"test_preflight_and_ci_wiring_is_an_executable_contract",
"test_preflight_wiring_mutations_fail",
"test_ci_wiring_mutations_fail",
)
EXPECTED_TEST_LITERAL_INVENTORY_KEYS = (
"PRIMARY_CUDA_SMS",
"EXACT_MACHINE_FIELDS",
"EXPECTED_DEPS",
"HUMAN_WORK_IDS",
"RECORD_ANCHORS",
"LIFECYCLE_RECORD_MUTATIONS",
"PUBLIC_PENDING_MUTATIONS",
"W10_W12_HUMAN_MUTATIONS",
"PRIMARY_ARTIFACT_PROSE_MUTATIONS",
"INVENTORY_CONSUMER_METHODS",
"CONSUMER_FLOW_MUTATIONS",
"UNKNOWN_MACHINE_FIELD_MUTATIONS",
"HUMAN_WORK_DEPS",
"GUARD_MAP_KEYS",
"BACKEND_POLICY_PROSE_MUTATIONS",
"PREFLIGHT_WIRING_MUTATIONS",
"CI_WIRING_MUTATIONS",
)
EXPECTED_TEST_INVENTORY_CONSUMER_KEYS = (
"PRIMARY_CUDA_SMS",
"EXACT_MACHINE_FIELDS",
"EXPECTED_DEPS",
"HUMAN_WORK_IDS",
"RECORD_ANCHORS",
"LIFECYCLE_RECORD_MUTATIONS",
"PUBLIC_PENDING_MUTATIONS",
"W10_W12_HUMAN_MUTATIONS",
"PRIMARY_ARTIFACT_PROSE_MUTATIONS",
"INVENTORY_CONSUMER_METHODS",
"CONSUMER_FLOW_MUTATIONS",
"UNKNOWN_MACHINE_FIELD_MUTATIONS",
"HUMAN_WORK_DEPS",
"GUARD_MAP_KEYS",
"BACKEND_POLICY_PROSE_MUTATIONS",
"PREFLIGHT_WIRING_MUTATIONS",
"CI_WIRING_MUTATIONS",
)
EXPECTED_GUARD_MAP_KEYS = {
"TEST_LITERAL_INVENTORIES": EXPECTED_TEST_LITERAL_INVENTORY_KEYS,
"TEST_INVENTORY_CONSUMERS": EXPECTED_TEST_INVENTORY_CONSUMER_KEYS,
}
TEST_LITERAL_INVENTORIES = {
"PRIMARY_CUDA_SMS": PRIMARY_CUDA_SMS,
"EXACT_MACHINE_FIELDS": {
"lifecycle": "ACTIVE",
"manifest_schema": "vllm.cpp.release-manifest.v1",
"delivery_pull_request": "196",
"delivery_mode": "single-pr-W1-W13",
"work_W5_status": "implemented",
"work_W6_status": "implemented",
"work_W12_policy": "optional-non-blocking",
"archive_claims": "published-v0.0.2",
"published_tag": "v0.0.2",
"published_sha": "7020de93652ca920424a10ac5255b34810dd2f24",
"published_run": "31466516224",
"published_asset_count": "26",
"runtime_claims": "pending",
"metal_channel": "stable-after-runtime-gate",
"mlx_channel": "preview",
"vulkan_channel": "preview",
"musl_channel": "experimental-preview",
"musl_scope": "cpu-only-no-gpu",
"rocm_channel": "blocked",
"gpu_driver_boundary": "external-host-never-bundled",
"required_anchor_paths": (
".agents/engine-matrix.md,.agents/roadmap_v1.md,.agents/NOW.md,"
".agents/coordination.md,.agents/completed/state-events/2026-08/"
"STATE-20260809T160000-001.md,docs/STATUS.md,"
"docs/BENCHMARKS.md,docs/FEATURES.md,release/manifest-v1.schema.json,"
"scripts/release_manifest.py,tests/scripts/test_release_manifest.py,"
"examples/CMakeLists.txt,scripts/package-server.py,"
"tests/scripts/test_server_package.py"
),
},
"EXPECTED_DEPS": {work: ",".join(deps) for work, deps in WORK_DEPS.items()},
"HUMAN_WORK_IDS": tuple(WORK_DEPS),
"RECORD_ANCHORS": ANCHORS,
"LIFECYCLE_RECORD_MUTATIONS": LIFECYCLE_RECORD_MUTATIONS,
"PUBLIC_PENDING_MUTATIONS": PUBLIC_PENDING_MUTATIONS,
"W10_W12_HUMAN_MUTATIONS": W10_W12_HUMAN_MUTATIONS,
"PRIMARY_ARTIFACT_PROSE_MUTATIONS": PRIMARY_ARTIFACT_PROSE_MUTATIONS,
"INVENTORY_CONSUMER_METHODS": {
"PRIMARY_CUDA_SMS": "test_each_primary_cuda_sm_is_required",
"EXACT_MACHINE_FIELDS": "test_each_exact_machine_field_is_fail_closed",
"EXPECTED_DEPS": "test_each_work_dependency_edge_is_pinned",
"HUMAN_WORK_IDS": "test_each_human_work_row_id_occurs_exactly_once",
"RECORD_ANCHORS": "test_each_required_record_anchor_is_fail_closed",
"LIFECYCLE_RECORD_MUTATIONS": (
"test_release_lifecycle_and_honesty_are_fail_closed"
),
"PUBLIC_PENDING_MUTATIONS": "test_public_release_rows_remain_pending",
"W10_W12_HUMAN_MUTATIONS": (
"test_human_w12_is_optional_and_cannot_replace_w10"
),
"PRIMARY_ARTIFACT_PROSE_MUTATIONS": (
"test_human_primary_artifact_contract_matches_machine_block"
),
"GUARD_MAP_KEYS": "test_checker_guard_map_keysets_are_exact",
"BACKEND_POLICY_PROSE_MUTATIONS": "test_backend_policy_prose_is_fail_closed",
"PREFLIGHT_WIRING_MUTATIONS": "test_preflight_wiring_mutations_fail",
"CI_WIRING_MUTATIONS": "test_ci_wiring_mutations_fail",
},
"CONSUMER_FLOW_MUTATIONS": ("continue", "break", "wrap_false"),
"UNKNOWN_MACHINE_FIELD_MUTATIONS": (("unexpected_field", "x"),),
"HUMAN_WORK_DEPS": {
work: ",".join(deps) for work, deps in WORK_DEPS.items()
},
"GUARD_MAP_KEYS": EXPECTED_GUARD_MAP_KEYS,
"BACKEND_POLICY_PROSE_MUTATIONS": BACKEND_POLICY_PROSE_MUTATIONS,
"PREFLIGHT_WIRING_MUTATIONS": PREFLIGHT_WIRING_MUTATIONS,
"CI_WIRING_MUTATIONS": CI_WIRING_MUTATIONS,
}
TEST_INVENTORY_CONSUMERS = {
"PRIMARY_CUDA_SMS": (
"test_each_primary_cuda_sm_is_required",
("sm",),
False,
),
"EXACT_MACHINE_FIELDS": (
"test_each_exact_machine_field_is_fail_closed",
("field", "expected"),
True,
),
"EXPECTED_DEPS": (
"test_each_work_dependency_edge_is_pinned",
("work", "deps"),
True,
),
"HUMAN_WORK_IDS": (
"test_each_human_work_row_id_occurs_exactly_once",
("work",),
False,
),
"RECORD_ANCHORS": (
"test_each_required_record_anchor_is_fail_closed",
("relative", "anchor"),
True,
),
"LIFECYCLE_RECORD_MUTATIONS": (
"test_release_lifecycle_and_honesty_are_fail_closed",
("relative", "before", "after", "reason"),
False,
),
"PUBLIC_PENDING_MUTATIONS": (
"test_public_release_rows_remain_pending",
("relative", "before", "after", "reason"),
False,
),
"W10_W12_HUMAN_MUTATIONS": (
"test_human_w12_is_optional_and_cannot_replace_w10",
("before", "after", "reason"),
False,
),
"PRIMARY_ARTIFACT_PROSE_MUTATIONS": (
"test_human_primary_artifact_contract_matches_machine_block",
("before", "after", "reason"),
False,
),
"INVENTORY_CONSUMER_METHODS": (
"test_each_semantic_inventory_consumer_body_is_pinned",
("inventory", "method"),
True,
),
"CONSUMER_FLOW_MUTATIONS": (
"test_each_semantic_inventory_consumer_body_is_pinned",
("mutation",),
False,
),
"UNKNOWN_MACHINE_FIELD_MUTATIONS": (
"test_unknown_machine_fields_are_fail_closed",
("field", "value"),
False,
),
"HUMAN_WORK_DEPS": (
"test_each_human_work_dependency_is_pinned",
("work", "expected"),
True,
),
"GUARD_MAP_KEYS": (
"test_checker_guard_map_keysets_are_exact",
("guard_map", "keys"),
True,
),
"BACKEND_POLICY_PROSE_MUTATIONS": (
"test_backend_policy_prose_is_fail_closed",
("before", "after", "reason"),
False,
),
"PREFLIGHT_WIRING_MUTATIONS": (
"test_preflight_wiring_mutations_fail",
("before", "after", "reason"),
False,
),
"CI_WIRING_MUTATIONS": (
"test_ci_wiring_mutations_fail",
("before", "after", "reason"),
False,
),
}
TEST_INVENTORY_BODY_DIGESTS = {
"PRIMARY_CUDA_SMS": "43e348a6fefad920d5ac461ef34868d20c05af64d3c9f032c62af469a358dee9",
"EXACT_MACHINE_FIELDS": "f7389b004be2b5665456e893abfa8ebb1b404c84711e86aba9673fcf8775c971",
"EXPECTED_DEPS": "b7d4608bab17632a8a02e7da6f7b8f656415c9ed08dc4ee18f7268709ec91512",
"HUMAN_WORK_IDS": "49195d0f7cd3f40d48c9f1282e4b9ead9571ca3a546c449c427801cac8fc8bdd",
"RECORD_ANCHORS": "5d354a9ed8590deccdc62890e403af66a21c416cb45e9788aacc4dce14364500",
"LIFECYCLE_RECORD_MUTATIONS": "ab35f4e72fe180cd3ef4675939d5ff8c709aff4c0474412d47ee78988c61199d",
"PUBLIC_PENDING_MUTATIONS": "69a3fc11686ccea3856b61f473796499466dc234e4aca952fce79bef2157714d",
"W10_W12_HUMAN_MUTATIONS": "17cb0586bf5ea235ba668bd0a4ae90345a33e125f211909e7f97267ec9e59dc8",
"PRIMARY_ARTIFACT_PROSE_MUTATIONS": "17cb0586bf5ea235ba668bd0a4ae90345a33e125f211909e7f97267ec9e59dc8",
"GUARD_MAP_KEYS": "701e4821bee926c2e074dbf2b97ff4a93bebb610cc6bed76e06063cab8974758",
"INVENTORY_CONSUMER_METHODS": "916894a32d88026a883cc1f316d949eb116ee1fced36d635b585d7bf3372b01d",
"CONSUMER_FLOW_MUTATIONS": "6f69f9e361d38c325fbc455c31ec7211578131368624312e024448afdfc01e83",
"UNKNOWN_MACHINE_FIELD_MUTATIONS": "b69a6bd26c8417e04994815042ba1520968b906d6bfee4b3413ffc0dafafc5f2",
"HUMAN_WORK_DEPS": "54a501b903eb3c97023084393666f9f63d289ab9a78e22f389c32bfc1711573b",
"BACKEND_POLICY_PROSE_MUTATIONS": "c5fea18a668932c4768cb9feb4746fd444b3df7e7ec15df1a588141898d28f2d",
"PREFLIGHT_WIRING_MUTATIONS": "d442c6d188efd624bffc9e94a7750d6a527c7b693affde5cbc33304f9e95272e",
"CI_WIRING_MUTATIONS": "7e20ed4d041fee98f96bb751e4435ad266d75ec8fbc9c5e1197a5d21940a6424",
}
EXACT_MACHINE_FIELDS = {
"lifecycle": "ACTIVE",
"manifest_schema": "vllm.cpp.release-manifest.v1",
"delivery_pull_request": "196",
"delivery_mode": "single-pr-W1-W13",
"work_W5_status": "implemented",
"work_W6_status": "implemented",
"work_W12_policy": "optional-non-blocking",
"archive_claims": "published-v0.0.2",
"published_tag": "v0.0.2",
"published_sha": "7020de93652ca920424a10ac5255b34810dd2f24",
"published_run": "31466516224",
"published_asset_count": "26",
"runtime_claims": "pending",
"metal_channel": "stable-after-runtime-gate",
"mlx_channel": "preview",
"vulkan_channel": "preview",
"musl_channel": "experimental-preview",
"musl_scope": "cpu-only-no-gpu",
"rocm_channel": "blocked",
"gpu_driver_boundary": "external-host-never-bundled",
"required_anchor_paths": (
".agents/engine-matrix.md,.agents/roadmap_v1.md,.agents/NOW.md,"
".agents/coordination.md,.agents/completed/state-events/2026-08/"
"STATE-20260809T160000-001.md,docs/STATUS.md,"
"docs/BENCHMARKS.md,docs/FEATURES.md,release/manifest-v1.schema.json,"
"scripts/release_manifest.py,tests/scripts/test_release_manifest.py,"
"examples/CMakeLists.txt,scripts/package-server.py,"
"tests/scripts/test_server_package.py"
),
}
EXPECTED_FIELDS = {
"identity": IDENTITY,
"primary_cuda_artifact": "one-fat-binary-per-os-host-abi",
"primary_cuda_sms": ",".join(PRIMARY_CUDA_SMS),
"per_sm_cuda": "optional-non-primary",
"primary_cpu_artifact": "one-adaptive-binary-per-os-host-abi",
"x86_64_baseline": "portable-sse2-without-avx2",
**EXACT_MACHINE_FIELDS,
**{f"work_{work}": ",".join(deps) for work, deps in WORK_DEPS.items()},
}
WORK_ROW = re.compile(
r"^\|\s*(W[0-9]+)\s*\|\s*([^|]*)\|\s*([^|]*)\|\s*([^|]*)\|",
re.M,
)
STATE_RELEASE_HEADING = (
"## Outcome"
)
STATE_RELEASE_LIFECYCLE = (
"The row remains `ACTIVE`. W1-W4 and W7-W13 remain pending"
)
def parse_contract(text: str) -> tuple[dict[str, str], list[str]]:
if text.count(BEGIN) != 1 or text.count(END) != 1:
return {}, [
f"{SPEC_PATH} must contain exactly one machine-readable release "
f"contract block ({BEGIN} ... {END})"
]
start = text.find(BEGIN) + len(BEGIN)
end = text.find(END, start)
if end < start:
return {}, [f"{SPEC_PATH} has a malformed release contract block"]
fields: dict[str, str] = {}
errors: list[str] = []
for line in text[start:end].splitlines():
stripped = line.strip()
if not stripped:
continue
if "=" not in stripped:
errors.append(f"release contract line is not key=value: {stripped!r}")
continue
key, value = stripped.split("=", 1)
if key in fields:
errors.append(f"release contract repeats field {key!r}")
fields[key] = value
return fields, errors
def _field_error(key: str, actual: str | None, expected: str) -> str:
names = {
"identity": "release spec identity",
"primary_cuda_artifact": "primary CUDA artifact",
"primary_cuda_sms": "primary CUDA SM set",
"per_sm_cuda": "per-SM CUDA policy",
"primary_cpu_artifact": "primary CPU artifact",
"x86_64_baseline": "x86_64 baseline",
"work_W12_policy": "W12 policy",
}
for work in WORK_DEPS:
names[f"work_{work}"] = f"{work} dependencies"
label = names.get(key, f"release contract field {key}")
return f"{label} is {actual!r}; expected {expected!r}"
def _normalize_deps(cell: str) -> tuple[str, ...]:
value = cell.replace("`", "").strip()
if value in {"", "—", "-", "[]"}:
return ()
if value.startswith("[") and value.endswith("]"):
value = value[1:-1]
return tuple(part.strip() for part in value.split(",") if part.strip())
def _normalize_prose(text: str) -> str:
return re.sub(r"\s+", " ", text).strip()
def backend_policy_errors(spec_text: str) -> list[str]:
"""Return drift from the accepted backend release-channel boundaries."""
normalized = _normalize_prose(spec_text)
return [
f"{reason} must remain {statement!r}"
for reason, statement in BACKEND_POLICY_PROSE.items()
if _normalize_prose(statement) not in normalized
]
def _without_line_comments(text: str) -> str:
"""Remove shell comments while preserving quoted hash characters."""
cleaned: list[str] = []
for line in text.splitlines():
quoted = False
escaped = False
kept: list[str] = []
for char in line:
if escaped:
kept.append(char)
escaped = False
continue
if char == "\\" and quoted:
kept.append(char)
escaped = True
continue
if char == '"':
quoted = not quoted
kept.append(char)
continue
if char == "#" and not quoted:
break
kept.append(char)
cleaned.append("".join(kept))
return "\n".join(cleaned)
def _indent(line: str) -> int:
return len(line) - len(line.lstrip())
def _literal_block(lines: list[str], header_index: int) -> list[str]:
parent_indent = _indent(lines[header_index])
raw: list[str] = []
for candidate in lines[header_index + 1 :]:
if not candidate.strip():
raw.append("")
continue
if _indent(candidate) <= parent_indent:
break
raw.append(candidate)
nonblank = [line for line in raw if line.strip()]
if not nonblank:
return []
content_indent = min(_indent(line) for line in nonblank)
return [line[content_indent:] if line.strip() else "" for line in raw]
def _yaml_mapping(
line: str, indent: int, sequence: bool = False
) -> tuple[str, str] | None:
if _indent(line) != indent:
return None
content = line[indent:]
if sequence:
if not content.startswith("-"):
return None
content = content[1:].lstrip()
if not content:
return None
match = re.match(
r"^(?P<key>'[^']*'|\"[^\"]*\"|[^:#]+?)\s*:\s*(?P<value>.*)$",
content,
)
if match is None:
return None
key = match.group("key").strip()
if len(key) >= 2 and key[0] == key[-1] and key[0] in {"'", '"'}:
key = key[1:-1]
return key.strip(), match.group("value").strip()
def _unconditional_ci_run_blocks(text: str) -> list[list[str]]:
"""Return direct run blocks owned by unconditional Actions jobs and steps."""
lines = text.splitlines()
blocks: list[list[str]] = []
jobs_index = next((i for i, line in enumerate(lines) if line == "jobs:"), None)
if jobs_index is None:
return blocks
job_starts = [
i
for i in range(jobs_index + 1, len(lines))
if (mapping := _yaml_mapping(lines[i], 2)) is not None
and mapping[1] == ""
]
for job_pos, job_start in enumerate(job_starts):
job_end = (
job_starts[job_pos + 1]
if job_pos + 1 < len(job_starts)
else len(lines)
)
job_lines = lines[job_start + 1 : job_end]
job_fields = {
mapping[0]
for line in job_lines
if (mapping := _yaml_mapping(line, 4)) is not None
}
if "if" in job_fields:
continue
steps_offset = next(
(
i
for i, line in enumerate(job_lines)
if _yaml_mapping(line, 4) == ("steps", "")
),
None,
)
if steps_offset is None:
continue
steps_start = job_start + 1 + steps_offset + 1
step_starts = [
i
for i in range(steps_start, job_end)
if _indent(lines[i]) == 6 and lines[i][6:].startswith("-")
]
for step_pos, step_start in enumerate(step_starts):
step_end = (
step_starts[step_pos + 1]
if step_pos + 1 < len(step_starts)
else job_end
)
step_fields: dict[str, tuple[str, int]] = {}
first = _yaml_mapping(lines[step_start], 6, sequence=True)
if first is not None:
step_fields[first[0]] = (first[1], step_start)
for index in range(step_start + 1, step_end):
mapping = _yaml_mapping(lines[index], 8)
if mapping is not None:
step_fields[mapping[0]] = (mapping[1], index)
if {"if", "continue-on-error", "shell"} & step_fields.keys():
continue
run = step_fields.get("run")
if run is not None and re.fullmatch(r"\|[-+]?", run[0]):
blocks.append(_literal_block(lines, run[1]))
return blocks
def _direct_commands(block: list[str]) -> list[list[str]] | None:
commands: list[list[str]] = []
for line in block:
stripped = line.strip()
if not stripped or stripped.startswith("#"):
continue
if line != line.lstrip():
return None
try:
argv = shlex.split(stripped, comments=True, posix=True)
except ValueError:
return None
if not argv or any(token in {";", "&&", "||", "|", "&"} for token in argv):
return None
commands.append(argv)
return commands
def _active_ci_commands(ci_text: str) -> set[tuple[str, ...]]:
commands: set[tuple[str, ...]] = set()
for block in _unconditional_ci_run_blocks(ci_text):
parsed = _direct_commands(block)
if parsed is not None:
commands.update(tuple(command) for command in parsed)
return commands
def _ci_has_active_release_step(ci_text: str) -> bool:
expected = [
["python3", "scripts/check-release-binary-contract.py"],
["python3", "tests/scripts/test_check_release_binary_contract.py"],
]
return any(
_direct_commands(block) == expected
for block in _unconditional_ci_run_blocks(ci_text)
)
def _bash_array_values(text: str, name: str) -> list[str] | None:
lines = text.splitlines()
starts = [i for i, line in enumerate(lines) if line.strip() == f"{name}=("]
if len(starts) != 1:
return None
values: list[str] = []
for line in lines[starts[0] + 1 :]:
if line.strip() == ")":
return values
try:
values.extend(shlex.split(line, comments=True, posix=True))
except ValueError:
return None
return None
def _trace_preflight_commands(text: str) -> tuple[int, list[tuple[str, ...]]]:
"""Execute preflight with shims and return every Python argv it owns."""
with tempfile.TemporaryDirectory(prefix="vllm-release-preflight-trace-") as temporary:
root = Path(temporary)
script = root / PREFLIGHT_PATH
script.parent.mkdir(parents=True)
script.write_text(text, encoding="utf-8")
script.chmod(0o700)
(root / ".agents").mkdir()
(root / ".agents/NOW.md").write_text("trace-only\n", encoding="utf-8")
shim_dir = root / "shim"
shim_dir.mkdir()
trace = root / "python.trace"
python = shim_dir / "python3"
python.write_text(
"#!/bin/sh\n"
"printf '%s\\0' \"$@\" >> \"$VLLM_RELEASE_TRACE\"\n"
"printf '\\0' >> \"$VLLM_RELEASE_TRACE\"\n",
encoding="utf-8",
)
python.chmod(0o700)
git = shim_dir / "git"
git.write_text("#!/bin/sh\nexit 1\n", encoding="utf-8")
git.chmod(0o700)
environment = os.environ.copy()
environment["PATH"] = f"{shim_dir}{os.pathsep}{environment.get('PATH', '')}"
environment["VLLM_RELEASE_TRACE"] = str(trace)
result = subprocess.run(
["bash", str(script), "--quiet", "--no-require-role"],
cwd=root,
env=environment,
text=True,
capture_output=True,
check=False,
)
raw = trace.read_bytes() if trace.exists() else b""
invocations = []
for record in raw.split(b"\0\0"):
if record:
invocations.append(
tuple(token.decode("utf-8") for token in record.split(b"\0") if token)
)
return result.returncode, invocations
def wiring_errors(preflight_text: str, ci_text: str) -> list[str]:
"""Require this checker and suite to execute through preflight and CI."""
errors: list[str] = []
uncommented = _without_line_comments(preflight_text)
checkers = _bash_array_values(uncommented, "CHECKERS")
suites = _bash_array_values(uncommented, "SUITES")
if checkers is None or "check-release-binary-contract" not in checkers:
errors.append("release checker is missing from preflight CHECKERS")
if suites is None or "test_check_release_binary_contract" not in suites:
errors.append("release mutation suite is missing from preflight SUITES")
if suites is None or "test_release_manifest" not in suites:
errors.append("W5 manifest suite is missing from preflight SUITES")
if suites is None or "test_release_windows_metadata" not in suites:
errors.append("W15 Windows metadata suite is missing from preflight SUITES")
returncode, invocations = _trace_preflight_commands(preflight_text)
checker_argv = ("scripts/check-release-binary-contract.py",)
suite_argv = ("tests/scripts/test_check_release_binary_contract.py",)
manifest_suite_argv = ("tests/scripts/test_release_manifest.py",)
windows_suite_argv = ("tests/scripts/test_release_windows_metadata.py",)
if invocations.count(checker_argv) != 1:
errors.append("preflight does not execute release CHECKERS through its checker loop")
if invocations.count(suite_argv) != 1:
errors.append("preflight does not execute release SUITES through its suite loop")
if invocations.count(manifest_suite_argv) != 1:
errors.append("preflight does not execute the W5 manifest suite exactly once")
if invocations.count(windows_suite_argv) != 1:
errors.append("preflight does not execute the W15 Windows metadata suite exactly once")
if returncode != 0:
errors.append(f"instrumented preflight execution failed with rc={returncode}")
active = _active_ci_commands(ci_text)
if ("python3", "scripts/check-release-binary-contract.py") not in active:
errors.append("release checker is missing from the explicit CI checker step")
if (
"python3",
"tests/scripts/test_check_release_binary_contract.py",
) not in active:
errors.append("release mutation suite is missing from the explicit CI step")
if ("python3", "tests/scripts/test_release_manifest.py") not in active:
errors.append("W5 manifest suite is missing from an unconditional CI step")
if ("python3", "tests/scripts/test_release_windows_metadata.py") not in active:
errors.append("W15 Windows metadata suite is missing from an unconditional CI step")
if not _ci_has_active_release_step(ci_text):
errors.append(
"CI release step must contain checker and suite as direct active commands"
)
return errors
def _table_record(
root: Path,
relative: str,
prefix: str,
cell_count: int,
label: str,
errors: list[str],