@gamaze/hicortex 0.25.0 → 0.26.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/README.md +2 -0
- package/assets/dashboard.html +326 -64
- package/dist/calibration.d.ts +59 -0
- package/dist/calibration.js +53 -2
- package/dist/dashboard.d.ts +38 -9
- package/dist/dashboard.js +84 -13
- package/dist/db.js +72 -0
- package/dist/mcp-server.js +27 -4
- package/dist/nightly.js +26 -0
- package/dist/quality-scoreboard.d.ts +351 -0
- package/dist/quality-scoreboard.js +826 -0
- package/dist/recall-index.d.ts +7 -7
- package/dist/recall-index.js +19 -14
- package/dist/recall-precision.d.ts +41 -7
- package/dist/recall-precision.js +32 -12
- package/dist/retrieval.js +3 -2
- package/dist/state.d.ts +9 -0
- package/dist/storage.d.ts +11 -6
- package/dist/storage.js +16 -10
- package/dist/types.d.ts +17 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -288,6 +288,8 @@ Config at `~/.hicortex/config.json`. Created by `init`. Key options:
|
|
|
288
288
|
| `memorySoftCap` | Soft cap on the memory corpus (default 10000). When the corpus exceeds this, the nightly's capacity-eviction stage removes the lowest-`effectiveStrength` memories (ties broken by oldest access) until under the cap — the active forgetting mechanism that bounds DB size, vector-index RAM, and consolidation workload. `0` disables eviction (indefinite growth — the pre-#245 behaviour). The evicted tail is cold by construction (effectiveStrength is the same decay-weighted score the recall ranker uses, so these were not surfacing in the top-k anyway). At 10K memories the load + JS sort is <100 ms |
|
|
289
289
|
| `updateChannel` | Release channel pinned into the generated daemon/timer ExecStart for **npx-thin** installs (global-binary installs use the absolute binary and are unaffected). A dist-tag (`"rc"`, `"next"`) or an exact version (`"0.17.1"`). E.g. `"rc"` → the timer runs `npx -y @gamaze/hicortex@rc nightly`, so the host tracks the rc dist-tag (an internal fleet can ride rc through a pre-promotion soak). Validated as `[\w.\-]+` (rejects anything that'd break the unit/plist templates). Absent → auto-detect (bare on `latest`, else `@next`). (0.17.1) |
|
|
290
290
|
| `nightlyHour` | **Deprecated (0.17) single-slot fallback.** Local hour (0–23) honoured only when `consolidationHours` is absent — yields one daily consolidation slot at that hour (preserves the pre-0.17 "one daily job" intent). New installs should use `consolidationHours` |
|
|
291
|
+
| `qualityGrading` | Explicit opt-in for the weekly recall-quality grading pass (default **off**). The pass sends a redacted prompt excerpt and the pushed index line to a third-party decisions endpoint for scoring; with the key off (or absent) the stage skips and logs a health line. Also requires the endpoint API key (OPENROUTER_HICORTEX_KEY env) and `qualityGradeModel`. |
|
|
292
|
+
| `qualityGradeModel` | The model id the grading lane requests when `qualityGrading` is on. No default — absent → the stage skips (greppable health line). |
|
|
291
293
|
| `telemetry` | Anonymous usage telemetry. **On by default and not written into config by `init`** — add `"telemetry": false` yourself (or set `HICORTEX_TELEMETRY=off`) to opt out. Inspect exactly what is sent with `hicortex telemetry` |
|
|
292
294
|
|
|
293
295
|
**Calibration is release-managed.** The ~35 tuning keys earlier releases exposed (recall breadth, relevance floors, ranking weights, decay speed, dedup/supersession/correction thresholds, the weak-primary floor) are no longer config: they are constants that ship with each release and change only in releases, with the eval evidence linked in the changelog. Config values for them are ignored — the server prints a one-time boot warning naming each ignored key. Your config file now describes your *install* (mode, model, schedules, identity, budgets), not the brain's tuning. The one deliberate exception is `recallCrossProjectMinSimilarity` — on the `firstRunLookbackDays` precedent, it is a per-install posture dial rather than corpus calibration, so it stayed a live config key.
|
package/assets/dashboard.html
CHANGED
|
@@ -467,7 +467,32 @@
|
|
|
467
467
|
.rec-l1 .l1txt{ color:var(--dim); overflow:hidden; text-overflow:ellipsis; font-size:10.5px; letter-spacing:-.01em; }
|
|
468
468
|
.rec-l1 b{ color:var(--green-mid); font-weight:600; }
|
|
469
469
|
.rec-l1.below b{ color:var(--dim); }
|
|
470
|
-
#
|
|
470
|
+
/* #578 quality drawers (divergence + contested): native details/summary
|
|
471
|
+
in the card's .csub scale — collapsed they are one dim line, open they
|
|
472
|
+
stack their rows inside the card (no page modal for ~5 rows/week).
|
|
473
|
+
Theme tokens only; the thumbs are small ghost buttons. */
|
|
474
|
+
.rec-det{ font-size:10.5px; color:var(--dim); }
|
|
475
|
+
.rec-det summary{ cursor:pointer; color:var(--dim); letter-spacing:-.01em; user-select:none; }
|
|
476
|
+
.rec-det summary:hover{ color:var(--text); }
|
|
477
|
+
.rec-det[open] summary{ color:var(--text); }
|
|
478
|
+
.rec-det-body{ margin:4px 0 2px; display:flex; flex-direction:column; gap:4px; }
|
|
479
|
+
.rec-det-body .rec-line{ font-size:10.5px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
480
|
+
.rec-contest-empty{ font-style:italic; }
|
|
481
|
+
.rec-thumb{ border:1px solid color-mix(in srgb, var(--text) 22%, transparent); background:none; color:var(--dim); border-radius:5px; font-size:11px; line-height:1; padding:2px 6px; cursor:pointer; }
|
|
482
|
+
.rec-thumb:hover{ color:var(--text); border-color:color-mix(in srgb, var(--text) 45%, transparent); }
|
|
483
|
+
.rec-thumb.ok:hover{ color:var(--green); border-color:var(--green); }
|
|
484
|
+
.rec-thumb.no:hover{ color:var(--red); border-color:var(--red); }
|
|
485
|
+
/* #591 plain headline — the gauge verdict as a sentence under the band */
|
|
486
|
+
.rec-plain{ font-size:11px; color:var(--dim); line-height:1.5; }
|
|
487
|
+
.rec-plain .dir-good{ color:var(--green-mid); font-weight:600; }
|
|
488
|
+
.rec-plain .dir-bad{ color:var(--red); font-weight:600; }
|
|
489
|
+
.rec-plain .dir-mixed{ color:var(--amber); font-weight:600; }
|
|
490
|
+
/* #591 valence tags on the Tier-1 rows — green = improving regardless of sign */
|
|
491
|
+
.rec-l1 .l1tag.good{ color:var(--green-mid); }
|
|
492
|
+
.rec-l1 .l1tag.bad{ color:var(--red); }
|
|
493
|
+
.rec-l1 .l1tag.flat{ color:var(--faint); }
|
|
494
|
+
.rec-item{ display:flex; align-items:center; gap:6px; min-width:0; }
|
|
495
|
+
.rec-item .rec-item-line{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; color:var(--dim); }
|
|
471
496
|
.b-health{ display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); white-space:nowrap; }
|
|
472
497
|
.dot{ width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 10px color-mix(in srgb, var(--green) 70%, transparent); animation:breathe 3.2s ease-in-out infinite; flex:none; }
|
|
473
498
|
.dot.blue{ background:var(--blue); box-shadow:0 0 10px color-mix(in srgb, var(--blue) 70%, transparent); }
|
|
@@ -1264,32 +1289,60 @@
|
|
|
1264
1289
|
<div class="csub" id="tok-sub"> </div>
|
|
1265
1290
|
<div id="tok-nights" aria-label="LLM tokens per nightly run this billing period"></div>
|
|
1266
1291
|
</div>
|
|
1267
|
-
<!-- Memory Precision (#476, owner retitle
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1292
|
+
<!-- Memory Precision (#476, owner retitle; #578 quality audit; #591
|
|
1293
|
+
presentation pass) — ONE card, two context levels + the quality
|
|
1294
|
+
instrument. Level 2 (recall depth) keeps the #426 U-band + zone
|
|
1295
|
+
word + provisional-hover semantics; the marker/tooltip read the
|
|
1296
|
+
WINDOW ratio off D.memory_precision.level2 (a pre-#476 server has
|
|
1297
|
+
no block → the headline ratio — today's rendering exactly). The
|
|
1298
|
+
#578 audit (owner: "do the numbers earn their place"): mean
|
|
1299
|
+
similarity and redundant share are TOOLTIP-ONLY (high cosine was
|
|
1300
|
+
the noise's camouflage — not actionable), divergence lives in a
|
|
1301
|
+
details drawer, and the FACE carries what answers "is recall
|
|
1302
|
+
quality improving": uses-per-showing (the big word), pushes/lines
|
|
1303
|
+
volume, and the Tier-1 rows with per-change deltas off the
|
|
1304
|
+
server's change-registry entries while the raw window covers
|
|
1305
|
+
them. The #591 pass (owner product feedback: the card must
|
|
1306
|
+
SELF-INTERPRET) makes that face plain: every Tier-1 row reads in
|
|
1307
|
+
plain words with its one-line meaning (MP_NAME), every delta
|
|
1308
|
+
carries a direction arrow colored by the explicit per-metric
|
|
1309
|
+
valence map (MP_GOOD — green = improving regardless of sign), the
|
|
1310
|
+
gauge verdict gains a plain sentence beneath the band (#rec-plain:
|
|
1311
|
+
the zone's meaning in words + the window-vs-baseline caveat + a
|
|
1312
|
+
direction word off the covered deltas), and the technical layer
|
|
1313
|
+
(attribution coverage, the bar value, exact definitions) demotes
|
|
1314
|
+
behind per-row tooltips + the existing drawers. The contested
|
|
1315
|
+
drawer (#578 judgment layer) lazily fetches
|
|
1316
|
+
/dashboard/quality/contested and PUTs the owner's thumbs — no
|
|
1317
|
+
grading data in the ≤ 2 KB memory_precision block — and its empty
|
|
1318
|
+
state distinguishes "grading not running" (zero verdicts in the
|
|
1319
|
+
newest snapshot) from "grader confident". The window rides the
|
|
1320
|
+
#452 selector via the echoed window_days — never hardcoded, never
|
|
1321
|
+
a second range control. -->
|
|
1283
1322
|
<div class="bseg" id="lim-rec">
|
|
1284
1323
|
<div class="gh"><span class="t">Memory Precision</span><span class="sub" id="rec-sub">uses per showing</span></div>
|
|
1285
1324
|
<div class="big"><b class="n rec-word" id="rec-zone">—</b></div>
|
|
1286
1325
|
<div class="rec-bandrow" id="rec-bandrow"><div class="rec-band" id="rec-band"></div><i class="rec-dot" id="rec-dot" hidden></i></div>
|
|
1326
|
+
<div class="rec-plain" id="rec-plain" hidden></div>
|
|
1287
1327
|
<div class="rec-l1" id="rec-l1" hidden style="display:block">
|
|
1288
|
-
<div class="l1row" id="l1-
|
|
1289
|
-
<div class="l1row" id="l1-
|
|
1290
|
-
<div class="l1row" id="l1-
|
|
1328
|
+
<div class="l1row" id="l1-blk"> </div>
|
|
1329
|
+
<div class="l1row" id="l1-cross"> </div>
|
|
1330
|
+
<div class="l1row" id="l1-sub"> </div>
|
|
1331
|
+
<div class="l1row" id="l1-recy"> </div>
|
|
1332
|
+
<div class="l1row" id="l1-vol"> </div>
|
|
1291
1333
|
</div>
|
|
1292
|
-
<
|
|
1334
|
+
<details id="rec-divdet" class="rec-det" hidden>
|
|
1335
|
+
<summary>divergence · <span id="rec-divn">0</span> never read</summary>
|
|
1336
|
+
<div id="rec-div-lines" class="rec-det-body"></div>
|
|
1337
|
+
</details>
|
|
1338
|
+
<details id="rec-series" class="rec-det" hidden>
|
|
1339
|
+
<summary>corpus & graded · last nightly</summary>
|
|
1340
|
+
<div id="rec-series-body" class="rec-det-body"></div>
|
|
1341
|
+
</details>
|
|
1342
|
+
<details id="rec-contest" class="rec-det">
|
|
1343
|
+
<summary>contested lines · <span id="rec-contest-n">—</span></summary>
|
|
1344
|
+
<div id="rec-contest-rows" class="rec-det-body rec-contest-empty">open to load</div>
|
|
1345
|
+
</details>
|
|
1293
1346
|
</div>
|
|
1294
1347
|
</div>
|
|
1295
1348
|
<!-- row 2 · ops & maturity — capture health · 30 nights · maturity split · model -->
|
|
@@ -3352,6 +3405,47 @@ function recallUsesZone(v,z){
|
|
|
3352
3405
|
/* vocabulary amendment (owner, 2026-09-14): the middle zone's word is
|
|
3353
3406
|
Healthy — Low / Healthy / Overfetching (keys + echo field names stay) */
|
|
3354
3407
|
const RECALL_ZONE_WORD = {low:'Low',normal:'Healthy',over:'Overfetching'};
|
|
3408
|
+
const RECALL_ZONE_PLAIN={low:'shown memories are rarely picked up',normal:'shown memories get picked up at a healthy rate',over:'shown memories get picked up almost always'};
|
|
3409
|
+
/* #591 presentation pass — the per-metric direction map: which way is
|
|
3410
|
+
improving for each Tier-1 metric. ONE constant owns every sign
|
|
3411
|
+
assumption on the card; a metric whose good direction flips changes
|
|
3412
|
+
here and nowhere else. Plain names beside it: the reader-facing
|
|
3413
|
+
vocabulary (the internal metric keys stay in the payload). */
|
|
3414
|
+
const MP_GOOD={block_size:'down',cross_share:'down',sub_bar_share:'down',recycling:'down'};
|
|
3415
|
+
const MP_NAME={block_size:'Clutter per prompt',cross_share:'Foreign-project content',sub_bar_share:'Weak matches',recycling:'Memory churn'};
|
|
3416
|
+
/* #591 plain headline — pure composer (the recallUsesZone convention):
|
|
3417
|
+
zone meaning in words · the window-vs-baseline caveat when the window
|
|
3418
|
+
still covers a registry change date · a direction word off the covered
|
|
3419
|
+
tier1 deltas. Returns {html} or null when there is no zone. */
|
|
3420
|
+
function mpPlainHeadline(zk,mp,todayStr){
|
|
3421
|
+
if(!zk) return null;
|
|
3422
|
+
if(typeof todayStr!=='string') todayStr=new Date().toISOString().slice(0,10);
|
|
3423
|
+
const parts=[RECALL_ZONE_PLAIN[zk]];
|
|
3424
|
+
const wd=mp&&typeof mp.window_days==='number'?mp.window_days:30;
|
|
3425
|
+
const changes=mp&&Array.isArray(mp.changes)?mp.changes:[];
|
|
3426
|
+
if(changes.length){
|
|
3427
|
+
const from=new Date(Date.parse(todayStr)-wd*86400000).toISOString().slice(0,10);
|
|
3428
|
+
const newest=changes.slice().sort((x,y)=>(x.date<y.date?1:-1))[0];
|
|
3429
|
+
if(typeof newest.date==='string'&&newest.date>=from)
|
|
3430
|
+
parts.push('the '+wd+'-day window still covers pre-change days ('+newest.date+')');
|
|
3431
|
+
}
|
|
3432
|
+
let imp=0,wor=0;
|
|
3433
|
+
for(const ch of changes){
|
|
3434
|
+
for(const k in MP_GOOD){
|
|
3435
|
+
const b=ch&&ch.before&&typeof ch.before[k]==='number'?ch.before[k]:null;
|
|
3436
|
+
const a=ch&&ch.after&&typeof ch.after[k]==='number'?ch.after[k]:null;
|
|
3437
|
+
if(b===null||a===null||a===b) continue;
|
|
3438
|
+
if((a<b)===(MP_GOOD[k]==='down')) imp++; else wor++;
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
let dir=null;
|
|
3442
|
+
if(imp>0&&wor===0) dir={word:'improving',cls:'good'};
|
|
3443
|
+
else if(wor>0&&imp===0) dir={word:'worsening',cls:'bad'};
|
|
3444
|
+
else if(imp>0&&wor>0) dir={word:'mixed',cls:'mixed'};
|
|
3445
|
+
let html=parts.join(' · ');
|
|
3446
|
+
if(dir) html+=' · deltas <span class="dir-'+dir.cls+'">'+dir.word+'</span>';
|
|
3447
|
+
return {html};
|
|
3448
|
+
}
|
|
3355
3449
|
/* ONE stop table drives the band fill AND the big word's sampled color —
|
|
3356
3450
|
mirrors the --red/--amber/--green theme tokens (tests pin the lockstep),
|
|
3357
3451
|
so word, marker, and gradient cannot disagree. Stops sit at 0, low_max,
|
|
@@ -3385,12 +3479,14 @@ function renderRecBand(ups){
|
|
|
3385
3479
|
if(mp&&mp.level2) ups=mp.level2.uses_per_showing;
|
|
3386
3480
|
lastRecUses=ups;
|
|
3387
3481
|
renderRecL1(mp);
|
|
3482
|
+
renderRecSeries();
|
|
3388
3483
|
const z=F&&F.thresholds?F.thresholds.recall_uses:null;
|
|
3389
3484
|
const axis=z&&typeof z.axis_max==='number'&&z.axis_max>0?z.axis_max:null;
|
|
3390
3485
|
const row=el('rec-bandrow'), band=el('rec-band'), dot=el('rec-dot'), word=el('rec-zone');
|
|
3391
3486
|
const theme=document.documentElement.dataset.theme==='light'?'light':'dark';
|
|
3392
3487
|
if(!axis){ /* pre-band server — quiet degrade */
|
|
3393
3488
|
row.hidden=true; dot.hidden=true; dot.title='';
|
|
3489
|
+
const pl0=el('rec-plain'); pl0.hidden=true; pl0.innerHTML='';
|
|
3394
3490
|
word.textContent='—'; word.className='n rec-word none';
|
|
3395
3491
|
word.style.color=''; word.style.textShadow='none'; word.title='no showings yet';
|
|
3396
3492
|
return;
|
|
@@ -3418,8 +3514,12 @@ function renderRecBand(ups){
|
|
|
3418
3514
|
word.style.color='rgb('+rgb+')';
|
|
3419
3515
|
word.style.textShadow=theme==='dark'?'0 0 12px rgba('+rgb+',.32)':'none';
|
|
3420
3516
|
word.title=dot.title;
|
|
3517
|
+
/* #591: the zone verdict in plain words beneath the band — meaning +
|
|
3518
|
+
window caveat + direction word, all off the pure composer */
|
|
3519
|
+
const pl=el('rec-plain'); const ph=mpPlainHeadline(zk,mp); pl.hidden=false; pl.innerHTML=ph?ph.html:'';
|
|
3421
3520
|
}else{
|
|
3422
3521
|
dot.hidden=true; dot.title='';
|
|
3522
|
+
const pl1=el('rec-plain'); pl1.hidden=true; pl1.innerHTML='';
|
|
3423
3523
|
word.textContent='—'; word.className='n rec-word none';
|
|
3424
3524
|
word.style.color=''; word.style.textShadow='none';
|
|
3425
3525
|
word.title='no showings yet';
|
|
@@ -3431,22 +3531,30 @@ function renderRecBand(ups){
|
|
|
3431
3531
|
before the counter was ever seeded). */
|
|
3432
3532
|
}
|
|
3433
3533
|
|
|
3434
|
-
/* ---------- Memory Precision — Level 1, the pushed index (#476)
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3534
|
+
/* ---------- Memory Precision — Level 1, the pushed index (#476) + the #578
|
|
3535
|
+
quality audit (owner: "do the numbers earn their place") + the #591
|
|
3536
|
+
presentation pass (owner product feedback: the card must self-interpret).
|
|
3537
|
+
The FACE carries the Tier-1 quality rows in PLAIN words — MP_NAME gives
|
|
3538
|
+
each internal metric its reader-facing name, every row appends its
|
|
3539
|
+
one-line meaning with the good direction DERIVED off MP_GOOD (never an
|
|
3540
|
+
inline sign assumption), and the per-change deltas off the server's
|
|
3541
|
+
change-registry entries (mp.changes; numbers computed at render
|
|
3542
|
+
server-side, the page never freezes one) render as valence tags: the
|
|
3543
|
+
arrow is the SIGN of the move, the color says whether that direction is
|
|
3544
|
+
GOOD for the metric (green = improving regardless of sign). The
|
|
3545
|
+
technical layer demotes behind PER-ROW titles (#591 progressive
|
|
3546
|
+
disclosure): attribution coverage, the echoed cross-project bar value,
|
|
3547
|
+
and each metric's exact definition. Mean similarity + redundant share
|
|
3548
|
+
stay card-level TOOLTIP-ONLY (the #578 ruling — high cosine was the
|
|
3549
|
+
noise's camouflage); divergence lives in the #rec-divdet drawer below.
|
|
3550
|
+
Absent tier1 (a pre-#578 server) → the quality rows hide and the card
|
|
3551
|
+
keeps the #476 shape; absent block entirely → the whole row hides and
|
|
3552
|
+
the sub keeps the old label (the capture card's block-absence guard). */
|
|
3446
3553
|
function renderRecL1(mp){
|
|
3447
|
-
const row=el('rec-l1'), sub=el('rec-sub')
|
|
3554
|
+
const row=el('rec-l1'), sub=el('rec-sub');
|
|
3448
3555
|
if(!mp||!mp.level1||!mp.level2){
|
|
3449
|
-
row.hidden=true;
|
|
3556
|
+
row.hidden=true;
|
|
3557
|
+
const dd0=el('rec-divdet'); if(dd0) dd0.hidden=true;
|
|
3450
3558
|
if(sub) sub.textContent='uses per showing';
|
|
3451
3559
|
return;
|
|
3452
3560
|
}
|
|
@@ -3454,39 +3562,193 @@ function renderRecL1(mp){
|
|
|
3454
3562
|
const l1=mp.level1;
|
|
3455
3563
|
const floor=(F&&F.thresholds&&typeof F.thresholds.recall_min_similarity==='number')?F.thresholds.recall_min_similarity:null;
|
|
3456
3564
|
const ra=(l1.thresholds&&typeof l1.thresholds.redundant_above==='number')?l1.thresholds.redundant_above:null;
|
|
3457
|
-
const mins=(l1.thresholds&&typeof l1.thresholds.divergence_min_shown==='number')?l1.thresholds.divergence_min_shown:5;
|
|
3458
3565
|
const sim=(typeof l1.mean_similarity==='number'&&isFinite(l1.mean_similarity))?l1.mean_similarity:null;
|
|
3459
3566
|
const red=(typeof l1.redundant_share==='number'&&isFinite(l1.redundant_share))?l1.redundant_share:null;
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3567
|
+
/* the tooltip carries the demoted #476 numbers — mean similarity (with the
|
|
3568
|
+
recall-floor context) + the redundant share (#578 audit: face rows these
|
|
3569
|
+
are not; high cosine was the noise's camouflage) */
|
|
3570
|
+
row.title='pushed index, last '+(mp.window_days||90)+' days — mean similarity '+
|
|
3571
|
+
(sim!==null?sim.toFixed(2):'—')+
|
|
3572
|
+
(floor!==null?' (recall floor '+floor.toFixed(2)+')':'')+
|
|
3573
|
+
(red!==null&&ra!==null?'; repeated-known '+Math.round(clamp(red,0,1)*100)+'% (≥'+ra.toFixed(2)+' cosine vs the session\'s standing context — lessons + identity)':'');
|
|
3574
|
+
renderRecDivDet(mp);
|
|
3575
|
+
const t=mp.tier1;
|
|
3576
|
+
if(!t){
|
|
3577
|
+
/* pre-#578 server: no quality rows exist — the face rows hide (their
|
|
3578
|
+
markup is #578's), the tooltip above still carries the #476 numbers,
|
|
3579
|
+
and the divergence drawer still renders from mp.divergence. */
|
|
3580
|
+
row.hidden=true;
|
|
3581
|
+
return;
|
|
3582
|
+
}
|
|
3583
|
+
row.hidden=false;
|
|
3584
|
+
row.classList.remove('below');
|
|
3585
|
+
/* the good-direction word derives off the map — 'fewer is better' for a
|
|
3586
|
+
down-good metric — never written inline per row */
|
|
3587
|
+
const better=k=>MP_GOOD[k]==='down'?'fewer is better':'more is better';
|
|
3588
|
+
/* per-change delta tags (#591 valence): one tag per registry entry the
|
|
3589
|
+
window covers and the server computed both sides for. The ARROW is the
|
|
3590
|
+
sign of the move (↓ a<b, ↑ a>b); the COLOR says whether that direction
|
|
3591
|
+
is good for the metric (MP_GOOD) — green = improving regardless of
|
|
3592
|
+
sign. pct when the before is nonzero, the raw pair otherwise (a 0→x
|
|
3593
|
+
move has no honest percentage); a flat pair is ±0% with no arrow. */
|
|
3594
|
+
const tag=(k)=>{
|
|
3595
|
+
if(!Array.isArray(mp.changes)) return '';
|
|
3596
|
+
const parts=[];
|
|
3597
|
+
for(const ch of mp.changes){
|
|
3598
|
+
const b=ch.before&&typeof ch.before[k]==='number'?ch.before[k]:null;
|
|
3599
|
+
const a=ch.after&&typeof ch.after[k]==='number'?ch.after[k]:null;
|
|
3600
|
+
if(b===null||a===null) continue;
|
|
3601
|
+
if(a===b){ parts.push(ch.id+' <span class="l1tag flat">±0%</span>'); continue; }
|
|
3602
|
+
const text=b!==0?Math.abs(Math.round((a-b)/b*100))+'%':b+'→'+a;
|
|
3603
|
+
const arrow=a<b?'↓':'↑';
|
|
3604
|
+
const cls=(MP_GOOD[k]==='down'?a<b:a>b)?'good':'bad';
|
|
3605
|
+
parts.push(ch.id+' <span class="l1tag '+cls+'">'+arrow+text+'</span>');
|
|
3606
|
+
}
|
|
3607
|
+
return parts.length?' ('+parts.join(', ')+')':'';
|
|
3608
|
+
};
|
|
3609
|
+
const bs=(typeof t.block_size==='number'&&isFinite(t.block_size))?t.block_size.toFixed(1):'—';
|
|
3610
|
+
const cs=(typeof t.cross_share==='number'&&isFinite(t.cross_share))?Math.round(t.cross_share*100)+'%':'—';
|
|
3611
|
+
const cv=(typeof t.attribution_coverage==='number'&&isFinite(t.attribution_coverage))?Math.round(t.attribution_coverage*100)+'%':'—';
|
|
3612
|
+
const sb=(typeof t.sub_bar_share==='number'&&isFinite(t.sub_bar_share))?Math.round(t.sub_bar_share*100)+'%':'—';
|
|
3613
|
+
const rc=(typeof t.recycling==='number'&&isFinite(t.recycling))?Math.round(t.recycling).toString():'—';
|
|
3614
|
+
const bar=(typeof t.cross_project_bar==='number'&&isFinite(t.cross_project_bar))?t.cross_project_bar.toFixed(2):'—';
|
|
3615
|
+
el('l1-blk').innerHTML='<b>'+MP_NAME.block_size+': '+bs+' memories shown</b> — '+better('block_size')+tag('block_size');
|
|
3616
|
+
el('l1-blk').title='average memories shown per prompt (pushed index block size)';
|
|
3617
|
+
el('l1-cross').innerHTML=MP_NAME.cross_share+': '+cs+' of what sessions see — '+better('cross_share')+tag('cross_share');
|
|
3618
|
+
el('l1-cross').title='share of attributable pushed lines whose memory belongs to a different project · attribution coverage '+cv+' (how many lines could be attributed to a project)';
|
|
3619
|
+
el('l1-sub').innerHTML=MP_NAME.sub_bar_share+': '+sb+' of foreign lines sit below the relevance bar — '+better('sub_bar_share')+tag('sub_bar_share');
|
|
3620
|
+
el('l1-sub').title='foreign-project lines whose match strength sits below the cross-project bar ('+bar+')';
|
|
3621
|
+
el('l1-recy').innerHTML=MP_NAME.recycling+': '+rc+' distinct memories a day — '+better('recycling')+tag('recycling');
|
|
3622
|
+
el('l1-recy').title='average distinct memories shown per day';
|
|
3623
|
+
el('l1-vol').innerHTML=fmt(t.pushes)+' prompts served · '+fmt(t.lines)+' memories shown';
|
|
3624
|
+
el('l1-vol').title='denominators: recall pushes · pushed index lines';
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
/* divergence drawer (#578 audit: off the face, into the details element).
|
|
3628
|
+
The count rides the summary; the ≤3 lines ride the drawer body — no memory
|
|
3629
|
+
lists on the card FACE (the 2026-09-12 ruling stands; a drawer is not a
|
|
3630
|
+
face row). */
|
|
3631
|
+
function renderRecDivDet(mp){
|
|
3632
|
+
const dd=el('rec-divdet'), dn=el('rec-divn'), dl=el('rec-div-lines');
|
|
3633
|
+
if(!dd||!dn||!dl) return;
|
|
3634
|
+
const dv=mp&&mp.divergence, n=(dv&&typeof dv.count==='number')?dv.count:0;
|
|
3635
|
+
if(!dv||!n){ dd.hidden=true; return; }
|
|
3636
|
+
dd.hidden=false;
|
|
3637
|
+
dn.textContent=n;
|
|
3638
|
+
dl.innerHTML='';
|
|
3639
|
+
for(const it of (dv.top||[])){
|
|
3640
|
+
const d=document.createElement('div');
|
|
3641
|
+
d.className='rec-line';
|
|
3642
|
+
d.textContent=it.line+' ('+it.shown+'×)';
|
|
3643
|
+
dl.appendChild(d);
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
/* ---------- corpus & graded drawer (#578): the snapshot-stamped half.
|
|
3648
|
+
The corpus-health trio (near-dup clusters, scope-anchor rate, canonical
|
|
3649
|
+
label drift) and the graded aggregates are computed by the NIGHTLY
|
|
3650
|
+
snapshot writer only (the dup-cluster KNN alone forbids a per-request
|
|
3651
|
+
path), so they render from the SNAPSHOT SERIES — the newest snapshot row
|
|
3652
|
+
carrying metrics.quality — never from live work. No snapshots with the
|
|
3653
|
+
block yet (first nights after upgrade) → the drawer hides. */
|
|
3654
|
+
function renderRecSeries(){
|
|
3655
|
+
const det=el('rec-series'), body=el('rec-series-body');
|
|
3656
|
+
if(!det||!body) return;
|
|
3657
|
+
let q=null;
|
|
3658
|
+
if(D&&Array.isArray(D.series)){
|
|
3659
|
+
for(let i=D.series.length-1;i>=0;i--){
|
|
3660
|
+
const m=D.series[i]&&D.series[i].metrics;
|
|
3661
|
+
if(m&&m.quality){ q=m.quality; break; }
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
if(!q){ det.hidden=true; return; }
|
|
3665
|
+
det.hidden=false;
|
|
3666
|
+
const c=q.corpus||{}, g=q.graded||{};
|
|
3667
|
+
body.innerHTML='';
|
|
3668
|
+
const row=(k,v)=>{
|
|
3669
|
+
const d=document.createElement('div');
|
|
3670
|
+
d.className='rec-line';
|
|
3671
|
+
d.textContent=k+': '+v;
|
|
3672
|
+
body.appendChild(d);
|
|
3673
|
+
};
|
|
3674
|
+
row('near-dup clusters',(typeof c.dup_clusters==='number'?c.dup_clusters:'—')+' at the merge bar');
|
|
3675
|
+
row('scope-anchored',(typeof c.scope_anchor_rate==='number'?Math.round(c.scope_anchor_rate*100)+'%':'—')+' of live memories');
|
|
3676
|
+
row('label drift',(typeof c.canonical_drift==='number'?c.canonical_drift:'—')+' non-canonical');
|
|
3677
|
+
row('graded useful',(typeof g.useful_share==='number'?Math.round(g.useful_share*100)+'%':'—')+' of '+(typeof g.graded==='number'?g.graded:0)+' verdicts');
|
|
3488
3678
|
}
|
|
3489
3679
|
|
|
3680
|
+
/* ---------- contested drawer (#578 judgment layer). Lazy by design: graded
|
|
3681
|
+
data NEVER rides the memory_precision block (≤ 2 KB discipline); the list
|
|
3682
|
+
is fetched on FIRST OPEN of the details element only, then kept in sync
|
|
3683
|
+
after each thumb. Thumbs PUT /dashboard/quality/verdict {id, verdict:
|
|
3684
|
+
1|-1} (numeric — the server's strict body), and a thumbed item leaves the
|
|
3685
|
+
list (the server clears owner-answered rows). Fail-soft: a fetch error
|
|
3686
|
+
renders the error line, never a dead drawer. */
|
|
3687
|
+
/* #591 honest empty state: an empty contested list means different things
|
|
3688
|
+
depending on whether ANY verdicts exist. The graded count rides the
|
|
3689
|
+
newest nightly snapshot (the same D.series walk the corpus drawer does)
|
|
3690
|
+
— zero graded rows means the opt-in weekly grading lane is not running,
|
|
3691
|
+
and the drawer must never claim grader confidence over zero verdicts. */
|
|
3692
|
+
function newestGradedCount(){
|
|
3693
|
+
if(!D||!Array.isArray(D.series)) return null;
|
|
3694
|
+
for(let i=D.series.length-1;i>=0;i--){
|
|
3695
|
+
const q=D.series[i]&&D.series[i].metrics&&D.series[i].metrics.quality;
|
|
3696
|
+
if(q&&q.graded&&typeof q.graded.graded==='number') return q.graded.graded;
|
|
3697
|
+
}
|
|
3698
|
+
return null;
|
|
3699
|
+
}
|
|
3700
|
+
let CONTESTED_LOADED=false;
|
|
3701
|
+
async function loadContested(force){
|
|
3702
|
+
const box=el('rec-contest-rows'), num=el('rec-contest-n');
|
|
3703
|
+
if(!box) return;
|
|
3704
|
+
if(CONTESTED_LOADED&&!force) return;
|
|
3705
|
+
try{
|
|
3706
|
+
const r=await api('/dashboard/quality/contested?limit=20');
|
|
3707
|
+
CONTESTED_LOADED=true;
|
|
3708
|
+
if(num) num.textContent=String(r.total);
|
|
3709
|
+
box.innerHTML='';
|
|
3710
|
+
box.classList.remove('rec-contest-empty');
|
|
3711
|
+
if(!r.items||!r.items.length){
|
|
3712
|
+
box.classList.add('rec-contest-empty');
|
|
3713
|
+
const graded=newestGradedCount();
|
|
3714
|
+
box.textContent=typeof graded==='number'&&graded>0?'nothing contested — the grader is confident this week':'nothing graded yet — weekly grading is off or has not run';
|
|
3715
|
+
return;
|
|
3716
|
+
}
|
|
3717
|
+
for(const it of r.items){
|
|
3718
|
+
const row=document.createElement('div');
|
|
3719
|
+
row.className='rec-item';
|
|
3720
|
+
const line=document.createElement('span');
|
|
3721
|
+
line.className='rec-item-line';
|
|
3722
|
+
line.textContent=(it.line||('['+it.memory_id+'] memory no longer available'))+
|
|
3723
|
+
(it.prompt_excerpt?' — prompt: '+it.prompt_excerpt:'');
|
|
3724
|
+
line.title='score '+(typeof it.score==='number'?it.score.toFixed(2):'—')+
|
|
3725
|
+
', confidence '+(typeof it.confidence==='number'?it.confidence.toFixed(2):'—');
|
|
3726
|
+
const up=document.createElement('button');
|
|
3727
|
+
up.className='rec-thumb ok'; up.textContent='👍'; up.title='useful';
|
|
3728
|
+
const down=document.createElement('button');
|
|
3729
|
+
down.className='rec-thumb no'; down.textContent='👎'; down.title='not useful';
|
|
3730
|
+
const send=async(v)=>{
|
|
3731
|
+
try{
|
|
3732
|
+
await api('/dashboard/quality/verdict',{method:'PUT',body:JSON.stringify({id:it.id,verdict:v})});
|
|
3733
|
+
row.remove();
|
|
3734
|
+
if(num) num.textContent=String(Math.max(0,(parseInt(num.textContent,10)||1)-1));
|
|
3735
|
+
}catch(e){ /* fail-soft: the row stays, the next open retries */ }
|
|
3736
|
+
};
|
|
3737
|
+
up.addEventListener('click',()=>send(1));
|
|
3738
|
+
down.addEventListener('click',()=>send(-1));
|
|
3739
|
+
row.appendChild(line); row.appendChild(up); row.appendChild(down);
|
|
3740
|
+
box.appendChild(row);
|
|
3741
|
+
}
|
|
3742
|
+
}catch(e){
|
|
3743
|
+
box.classList.add('rec-contest-empty');
|
|
3744
|
+
box.textContent='contested list unavailable ('+(e&&e.message?e.message:'load failed')+')';
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
(function(){
|
|
3748
|
+
const det=el('rec-contest');
|
|
3749
|
+
if(det) det.addEventListener('toggle',()=>{ if(det.open) loadContested(); });
|
|
3750
|
+
})();
|
|
3751
|
+
|
|
3490
3752
|
let MODEL_LABEL='';
|
|
3491
3753
|
/* #409 fix round 5 — owner ruling 2026-09-14 (verbatim): "I do NOT want to
|
|
3492
3754
|
know what it is compatible with, I want to know the fucking model." The
|
package/dist/calibration.d.ts
CHANGED
|
@@ -159,6 +159,65 @@ export declare const MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = 5;
|
|
|
159
159
|
* the same trust boundary as /distill's denoised conversation text).
|
|
160
160
|
*/
|
|
161
161
|
export declare const MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = 256;
|
|
162
|
+
/**
|
|
163
|
+
* One pinned quality change — the Tier-3 baseline discipline (#578): every
|
|
164
|
+
* change that can move recall quality pins its deploy DATE here (edited at
|
|
165
|
+
* release, exactly like a calibration constant's rationale comment), and the
|
|
166
|
+
* card computes each entry's before/after from the RAW event store at render
|
|
167
|
+
* (before = window up to the date, after = the date onward). No frozen
|
|
168
|
+
* numbers: a pinned number freezes a metric definition that will evolve
|
|
169
|
+
* (the moving-reference problem), a date does not. Baselines age out of raw
|
|
170
|
+
* events after the 90-day retention; the nightly snapshot's quality block
|
|
171
|
+
* carries the trend from there.
|
|
172
|
+
*/
|
|
173
|
+
export interface QualityChange {
|
|
174
|
+
/** Short machine id (rendered as the delta tag on the card face). */
|
|
175
|
+
id: string;
|
|
176
|
+
/** ISO date (UTC) the change deployed — the before/after split day. */
|
|
177
|
+
date: string;
|
|
178
|
+
/** Human label for the drawer/tooltip. */
|
|
179
|
+
label: string;
|
|
180
|
+
/** Source issue (provenance, the house convention). */
|
|
181
|
+
issue: number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The seeded change registry (#578): TWO
|
|
185
|
+
* entries for 2026-10-28 — #566 (the cross-project recall fence, bar
|
|
186
|
+
* CROSS_PROJECT_MIN_SIMILARITY) and #567 (project-label reconciliation,
|
|
187
|
+
* shipped in the same 0.25.0 release) — independent changes, independent
|
|
188
|
+
* before/afters, back-pinned now while the 90-day raw window still covers
|
|
189
|
+
* them. Future quality changes append their entry at release time (#569's
|
|
190
|
+
* decay fix is the next: its date lands when it deploys).
|
|
191
|
+
*/
|
|
192
|
+
export declare const QUALITY_CHANGES: readonly QualityChange[];
|
|
193
|
+
/**
|
|
194
|
+
* Weekly quality-grading call cap (#578: its own weekly lane, separate from
|
|
195
|
+
* nightlyLlmCallBudget) — different provider, different endpoint,
|
|
196
|
+
* independent starvation risk; folding it into the one #405 ceiling would
|
|
197
|
+
* let the consolidation LLM starve grading (or vice versa) with no signal.
|
|
198
|
+
* The per-call cost is negligible, so the cap bounds spend trivially.
|
|
199
|
+
* At cap the remaining sampled items DEFER to the next week (the week
|
|
200
|
+
* cursor does not advance past ungraded items — dup-over-loss).
|
|
201
|
+
* Release-managed: no config key, moving it is a release decision.
|
|
202
|
+
*/
|
|
203
|
+
export declare const QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
|
|
204
|
+
/**
|
|
205
|
+
* Auto-grader confidence below which a graded line lands in the CONTESTED
|
|
206
|
+
* slice for the owner's thumbs (#578). PROVISIONAL first anchor (the #426
|
|
207
|
+
* posture): 0.70, expected to move on fleet data. Applied at RENDER only
|
|
208
|
+
* (raw score + confidence are stored threshold-free; a recalibration never
|
|
209
|
+
* rewrites history).
|
|
210
|
+
*/
|
|
211
|
+
export declare const QUALITY_CONTESTED_CONFIDENCE = 0.7;
|
|
212
|
+
/**
|
|
213
|
+
* Render edge for "useful" on a graded score (#578): a grading `score`
|
|
214
|
+
* question answers 0..1; ≥ this reads useful in the graded-useful share.
|
|
215
|
+
* 0.5 — the scale's own midpoint, deliberately NOT the utility threshold
|
|
216
|
+
* calibrated for recall INJECTION trimming (0.75 — a different decision).
|
|
217
|
+
* Derived at render, never stored. PROVISIONAL alongside
|
|
218
|
+
* QUALITY_CONTESTED_CONFIDENCE.
|
|
219
|
+
*/
|
|
220
|
+
export declare const QUALITY_USEFUL_SCORE = 0.5;
|
|
162
221
|
/**
|
|
163
222
|
* Kill-switch for the deterministic volatility gate (#489, owner decision 5):
|
|
164
223
|
* false disables isVolatileStatusEntry's use in the distill path (entries
|
package/dist/calibration.js
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* the removal is never silent.
|
|
25
25
|
*/
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
exports.DRAIN_QUEUE_WARN_AGE_HOURS = exports.DRAIN_YIELD_PROBE_TIMEOUT_MS = exports.DRAIN_YIELD_WAIT_CAP_MS = exports.DRAIN_YIELD_POLL_MS = exports.DIAGNOSTIC_ENV_TIER = exports.OLLAMA_FLUSH_WAIT_MS = exports.OLLAMA_FLUSH_EVERY = exports.NUM_CTX = exports.DEFAULT_FIRST_RUN_LOOKBACK_DAYS = exports.ENRICH_STRENGTH_DELTA = exports.STAGE_TRUTH_STRENGTH = exports.STAGE_BELIEF_STRENGTH = void 0;
|
|
27
|
+
exports.CORRECTION_MIN_SIMILARITY = exports.DEDUP_AUTO_MERGE_THRESHOLD = exports.IMPORTANCE_SETTLE_WINDOW_DAYS = exports.IMPORTANCE_CEILING = exports.BM25_WEIGHT_DOMAIN = exports.BM25_WEIGHT_PROJECT = exports.BM25_WEIGHT_BODY = exports.BOTH_CHANNEL_BOOST = exports.RRF_VECTOR_WEIGHT = exports.RRF_FTS_WEIGHT = exports.RRF_COMPOSITE_WEIGHT = exports.RRF_K = exports.SCOPE_AFFINITY_WEIGHT = exports.SUPERSEDED_DEMOTION = exports.RECENCY_HEAD_DAYS = exports.RECENCY_HEAD_WEIGHT = exports.RECENCY_HOURLY_DECAY = exports.SCORE_RECENCY_WEIGHT = exports.CONNECTIONS_SATURATION_DEGREE = exports.SCORE_CONNECTIONS_WEIGHT = exports.SCORE_STRENGTH_WEIGHT = exports.SCORE_SIMILARITY_WEIGHT = exports.VOLATILE_GATE_MAX_CHARS = exports.VOLATILE_STATUS_FILTER = exports.QUALITY_USEFUL_SCORE = exports.QUALITY_CONTESTED_CONFIDENCE = exports.QUALITY_GRADE_WEEKLY_CALL_CAP = exports.QUALITY_CHANGES = exports.MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = exports.MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = exports.MEMORY_PRECISION_REDUNDANT_ABOVE = exports.MEMORY_PRECISION_WINDOW_DAYS = exports.RECALL_USES_AXIS_MAX = exports.RECALL_USES_NORMAL_MAX = exports.RECALL_USES_LOW_MAX = exports.RECALL_RESHOW_TURNS = exports.NOVELTY_FLOOR_SLOTS = exports.RECALL_TITLE_CHARS = exports.RECALL_MIN_PROMPT_CHARS = exports.RECALL_MAX_ITEMS = exports.CROSS_PROJECT_MIN_SIMILARITY = exports.RECALL_MIN_SIMILARITY = exports.SESSION_INTENT_WEIGHT = exports.COLD_EXPOSURE_SLOTS = exports.RECENT_WINDOW_DAYS = exports.RECENT_LIMIT = exports.SEARCH_LIMIT = exports.PROMOTION_STRENGTH_FLOOR = exports.PROMOTION_RATE = exports.DECAY_HALF_LIFE_DAYS = void 0;
|
|
28
|
+
exports.DRAIN_QUEUE_WARN_AGE_HOURS = exports.DRAIN_YIELD_PROBE_TIMEOUT_MS = exports.DRAIN_YIELD_WAIT_CAP_MS = exports.DRAIN_YIELD_POLL_MS = exports.DIAGNOSTIC_ENV_TIER = exports.OLLAMA_FLUSH_WAIT_MS = exports.OLLAMA_FLUSH_EVERY = exports.NUM_CTX = exports.DEFAULT_FIRST_RUN_LOOKBACK_DAYS = exports.ENRICH_STRENGTH_DELTA = exports.STAGE_TRUTH_STRENGTH = exports.STAGE_BELIEF_STRENGTH = exports.STAGE_FADING_STRENGTH = exports.STAGE_FADING_DAYS = exports.WEAK_PRIMARY_FLOOR = exports.CORRECTION_REWRITE_MIN_CONFIDENCE = void 0;
|
|
29
29
|
exports.resolveNumCtx = resolveNumCtx;
|
|
30
30
|
exports.resolveOllamaFlushEvery = resolveOllamaFlushEvery;
|
|
31
31
|
exports.resolveOllamaFlushWaitMs = resolveOllamaFlushWaitMs;
|
|
@@ -186,6 +186,57 @@ exports.MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = 5;
|
|
|
186
186
|
* the same trust boundary as /distill's denoised conversation text).
|
|
187
187
|
*/
|
|
188
188
|
exports.MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = 256;
|
|
189
|
+
/**
|
|
190
|
+
* The seeded change registry (#578): TWO
|
|
191
|
+
* entries for 2026-10-28 — #566 (the cross-project recall fence, bar
|
|
192
|
+
* CROSS_PROJECT_MIN_SIMILARITY) and #567 (project-label reconciliation,
|
|
193
|
+
* shipped in the same 0.25.0 release) — independent changes, independent
|
|
194
|
+
* before/afters, back-pinned now while the 90-day raw window still covers
|
|
195
|
+
* them. Future quality changes append their entry at release time (#569's
|
|
196
|
+
* decay fix is the next: its date lands when it deploys).
|
|
197
|
+
*/
|
|
198
|
+
exports.QUALITY_CHANGES = Object.freeze([
|
|
199
|
+
Object.freeze({
|
|
200
|
+
id: "fence",
|
|
201
|
+
date: "2026-10-28",
|
|
202
|
+
label: "cross-project recall fence (0.72 bar)",
|
|
203
|
+
issue: 566,
|
|
204
|
+
}),
|
|
205
|
+
Object.freeze({
|
|
206
|
+
id: "labels",
|
|
207
|
+
date: "2026-10-28",
|
|
208
|
+
label: "project-label reconciliation (canonicalize at gate + ingest)",
|
|
209
|
+
issue: 567,
|
|
210
|
+
}),
|
|
211
|
+
]);
|
|
212
|
+
/**
|
|
213
|
+
* Weekly quality-grading call cap (#578: its own weekly lane, separate from
|
|
214
|
+
* nightlyLlmCallBudget) — different provider, different endpoint,
|
|
215
|
+
* independent starvation risk; folding it into the one #405 ceiling would
|
|
216
|
+
* let the consolidation LLM starve grading (or vice versa) with no signal.
|
|
217
|
+
* The per-call cost is negligible, so the cap bounds spend trivially.
|
|
218
|
+
* At cap the remaining sampled items DEFER to the next week (the week
|
|
219
|
+
* cursor does not advance past ungraded items — dup-over-loss).
|
|
220
|
+
* Release-managed: no config key, moving it is a release decision.
|
|
221
|
+
*/
|
|
222
|
+
exports.QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
|
|
223
|
+
/**
|
|
224
|
+
* Auto-grader confidence below which a graded line lands in the CONTESTED
|
|
225
|
+
* slice for the owner's thumbs (#578). PROVISIONAL first anchor (the #426
|
|
226
|
+
* posture): 0.70, expected to move on fleet data. Applied at RENDER only
|
|
227
|
+
* (raw score + confidence are stored threshold-free; a recalibration never
|
|
228
|
+
* rewrites history).
|
|
229
|
+
*/
|
|
230
|
+
exports.QUALITY_CONTESTED_CONFIDENCE = 0.70;
|
|
231
|
+
/**
|
|
232
|
+
* Render edge for "useful" on a graded score (#578): a grading `score`
|
|
233
|
+
* question answers 0..1; ≥ this reads useful in the graded-useful share.
|
|
234
|
+
* 0.5 — the scale's own midpoint, deliberately NOT the utility threshold
|
|
235
|
+
* calibrated for recall INJECTION trimming (0.75 — a different decision).
|
|
236
|
+
* Derived at render, never stored. PROVISIONAL alongside
|
|
237
|
+
* QUALITY_CONTESTED_CONFIDENCE.
|
|
238
|
+
*/
|
|
239
|
+
exports.QUALITY_USEFUL_SCORE = 0.5;
|
|
189
240
|
// ---------------------------------------------------------------------------
|
|
190
241
|
// Volatility gate (#489) — deterministic drop of GH-ticket-status /
|
|
191
242
|
// version-bump / commit-state entries at the distill gate, and the one-shot
|