@gamaze/hicortex 0.26.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.
@@ -482,6 +482,15 @@
482
482
  .rec-thumb:hover{ color:var(--text); border-color:color-mix(in srgb, var(--text) 45%, transparent); }
483
483
  .rec-thumb.ok:hover{ color:var(--green); border-color:var(--green); }
484
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); }
485
494
  .rec-item{ display:flex; align-items:center; gap:6px; min-width:0; }
486
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); }
487
496
  .b-health{ display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); white-space:nowrap; }
@@ -1280,30 +1289,41 @@
1280
1289
  <div class="csub" id="tok-sub">&nbsp;</div>
1281
1290
  <div id="tok-nights" aria-label="LLM tokens per nightly run this billing period"></div>
1282
1291
  </div>
1283
- <!-- Memory Precision (#476, owner retitle; #578 quality audit) — ONE
1284
- card, two context levels + the quality instrument. Level 2 (recall
1285
- depth) keeps the #426 U-band + zone word + provisional-hover
1286
- semantics; the marker/tooltip read the WINDOW ratio off
1287
- D.memory_precision.level2 (a pre-#476 server has no block → the
1288
- headline ratio — today's rendering exactly). The #578 audit
1289
- (owner: "do the numbers earn their place"): mean similarity and
1290
- redundant share are TOOLTIP-ONLY (high cosine was the noise's
1291
- camouflage — not actionable), divergence lives in a details
1292
- drawer, and the FACE carries what answers "is recall quality
1293
- improving": uses-per-showing (the big word), pushes/lines volume,
1294
- and the Tier-1 rows (block size, cross-project share + attribution
1295
- coverage, sub-bar share at the echoed fence bar, distinct-memory
1296
- recycling) with per-change deltas off the server's change-registry
1297
- entries while the raw window covers them. The contested drawer
1298
- (#578 judgment layer) lazily fetches /dashboard/quality/contested
1299
- and PUTs the owner's thumbs — no grading data in the ≤ 2 KB
1300
- memory_precision block. The window rides the #452 selector via the
1301
- echoed window_days — never hardcoded, never a second range
1302
- control. -->
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. -->
1303
1322
  <div class="bseg" id="lim-rec">
1304
1323
  <div class="gh"><span class="t">Memory Precision</span><span class="sub" id="rec-sub">uses per showing</span></div>
1305
1324
  <div class="big"><b class="n rec-word" id="rec-zone">—</b></div>
1306
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>
1307
1327
  <div class="rec-l1" id="rec-l1" hidden style="display:block">
1308
1328
  <div class="l1row" id="l1-blk">&nbsp;</div>
1309
1329
  <div class="l1row" id="l1-cross">&nbsp;</div>
@@ -3385,6 +3405,47 @@ function recallUsesZone(v,z){
3385
3405
  /* vocabulary amendment (owner, 2026-09-14): the middle zone's word is
3386
3406
  Healthy — Low / Healthy / Overfetching (keys + echo field names stay) */
3387
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
+ }
3388
3449
  /* ONE stop table drives the band fill AND the big word's sampled color —
3389
3450
  mirrors the --red/--amber/--green theme tokens (tests pin the lockstep),
3390
3451
  so word, marker, and gradient cannot disagree. Stops sit at 0, low_max,
@@ -3425,6 +3486,7 @@ function renderRecBand(ups){
3425
3486
  const theme=document.documentElement.dataset.theme==='light'?'light':'dark';
3426
3487
  if(!axis){ /* pre-band server — quiet degrade */
3427
3488
  row.hidden=true; dot.hidden=true; dot.title='';
3489
+ const pl0=el('rec-plain'); pl0.hidden=true; pl0.innerHTML='';
3428
3490
  word.textContent='—'; word.className='n rec-word none';
3429
3491
  word.style.color=''; word.style.textShadow='none'; word.title='no showings yet';
3430
3492
  return;
@@ -3452,8 +3514,12 @@ function renderRecBand(ups){
3452
3514
  word.style.color='rgb('+rgb+')';
3453
3515
  word.style.textShadow=theme==='dark'?'0 0 12px rgba('+rgb+',.32)':'none';
3454
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:'';
3455
3520
  }else{
3456
3521
  dot.hidden=true; dot.title='';
3522
+ const pl1=el('rec-plain'); pl1.hidden=true; pl1.innerHTML='';
3457
3523
  word.textContent='—'; word.className='n rec-word none';
3458
3524
  word.style.color=''; word.style.textShadow='none';
3459
3525
  word.title='no showings yet';
@@ -3466,18 +3532,24 @@ function renderRecBand(ups){
3466
3532
  }
3467
3533
 
3468
3534
  /* ---------- Memory Precision — Level 1, the pushed index (#476) + the #578
3469
- quality audit (owner: "do the numbers earn their place"). The FACE carries
3470
- the Tier-1 quality rows — block size (lines per push), cross-project share
3471
- with its attribution coverage, sub-bar share at the ECHOED fence bar,
3472
- distinct-memory recycling — each tagged with the per-change deltas off the
3473
- server's change-registry entries (mp.changes; numbers computed at render
3474
- server-side, the page never freezes one), plus the pushes/lines volume
3475
- (the denominators). Mean similarity + redundant share are TOOLTIP-ONLY
3476
- (they were the noise's camouflage); divergence lives in the #rec-divdet
3477
- drawer below. NO verdict words anywhere — numbers, the #426 ruling. Absent
3478
- tier1 (a pre-#578 server) → the quality rows hide and the card keeps the
3479
- #476 shape; absent block entirely → the whole row hides and the sub keeps
3480
- the old label (the capture card's block-absence guard). */
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). */
3481
3553
  function renderRecL1(mp){
3482
3554
  const row=el('rec-l1'), sub=el('rec-sub');
3483
3555
  if(!mp||!mp.level1||!mp.level2){
@@ -3510,9 +3582,15 @@ function renderRecL1(mp){
3510
3582
  }
3511
3583
  row.hidden=false;
3512
3584
  row.classList.remove('below');
3513
- /* per-change delta tags: one dim tag per registry entry the window covers
3514
- and the server computed both sides for. pct when the before is nonzero,
3515
- the raw arrow otherwise (a 0→x move has no honest percentage). */
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. */
3516
3594
  const tag=(k)=>{
3517
3595
  if(!Array.isArray(mp.changes)) return '';
3518
3596
  const parts=[];
@@ -3520,23 +3598,30 @@ function renderRecL1(mp){
3520
3598
  const b=ch.before&&typeof ch.before[k]==='number'?ch.before[k]:null;
3521
3599
  const a=ch.after&&typeof ch.after[k]==='number'?ch.after[k]:null;
3522
3600
  if(b===null||a===null) continue;
3523
- let d;
3524
- if(b!==0){ d=Math.round((a-b)/b*100); d=(d>0?'+':'')+d+'%'; }
3525
- else { d=(a===0?'±0%':b+'→'+a); }
3526
- parts.push(ch.id+' '+d);
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>');
3527
3606
  }
3528
3607
  return parts.length?' ('+parts.join(', ')+')':'';
3529
3608
  };
3530
- const bs=(typeof t.block_size==='number'&&isFinite(t.block_size))?t.block_size.toFixed(2):'—';
3609
+ const bs=(typeof t.block_size==='number'&&isFinite(t.block_size))?t.block_size.toFixed(1):'—';
3531
3610
  const cs=(typeof t.cross_share==='number'&&isFinite(t.cross_share))?Math.round(t.cross_share*100)+'%':'—';
3532
3611
  const cv=(typeof t.attribution_coverage==='number'&&isFinite(t.attribution_coverage))?Math.round(t.attribution_coverage*100)+'%':'—';
3533
3612
  const sb=(typeof t.sub_bar_share==='number'&&isFinite(t.sub_bar_share))?Math.round(t.sub_bar_share*100)+'%':'—';
3534
3613
  const rc=(typeof t.recycling==='number'&&isFinite(t.recycling))?Math.round(t.recycling).toString():'—';
3535
- el('l1-blk').innerHTML='<b>Block: '+bs+' lines/push</b>'+tag('block_size');
3536
- el('l1-cross').textContent='Cross-project: '+cs+' (attributed '+cv+')'+tag('cross_share');
3537
- el('l1-sub').textContent='Sub-bar: '+sb+' below bar '+(typeof t.cross_project_bar==='number'?t.cross_project_bar.toFixed(2):'—')+tag('sub_bar_share');
3538
- el('l1-recy').textContent='Recycling: '+rc+' memories/day'+tag('recycling');
3539
- el('l1-vol').textContent=fmt(t.pushes)+' pushes · '+fmt(t.lines)+' lines';
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';
3540
3625
  }
3541
3626
 
3542
3627
  /* divergence drawer (#578 audit: off the face, into the details element).
@@ -3599,6 +3684,19 @@ function renderRecSeries(){
3599
3684
  1|-1} (numeric — the server's strict body), and a thumbed item leaves the
3600
3685
  list (the server clears owner-answered rows). Fail-soft: a fetch error
3601
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
+ }
3602
3700
  let CONTESTED_LOADED=false;
3603
3701
  async function loadContested(force){
3604
3702
  const box=el('rec-contest-rows'), num=el('rec-contest-n');
@@ -3612,7 +3710,8 @@ async function loadContested(force){
3612
3710
  box.classList.remove('rec-contest-empty');
3613
3711
  if(!r.items||!r.items.length){
3614
3712
  box.classList.add('rec-contest-empty');
3615
- box.textContent='nothing contested — the grader is confident this week';
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';
3616
3715
  return;
3617
3716
  }
3618
3717
  for(const it of r.items){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamaze/hicortex",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "Persistent agent identity for AI agents \u2014 a hand-edited identity layer, nightly-distilled experience, and lessons injected every session, shared across your whole fleet. Works with Hermes, OpenClaw, Claude Code, Pi, and opencode.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/server.json CHANGED
@@ -3,12 +3,12 @@
3
3
  "name": "io.github.gamaze-labs/hicortex",
4
4
  "title": "Hicortex \u2014 AI Fleet Memory",
5
5
  "description": "Shared fleet memory for AI agents: nightly self-correction, recall every prompt (supported agents).",
6
- "version": "0.26.0",
6
+ "version": "0.26.1",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@gamaze/hicortex",
11
- "version": "0.26.0",
11
+ "version": "0.26.1",
12
12
  "transport": {
13
13
  "type": "stdio",
14
14
  "command": "npx",