@biffo/cli 0.324.1 → 0.324.2
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/dist/index.js +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16949,6 +16949,7 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
16949
16949
|
const knownModelIds = options.knownModelIds ?? OPENROUTER_MODEL_IDS;
|
|
16950
16950
|
const snapshotFetchedAt = options.snapshotFetchedAt ?? OPENROUTER_MODEL_SNAPSHOT_FETCHED_AT;
|
|
16951
16951
|
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
16952
|
+
const snapshotAgeEnforced = options.enforceSnapshotAge ?? true;
|
|
16952
16953
|
const configPath = join69(repoRoot, CONFIG_PY_PATH);
|
|
16953
16954
|
const orchestrationPath = join69(repoRoot, ORCHESTRATION_SCHEMA_PATH);
|
|
16954
16955
|
const configMissing = !existsSync58(configPath);
|
|
@@ -16990,7 +16991,7 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
16990
16991
|
});
|
|
16991
16992
|
}
|
|
16992
16993
|
const badFindings = findings.filter((f) => f.status !== "ok");
|
|
16993
|
-
const ok = !configMissing && !orchestrationSchemaMissing && !settingsBlind && !curatedFieldsBlind && !snapshotEmpty && !snapshotStale && badFindings.length === 0;
|
|
16994
|
+
const ok = !configMissing && !orchestrationSchemaMissing && !settingsBlind && !curatedFieldsBlind && !snapshotEmpty && !(snapshotStale && snapshotAgeEnforced) && badFindings.length === 0;
|
|
16994
16995
|
const summaryParts = [
|
|
16995
16996
|
`${findings.length} declared model id(s) checked against ${knownModelIds.length} known OpenRouter id(s) (snapshot fetched ${snapshotFetchedAt})`,
|
|
16996
16997
|
`${badFindings.length} not ok`
|
|
@@ -17002,7 +17003,7 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
17002
17003
|
if (snapshotEmpty) summaryParts.push("SNAPSHOT EMPTY");
|
|
17003
17004
|
if (snapshotStale)
|
|
17004
17005
|
summaryParts.push(
|
|
17005
|
-
`SNAPSHOT STALE (older than ${MODEL_SNAPSHOT_MAX_AGE_DAYS}d \u2014 run refresh-openrouter-model-snapshot.ts)`
|
|
17006
|
+
snapshotAgeEnforced ? `SNAPSHOT STALE (older than ${MODEL_SNAPSHOT_MAX_AGE_DAYS}d \u2014 run refresh-openrouter-model-snapshot.ts)` : `snapshot older than ${MODEL_SNAPSHOT_MAX_AGE_DAYS}d (warning only \u2014 bump biffo.core.json's pinned CLI version)`
|
|
17006
17007
|
);
|
|
17007
17008
|
return {
|
|
17008
17009
|
configPath: CONFIG_PY_PATH,
|
|
@@ -17015,6 +17016,7 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
17015
17016
|
snapshotModelCount: knownModelIds.length,
|
|
17016
17017
|
snapshotEmpty,
|
|
17017
17018
|
snapshotStale,
|
|
17019
|
+
snapshotAgeEnforced,
|
|
17018
17020
|
findings,
|
|
17019
17021
|
ok,
|
|
17020
17022
|
summary: summaryParts.join("; ")
|
|
@@ -17210,7 +17212,9 @@ async function runPluginToolSupplyCheck() {
|
|
|
17210
17212
|
if (!existsSync59(servicesApiRoot)) {
|
|
17211
17213
|
console.log("\u2713 plugin model-id guard: no services/api/ \u2014 nothing to audit");
|
|
17212
17214
|
} else {
|
|
17213
|
-
const modelReport = auditDeclaredModelIds(root
|
|
17215
|
+
const modelReport = auditDeclaredModelIds(root, {
|
|
17216
|
+
enforceSnapshotAge: ownership === "template"
|
|
17217
|
+
});
|
|
17214
17218
|
console.log(`audited ${modelReport.findings.length} declared model id(s)`);
|
|
17215
17219
|
if (!modelReport.ok) {
|
|
17216
17220
|
allOk = false;
|
|
@@ -17244,6 +17248,11 @@ async function runPluginToolSupplyCheck() {
|
|
|
17244
17248
|
}
|
|
17245
17249
|
} else {
|
|
17246
17250
|
console.log(`\u2713 plugin model-id guard: ${modelReport.summary}`);
|
|
17251
|
+
if (modelReport.snapshotStale && !modelReport.snapshotAgeEnforced) {
|
|
17252
|
+
console.warn(
|
|
17253
|
+
`\u26A0 plugin model-id guard: the OpenRouter snapshot in this CLI (fetched ${modelReport.snapshotFetchedAt}) is older than the refresh window. Not failing \u2014 it is the pinned CLI's snapshot, not this PR's. Bump the CLI pin in biffo.core.json (biffo core upgrade) to pick up a fresher one.`
|
|
17254
|
+
);
|
|
17255
|
+
}
|
|
17247
17256
|
}
|
|
17248
17257
|
}
|
|
17249
17258
|
if (!allOk) {
|