neurarch 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/bin/neurarch.mjs +16 -1
- package/bin/scan.mjs +255 -0
- package/bin/templateCheck.mjs +99 -0
- package/bin/weightsDiff.mjs +35 -0
- package/engine.bundle.mjs +5749 -1054
- package/package.json +1 -1
- package/policy.bundle.mjs +446 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neurarch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The pre-check for an open-weight model change, before it takes a GPU or traffic: training peak memory, the smallest card that holds it and what a run costs, whether a parallel layout is legal and balanced (`neurarch layout`), whether a serving launch will start (`neurarch serve-check`), and whether the data fits the config, all read from a Hugging Face config or a traced graph. `neurarch rightsize jobs.csv` puts each past job's request next to what it needed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
package/policy.bundle.mjs
CHANGED
|
@@ -7231,6 +7231,7 @@ var PIN_RULE_META = {
|
|
|
7231
7231
|
"pin/hf-floating-revision": { code: "NX-PIN-002", severity: "warn", bandit: "B615", summary: "A Hugging Face download names a branch or tag (main, v1.0, refs/pr/1), which can be moved, instead of a commit." },
|
|
7232
7232
|
"pin/hf-unpinned-dynamic": { code: "NX-PIN-003", severity: "info", bandit: "B615", summary: "A Hugging Face download takes its repo id from a variable and has no revision; if the value is a Hub id, it is not pinned." }
|
|
7233
7233
|
};
|
|
7234
|
+
var KEEP_PINNED = false;
|
|
7234
7235
|
var HEX7 = /^[0-9a-fA-F]{7,}$/;
|
|
7235
7236
|
var HUB_ID = /^[A-Za-z0-9][\w.-]*(?:\/[\w.-]+)?$/;
|
|
7236
7237
|
var LOCAL = /^(?:\.{1,2}\/|\/|~)/;
|
|
@@ -7375,7 +7376,7 @@ function pyImports(toks) {
|
|
|
7375
7376
|
}
|
|
7376
7377
|
return m;
|
|
7377
7378
|
}
|
|
7378
|
-
var HF_MODULES = ["transformers", "datasets", "huggingface_hub", "diffusers", "peft"];
|
|
7379
|
+
var HF_MODULES = ["transformers", "datasets", "huggingface_hub", "diffusers", "peft", "sentence_transformers"];
|
|
7379
7380
|
var isHfOrigin = (origin) => !!origin && HF_MODULES.includes(origin.split(".")[0]);
|
|
7380
7381
|
function pyArgs(toks, open) {
|
|
7381
7382
|
const args = [];
|
|
@@ -7419,7 +7420,13 @@ var CALLS = {
|
|
|
7419
7420
|
load_dataset: { repoKw: ["path"], repoPos: 0, repoType: "dataset" },
|
|
7420
7421
|
hf_hub_download: { repoKw: ["repo_id"], repoPos: 0, repoType: "model" },
|
|
7421
7422
|
snapshot_download: { repoKw: ["repo_id"], repoPos: 0, repoType: "model" },
|
|
7422
|
-
pipeline: { repoKw: ["model"], repoPos: 1, repoType: "model" }
|
|
7423
|
+
pipeline: { repoKw: ["model"], repoPos: 1, repoType: "model" },
|
|
7424
|
+
// sentence-transformers downloads from the Hub too, and is how most embedding
|
|
7425
|
+
// models with remote code are loaded (167 of 353 public files sampled on
|
|
7426
|
+
// 2026-11-17 that name one of the cross-repository models).
|
|
7427
|
+
SentenceTransformer: { repoKw: ["model_name_or_path"], repoPos: 0, repoType: "model" },
|
|
7428
|
+
CrossEncoder: { repoKw: ["model_name_or_path", "model_name"], repoPos: 0, repoType: "model" },
|
|
7429
|
+
SparseEncoder: { repoKw: ["model_name_or_path"], repoPos: 0, repoType: "model" }
|
|
7423
7430
|
};
|
|
7424
7431
|
var lineAt = (starts, off) => {
|
|
7425
7432
|
let lo = 0;
|
|
@@ -7437,14 +7444,57 @@ var lineStarts = (src) => {
|
|
|
7437
7444
|
return s;
|
|
7438
7445
|
};
|
|
7439
7446
|
var NOSEC = /#\s*nosec\b(?!\s*:?\s*[A-Z]\d)|#\s*nosec\b[^\n]*\bB615\b/;
|
|
7447
|
+
function pyStringConstants(toks) {
|
|
7448
|
+
const seen = /* @__PURE__ */ new Map();
|
|
7449
|
+
let depth = 0;
|
|
7450
|
+
for (let k = 0; k < toks.length; k++) {
|
|
7451
|
+
const t = toks[k];
|
|
7452
|
+
if (t.t === "op" && "([{".includes(t.v)) depth++;
|
|
7453
|
+
else if (t.t === "op" && ")]}".includes(t.v)) depth = Math.max(0, depth - 1);
|
|
7454
|
+
if (depth || t.t !== "name" || toks[k + 1]?.t !== "op" || toks[k + 1].v !== "=") continue;
|
|
7455
|
+
if (k > 0 && toks[k - 1].t === "op" && toks[k - 1].v === ".") continue;
|
|
7456
|
+
const v = toks[k + 2];
|
|
7457
|
+
const after = toks[k + 3];
|
|
7458
|
+
const single = v?.t === "str" && v.v != null && !(after?.t === "str") && !(after?.t === "op" && [".", "+", "[", "(", "%"].includes(after.v));
|
|
7459
|
+
const value = single ? v.v : null;
|
|
7460
|
+
if (!seen.has(t.v)) seen.set(t.v, value);
|
|
7461
|
+
else if (seen.get(t.v) !== value) seen.set(t.v, null);
|
|
7462
|
+
}
|
|
7463
|
+
const out = /* @__PURE__ */ new Map();
|
|
7464
|
+
for (const [k, v] of seen) if (v != null) out.set(k, v);
|
|
7465
|
+
return out;
|
|
7466
|
+
}
|
|
7467
|
+
var RECORD_NAME_KWS = ["name", "model", "model_name", "model_id", "repo_id", "hf_model_id", "model_name_or_path"];
|
|
7440
7468
|
function scanPython(src, path, lineOf = (l) => l) {
|
|
7441
7469
|
const toks = pyTokens(src);
|
|
7442
7470
|
const imports = pyImports(toks);
|
|
7443
7471
|
const hfImported = [...imports.values()].some(isHfOrigin);
|
|
7444
|
-
if (!hfImported) return [];
|
|
7472
|
+
if (!hfImported && !KEEP_PINNED) return [];
|
|
7445
7473
|
const starts = lineStarts(src);
|
|
7446
7474
|
const lines = src.split("\n");
|
|
7447
7475
|
const hits = [];
|
|
7476
|
+
const consts = KEEP_PINNED ? pyStringConstants(toks) : /* @__PURE__ */ new Map();
|
|
7477
|
+
const named = (a) => a && a.toks.length === 1 && a.toks[0].t === "name" ? consts.get(a.toks[0].v) : void 0;
|
|
7478
|
+
const callSpan = (k, close) => [lineAt(starts, toks[k].at), lineAt(starts, toks[close]?.at ?? toks[k].at)];
|
|
7479
|
+
if (KEEP_PINNED) {
|
|
7480
|
+
for (let k = 0; k < toks.length; k++) {
|
|
7481
|
+
const t = toks[k];
|
|
7482
|
+
if (t.t !== "name" || CALLS[t.v] || toks[k + 1]?.t !== "op" || toks[k + 1].v !== "(") continue;
|
|
7483
|
+
if (k > 0 && toks[k - 1].t === "name" && toks[k - 1].v === "def") continue;
|
|
7484
|
+
const { args, close } = pyArgs(toks, k + 1);
|
|
7485
|
+
const kw = (name) => args.find((a) => a.kw === name);
|
|
7486
|
+
const revArg = kw("revision");
|
|
7487
|
+
const rev = literal(revArg) ?? named(revArg);
|
|
7488
|
+
if (!rev || !isPinnedRevision(rev)) continue;
|
|
7489
|
+
const nameArg = RECORD_NAME_KWS.map(kw).find(Boolean);
|
|
7490
|
+
const repo = literal(nameArg) ?? named(nameArg);
|
|
7491
|
+
if (!repo || !repo.includes("/") || looksLocal(repo) || !HUB_ID.test(repo)) continue;
|
|
7492
|
+
const [first, last] = callSpan(k, close);
|
|
7493
|
+
if (lines.slice(first - 1, last).some((l) => NOSEC.test(l))) continue;
|
|
7494
|
+
hits.push({ rule: "pin/hf-floating-revision", path, line: lineOf(first), api: t.v, repo, repoType: "model", revision: rev, syntax: "python", pinned: true, via: "record", ...lines.slice(first - 1, last).some((l) => /code_revision/.test(l)) ? { codeRevision: true } : {} });
|
|
7495
|
+
}
|
|
7496
|
+
}
|
|
7497
|
+
if (!hfImported) return hits;
|
|
7448
7498
|
for (let k = 0; k < toks.length; k++) {
|
|
7449
7499
|
const t = toks[k];
|
|
7450
7500
|
if (t.t !== "name" || !CALLS[t.v] || toks[k + 1]?.t !== "op" || toks[k + 1].v !== "(") continue;
|
|
@@ -7471,29 +7521,34 @@ function scanPython(src, path, lineOf = (l) => l) {
|
|
|
7471
7521
|
if (isTrue(kw("local_files_only"))) continue;
|
|
7472
7522
|
const revArg = kw("revision") ?? kw("commit_id");
|
|
7473
7523
|
let revision;
|
|
7524
|
+
let via;
|
|
7474
7525
|
if (revArg) {
|
|
7475
|
-
|
|
7526
|
+
let v = literal(revArg);
|
|
7527
|
+
if (v === void 0 && (v = named(revArg)) !== void 0) via = "variable";
|
|
7476
7528
|
if (v === void 0) continue;
|
|
7477
|
-
if (isPinnedRevision(v)) continue;
|
|
7529
|
+
if (isPinnedRevision(v) && !KEEP_PINNED) continue;
|
|
7478
7530
|
revision = v;
|
|
7479
7531
|
}
|
|
7532
|
+
const pinned = revision !== void 0 && isPinnedRevision(revision);
|
|
7480
7533
|
const positional = args.filter((a) => !a.kw && !a.star);
|
|
7481
7534
|
const peft = t.v === "from_pretrained" && /^PeftModel/.test(chain[chain.length - 2] ?? "");
|
|
7482
7535
|
const repoArg = (peft ? kw("model_id") : spec.repoKw.map(kw).find(Boolean)) ?? positional[peft ? 1 : spec.repoPos];
|
|
7483
7536
|
if (!repoArg) continue;
|
|
7484
|
-
|
|
7537
|
+
let repo = literal(repoArg);
|
|
7538
|
+
if (repo === void 0 && (repo = named(repoArg)) !== void 0) via = "variable";
|
|
7485
7539
|
const api = chain.join(".");
|
|
7486
7540
|
const repoType = spec.repoType === "dataset" || kw("repo_type") && literal(kw("repo_type")) === "dataset" ? "dataset" : "model";
|
|
7487
7541
|
const line = lineOf(firstLine);
|
|
7488
7542
|
if (repo === void 0) {
|
|
7489
7543
|
if (!resolvesHf) continue;
|
|
7490
7544
|
if (localExpr(repoArg)) continue;
|
|
7545
|
+
if (pinned) continue;
|
|
7491
7546
|
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned-dynamic", path, line, api, repoType, revision, syntax: "python" });
|
|
7492
7547
|
continue;
|
|
7493
7548
|
}
|
|
7494
7549
|
if (looksLocal(repo) || !HUB_ID.test(repo)) continue;
|
|
7495
7550
|
if (t.v === "load_dataset" && BUILDERS.has(repo)) continue;
|
|
7496
|
-
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line, api, repo, repoType, revision, syntax: "python" });
|
|
7551
|
+
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line, api, repo, repoType, revision, syntax: "python", ...pinned ? { pinned } : {}, ...via ? { via } : {}, ...KEEP_PINNED && (kw("code_revision") || lines.slice(firstLine - 1, lastLine).some((l) => /code_revision/.test(l))) ? { codeRevision: true } : {} });
|
|
7497
7552
|
}
|
|
7498
7553
|
return hits;
|
|
7499
7554
|
}
|
|
@@ -7626,15 +7681,17 @@ function scanShell(src, path, lineOf = (l) => l) {
|
|
|
7626
7681
|
const L = launchOf(words);
|
|
7627
7682
|
if (!L || !L.model) continue;
|
|
7628
7683
|
const rev = flagValue(L.rest, ["--revision"]);
|
|
7629
|
-
|
|
7684
|
+
const pinned = rev.present && rev.value !== void 0 && isPinnedRevision(rev.value);
|
|
7685
|
+
if (rev.present && (rev.value === void 0 || rev.value.startsWith("$") || pinned && !KEEP_PINNED)) continue;
|
|
7630
7686
|
const line = lineOf(ll.line);
|
|
7631
7687
|
const revision = rev.present ? rev.value : void 0;
|
|
7632
7688
|
if (L.model.startsWith("$") || /[{}]/.test(L.model)) {
|
|
7689
|
+
if (pinned) continue;
|
|
7633
7690
|
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned-dynamic", path, line, api: L.api, repoType: L.repoType, revision, syntax: "shell" });
|
|
7634
7691
|
continue;
|
|
7635
7692
|
}
|
|
7636
7693
|
if (looksLocal(L.model) || !HUB_ID.test(L.model)) continue;
|
|
7637
|
-
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line, api: L.api, repo: L.model, repoType: L.repoType, revision, syntax: "shell" });
|
|
7694
|
+
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line, api: L.api, repo: L.model, repoType: L.repoType, revision, syntax: "shell", ...pinned ? { pinned } : {}, ...KEEP_PINNED && flagValue(L.rest, ["--code-revision"]).present ? { codeRevision: true } : {} });
|
|
7638
7695
|
}
|
|
7639
7696
|
}
|
|
7640
7697
|
return hits;
|
|
@@ -7683,13 +7740,66 @@ function scanYaml(src, path) {
|
|
|
7683
7740
|
let revision;
|
|
7684
7741
|
if (rev) {
|
|
7685
7742
|
const v = unquote(rev.value);
|
|
7686
|
-
if (!v || /[${}]/.test(v) || isPinnedRevision(v)) continue;
|
|
7743
|
+
if (!v || /[${}]/.test(v) || isPinnedRevision(v) && !KEEP_PINNED) continue;
|
|
7687
7744
|
revision = v;
|
|
7688
7745
|
}
|
|
7689
|
-
|
|
7746
|
+
const pinned = revision !== void 0 && isPinnedRevision(revision);
|
|
7747
|
+
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line: i + 1, api: `${p.key}:`, repo: value, repoType: "model", revision, syntax: "yaml", ...pinned ? { pinned } : {} });
|
|
7690
7748
|
}
|
|
7691
7749
|
return [...hits, ...scanShell(src, path)];
|
|
7692
7750
|
}
|
|
7751
|
+
var MODEL_ENV = /^(HF_|HUGGING_FACE_HUB_|VLLM_|TGI_|TEI_)?MODEL(_ID|_NAME|_REPO|_NAME_OR_PATH)?$/;
|
|
7752
|
+
var REVISION_ENV = /^(HF_|VLLM_|TGI_|TEI_)?(MODEL_)?REVISION$/;
|
|
7753
|
+
var CODE_REVISION_ENV = /CODE_REVISION$/;
|
|
7754
|
+
function envPairs(src) {
|
|
7755
|
+
const out = [];
|
|
7756
|
+
const lines = src.split(/\r?\n/);
|
|
7757
|
+
const q = (v) => unquote(v.trim());
|
|
7758
|
+
for (let i = 0; i < lines.length; i++) {
|
|
7759
|
+
const l = lines[i];
|
|
7760
|
+
if (/^\s*#/.test(l) || /#\s*nosec\b/.test(l)) continue;
|
|
7761
|
+
let m = /^\s*-\s+name\s*:\s*["']?([A-Z][A-Z0-9_]*)["']?\s*$/.exec(l);
|
|
7762
|
+
if (m) {
|
|
7763
|
+
const nx = /^\s*value\s*:\s*(.+?)\s*$/.exec(lines[i + 1] ?? "");
|
|
7764
|
+
if (nx) out.push({ key: m[1], value: q(nx[1]), line: i + 1 });
|
|
7765
|
+
continue;
|
|
7766
|
+
}
|
|
7767
|
+
if (m = /^\s*(?:-\s+)?["']?([A-Z][A-Z0-9_]*)=([^\s"']+)["']?\s*$/.exec(l)) {
|
|
7768
|
+
out.push({ key: m[1], value: q(m[2]), line: i + 1 });
|
|
7769
|
+
continue;
|
|
7770
|
+
}
|
|
7771
|
+
if (m = /^\s*([A-Z][A-Z0-9_]*)\s*:\s*(\S.*?)\s*$/.exec(l)) {
|
|
7772
|
+
out.push({ key: m[1], value: q(m[2]), line: i + 1 });
|
|
7773
|
+
continue;
|
|
7774
|
+
}
|
|
7775
|
+
if (m = /^\s*(?:ENV|export)\s+(.+)$/.exec(l)) {
|
|
7776
|
+
const body = m[1].replace(/\s*\\\s*$/, "");
|
|
7777
|
+
const kv = [...body.matchAll(/([A-Z][A-Z0-9_]*)=("[^"]*"|'[^']*'|\S+)/g)];
|
|
7778
|
+
if (kv.length) for (const x of kv) out.push({ key: x[1], value: q(x[2]), line: i + 1 });
|
|
7779
|
+
else {
|
|
7780
|
+
const sp = /^([A-Z][A-Z0-9_]*)\s+(\S+)\s*$/.exec(body);
|
|
7781
|
+
if (sp) out.push({ key: sp[1], value: q(sp[2]), line: i + 1 });
|
|
7782
|
+
}
|
|
7783
|
+
}
|
|
7784
|
+
}
|
|
7785
|
+
return out;
|
|
7786
|
+
}
|
|
7787
|
+
function scanEnvModels(src, path, syntax) {
|
|
7788
|
+
const pairs2 = envPairs(src);
|
|
7789
|
+
const rev = pairs2.find((p) => REVISION_ENV.test(p.key) && !CODE_REVISION_ENV.test(p.key));
|
|
7790
|
+
const codeRevision = pairs2.some((p) => CODE_REVISION_ENV.test(p.key));
|
|
7791
|
+
const trustRemoteCode = pairs2.some((p) => /TRUST_REMOTE_CODE$/.test(p.key) && /^(1|true|yes)$/i.test(p.value));
|
|
7792
|
+
const hits = [];
|
|
7793
|
+
for (const p of pairs2) {
|
|
7794
|
+
if (!MODEL_ENV.test(p.key)) continue;
|
|
7795
|
+
const v = p.value;
|
|
7796
|
+
if (!v.includes("/") || /[${}]/.test(v) || looksLocal(v) || !HUB_ID.test(v) || API_PREFIXES.has(v.split("/")[0].toLowerCase())) continue;
|
|
7797
|
+
const revision = rev && !/[${}]/.test(rev.value) ? rev.value : void 0;
|
|
7798
|
+
const pinned = revision !== void 0 && isPinnedRevision(revision);
|
|
7799
|
+
hits.push({ rule: revision ? "pin/hf-floating-revision" : "pin/hf-unpinned", path, line: p.line, api: `env ${p.key}`, repo: v, repoType: "model", revision, syntax, via: "env", trustRemoteCode, ...pinned ? { pinned } : {}, ...codeRevision ? { codeRevision } : {} });
|
|
7800
|
+
}
|
|
7801
|
+
return hits;
|
|
7802
|
+
}
|
|
7693
7803
|
function scanNotebook(raw, path) {
|
|
7694
7804
|
let nb;
|
|
7695
7805
|
try {
|
|
@@ -7745,6 +7855,23 @@ function scanPins(path, text) {
|
|
|
7745
7855
|
return [];
|
|
7746
7856
|
}
|
|
7747
7857
|
}
|
|
7858
|
+
function scanModelRefs(path, text) {
|
|
7859
|
+
KEEP_PINNED = true;
|
|
7860
|
+
try {
|
|
7861
|
+
const kind = pinFileKind(path);
|
|
7862
|
+
const env = kind === "yaml" || kind === "shell" ? scanEnvModels(text, path, kind) : [];
|
|
7863
|
+
const hits = [...scanPins(path, text).filter((h) => h.repo), ...env];
|
|
7864
|
+
const seen = /* @__PURE__ */ new Set();
|
|
7865
|
+
return hits.filter((h) => {
|
|
7866
|
+
const k = `${h.line}|${h.repo}|${h.revision ?? ""}`;
|
|
7867
|
+
if (seen.has(k)) return false;
|
|
7868
|
+
seen.add(k);
|
|
7869
|
+
return true;
|
|
7870
|
+
});
|
|
7871
|
+
} finally {
|
|
7872
|
+
KEEP_PINNED = false;
|
|
7873
|
+
}
|
|
7874
|
+
}
|
|
7748
7875
|
function pinSpelling(syntax, sha) {
|
|
7749
7876
|
return syntax === "python" ? `revision="${sha}"` : syntax === "shell" ? `--revision ${sha}` : `model_revision: ${sha}`;
|
|
7750
7877
|
}
|
|
@@ -7898,12 +8025,305 @@ function renderPolicyText(ev, opts) {
|
|
|
7898
8025
|
lines.push(` ${c.gating ? `${c.gating} blocking` : "nothing blocks"}${c.waived ? `, ${c.waived} waived` : ""}${c.existing ? `, ${c.existing} in baseline` : ""}${c.off ? `, ${c.off} off` : ""}${hidden ? ` (${hidden} not shown; --all to show)` : ""}: exit ${ev.exitCode}`);
|
|
7899
8026
|
return lines.join("\n") + "\n";
|
|
7900
8027
|
}
|
|
8028
|
+
|
|
8029
|
+
// src/utils/policy/modelScan.ts
|
|
8030
|
+
var PICKLE = /\.(bin|pt|pth|pkl|ckpt)$/i;
|
|
8031
|
+
function remoteCodeOf(info, self) {
|
|
8032
|
+
const refs = [];
|
|
8033
|
+
const take = (v) => {
|
|
8034
|
+
if (typeof v === "string") refs.push(v);
|
|
8035
|
+
else if (Array.isArray(v)) v.forEach(take);
|
|
8036
|
+
else if (v && typeof v === "object") Object.values(v).forEach(take);
|
|
8037
|
+
};
|
|
8038
|
+
take(info?.config?.auto_map);
|
|
8039
|
+
take(info?.config?.tokenizer_config?.auto_map);
|
|
8040
|
+
const crossRepo = [...new Set(refs.filter((r) => r.includes("--")).map((r) => r.split("--")[0]))].filter((r) => r !== self).sort();
|
|
8041
|
+
return { declared: refs.length > 0, crossRepo };
|
|
8042
|
+
}
|
|
8043
|
+
function codeFiles(info) {
|
|
8044
|
+
const out = {};
|
|
8045
|
+
for (const s of info?.siblings ?? []) if (s.rfilename.endsWith(".py")) out[s.rfilename] = s.blobId ?? "";
|
|
8046
|
+
return out;
|
|
8047
|
+
}
|
|
8048
|
+
function codeChanged(before, after) {
|
|
8049
|
+
const a = codeFiles(before);
|
|
8050
|
+
const b = codeFiles(after);
|
|
8051
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])].filter((f) => a[f] !== b[f]).sort();
|
|
8052
|
+
}
|
|
8053
|
+
function weightFormat(info) {
|
|
8054
|
+
const names = (info?.siblings ?? []).map((s) => s.rfilename);
|
|
8055
|
+
if (names.some((n) => n.endsWith(".safetensors") || n.endsWith(".gguf"))) return "safetensors";
|
|
8056
|
+
if (names.some((n) => PICKLE.test(n) && !n.includes("optimizer") && !n.includes("training_args"))) return "pickle-only";
|
|
8057
|
+
return "none";
|
|
8058
|
+
}
|
|
8059
|
+
function recordedSince(changes, id, pinnedSha, pinnedDate) {
|
|
8060
|
+
const mine = changes.filter((c) => c.id === id).sort((a, b) => a.date < b.date ? -1 : a.date > b.date ? 1 : 0);
|
|
8061
|
+
if (!pinnedSha) return mine;
|
|
8062
|
+
const short = pinnedSha.toLowerCase();
|
|
8063
|
+
const hit = (s) => !!s && s.toLowerCase().startsWith(short);
|
|
8064
|
+
const at = mine.findIndex((c) => hit(c.toSha));
|
|
8065
|
+
if (at >= 0) return mine.slice(at + 1);
|
|
8066
|
+
const from = mine.findIndex((c) => hit(c.fromSha));
|
|
8067
|
+
if (from >= 0) return mine.slice(from);
|
|
8068
|
+
if (pinnedDate) return mine.filter((c) => c.date > pinnedDate);
|
|
8069
|
+
return null;
|
|
8070
|
+
}
|
|
8071
|
+
var TRIGGER_KINDS = /* @__PURE__ */ new Set(["conditional-literal", "outside-safe-subset"]);
|
|
8072
|
+
var ATTN_FIELDS = ["_attn_implementation_internal", "_attn_implementation", "attn_implementation"];
|
|
8073
|
+
var HUB_REPO = /^[A-Za-z0-9][\w.-]*\/[\w.-]+(?::[\w.-]+)?$/;
|
|
8074
|
+
function attnRepoRefs(cfg) {
|
|
8075
|
+
const out = [];
|
|
8076
|
+
const visit3 = (o, prefix, depth) => {
|
|
8077
|
+
if (!o || typeof o !== "object" || Array.isArray(o)) return;
|
|
8078
|
+
for (const [k, v] of Object.entries(o)) {
|
|
8079
|
+
if (ATTN_FIELDS.includes(k) && typeof v === "string" && HUB_REPO.test(v)) out.push([prefix + k, v]);
|
|
8080
|
+
else if (depth < 1 && v && typeof v === "object") visit3(v, `${prefix}${k}.`, depth + 1);
|
|
8081
|
+
}
|
|
8082
|
+
};
|
|
8083
|
+
visit3(cfg, "", 0);
|
|
8084
|
+
return out;
|
|
8085
|
+
}
|
|
8086
|
+
var changeUrl = (c) => c.commit;
|
|
8087
|
+
function assessRef(r) {
|
|
8088
|
+
const out = [];
|
|
8089
|
+
const main = r.atMain ?? null;
|
|
8090
|
+
const pin = r.pinned ? r.atPin ?? null : main;
|
|
8091
|
+
const declared = remoteCodeOf(main ?? pin, r.id);
|
|
8092
|
+
const code = r.remoteCodeRuns === false ? { declared: false, crossRepo: [] } : declared;
|
|
8093
|
+
const moved = !!(r.pinned && main?.sha && !main.sha.toLowerCase().startsWith(r.pinned.toLowerCase()));
|
|
8094
|
+
if (code.declared && !r.pinned) {
|
|
8095
|
+
out.push({ lane: "security", severity: "high", kind: "remote-code-unpinned", message: `Loads Python from the model repository (auto_map) and is not pinned: with trust_remote_code, whatever ${r.id} has on main runs in your process.`, fix: `Pin revision= to a commit you have read${code.crossRepo.length ? `, and code_revision= for ${code.crossRepo.join(", ")}` : ""}.` });
|
|
8096
|
+
}
|
|
8097
|
+
if (code.crossRepo.length && r.codeRevision !== true) {
|
|
8098
|
+
out.push({ lane: "security", severity: r.pinned ? "high" : "medium", kind: "remote-code-cross-repo", message: `Its auto_map imports code from ${code.crossRepo.join(", ")}. Loaded with trust_remote_code=True, transformers pins that code only with code_revision=; revision= alone pins ${r.id} and still loads the other repository's main.`, fix: `Pass code_revision=<commit of ${code.crossRepo[0]}>, or vendor the module.`, url: "https://github.com/huggingface/transformers/blob/v4.57.1/src/transformers/dynamic_module_utils.py#L595-L602" });
|
|
8099
|
+
}
|
|
8100
|
+
if (moved && r.atPin && main) {
|
|
8101
|
+
const files = codeChanged(r.atPin, main);
|
|
8102
|
+
if (files.length) out.push({ lane: "security", severity: "high", kind: "remote-code-changed", message: `Python in the repository changed since your pin: ${files.join(", ")}. Moving the pin runs different code.`, fix: `Read the diff before moving the pin: https://huggingface.co/${r.id}/compare (or git diff ${r.pinned.slice(0, 12)} main in a clone).` });
|
|
8103
|
+
}
|
|
8104
|
+
const fmtNow = weightFormat(main ?? pin);
|
|
8105
|
+
if (fmtNow === "pickle-only") {
|
|
8106
|
+
const was = r.pinned && r.atPin ? weightFormat(r.atPin) : null;
|
|
8107
|
+
out.push({ lane: "security", severity: was === "safetensors" ? "high" : "medium", kind: was === "safetensors" ? "weights-to-pickle" : "weights-pickle-only", message: was === "safetensors" ? "Weights moved from safetensors to a pickle format (.bin/.pt) since your pin; loading pickle can execute code." : "Weights are only in a pickle format (.bin/.pt); loading pickle can execute code (torch.load weights_only was bypassed in CVE-2025-32434, fixed in torch 2.6.0).", fix: "Prefer a safetensors revision, or load with torch>=2.6 and weights_only=True." });
|
|
8108
|
+
}
|
|
8109
|
+
const attnNow = attnRepoRefs(r.rawConfigMain ?? (r.pinned ? r.rawConfigPin : null));
|
|
8110
|
+
const attnPin = new Set(attnRepoRefs(r.rawConfigPin).map(([k, v]) => `${k}=${v}`));
|
|
8111
|
+
for (const [field, repo] of attnNow) {
|
|
8112
|
+
const added = r.pinned && r.rawConfigPin && !attnPin.has(`${field}=${repo}`);
|
|
8113
|
+
out.push({ lane: "security", severity: "high", kind: "config-remote-attention", message: `config.json${added ? " gained" : " sets"} ${field} = "${repo}"${added ? " since your pin" : ""}: a Hub repository named as the attention implementation. transformers before 5.3.0 downloads and runs that repository's code on load, with trust_remote_code=False (CVE-2026-4372).`, fix: "Use transformers >= 5.3.0, and read why a model config names another repository before loading it.", url: "https://github.com/advisories/GHSA-29pf-2h5f-8g72" });
|
|
8114
|
+
}
|
|
8115
|
+
const pinDate = r.pinned ? r.atPin?.lastModified : void 0;
|
|
8116
|
+
for (const l of r.securityRecorded ?? []) {
|
|
8117
|
+
if (l.lane !== "security" || l.id !== r.id) continue;
|
|
8118
|
+
if (r.pinned && (!pinDate || l.date <= pinDate)) continue;
|
|
8119
|
+
if (l.kind === "remote-code-config" && attnNow.length) continue;
|
|
8120
|
+
if (l.kind === "remote-code" && r.pinned && moved) continue;
|
|
8121
|
+
const held = l.kind === "remote-code-repo" && r.codeRevision === true;
|
|
8122
|
+
out.push({ lane: "security", severity: held ? "low" : l.kind === "remote-code-config" || l.kind === "remote-code-repo" && r.pinned ? "high" : "medium", kind: `recorded-${l.kind}`, message: `${l.date.slice(0, 10)}: ${l.sentence}${held ? " Your code_revision holds the code you pinned." : ""}`, ...l.commit ? { url: l.commit } : {} });
|
|
8123
|
+
}
|
|
8124
|
+
const since = recordedSince(r.recorded ?? [], r.id, r.pinned, r.atPin?.lastModified);
|
|
8125
|
+
const relevant = (since ?? []).filter((c) => !c.formatOnly);
|
|
8126
|
+
const triggers = relevant.flatMap((c) => (c.safety ?? []).filter((s) => TRIGGER_KINDS.has(s.kind)).map(() => c));
|
|
8127
|
+
for (const c of [...new Set(triggers)]) {
|
|
8128
|
+
out.push({ lane: "security", severity: "medium", kind: "template-trigger-branch", message: `${c.date.slice(0, 10)}: the chat template gained a branch on a literal string, the shape published template backdoors use. Not evidence of one; read it. ${c.sentence}`, url: changeUrl(c) });
|
|
8129
|
+
}
|
|
8130
|
+
if (!r.pinned) {
|
|
8131
|
+
out.push({ lane: "hygiene", severity: "medium", kind: "unpinned", message: `Not pinned to a commit: every run loads whatever ${r.id} has on main that day.`, fix: main?.sha ? `revision="${main.sha}"` : "Pin revision= to a 40-character commit." });
|
|
8132
|
+
}
|
|
8133
|
+
if (r.templateVerdict === "different") {
|
|
8134
|
+
out.push({ lane: "behavior", severity: "high", kind: "template-render-changed", message: "The chat template at main renders a different prompt than at your pin (system, multi-turn or tool-call conversation).", fix: `npx neurarch template-check ${r.id} --from ${r.pinned?.slice(0, 12)}` });
|
|
8135
|
+
}
|
|
8136
|
+
for (const c of relevant) {
|
|
8137
|
+
const eos = c.consequence?.eos != null;
|
|
8138
|
+
const render = c.templateRender?.verdict === "rendering-changed";
|
|
8139
|
+
const sev = eos || render ? "high" : c.classes.some((k) => k === "structural" || k === "tokenizer" || k === "generation-defaults" || k === "template") ? "medium" : "low";
|
|
8140
|
+
if (r.pinned) out.push({ lane: "behavior", severity: sev, kind: `upstream-${c.classes[0] ?? "change"}`, message: c.sentence, url: changeUrl(c) });
|
|
8141
|
+
}
|
|
8142
|
+
if (!r.pinned && relevant.length) {
|
|
8143
|
+
const last = relevant[relevant.length - 1];
|
|
8144
|
+
out.push({ lane: "behavior", severity: "low", kind: "upstream-history", message: `${relevant.length} recorded upstream change${relevant.length === 1 ? "" : "s"} to ${r.id}; the latest, ${last.date.slice(0, 10)}: ${last.sentence}`, url: `https://www.neurarch.com/changes/` });
|
|
8145
|
+
}
|
|
8146
|
+
if (r.pinned && !moved && main?.sha) {
|
|
8147
|
+
out.push({ lane: "hygiene", severity: "low", kind: "pin-current", message: "Pinned at the commit main points at now." });
|
|
8148
|
+
}
|
|
8149
|
+
if (r.pinned && since === null && r.tracked) {
|
|
8150
|
+
out.push({ lane: "behavior", severity: "low", kind: "pin-not-located", message: "The pinned commit is not in the recorded history and its date could not be read, so recorded changes since it are not listed." });
|
|
8151
|
+
}
|
|
8152
|
+
const rank = { security: 0, behavior: 1, hygiene: 2 };
|
|
8153
|
+
const sevRank = { high: 0, medium: 1, low: 2 };
|
|
8154
|
+
return out.sort((a, b) => rank[a.lane] - rank[b.lane] || sevRank[a.severity] - sevRank[b.severity]);
|
|
8155
|
+
}
|
|
8156
|
+
var scanExitCode = (all) => all.some((fs) => fs.some((f) => f.severity === "high")) ? 1 : 0;
|
|
8157
|
+
function matchParen(src, open) {
|
|
8158
|
+
let depth = 0;
|
|
8159
|
+
for (let i = open; i < src.length; i++) {
|
|
8160
|
+
const c = src[i];
|
|
8161
|
+
if (c === "#") {
|
|
8162
|
+
while (i < src.length && src[i] !== "\n") i++;
|
|
8163
|
+
continue;
|
|
8164
|
+
}
|
|
8165
|
+
if (c === '"' || c === "'") {
|
|
8166
|
+
const triple = src.startsWith(c.repeat(3), i);
|
|
8167
|
+
const d = triple ? c.repeat(3) : c;
|
|
8168
|
+
i += d.length;
|
|
8169
|
+
while (i < src.length && !src.startsWith(d, i)) {
|
|
8170
|
+
if (src[i] === "\\") i++;
|
|
8171
|
+
i++;
|
|
8172
|
+
}
|
|
8173
|
+
i += d.length - 1;
|
|
8174
|
+
continue;
|
|
8175
|
+
}
|
|
8176
|
+
if (c === "(" || c === "[" || c === "{") depth++;
|
|
8177
|
+
else if (c === ")" || c === "]" || c === "}") {
|
|
8178
|
+
depth--;
|
|
8179
|
+
if (depth === 0) return i + 1;
|
|
8180
|
+
}
|
|
8181
|
+
}
|
|
8182
|
+
return -1;
|
|
8183
|
+
}
|
|
8184
|
+
function appendArgs(src, open, close, items) {
|
|
8185
|
+
const inner = src.slice(open + 1, close - 1);
|
|
8186
|
+
let end = close - 1;
|
|
8187
|
+
while (end > open + 1 && /\s/.test(src[end - 1])) end--;
|
|
8188
|
+
const multiline = inner.includes("\n");
|
|
8189
|
+
const trailingComma = src[end - 1] === ",";
|
|
8190
|
+
if (!multiline) {
|
|
8191
|
+
const sep = end === open + 1 ? "" : trailingComma ? " " : ", ";
|
|
8192
|
+
return src.slice(0, end) + sep + items.join(", ") + src.slice(end);
|
|
8193
|
+
}
|
|
8194
|
+
const lastLineStart = src.lastIndexOf("\n", end - 1) + 1;
|
|
8195
|
+
const indent = /^\s*/.exec(src.slice(lastLineStart, end))[0];
|
|
8196
|
+
const body = items.map((x) => `${indent}${x},`).join("\n");
|
|
8197
|
+
return src.slice(0, end) + (trailingComma ? "" : ",") + "\n" + body + src.slice(end);
|
|
8198
|
+
}
|
|
8199
|
+
var ST_CALLS = /(^|\.)(SentenceTransformer|CrossEncoder|SparseEncoder)$/;
|
|
8200
|
+
function fixPythonCall(src, line, api, set2) {
|
|
8201
|
+
const lines = src.split("\n");
|
|
8202
|
+
const startOfLine = lines.slice(0, line - 1).reduce((n, l) => n + l.length + 1, 0);
|
|
8203
|
+
const name = api.split(".").pop();
|
|
8204
|
+
const re = new RegExp(`\\b${name}\\s*\\(`, "g");
|
|
8205
|
+
re.lastIndex = startOfLine;
|
|
8206
|
+
const m = re.exec(src);
|
|
8207
|
+
if (!m || m.index > startOfLine + (lines[line - 1]?.length ?? 0)) return { skipped: `could not find ${api}( at line ${line}` };
|
|
8208
|
+
const open = m.index + m[0].length - 1;
|
|
8209
|
+
const close = matchParen(src, open);
|
|
8210
|
+
if (close < 0) return { skipped: "unbalanced call" };
|
|
8211
|
+
const call = src.slice(open, close);
|
|
8212
|
+
if (/\*\*\s*\w/.test(call)) return { skipped: "the call passes **kwargs; add code_revision where that dict is built" };
|
|
8213
|
+
const items = [];
|
|
8214
|
+
if (set2.revision && !/\brevision\s*=/.test(call.replace(/code_revision/g, ""))) items.push(`revision="${set2.revision}"`);
|
|
8215
|
+
let out = src;
|
|
8216
|
+
if (set2.codeRevision && !/code_revision/.test(call)) {
|
|
8217
|
+
if (ST_CALLS.test(api)) {
|
|
8218
|
+
for (const kw of ["model_kwargs", "config_kwargs"]) {
|
|
8219
|
+
const k = new RegExp(`\\b${kw}\\s*=\\s*`).exec(call);
|
|
8220
|
+
if (k) {
|
|
8221
|
+
const at = open + k.index + k[0].length;
|
|
8222
|
+
if (out[at] !== "{") return { skipped: `${kw} is not a literal dict; add "code_revision": "${set2.codeRevision}" to it` };
|
|
8223
|
+
out = out.slice(0, at + 1) + `"code_revision": "${set2.codeRevision}", ` + out.slice(at + 1);
|
|
8224
|
+
} else items.push(`${kw}={"code_revision": "${set2.codeRevision}"}`);
|
|
8225
|
+
}
|
|
8226
|
+
} else items.push(`code_revision="${set2.codeRevision}"`);
|
|
8227
|
+
}
|
|
8228
|
+
if (!items.length && out === src) return { skipped: "already holds both" };
|
|
8229
|
+
const close2 = matchParen(out, open);
|
|
8230
|
+
return { src: items.length ? appendArgs(out, open, close2, items) : out };
|
|
8231
|
+
}
|
|
8232
|
+
function fixShellLine(src, line, set2) {
|
|
8233
|
+
const lines = src.split("\n");
|
|
8234
|
+
let end = line - 1;
|
|
8235
|
+
while (end < lines.length - 1 && /\\\s*$/.test(lines[end])) end++;
|
|
8236
|
+
const logical = lines.slice(line - 1, end + 1).join("\n");
|
|
8237
|
+
const add = [];
|
|
8238
|
+
if (set2.revision && !/--revision\b/.test(logical)) add.push(`--revision ${set2.revision}`);
|
|
8239
|
+
if (set2.codeRevision && !/--code-revision\b/.test(logical)) add.push(`--code-revision ${set2.codeRevision}`);
|
|
8240
|
+
if (!add.length) return { skipped: "already holds both" };
|
|
8241
|
+
const l = lines[end];
|
|
8242
|
+
const cm = /\s+#.*$/.exec(l);
|
|
8243
|
+
const body = cm ? l.slice(0, cm.index) : l;
|
|
8244
|
+
lines[end] = `${body.replace(/\s+$/, "")} ${add.join(" ")}${cm ? cm[0] : ""}`;
|
|
8245
|
+
return { src: lines.join("\n") };
|
|
8246
|
+
}
|
|
8247
|
+
var NIST_MAP = {
|
|
8248
|
+
security: ["NIST SP 800-218A PW.4.4 (verify integrity, provenance and security of acquired AI models; scan for malicious content before use)"],
|
|
8249
|
+
behavior: ["NIST SP 800-218A PW.4.4 (verify acquired AI components, including configuration parameters, before use)"],
|
|
8250
|
+
hygiene: ["NIST SP 800-218A PS.3.1 (version and track AI models in asset inventories)", "NIST AI 600-1 GV-1.6-003 (record versions of underlying models)"]
|
|
8251
|
+
};
|
|
8252
|
+
var CVE_OF = { "config-remote-attention": "CVE-2026-4372", "weights-pickle-only": "CVE-2025-32434", "weights-to-pickle": "CVE-2025-32434" };
|
|
8253
|
+
var purl = (id, sha) => `pkg:huggingface/${id}${sha ? `@${sha.toLowerCase()}` : ""}`;
|
|
8254
|
+
function scanBom(models, meta) {
|
|
8255
|
+
const components = [];
|
|
8256
|
+
const dependencies = [];
|
|
8257
|
+
const vulnerabilities = [];
|
|
8258
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8259
|
+
for (const m of models) {
|
|
8260
|
+
const ref = purl(m.id, m.pinned ?? m.mainSha);
|
|
8261
|
+
if (seen.has(ref)) continue;
|
|
8262
|
+
seen.add(ref);
|
|
8263
|
+
components.push({
|
|
8264
|
+
"bom-ref": ref,
|
|
8265
|
+
type: "machine-learning-model",
|
|
8266
|
+
name: m.id,
|
|
8267
|
+
version: m.pinned ?? (m.mainSha ? `main@${m.mainSha}` : "main"),
|
|
8268
|
+
purl: ref,
|
|
8269
|
+
externalReferences: [{ type: "distribution", url: `https://huggingface.co/${m.id}${m.pinned ? `/tree/${m.pinned}` : ""}` }],
|
|
8270
|
+
properties: [
|
|
8271
|
+
{ name: "neurarch:pinned", value: m.pinned ? "true" : "false" },
|
|
8272
|
+
...m.mainSha ? [{ name: "neurarch:upstreamMain", value: m.mainSha }] : [],
|
|
8273
|
+
...m.sites.map((s) => ({ name: "neurarch:callSite", value: s }))
|
|
8274
|
+
]
|
|
8275
|
+
});
|
|
8276
|
+
const deps = [];
|
|
8277
|
+
for (const c of m.codeRepos ?? []) {
|
|
8278
|
+
const cref = purl(c.id, c.sha);
|
|
8279
|
+
deps.push(cref);
|
|
8280
|
+
if (!seen.has(cref)) {
|
|
8281
|
+
seen.add(cref);
|
|
8282
|
+
components.push({ "bom-ref": cref, type: "library", name: c.id, version: c.sha ?? "main", purl: cref, description: "Python modules imported through auto_map from another repository", properties: [{ name: "neurarch:codeRevisionHeld", value: c.held ? "true" : "false" }] });
|
|
8283
|
+
}
|
|
8284
|
+
}
|
|
8285
|
+
if (deps.length) dependencies.push({ ref, dependsOn: deps });
|
|
8286
|
+
for (const f of m.findings) {
|
|
8287
|
+
if (f.kind === "pin-current") continue;
|
|
8288
|
+
const cve = CVE_OF[f.kind];
|
|
8289
|
+
vulnerabilities.push({
|
|
8290
|
+
"bom-ref": `${ref}#${f.kind}-${vulnerabilities.length}`,
|
|
8291
|
+
id: cve ?? `NEURARCH-${f.kind}`,
|
|
8292
|
+
source: cve ? { name: "NVD", url: `https://nvd.nist.gov/vuln/detail/${cve}` } : { name: "neurarch", url: "https://www.neurarch.com/changes/" },
|
|
8293
|
+
ratings: [{ severity: f.severity === "high" ? "high" : f.severity === "medium" ? "medium" : "low", method: "other" }],
|
|
8294
|
+
description: f.message,
|
|
8295
|
+
...f.fix ? { recommendation: f.fix } : {},
|
|
8296
|
+
affects: [{ ref }],
|
|
8297
|
+
properties: [{ name: "neurarch:lane", value: f.lane }, ...NIST_MAP[f.lane].map((v) => ({ name: "neurarch:maps-to", value: v })), ...f.url ? [{ name: "neurarch:evidence", value: f.url }] : []]
|
|
8298
|
+
});
|
|
8299
|
+
}
|
|
8300
|
+
}
|
|
8301
|
+
return {
|
|
8302
|
+
bomFormat: "CycloneDX",
|
|
8303
|
+
specVersion: "1.6",
|
|
8304
|
+
serialNumber: meta.serial,
|
|
8305
|
+
version: 1,
|
|
8306
|
+
metadata: {
|
|
8307
|
+
timestamp: meta.timestamp,
|
|
8308
|
+
tools: { components: [{ type: "application", name: meta.tool, version: meta.version }] },
|
|
8309
|
+
properties: [
|
|
8310
|
+
{ name: "neurarch:maps-to", value: "NIST SP 800-218A PS.3.2 (provenance data for all components, e.g. in an SBOM)" },
|
|
8311
|
+
{ name: "neurarch:maps-to", value: "NIST AI 600-1 GV-1.6-003 (inventory records versions of underlying models)" },
|
|
8312
|
+
{ name: "neurarch:note", value: "The NIST items are recommendations. This BOM is evidence toward them, not a certification. Lanes: security = code that runs on load or weights that can execute; behavior = what the model receives changed, not a vulnerability; hygiene = not pinned." }
|
|
8313
|
+
]
|
|
8314
|
+
},
|
|
8315
|
+
components,
|
|
8316
|
+
dependencies,
|
|
8317
|
+
vulnerabilities
|
|
8318
|
+
};
|
|
8319
|
+
}
|
|
7901
8320
|
export {
|
|
7902
8321
|
BASELINE_PATH,
|
|
7903
8322
|
BUILTIN_PRESETS,
|
|
7904
8323
|
CHANGE_FEEDS_URL,
|
|
7905
8324
|
CHECKERS,
|
|
7906
8325
|
DEFAULT_WAIVER_DAYS,
|
|
8326
|
+
NIST_MAP,
|
|
7907
8327
|
PIN_RULE_META,
|
|
7908
8328
|
POLICY_FILE_NAMES,
|
|
7909
8329
|
POLICY_SCHEMA,
|
|
@@ -7914,11 +8334,17 @@ export {
|
|
|
7914
8334
|
addDays,
|
|
7915
8335
|
allLineHashes,
|
|
7916
8336
|
anchorLine,
|
|
8337
|
+
assessRef,
|
|
8338
|
+
attnRepoRefs,
|
|
7917
8339
|
budgetFindings,
|
|
7918
8340
|
buildSarif,
|
|
7919
8341
|
cardMatches,
|
|
8342
|
+
codeChanged,
|
|
8343
|
+
envPairs,
|
|
7920
8344
|
evaluate,
|
|
7921
8345
|
findingFingerprint,
|
|
8346
|
+
fixPythonCall,
|
|
8347
|
+
fixShellLine,
|
|
7922
8348
|
fromChangeGate,
|
|
7923
8349
|
fromDataFit,
|
|
7924
8350
|
fromLayout,
|
|
@@ -7942,11 +8368,18 @@ export {
|
|
|
7942
8368
|
parsePresetRef,
|
|
7943
8369
|
pinFileKind,
|
|
7944
8370
|
pinSpelling,
|
|
8371
|
+
pyStringConstants,
|
|
7945
8372
|
readBaseline,
|
|
7946
8373
|
readPolicyDoc,
|
|
8374
|
+
recordedSince,
|
|
8375
|
+
remoteCodeOf,
|
|
7947
8376
|
renderPolicyText,
|
|
7948
8377
|
resolveCard,
|
|
7949
8378
|
resolveWaivers,
|
|
8379
|
+
scanBom,
|
|
8380
|
+
scanEnvModels,
|
|
8381
|
+
scanExitCode,
|
|
8382
|
+
scanModelRefs,
|
|
7950
8383
|
scanNotebook,
|
|
7951
8384
|
scanPins,
|
|
7952
8385
|
scanPython,
|
|
@@ -7954,5 +8387,6 @@ export {
|
|
|
7954
8387
|
scanYaml,
|
|
7955
8388
|
stableHash,
|
|
7956
8389
|
today,
|
|
7957
|
-
waiverKey
|
|
8390
|
+
waiverKey,
|
|
8391
|
+
weightFormat
|
|
7958
8392
|
};
|