@blockrun/franklin 3.15.24 → 3.15.25
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/stats/audit.js +9 -0
- package/dist/stats/tracker.js +6 -0
- package/package.json +1 -1
package/dist/stats/audit.js
CHANGED
|
@@ -33,6 +33,15 @@ export function appendAudit(entry) {
|
|
|
33
33
|
// remember to redirect HOME.
|
|
34
34
|
if (isTestFixtureModel(entry.model))
|
|
35
35
|
return;
|
|
36
|
+
// Belt-and-braces: when 3.15.17 renamed several test fixtures from
|
|
37
|
+
// local/test-model to zai/glm-5.1 (a real-looking model, so
|
|
38
|
+
// persistence tests can verify the write path), the model-name gate
|
|
39
|
+
// stopped catching them. Verified on a real machine: 310 of 370
|
|
40
|
+
// recent zai/glm-5.1 audit entries had output_tokens < 10 — clearly
|
|
41
|
+
// mock responses. The env-var lets tests opt out at file level
|
|
42
|
+
// without renaming fixtures back.
|
|
43
|
+
if (process.env.FRANKLIN_NO_AUDIT === '1')
|
|
44
|
+
return;
|
|
36
45
|
try {
|
|
37
46
|
fs.mkdirSync(BLOCKRUN_DIR, { recursive: true });
|
|
38
47
|
const safe = {
|
package/dist/stats/tracker.js
CHANGED
|
@@ -163,6 +163,12 @@ export function recordUsage(model, inputTokens, outputTokens, costUsd, latencyMs
|
|
|
163
163
|
// test fixtures before this gate).
|
|
164
164
|
if (isTestFixtureModel(model))
|
|
165
165
|
return;
|
|
166
|
+
// Test fixtures using real model names (`zai/glm-5.1` after 3.15.17's
|
|
167
|
+
// rename) escape the prefix gate. Env-var override lets tests opt
|
|
168
|
+
// out at file level. Mirrors the audit.ts guard; same env var so
|
|
169
|
+
// tests flip a single switch.
|
|
170
|
+
if (process.env.FRANKLIN_NO_AUDIT === '1')
|
|
171
|
+
return;
|
|
166
172
|
const stats = getCachedStats();
|
|
167
173
|
const now = Date.now();
|
|
168
174
|
// Update totals
|
package/package.json
CHANGED