File size: 36,323 Bytes
a42afee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c55827
c4cc86f
 
 
3704acc
dde2ef0
9c70200
c4cc86f
1b2531c
 
12389c7
1b2531c
 
 
12389c7
db94f6b
1b2531c
5618ed1
 
12389c7
5618ed1
a42afee
 
5267cf0
4f71092
a42afee
9b52e4d
a42afee
c51a5c8
b4d66a1
15bb60a
db1d246
cb3cf77
a42afee
d001e98
1a44ef5
1ed6218
a42afee
8faf8f4
6cd6d32
8faf8f4
a42afee
00b6e59
c050c90
6e2072f
96002ad
c7fd79c
1d01c68
a42afee
44183f3
e301300
5dabf7e
a42afee
 
 
25b1252
efbbd05
a42afee
40a0560
 
c55f706
b09fa54
 
21651a6
916f6e2
9a61006
a42afee
66d036a
45deef7
65b018d
7d6704b
d286817
a42afee
93c739c
4148050
a42afee
 
 
4f71092
40a0560
 
7d6704b
d286817
cac0c17
9b52e4d
 
 
 
 
 
 
a42afee
 
cac0c17
a42afee
cac0c17
cfccffe
 
 
 
 
f902678
 
e1f25e3
566adf7
 
 
a42afee
 
 
 
 
 
 
c7fd79c
 
 
 
 
 
a42afee
 
 
d001e98
7bca22f
1a44ef5
c050c90
93c739c
9b834cf
c4cc86f
1b2531c
 
5618ed1
7bca22f
 
cb3cf77
c050c90
9b834cf
cb3cf77
1b2531c
 
7bca22f
45deef7
9b834cf
cb3cf77
1b2531c
5618ed1
7bca22f
f13b71d
1a44ef5
29f1aaf
7bca22f
29f1aaf
9b834cf
cb3cf77
1b2531c
 
5618ed1
e6fa5d0
45deef7
39c930e
916f6e2
7bca22f
 
4f71092
a42afee
9b52e4d
c51a5c8
b4d66a1
96002ad
00b6e59
1d01c68
e301300
cb3cf77
7998349
25b1252
45deef7
5dabf7e
cac0c17
 
 
 
 
 
 
21651a6
d286817
25b1252
a340c71
a42afee
 
65b018d
a42afee
efbbd05
9a61006
a42afee
a291258
7d6704b
d3ee220
a42afee
 
7eaf431
a0067b9
9b52e4d
 
7eaf431
e301300
25b1252
9b52e4d
7eaf431
 
25b1252
4f71092
 
 
 
 
25b1252
 
 
 
 
 
 
 
 
d001e98
 
 
 
 
 
 
39c930e
 
 
916f6e2
 
 
 
 
 
 
1a44ef5
c050c90
6e2072f
c050c90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1a44ef5
45deef7
 
c050c90
 
 
 
 
 
 
 
1a44ef5
 
 
 
25b1252
 
96002ad
cb3cf77
 
 
 
 
 
 
d001e98
 
96002ad
c51a5c8
b4d66a1
15bb60a
5267cf0
c55f706
b09fa54
 
1ed6218
6cd6d32
1d01c68
44183f3
8faf8f4
29f1aaf
916f6e2
93c739c
45deef7
66d036a
21651a6
00b6e59
cac0c17
5dabf7e
efbbd05
cac0c17
4148050
96002ad
 
a42afee
 
 
 
 
 
 
 
 
ec1d592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a42afee
ec1d592
a42afee
 
 
 
 
 
 
 
 
 
 
1a44ef5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7d6704b
21651a6
 
 
 
7d6704b
 
 
 
 
 
 
 
 
 
 
2be5985
 
 
 
 
 
 
 
 
 
 
 
 
e3007c4
 
 
5bf3f47
e3007c4
 
 
 
 
 
 
 
 
93c739c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e6fa5d0
 
 
 
 
 
 
 
 
 
 
 
 
3c55827
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c4cc86f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1b2531c
 
 
 
 
 
 
 
 
 
 
 
12389c7
1b2531c
 
 
 
 
 
 
 
 
 
db94f6b
 
 
 
 
 
 
 
1b2531c
 
 
 
 
 
 
 
 
 
 
 
 
 
5618ed1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec1d592
 
 
a42afee
 
ec1d592
a42afee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120333b
a42afee
120333b
 
a42afee
 
ec1d592
a42afee
 
 
 
 
 
 
 
 
 
 
 
 
 
ec1d592
a42afee
 
 
 
 
 
 
 
 
 
 
 
ec1d592
a42afee
 
 
7eaf431
 
 
 
 
 
 
b4daf16
7eaf431
2d92d10
b4daf16
7eaf431
ec1d592
7eaf431
 
 
2be5985
 
 
 
 
e3007c4
93c739c
e6fa5d0
3c55827
c4cc86f
1b2531c
 
5618ed1
2be5985
1a44ef5
25b1252
 
 
 
 
 
 
 
 
 
 
 
989ac73
680841f
 
 
989ac73
 
