claude-token-saver 3.4.0 → 3.4.1
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/package.json +1 -1
- package/src/model-rules.js +5 -1
package/package.json
CHANGED
package/src/model-rules.js
CHANGED
|
@@ -35,6 +35,10 @@ import { homedir } from 'node:os';
|
|
|
35
35
|
// Post-promotion delegated-category error rate above this flags the rule
|
|
36
36
|
// for review (rule-health). Calibrated against local T0 avg error incidence.
|
|
37
37
|
export const HEALTH_ERR_RATE = 0.2;
|
|
38
|
+
// Below this many shape-eligible episodes in the window the error rate is
|
|
39
|
+
// noise (1 error in 4 episodes = 25% — instant flag), so the review flag is
|
|
40
|
+
// withheld until the sample is large enough to mean something.
|
|
41
|
+
export const HEALTH_MIN_SAMPLE = 10;
|
|
38
42
|
|
|
39
43
|
function stateDir() {
|
|
40
44
|
if (process.platform === 'win32') {
|
|
@@ -214,7 +218,7 @@ export function refreshModelRules(episodeStats, { now } = {}) {
|
|
|
214
218
|
r.count = s.count;
|
|
215
219
|
r.errRate = s.epCount > 0 ? s.errCount / s.epCount : 0;
|
|
216
220
|
r.lastSeen = now || r.lastSeen;
|
|
217
|
-
r.status = r.errRate > HEALTH_ERR_RATE ? 'review' : 'active';
|
|
221
|
+
r.status = r.errRate > HEALTH_ERR_RATE && s.epCount >= HEALTH_MIN_SAMPLE ? 'review' : 'active';
|
|
218
222
|
changed = true;
|
|
219
223
|
}
|
|
220
224
|
if (changed) {
|