File size: 3,260 Bytes
33672db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Pre-flight check for OpenEnv Hackathon (India 2026) non-negotiables.

Run from repo root:
  python scripts/verify_hackathon_submission.py
"""

from __future__ import annotations

import re
import sys
from pathlib import Path

REPO = Path(__file__).resolve().parent.parent


def _fail(msg: str) -> None:
    print(f"FAIL  {msg}")


def _ok(msg: str) -> None:
    print(f"OK    {msg}")


def main() -> int:
    code = 0

    req = REPO / "requirements.txt"
    if req.is_file() and "openenv-core" in req.read_text(encoding="utf-8"):
        _ok("requirements.txt includes openenv-core (Space Docker installs OpenEnv).")
    else:
        _fail("requirements.txt should include openenv-core (PyPI latest 0.2.x)")
        code = 1

    if (REPO / "openenv.yaml").is_file():
        _ok("openenv.yaml present.")
    else:
        _fail("openenv.yaml missing")
        code = 1

    readme = REPO / "README.md"
    if readme.is_file():
        text = readme.read_text(encoding="utf-8")
        if "huggingface.co/spaces/" in text:
            _ok("README links a Hugging Face Space.")
        else:
            _fail("README should link huggingface.co/spaces/...")
            code = 1
        if "ImmunoOrg_Training_Colab.ipynb" in text:
            _ok("README links Colab notebook.")
        else:
            _fail("README should link ImmunoOrg_Training_Colab.ipynb")
            code = 1
        if "docs.google.com/document" in text or "HF_MINI_BLOG" in text or "youtube.com" in text.lower():
            _ok("README mentions judges doc and/or HF blog / YouTube placeholders.")
        else:
            _fail("Add judges doc URL + HF blog / YouTube URLs (see README resource table).")
            code = 1
    else:
        _fail("README.md missing")
        code = 1

    pngs = list(REPO.glob("evidence*.png"))
    if len(pngs) >= 4:
        _ok(f"Found {len(pngs)} evidence*.png files.")
    else:
        _fail("Expected several evidence*.png files at repo root.")
        code = 1

    grpo_png = REPO / "evidence_grpo_training.png"
    if grpo_png.is_file():
        _ok("evidence_grpo_training.png exists (GRPO plot).")
    else:
        print(
            "WARN  evidence_grpo_training.png missing — after any GRPO run:\n"
            "       python scripts/plot_grpo_log_history.py immunoorg-defender/grpo_log_history.json\n"
            "       (Judges expect training loss/reward plots from a real run; Colab is fine.)"
        )

    if (REPO / "Blog.MD").is_file():
        _ok("Blog.MD present (HF writeup).")
    else:
        _fail("Blog.MD missing (copy BLOG_POST.md to Blog.MD)")
        code = 1

    if (REPO / "BLOG_POST.md").is_file():
        _ok("BLOG_POST.md present (source draft).")
    else:
        _fail("BLOG_POST.md missing")
        code = 1

    if (REPO / "PUBLISH_HACKATHON.md").is_file():
        _ok("PUBLISH_HACKATHON.md present.")
    else:
        _fail("PUBLISH_HACKATHON.md missing")
        code = 1

    print()
    if code == 0:
        print("All automated checks passed. Still manually: publish HF post or YouTube, fill URLs in README, push Space.")
    else:
        print("Fix the items above before submitting.")
    return code


if __name__ == "__main__":
    sys.exit(main())