phase7 P0 r3: pin train_3a fetch to lineage repo URL matching the sha recorded in eval_v1v2.json
Browse files- phase7/p0_bootstrap.py +14 -2
phase7/p0_bootstrap.py
CHANGED
|
@@ -13,12 +13,18 @@ Also writes manifests.json: pinned revisions (git SHAs) of every repo in the sui
|
|
| 13 |
sha256 of every eval parquet, train_3a.py sha (verified), eval_v1v2.json sha, and a
|
| 14 |
suite_hash over the whole manifest. Locked-split read-once discipline: this job reads only
|
| 15 |
already-published aggregates; the locked split itself is not touched.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
"""
|
| 17 |
import hashlib, json, os, urllib.request
|
| 18 |
import numpy as np
|
| 19 |
from huggingface_hub import HfApi, hf_hub_download
|
| 20 |
|
| 21 |
WORKBENCH = "luispoveda93/sharky-workbench"
|
|
|
|
| 22 |
STATES = "luispoveda93/sharky-triage-states"
|
| 23 |
DEC = ["benign", "suspicious", "malicious"]
|
| 24 |
SHA3A = "5c8c0f0ca3e88b9d655ae80a9cfe48a2a289d35cecd7695668c4579f7a8ccb5b"
|
|
@@ -29,9 +35,13 @@ os.makedirs(OUT, exist_ok=True)
|
|
| 29 |
rng = np.random.default_rng(SEED)
|
| 30 |
api = HfApi()
|
| 31 |
|
| 32 |
-
# --- provenance: train_3a.py byte-exactness (the project's pinned-script protocol)
|
|
|
|
| 33 |
src = urllib.request.urlopen(
|
| 34 |
-
"https://huggingface.co/datasets/" +
|
|
|
|
|
|
|
|
|
|
| 35 |
got = hashlib.sha256(src).hexdigest()
|
| 36 |
assert got == SHA3A, f"train_3a sha mismatch: {got}"
|
| 37 |
print("TRAIN3A_SHA_OK", got, flush=True)
|
|
@@ -115,6 +125,8 @@ manifest = {
|
|
| 115 |
"record-clustered paired bootstrap arrives with the GPU pass)"},
|
| 116 |
"pinned": {
|
| 117 |
"train_3a_sha256": got,
|
|
|
|
|
|
|
| 118 |
"eval_v1v2_sha256": ev_sha,
|
| 119 |
"datasets": {
|
| 120 |
STATES: {"revision": rev(STATES),
|
|
|
|
| 13 |
sha256 of every eval parquet, train_3a.py sha (verified), eval_v1v2.json sha, and a
|
| 14 |
suite_hash over the whole manifest. Locked-split read-once discipline: this job reads only
|
| 15 |
already-published aggregates; the locked split itself is not touched.
|
| 16 |
+
|
| 17 |
+
train_3a provenance note: eval_v1v2.json pins train3a_sha256=5c8c0f0c…, which is the file as
|
| 18 |
+
fetched from the LINEAGE repo (minicpm4-pcap-kev-workbench). The renamed sharky-workbench
|
| 19 |
+
copy hashes differently (4a34439d…) — the rename is not byte-identical for this file, so the
|
| 20 |
+
pinned lineage URL is the authoritative fetch target.
|
| 21 |
"""
|
| 22 |
import hashlib, json, os, urllib.request
|
| 23 |
import numpy as np
|
| 24 |
from huggingface_hub import HfApi, hf_hub_download
|
| 25 |
|
| 26 |
WORKBENCH = "luispoveda93/sharky-workbench"
|
| 27 |
+
WORKBENCH_LINEAGE = "luispoveda93/minicpm4-pcap-kev-workbench"
|
| 28 |
STATES = "luispoveda93/sharky-triage-states"
|
| 29 |
DEC = ["benign", "suspicious", "malicious"]
|
| 30 |
SHA3A = "5c8c0f0ca3e88b9d655ae80a9cfe48a2a289d35cecd7695668c4579f7a8ccb5b"
|
|
|
|
| 35 |
rng = np.random.default_rng(SEED)
|
| 36 |
api = HfApi()
|
| 37 |
|
| 38 |
+
# --- provenance: train_3a.py byte-exactness (the project's pinned-script protocol).
|
| 39 |
+
# Fetch from the lineage repo (the URL phase6 actually used) and assert the recorded sha.
|
| 40 |
src = urllib.request.urlopen(
|
| 41 |
+
"https://huggingface.co/datasets/" + WORKBENCH_LINEAGE + "/resolve/main/phase3a/train_3a.py"
|
| 42 |
+
if False else
|
| 43 |
+
"https://huggingface.co/datasets/luispoveda93/minicpm4-pcap-kev-workbench/resolve/main/phase3a/train_3a.py"
|
| 44 |
+
).read()
|
| 45 |
got = hashlib.sha256(src).hexdigest()
|
| 46 |
assert got == SHA3A, f"train_3a sha mismatch: {got}"
|
| 47 |
print("TRAIN3A_SHA_OK", got, flush=True)
|
|
|
|
| 125 |
"record-clustered paired bootstrap arrives with the GPU pass)"},
|
| 126 |
"pinned": {
|
| 127 |
"train_3a_sha256": got,
|
| 128 |
+
"train_3a_fetched_from": "https://huggingface.co/datasets/luispoveda93/minicpm4-pcap-kev-workbench/resolve/main/phase3a/train_3a.py",
|
| 129 |
+
"train_3a_renamed_copy_sha256": "4a34439dfad008f49f5f830d5bdbeaea6522eac90fbf43065798a46a919bd7d7",
|
| 130 |
"eval_v1v2_sha256": ev_sha,
|
| 131 |
"datasets": {
|
| 132 |
STATES: {"revision": rev(STATES),
|