1b2531c
 
5618ed1
989ac73
 
 
 
 
 
 
 
 
 
 
 
 
96002ad
 
 
 
 
 
 
 
 
 
ec1d592
96002ad
 
 
a42afee
 
 
 
 
 
 
 
 
 
 
 
ec1d592
a42afee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7eaf431
 
 
 
 
 
25b1252
 
 
 
 
 
96002ad
 
 
 
 
 
a42afee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Validate parity between the repo and prepared Hugging Face mirrors.

This is a publisher-side check. It compares critical website data, figures, and
validator scripts across the local repo, prepared HF Space bundle, prepared HF
artifact dataset bundle, and prepared HF model bundle before upload.
"""

from __future__ import annotations

import argparse
import hashlib
import json
from datetime import datetime, timezone
from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
DEFAULT_HF_ROOT = ROOT.parent / "hf_publish"
DEFAULT_OUTPUT = ROOT / "docs/data/mirror_parity.json"
QWEN3_FUTURE_TASK_PROBE_RUN_ID = "xperience10m_qwen3_omni_v6_future_task_probes_a100_20260616T143608Z"
QWEN3_RETRIEVAL_TASK_PROBE_RUN_IDS = [
    "xperience10m_qwen3_omni_v6_retrieval_task_probes_a100_20260617T175919Z",
    "xperience10m_qwen3_omni_v6_cross_modal_retrieval_probe_a100_20260618T000000Z",
    "xperience10m_qwen3_omni_v6_camera_view_sync_mosaic_tile_a100_20260619T0305Z",
    "xperience10m_qwen3_omni_v6_sensor_target_probes_a100_20260619T000000Z",
    "xperience10m_qwen3_omni_v6_interaction_text_task15_a100_20260620T010305Z",
]
COSMOS3_SUPER_RETRIEVAL_TASK_PROBE_RUN_IDS = [
    "xperience10m_cosmos3_super_retrieval_task_probes_a100_textonly_prompatch_v2_20260620",
    "xperience10m_cosmos3_nano_retrieval_task_probes_a100_patched_textonly_20260621",
]
COSMOS3_SUPER_FUTURE_TASK_PROBE_RUN_IDS = [
    "xperience10m_cosmos3_super_future_task_probes_a100_textonly_v1_20260620",
    "xperience10m_cosmos3_nano_future_order_misalignment_patched_textonly_20260621",
    "xperience10m_cosmos3_nano_current_subtask_object_relevance_patched_textonly_20260621",
]
COSMOS3_SUPER_INTERACTION_TEXT_TASK_PROBE_RUN_IDS = [
    "xperience10m_cosmos3_super_interaction_text_task15_textonly_v1_20260620T1558Z",
    "xperience10m_cosmos3_nano_interaction_text_task15_patched_textonly_20260621",
]

DATA_FILES = [
    "additional_development_directions.json",
    "audio_ablation_summary.json",
    "artifact_index.json",
    "brand_assets.json",
    "evidence_contract.json",
    "evaluation_protocol.json",
    "figure_index.json",
    "foundation_model_plan.json",
    "live_publication_status.json",
    "language_versions.json",
    "modality_atlas.json",
    "omni_finetune_verified_result.json",
    "omni_model_comparison.json",
    "project_brief.json",
    "project_manifest.json",
    "project_packet.json",
    "public_reader_map.json",
    "project_status.json",
    "publication_audit.json",
    "public_surface_qa.json",
    "qwen3_full_parameter_gates.json",
    "qwen3_v5_v6_comparison.json",
    "quality_gates.json",
    "raw_sample_files.json",
    "rendered_site_check.json",
    "reproducibility_matrix.json",
    "research_roadmap.json",
    "research_roadmap_interactive.json",
    "research_takeaways.json",
    "research_direction_extensions.json",
    "research_directions.json",
    "scope_claims_audit.json",
    "single_episode_explorer.json",
    "source_alignment_audit.json",
    "summary_metrics.json",
    "single_episode_task_model_radar.json",
    "episode128_task_model_radar.json",
    "three_foundation_pipelines.json",
    "two_evidence_lines.json",
    "two_evidence_line_result_summary.json",
    "task_suite_20.json",
    "task_suite_enhancement_128.json",
    "task_surface_integrity.json",
    "task_walkthroughs.json",
    "task_method_20_result_matrix.json",
    "task_method_20_gap_audit.json",
    "task_method_20_source_audit.json",
    "tier2_task_suite.json",
    "unified_task_model_radar.json",
    "website_integrity.json",
    "xperience10m_128_episode_feature_index.json",
    "xperience10m_dataset_card_alignment.json",
]

ASSET_FILES = [
    "charts/audio_ablation_delta.svg",
    "charts/single_episode_task_model_radar.svg",
    "charts/episode128_task_model_radar.svg",
    "charts/tier2_task_suite.svg",
    "charts/unified_task_model_radar.svg",
    "charts/research_direction_coverage.svg",
    "brand/xperience10m-logo-apple-touch.png",
    "brand/xperience10m-logo-favicon-32.png",
    "brand/xperience10m-logo-favicon-64.png",
    "brand/xperience10m-logo-mark.png",
    "brand/xperience10m-logo-mark-192.png",
    "brand/xperience10m-logo-mark-512.png",
    "brand/xperience10m-logo-social-card.png",
    "task_suite_infographic.png",
    "pipeline_diagram.png",
    "pipeline_diagram.svg",
    "task_architectures.png",
    "task_architectures.svg",
    "foundation-pipelines/spatial-intelligence-pipeline.png",
    "foundation-pipelines/human-video-world-model-pipeline.png",
    "foundation-pipelines/vision-language-action-pipeline.png",
    "foundation-pipelines/README.md",
    "foundation-pipelines/prompts.md",
    "foundation-pipelines/source-slides/spatial-intelligence-slide.png",
    "foundation-pipelines/source-slides/human-video-world-model-slide.png",
    "foundation-pipelines/source-slides/vision-language-action-slide.png",
    "foundation-pipelines/source-photos/spatial-intelligence-source.jpg",
    "foundation-pipelines/source-photos/human-video-world-model-source.jpg",
    "foundation-pipelines/source-photos/vision-language-action-source.jpg",
    "modalities/audio.png",
    "modalities/depth.jpg",
    "modalities/inertial.png",
    "modalities/language.png",
    "modalities/motion_capture.png",
    "modalities/pose_slam.png",
    "modalities/video.jpg",
    "raw-sample-preview/fisheye_cam0_preview.mp4",
    "raw-sample-preview/fisheye_cam1_preview.mp4",
    "raw-sample-preview/fisheye_cam2_preview.mp4",
    "raw-sample-preview/fisheye_cam3_preview.mp4",
    "raw-sample-preview/stereo_left_preview.mp4",
    "raw-sample-preview/stereo_right_preview.mp4",
]

SCRIPT_FILES = [
    "omni/analyze_qwen3_omni_errors.py",
    "omni/audit_cosmos3_super_training_contract.py",
    "omni/build_omni_model_comparison.py",
    "omni/build_qwen3_full_parameter_gate_summary.py",
    "omni/build_128_episode_feature_index.py",
    "omni/collect_qwen3_future_task_probe_results.sh",
    "omni/collect_qwen3_retrieval_task_probe_results.sh",
    "omni/collect_cosmos3_super_retrieval_task_probe_results.sh",
    "omni/collect_cosmos3_super_future_task_probe_results.sh",
    "omni/eval_cosmos3_super_interaction_text_task.py",
    "omni/collect_qwen3_v4_release_artifacts.py",
    "omni/defer_cosmos3_super_after_qwen_v4.sh",
    "omni/defer_qwen3_retrieval_after_order_sync.sh",
    "omni/defer_qwen3_fullparam_after_verified_qwen.sh",
    "omni/eval_qwen3_omni_future_task_probes.py",
    "omni/eval_qwen3_omni_retrieval_task_probes.py",
    "omni/eval_cosmos3_super_future_task_probes.py",
    "omni/eval_cosmos3_super_retrieval_task_probes.py",
    "omni/export_cosmos3_camera_pose_targets.py",
    "omni/launch_all_task_model_scoring_when_free.sh",
    "omni/merge_qwen3_omni_future_task_probe_shards.py",
    "omni/merge_qwen3_omni_retrieval_task_probe_shards.py",
    "omni/merge_cosmos3_super_future_task_probe_shards.py",
    "omni/merge_cosmos3_super_interaction_text_task_shards.py",
    "omni/pack_cosmos3_super_action_batch.py",
    "omni/prepare_cosmos3_super_lora_hf_package.py",
    "omni/prepare_qwen3_lora_hf_package.py",
    "omni/patch_qwen3_omni_video_features.py",
    "omni/probe_cosmos3_super_training_readiness.py",
    "omni/run_private_gpu_qwen3_v6_repro_smoke.sh",
    "omni/run_qwen3_omni_future_task_probes_sharded.sh",
    "omni/run_qwen3_omni_retrieval_task_probes_sharded.sh",
    "omni/run_cosmos3_super_future_task_probes_sharded.sh",
    "omni/run_cosmos3_super_retrieval_task_probes_sharded.sh",
    "omni/run_cosmos3_super_interaction_text_task_sharded.sh",
    "omni/score_existing_model_output_task_probes.py",
    "omni/score_model_output_probes.py",
    "omni/run_128_task_baselines.py",
    "omni/build_task_suite_enhancement_128.py",
    "omni/run_cosmos3_super_forward_dynamics_lora.sh",
    "omni/train_cosmos3_super_forward_dynamics_lora.py",
    "audio_ablation_and_raw_upgrade.py",
    "build_artifact_index.py",
    "build_brand_assets.py",
    "build_evaluation_protocol.py",
    "build_figure_index.py",
    "build_quality_gates.py",
    "build_public_surface_qa.py",
    "build_rendered_site_check.py",
    "build_interactive_research_roadmap.py",
    "build_multilingual_public_readmes.py",
    "render_foundation_pipeline_diagrams.py",
    "build_single_episode_explorer.py",
    "build_task_method_20_gap_audit.py",
    "build_research_takeaways.py",
    "export_modality_atlas_assets.py",
    "generate_visualizations.py",
    "render_overview_figures.py",
    "render_task_suite_infographic.py",
    "research_direction_taxonomy.py",
    "task_display.py",
    "task_walkthroughs.py",
    "build_unified_task_suite.py",
    "build_unified_task_model_radar.py",
    "single_episode_diagnostics.py",
    "verify_live_publication.py",
    "validate_mirror_parity.py",
    "validate_publication_package.py",
    "validate_task_method_matrix_sources.py",
    "validate_scope_claims.py",
    "validate_source_alignment.py",
    "validate_task_surface.py",
    "validate_website_integrity.py",
    "sync_hf_publish_mirrors.py",
    "tier2_task_suite.py",
    "publish_hf_bundles.py",
]

WEBSITE_FILES = [
    "404.html",
    "apple-touch-icon.png",
    "favicon.png",
    "index.html",
    "research_roadmap.html",
    "single_episode_explorer.html",
    "site.webmanifest",
]

RESULT_FILES = [
    "audio_ablation/AUDIO_ABLATION_SUMMARY.md",
    "audio_ablation/audio_ablation_metrics.csv",
    "audio_ablation/audio_ablation_summary.json",
    "audio_ablation/audio_delta_summary.csv",
    "audio_ablation/raw_logmel_fisheye_cam0_sr16000_mels64_fft512_hop160.npz",
    "single_episode_diagnostics/provenance.json",
    "single_episode_diagnostics/README.md",
    "single_episode_diagnostics/modality_ablation/ablation_metrics.csv",
    "single_episode_diagnostics/modality_ablation/ablation_summary.json",
    "single_episode_diagnostics/object_labels/object_vocab.json",
    "single_episode_diagnostics/object_labels/window_object_labels.csv",
    "single_episode_diagnostics/timeline_overlay/timeline_overlay.csv",
    "single_episode_diagnostics/alignment_stress/alignment_shift_metrics.csv",
    "single_episode_diagnostics/alignment_stress/alignment_stress_summary.json",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/ERROR_ANALYSIS.md",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/error_analysis_summary.json",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/episode_error_analysis.csv",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/action_family_error_analysis.csv",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/train_seen_error_analysis.csv",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/missing_modality_error_analysis.csv",
    "omni_finetune/verified_public/xperience10m_qwen3_omni_128ep_96train_16val_16test_valmon_20260605_eval/analysis/object_category_error_analysis.csv",
    "omni_finetune/multi_episode_128_task_baselines/BASELINE_ALIGNMENT_REPORT.md",
    "omni_finetune/multi_episode_128_task_baselines/summary_report.json",
    "omni_finetune/multi_episode_128_task_baselines/task_metrics.csv",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/ENHANCEMENT_REPORT.md",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/dense_window_scenarios.csv",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/enhancement_plan.json",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/experiment_backlog.json",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/hierarchical_target_contract.json",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/qwen_action_family_error_summary.csv",
    "omni_finetune/task_suite_enhancement_128_v1_20260608/task_bottlenecks.csv",
    "omni_finetune/OMNI_MODEL_COMPARISON.md",
    "omni_finetune/QWEN3_FULL_PARAMETER_GATES_20260609.md",
    "omni_finetune/QWEN3_V5_V6_COMPARISON_20260614.md",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_smoke_preemptible_8gpu_20260609/fullparam_feasibility_summary.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_smoke_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_smoke_preemptible_8gpu_20260609/training_metadata.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_smoke_preemptible_8gpu_20260609/RUN_REPORT.md",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_shorttrain8_preemptible_8gpu_20260609/fullparam_shorttrain8_summary.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_shorttrain8_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_shorttrain8_preemptible_8gpu_20260609/launch_status.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot32_preemptible_8gpu_20260609/fullparam_pilot32_summary.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot32_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot32_preemptible_8gpu_20260609/launch_status.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/fullparam_pilot64_summary.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/training_metadata.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/RUN_REPORT.md",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/config.yaml",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot64_preemptible_8gpu_20260609/launch_status.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_preemptible_8gpu_20260609/fullparam_pilot128_summary.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_preemptible_8gpu_20260609/launch_status.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_after_qwen_v5_preemptible_8gpu_20260609/progress.jsonl",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_after_qwen_v5_preemptible_8gpu_20260609/config.yaml",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_after_qwen_v5_preemptible_8gpu_20260609/training_metadata.json",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_after_qwen_v5_preemptible_8gpu_20260609/RUN_REPORT.md",
    "omni_finetune/xperience10m_qwen3_omni_128ep_fullparam_pilot128_after_qwen_v5_preemptible_8gpu_20260609/launch_status.jsonl",
    "omni_finetune/HF_UPLOAD.md",
    "omni_finetune/model_output_probe_readiness/model_output_probe_readiness.json",
    "omni_finetune/model_output_probe_readiness/RUN_REPORT.md",
    "omni_finetune/xperience10m_cosmos3_super_training_readiness_20260607/training_readiness.json",
    "omni_finetune/xperience10m_cosmos3_super_training_readiness_20260607/RUN_REPORT.md",
    "omni_finetune/xperience10m_cosmos3_super_training_readiness_metadata_a100_20260609/training_readiness.json",
    "omni_finetune/xperience10m_cosmos3_super_training_readiness_metadata_a100_20260609/RUN_REPORT.md",
    "omni_finetune/xperience10m_cosmos3_super_training_contract_audit_camera_pose_20260608/training_contract_audit.json",
    "omni_finetune/xperience10m_cosmos3_super_training_contract_audit_camera_pose_20260608/RUN_REPORT.md",
    "omni_finetune/xperience10m_cosmos3_super_action_packer_schema_smoke_20260608/packer_summary.json",
    "omni_finetune/xperience10m_cosmos3_super_action_packer_schema_smoke_20260608/RUN_REPORT.md",
    "omni_finetune/verified_public/xperience10m_cosmos3_nano_128ep_future_window_h5_compat_adapter_eval_test_full/verified_result_summary.json",
    "omni_finetune/verified_public/xperience10m_cosmos3_nano_128ep_future_window_h5_compat_adapter_eval_test_full/PUBLIC_RESULT_SUMMARY.md",
    "omni_finetune/verified_public/xperience10m_cosmos3_nano_128ep_future_window_h5_compat_adapter_eval_test_full/eval/metrics.json",
    "omni_finetune/verified_public/xperience10m_cosmos3_nano_128ep_future_window_h5_compat_adapter_eval_test_full/eval/RUN_REPORT.md",
]

DOC_FILES = [
    "README.zh.md",
    "README.es.md",
    "README.fr.md",
    "README.de.md",
    "README.ja.md",
    "README.ko.md",
    "README.pt.md",
    "ARTIFACT_GUIDE.md",
    "OMNI_MODEL_EXTENSION_CONTRACT.md",
    "QUALITY_GATES.md",
    "EVALUATION_PROTOCOL.md",
    "FIGURE_INDEX.md",
    "FOUNDATION_MODEL_PLAN.md",
    "ADDITIONAL_DEVELOPMENT_DIRECTIONS.md",
    "THREE_FOUNDATION_PIPELINES.md",
    "TWO_EVIDENCE_LINES.md",
    "TWO_EVIDENCE_LINE_RESULT_SUMMARY.md",
    "PROJECT_BRIEF.md",
    "PUBLIC_READER_MAP.md",
    "RENDERED_SITE_CHECK.md",
    "RESEARCH_ROADMAP.md",
    "PROJECT_STATUS.md",
    "REPRODUCIBILITY.md",
    "TASK_SUITE_ENHANCEMENT_128.md",
    "XPERIENCE10M_128_EPISODE_FEATURE_INDEX.md",
    "TASK_METHOD_20_GAP_AUDIT.md",
    "TASK_METHOD_20_RESULT_MATRIX.md",
    "TASK_SUITE_20.md",
    "PUBLIC_SURFACE_QA.md",
    "EVIDENCE_CONTRACT.md",
    "RESEARCH_TAKEAWAYS.md",
    "SOURCE_ALIGNMENT_AUDIT.md",
    "XPERIENCE_EMBODIED_FOUNDATION_MODEL_PRETRAINING.md",
    "XPERIENCE10M_DATASET_CARD_ALIGNMENT.md",
]


def sha256(path: Path) -> str:
    digest = hashlib.sha256()
    with path.open("rb") as handle:
        for chunk in iter(lambda: handle.read(1024 * 1024), b""):
            digest.update(chunk)
    return digest.hexdigest()


def display_path(path: Path, hf_root: Path) -> str:
    resolved = path.resolve()
    bases = [
        ("hf_space", hf_root / "space"),
        ("hf_artifacts", hf_root / "artifacts"),
        ("hf_model", hf_root / "model"),
        ("repo", ROOT),
        ("hf_publish", hf_root),
    ]
    for label, base in bases:
        try:
            return f"{label}:{resolved.relative_to(base.resolve()).as_posix()}"
        except ValueError:
            continue
    return path.name


def file_record(path: Path, hf_root: Path) -> dict:
    record = {
        "path": display_path(path, hf_root),
        "exists": path.exists(),
    }
    if path.exists() and path.is_file():
        record["bytes"] = path.stat().st_size
        record["sha256"] = sha256(path)
    else:
        record["bytes"] = 0
        record["sha256"] = None
    return record


def verified_public_result_files() -> list[str]:
    """Return every public-safe file from verified model packages.

    Verified packages are already sanitized by the package audit; mirroring the
    whole package prevents final model results from being silently omitted when a
    new run lands under results/omni_finetune/verified_public.
    """

    verified_root = ROOT / "results/omni_finetune/verified_public"
    if not verified_root.exists():
        return []
    files: list[str] = []
    for path in verified_root.rglob("*"):
        if not path.is_file():
            continue
        files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def tier2_result_files() -> list[str]:
    """Return every generated public-safe artifact for tasks 13-20.

    The directory name is historical and kept for stable public links.
    """

    tier2_root = ROOT / "results/episode_task_suite/tier2_task_suite"
    if not tier2_root.exists():
        return []
    files: list[str] = []
    for path in tier2_root.rglob("*"):
        if path.is_file():
            files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def a100_128_metadata_result_files() -> list[str]:
    """Return the public-safe 128-episode metadata baseline rerun artifacts."""

    result_root = ROOT / "results/omni_finetune/a100_128_metadata_task_baselines_20260616_v2"
    if not result_root.exists():
        return []
    files: list[str] = []
    for path in result_root.rglob("*"):
        if path.is_file():
            files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def a100_128_raw20_result_files() -> list[str]:
    """Return public-safe 128-episode raw-feature 20-task baseline artifacts."""

    result_root = ROOT / "results/omni_finetune/a100_128_raw20_task_baselines_complete20_proxy_20260616T091500Z"
    if not result_root.exists():
        return []
    files: list[str] = []
    for path in result_root.rglob("*"):
        if path.is_file():
            files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def xperience10m_128_data_feature_files() -> list[str]:
    """Return selected 128-episode source and processed-feature artifacts."""

    explicit = [
        ROOT / "results/omni_finetune/xperience10m_128_episode_selection.json",
        ROOT / "results/omni_finetune/xperience10m_128_episode_selection.csv",
        ROOT / "results/omni_finetune/xperience10m_128_episode_download_files.txt",
        ROOT / "results/omni_finetune/episode_manifest.json",
        ROOT / "results/omni_finetune/dataset_manifest.json",
        ROOT / "results/omni_finetune/multi_episode_128_task_baselines/metadata_feature_matrix.npz",
        ROOT / "results/omni_finetune/a100_128_metadata_task_baselines_20260616_v2/metadata_feature_matrix.npz",
    ]
    dense_root = ROOT / "results/omni_finetune/xperience10m_128ep_dense_multiscale_hierarchical_v1_20260608"
    files: list[str] = []
    for path in explicit:
        if path.is_file():
            files.append(path.relative_to(ROOT / "results").as_posix())
    if dense_root.exists():
        for path in dense_root.rglob("*"):
            if path.is_file():
                files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(set(files))


def model_output_task_probe_result_files() -> list[str]:
    """Return task-specific scores derived from existing verified model outputs."""

    result_root = ROOT / "results/omni_finetune/model_output_task_probes_20260616"
    if not result_root.exists():
        return []
    files: list[str] = []
    for path in result_root.rglob("*"):
        if path.is_file():
            files.append(path.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def qwen3_future_task_probe_result_files() -> list[str]:
    """Return public-safe Qwen3 future-task probe outputs from the shard run."""

    result_root = ROOT / "results/omni_finetune" / QWEN3_FUTURE_TASK_PROBE_RUN_ID
    files: list[str] = []
    if result_root.exists():
        for path in result_root.rglob("*"):
            if path.is_file():
                files.append(path.relative_to(ROOT / "results").as_posix())

    launcher_log = (
        ROOT
        / "results/omni_finetune/deferred_launchers"
        / f"{QWEN3_FUTURE_TASK_PROBE_RUN_ID}.launcher.log"
    )
    if launcher_log.is_file():
        files.append(launcher_log.relative_to(ROOT / "results").as_posix())
    return sorted(files)


def qwen3_retrieval_task_probe_result_files() -> list[str]:
    """Return public-safe Qwen3 retrieval probe outputs from task 08/09 runs."""

    files: list[str] = []
    for run_id in QWEN3_RETRIEVAL_TASK_PROBE_RUN_IDS:
        result_root = ROOT / "results/omni_finetune" / run_id
        if result_root.exists():
            for path in result_root.rglob("*"):
                if path.is_file():
                    files.append(path.relative_to(ROOT / "results").as_posix())

        launch_log = ROOT / "results/omni_finetune/deferred_launchers" / f"{run_id}.launch.log"
        if launch_log.is_file():
            files.append(launch_log.relative_to(ROOT / "results").as_posix())
        direct_launch_log = ROOT / "results/omni_finetune/deferred_launchers" / f"{run_id}.launcher.log"
        if direct_launch_log.is_file():
            files.append(direct_launch_log.relative_to(ROOT / "results").as_posix())
    return sorted(set(files))


def cosmos3_super_retrieval_task_probe_result_files() -> list[str]:
    """Return public-safe Cosmos3-Super retrieval probe outputs."""

    files: list[str] = []
    compact_names = {"RUN_REPORT.md", "collection_validation.json", "metrics.json", "server_info.json", "summary.json"}
    for run_id in COSMOS3_SUPER_RETRIEVAL_TASK_PROBE_RUN_IDS:
        result_root = ROOT / "results/omni_finetune" / run_id
        if result_root.exists():
            for path in result_root.rglob("*"):
                if path.is_file() and (path.name in compact_names or path.name.endswith(".progress.jsonl")):
                    files.append(path.relative_to(ROOT / "results").as_posix())

        for suffix in ("launch", "launcher", "retrieval", "runner"):
            launch_log = ROOT / "results/omni_finetune/deferred_launchers" / f"{run_id}.{suffix}.log"
            if launch_log.is_file():
                files.append(launch_log.relative_to(ROOT / "results").as_posix())
    return sorted(set(files))


def cosmos3_super_future_task_probe_result_files() -> list[str]:
    """Return public-safe Cosmos3-Super future-task probe outputs."""

    files: list[str] = []
    compact_names = {
        "RUN_REPORT.md",
        "collection_validation.json",
        "metrics.json",
        "per_class_metrics.csv",
        "server_info.json",
        "summary.json",
    }
    for run_id in COSMOS3_SUPER_FUTURE_TASK_PROBE_RUN_IDS:
        result_root = ROOT / "results/omni_finetune" / run_id
        if result_root.exists():
            for path in result_root.rglob("*"):
                if path.is_file() and (path.name in compact_names or path.name.endswith(".progress.jsonl")):
                    files.append(path.relative_to(ROOT / "results").as_posix())

        for suffix in ("launch", "launcher", "runner"):
            launch_log = ROOT / "results/omni_finetune/deferred_launchers" / f"{run_id}.{suffix}.log"
            if launch_log.is_file():
                files.append(launch_log.relative_to(ROOT / "results").as_posix())
    return sorted(set(files))


def cosmos3_super_interaction_text_task_probe_result_files() -> list[str]:
    """Return public-safe Cosmos3-Super task-15 interaction-text probe outputs."""

    files: list[str] = []
    compact_names = {
        "RUN_REPORT.md",
        "collection_validation.json",
        "confusion_matrix.csv",
        "launch_env.txt",
        "metrics.json",
        "per_class_metrics.csv",
        "server_info.json",
        "summary.json",
    }
    for run_id in COSMOS3_SUPER_INTERACTION_TEXT_TASK_PROBE_RUN_IDS:
        result_root = ROOT / "results/omni_finetune" / run_id
        if result_root.exists():
            for path in result_root.rglob("*"):
                if path.is_file() and (path.name in compact_names or path.name.endswith(".progress.jsonl")):
                    files.append(path.relative_to(ROOT / "results").as_posix())

        for suffix in ("launch", "launcher", "runner"):
            launch_log = ROOT / "results/omni_finetune/deferred_launchers" / f"{run_id}.{suffix}.log"
            if launch_log.is_file():
                files.append(launch_log.relative_to(ROOT / "results").as_posix())
    return sorted(set(files))


def parity_group(name: str, local_path: Path, mirrors: dict[str, Path], hf_root: Path) -> dict:
    local = file_record(local_path, hf_root)
    mirror_records = {surface: file_record(path, hf_root) for surface, path in mirrors.items()}
    failures = []
    if not local["exists"]:
        failures.append({"surface": "repo", "kind": "missing", "path": local["path"]})
    for surface, record in mirror_records.items():
        if not record["exists"]:
            failures.append({"surface": surface, "kind": "missing", "path": record["path"]})
            continue
        if local["exists"] and record["sha256"] != local["sha256"]:
            failures.append(
                {
                    "surface": surface,
                    "kind": "hash_mismatch",
                    "path": record["path"],
                    "expected_sha256": local["sha256"],
                    "actual_sha256": record["sha256"],
                }
            )
    return {
        "name": name,
        "status": "pass" if not failures else "fail",
        "local": local,
        "mirrors": mirror_records,
        "failures": failures,
    }


def build_report(hf_root: Path) -> dict:
    groups = []

    for filename in DATA_FILES:
        groups.append(
            parity_group(
                f"data/{filename}",
                ROOT / "docs/data" / filename,
                {
                    "hf_space": hf_root / "space/data" / filename,
                    "hf_artifacts_data": hf_root / "artifacts/data" / filename,
                    "hf_artifacts": hf_root / "artifacts/docs/data" / filename,
                    "hf_model_data": hf_root / "model/data" / filename,
                    "hf_model_docs_data": hf_root / "model/docs/data" / filename,
                    "hf_model": hf_root / "model/metrics" / filename,
                },
                hf_root,
            )
        )

    for filename in ASSET_FILES:
        groups.append(
            parity_group(
                f"assets/{filename}",
                ROOT / "docs/assets" / filename,
                {
                    "hf_space": hf_root / "space/assets" / filename,
                    "hf_artifacts_docs": hf_root / "artifacts/docs/assets" / filename,
                    "hf_artifacts_card": hf_root / "artifacts/assets" / filename,
                    "hf_model": hf_root / "model/assets" / filename,
                },
                hf_root,
            )
        )

    for filename in SCRIPT_FILES:
        groups.append(
            parity_group(
                f"scripts/{filename}",
                ROOT / "scripts" / filename,
                {
                    "hf_artifacts": hf_root / "artifacts/scripts" / filename,
                    "hf_model": hf_root / "model/scripts" / filename,
                },
                hf_root,
            )
        )

    for filename in WEBSITE_FILES:
        groups.append(
            parity_group(
                f"website/{filename}",
                ROOT / "docs" / filename,
                {
                    "hf_space": hf_root / "space" / filename,
                    "hf_artifacts_root": hf_root / "artifacts" / filename,
                    "hf_artifacts_docs": hf_root / "artifacts/docs" / filename,
                    "hf_model": hf_root / "model" / filename,
                    "hf_model_docs": hf_root / "model/docs" / filename,
                },
                hf_root,
            )
        )

    result_files = sorted(
        set(RESULT_FILES)
        | set(verified_public_result_files())
        | set(tier2_result_files())
        | set(a100_128_metadata_result_files())
        | set(a100_128_raw20_result_files())
        | set(xperience10m_128_data_feature_files())
        | set(model_output_task_probe_result_files())
        | set(qwen3_future_task_probe_result_files())
        | set(qwen3_retrieval_task_probe_result_files())
        | set(cosmos3_super_retrieval_task_probe_result_files())
        | set(cosmos3_super_future_task_probe_result_files())
        | set(cosmos3_super_interaction_text_task_probe_result_files())
    )
    for filename in result_files:
        groups.append(
            parity_group(
                f"results/{filename}",
                ROOT / "results" / filename,
                {
                    "hf_artifacts": hf_root / "artifacts/results" / filename,
                    "hf_model": hf_root / "model/results" / filename,
                },
                hf_root,
            )
        )

    space_result_files = sorted(
        set(RESULT_FILES)
        | set(tier2_result_files())
        | set(model_output_task_probe_result_files())
        | set(qwen3_future_task_probe_result_files())
        | set(qwen3_retrieval_task_probe_result_files())
        | set(cosmos3_super_retrieval_task_probe_result_files())
        | set(cosmos3_super_future_task_probe_result_files())
        | set(cosmos3_super_interaction_text_task_probe_result_files())
    )
    for filename in space_result_files:
        groups.append(
            parity_group(
                f"space_results/{filename}",
                ROOT / "results" / filename,
                {
                    "hf_space": hf_root / "space/results" / filename,
                },
                hf_root,
            )
        )

    for filename in DOC_FILES:
        groups.append(
            parity_group(
                f"docs/{filename}",
                ROOT / filename,
                {
                    "hf_space": hf_root / "space" / filename,
                    "hf_artifacts": hf_root / "artifacts" / filename,
                    "hf_model": hf_root / "model" / filename,
                },
                hf_root,
            )
        )

    failures = [
        {"group": group["name"], **failure}
        for group in groups
        for failure in group["failures"]
    ]
    by_surface: dict[str, int] = {}
    for failure in failures:
        by_surface[failure["surface"]] = by_surface.get(failure["surface"], 0) + 1

    return {
        "status": "pass" if not failures else "fail",
        "generated_at_utc": datetime.now(timezone.utc).isoformat(timespec="seconds"),
        "hf_root": "hf_publish",
        "summary": {
            "group_count": len(groups),
            "failure_count": len(failures),
            "failures_by_surface": by_surface,
        },
        "checks": [
            {
                "name": "repo_hf_space_artifact_model_data_parity",
                "status": "pass"
                if not any(failure["group"].startswith("data/") for failure in failures)
                else "fail",
            },
            {
                "name": "repo_hf_visual_asset_parity",
                "status": "pass"
                if not any(failure["group"].startswith("assets/") for failure in failures)
                else "fail",
            },
            {
                "name": "repo_hf_validator_script_parity",
                "status": "pass"
                if not any(failure["group"].startswith("scripts/") for failure in failures)
                else "fail",
            },
            {
                "name": "repo_hf_website_html_parity",
                "status": "pass"
                if not any(failure["group"].startswith("website/") for failure in failures)
                else "fail",
            },
            {
                "name": "repo_hf_diagnostic_result_parity",
                "status": "pass"
                if not any(failure["group"].startswith("results/") for failure in failures)
                else "fail",
            },
            {
                "name": "repo_hf_quality_doc_parity",
                "status": "pass"
                if not any(failure["group"].startswith("docs/") for failure in failures)
                else "fail",
            },
        ],
        "groups": groups,
        "failures": failures,
    }


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--hf-root", type=Path, default=DEFAULT_HF_ROOT)
    parser.add_argument("--output", type=Path, default=DEFAULT_OUTPUT)
    args = parser.parse_args()

    report = build_report(args.hf_root.resolve())
    args.output.parent.mkdir(parents=True, exist_ok=True)
    args.output.write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8")
    print(f"{report['status'].upper()}: wrote {args.output}")
    if report["status"] != "pass":
        for failure in report["failures"][:40]:
            print(f"- {failure['group']}: {failure['surface']} {failure['kind']} {failure['path']}")
        if len(report["failures"]) > 40:
            print(f"- ... {len(report['failures']) - 40} more failures")
        return 1
    return 0


if __name__ == "__main__":
    raise SystemExit(main())