@gamaze/hicortex 0.26.1 → 0.26.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.
@@ -450,47 +450,43 @@
450
450
  .rec-band{ position:absolute; inset:0; border-radius:4px; }
451
451
  .rec-dot{ position:absolute; top:50%; transform:translate(-50%,-50%); width:11px; height:11px; border-radius:50%; background:var(--text); border:2px solid var(--panel); box-shadow:0 0 0 1px color-mix(in srgb, var(--text) 40%, transparent), 0 0 8px color-mix(in srgb, var(--text) 30%, transparent); }
452
452
  .rec-foot{ display:flex; align-items:center; gap:7px; }
453
- /* Memory Precision Level 1 (#476) — the pushed-index row: a compact
454
- second line in the .csub scale (the sibling-rhythm ruling 2026-09-14:
455
- the card keeps the shared .bseg gap rhythm, header → big → band →
456
- index row → foot). Direction-only coloring: green at/above the echoed
457
- recall floor, muted below (the index bar reads conservative); the
458
- floor tick is amber like the pace marker. Theme tokens only — both
459
- themes render from their own table, no JS colors here. */
460
- .rec-l1{ display:block; font-size:10.5px; color:var(--dim); min-width:0; line-height:1.6; }
461
- .rec-l1 .l1row{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
462
- .rec-l1 .lbl{ display:none; } /* #476 rename: the three-bucket text is self-labeled */
463
- .rec-l1 .l1bar{ position:relative; flex:1 1 46px; height:5px; border-radius:3px; background:var(--tbar-bg); min-width:36px; }
464
- .rec-l1 .l1bar .l1-fill{ position:absolute; left:0; top:0; bottom:0; border-radius:3px; background:color-mix(in srgb, var(--green) 65%, transparent); }
465
- .rec-l1.below .l1bar .l1-fill{ background:color-mix(in srgb, var(--dim) 55%, transparent); }
466
- .rec-l1 .l1bar .l1-floor{ position:absolute; top:-2px; bottom:-2px; width:1px; background:var(--amber); }
467
- .rec-l1 .l1txt{ color:var(--dim); overflow:hidden; text-overflow:ellipsis; font-size:10.5px; letter-spacing:-.01em; }
468
- .rec-l1 b{ color:var(--green-mid); font-weight:600; }
469
- .rec-l1.below b{ color:var(--dim); }
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. */
453
+ /* Memory Precision stat rows (#593 round 2, Option B): ONE stat per row in
454
+ a FIXED three-column grid — value / label / trend chip — so a row can
455
+ never wrap: the label ellipsizes inside its column, the fixed value
456
+ column right-aligns every hero number on one edge, the chip sits flush
457
+ right. The value is the hero (≥2x the label size — tests pin the
458
+ ratio), neutral --text; the chips are the ONLY colored element on the
459
+ face (green improving / red worsening / gray flat or no baseline).
460
+ Rows breathe — the card may grow taller (owner 2026-11-10). Theme
461
+ tokens only, both themes. */
462
+ .rec-l1{ display:flex; flex-direction:column; gap:8px; min-width:0; }
463
+ .rec-l1[hidden]{ display:none; } /* author display beats the UA's [hidden] — the #billing-banner idiom; without it the flex rule un-hides the container */
464
+ .rec-l1 .l1stat{ display:grid; grid-template-columns:72px minmax(0,1fr) auto; column-gap:10px; align-items:baseline; min-width:0; white-space:nowrap; }
465
+ .rec-l1 .l1v{ font-size:22px; font-weight:640; color:var(--text); text-align:right; font-variant-numeric:tabular-nums; line-height:1.05; min-width:0; }
466
+ .rec-l1 .l1v .l1u{ font-style:normal; font-size:10.5px; font-weight:520; color:var(--dim); margin-left:2px; }
467
+ .rec-l1 .l1l{ font-size:10.5px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; min-width:0; }
468
+ .rec-l1 .l1chip{ justify-self:end; font-size:10.5px; font-weight:620; line-height:1; padding:2.5px 8px; border-radius:999px; white-space:nowrap; color:var(--green-mid); background:color-mix(in srgb, var(--green-mid) 13%, transparent); }
469
+ .rec-l1 .l1chip.bad{ color:var(--red); background:color-mix(in srgb, var(--red) 13%, transparent); }
470
+ .rec-l1 .l1chip.flat{ color:var(--faint); background:color-mix(in srgb, var(--faint) 12%, transparent); }
471
+ .rec-l1 .l1vol{ font-size:10.5px; color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
472
+ /* #578 quality drawers (corpus + contested — the divergence drawer left
473
+ the card in #593): native details/summary in the card's .csub scale —
474
+ collapsed they are one dim line, open they stack their rows inside the
475
+ card (no page modal for ~5 rows/week). Theme tokens only; the thumbs
476
+ are small ghost buttons. */
474
477
  .rec-det{ font-size:10.5px; color:var(--dim); }
475
478
  .rec-det summary{ cursor:pointer; color:var(--dim); letter-spacing:-.01em; user-select:none; }
476
479
  .rec-det summary:hover{ color:var(--text); }
477
480
  .rec-det[open] summary{ color:var(--text); }
478
481
  .rec-det-body{ margin:4px 0 2px; display:flex; flex-direction:column; gap:4px; }
479
482
  .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
483
  .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
484
  .rec-thumb:hover{ color:var(--text); border-color:color-mix(in srgb, var(--text) 45%, transparent); }
483
485
  .rec-thumb.ok:hover{ color:var(--green); border-color:var(--green); }
484
486
  .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); }
487
+ /* #593: the headline is ONE line — direction word + window caveat, never
488
+ wrapping; neutral text (the trend chips are the only colored element). */
489
+ .rec-plain{ font-size:11px; color:var(--dim); line-height:1.5; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
494
490
  .rec-item{ display:flex; align-items:center; gap:6px; min-width:0; }
495
491
  .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); }
496
492
  .b-health{ display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); white-space:nowrap; }
@@ -1290,58 +1286,57 @@
1290
1286
  <div id="tok-nights" aria-label="LLM tokens per nightly run this billing period"></div>
1291
1287
  </div>
1292
1288
  <!-- 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. -->
1289
+ presentation pass; #593 stat-table round 2) — ONE card, two
1290
+ context levels + the quality instrument. Level 2 (recall depth)
1291
+ keeps the #426 U-band + zone word + provisional-hover semantics;
1292
+ the marker/tooltip read the WINDOW ratio off
1293
+ D.memory_precision.level2 (a pre-#476 server has no block → the
1294
+ headline ratio — today's rendering exactly). The #578 audit
1295
+ (owner: "do the numbers earn their place"): mean similarity and
1296
+ redundant share are TOOLTIP-ONLY (high cosine was the noise's
1297
+ camouflage — not actionable), and the FACE carries what answers
1298
+ "is recall quality improving": uses-per-showing (the big word),
1299
+ pushes/lines volume, and the Tier-1 rows with per-change deltas
1300
+ off the server's change-registry entries while the raw window
1301
+ covers them. The #591 pass (owner product feedback: the card must
1302
+ SELF-INTERPRET) made every row read in plain words (MP_NAME) with
1303
+ deltas valenced by the explicit per-metric map (MP_GOOD) and the
1304
+ technical layer demoted behind per-row tooltips. The #593 round 2
1305
+ (owner amendment 2026-11-10: the card reads as a STAT TABLE)
1306
+ reshapes that face: EXACTLY 4 stat rows (clutter / foreign
1307
+ content / weak matches / churn), ONE stat per row in a fixed
1308
+ value/label/chip grid that can never wrap — the value is the
1309
+ hero (≥2x the label, right-aligned, neutral), the trend chips are
1310
+ the only colored element, labels stay 2-4 words with meanings in
1311
+ tooltips, the headline is ONE neutral line (direction · caveat)
1312
+ and the zone word's tooltip carries the plain meaning +
1313
+ uses-per-showing. The divergence drawer is GONE from the card
1314
+ (owner: the row double-counted the gauge's own reason; the data
1315
+ still flows into the nightly snapshots — the page just never
1316
+ renders it), and the contested row is presence-gated: hidden
1317
+ unless the grading lane ran AND something is contested (no
1318
+ zero-state strings; the count loads eagerly at band render). The
1319
+ window rides the #452 selector via the echoed window_days —
1320
+ never hardcoded, never a second range control. -->
1322
1321
  <div class="bseg" id="lim-rec">
1323
1322
  <div class="gh"><span class="t">Memory Precision</span><span class="sub" id="rec-sub">uses per showing</span></div>
1324
1323
  <div class="big"><b class="n rec-word" id="rec-zone">—</b></div>
1325
1324
  <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
1325
  <div class="rec-plain" id="rec-plain" hidden></div>
1327
- <div class="rec-l1" id="rec-l1" hidden style="display:block">
1328
- <div class="l1row" id="l1-blk">&nbsp;</div>
1329
- <div class="l1row" id="l1-cross">&nbsp;</div>
1330
- <div class="l1row" id="l1-sub">&nbsp;</div>
1331
- <div class="l1row" id="l1-recy">&nbsp;</div>
1332
- <div class="l1row" id="l1-vol">&nbsp;</div>
1326
+ <div class="rec-l1" id="rec-l1" hidden>
1327
+ <div class="l1stat" id="l1-blk">&nbsp;</div>
1328
+ <div class="l1stat" id="l1-cross">&nbsp;</div>
1329
+ <div class="l1stat" id="l1-sub">&nbsp;</div>
1330
+ <div class="l1stat" id="l1-recy">&nbsp;</div>
1331
+ <div class="l1vol" id="l1-vol">&nbsp;</div>
1333
1332
  </div>
1334
- <details id="rec-divdet" class="rec-det" hidden>
1335
- <summary>divergence &middot; <span id="rec-divn">0</span> never read</summary>
1336
- <div id="rec-div-lines" class="rec-det-body"></div>
1337
- </details>
1338
1333
  <details id="rec-series" class="rec-det" hidden>
1339
1334
  <summary>corpus &amp; graded &middot; last nightly</summary>
1340
1335
  <div id="rec-series-body" class="rec-det-body"></div>
1341
1336
  </details>
1342
- <details id="rec-contest" class="rec-det">
1337
+ <details id="rec-contest" class="rec-det" hidden>
1343
1338
  <summary>contested lines &middot; <span id="rec-contest-n">&mdash;</span></summary>
1344
- <div id="rec-contest-rows" class="rec-det-body rec-contest-empty">open to load</div>
1339
+ <div id="rec-contest-rows" class="rec-det-body"></div>
1345
1340
  </details>
1346
1341
  </div>
1347
1342
  </div>
@@ -3338,6 +3333,7 @@ function renderBand(){
3338
3333
  // Recall level — the designed U-band (#426 final ruling 2026-09-13; see
3339
3334
  // renderRecBand).
3340
3335
  renderRecBand(h?h.uses_per_showing:null);
3336
+ loadContested(); /* #593: presence needs the count — one guarded GET at render */
3341
3337
 
3342
3338
  // Model — the detected label from /health/detail (configure lands in phase 2)
3343
3339
  renderModelCard();
@@ -3410,24 +3406,31 @@ const RECALL_ZONE_PLAIN={low:'shown memories are rarely picked up',normal:'shown
3410
3406
  improving for each Tier-1 metric. ONE constant owns every sign
3411
3407
  assumption on the card; a metric whose good direction flips changes
3412
3408
  here and nowhere else. Plain names beside it: the reader-facing
3413
- vocabulary (the internal metric keys stay in the payload). */
3409
+ vocabulary (the internal metric keys stay in the payload; #593 renamed
3410
+ cross_share's face label to the amendment's "Foreign content"). */
3414
3411
  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. */
3412
+ const MP_NAME={block_size:'Clutter per prompt',cross_share:'Foreign content',sub_bar_share:'Weak matches',recycling:'Memory churn'};
3413
+ /* #593 plain headline — pure composer (the recallUsesZone convention):
3414
+ ONE neutral line, direction word · window caveat. The direction word
3415
+ derives off the covered tier1 deltas × MP_GOOD (plain text — the trend
3416
+ chips are the card's only colored element); the caveat fires while the
3417
+ window still covers a registry change date (the trend then reads
3418
+ pre-change days too), with the exact dates demoted to the line's own
3419
+ tooltip. Returns {html,title} or null when there is no zone / nothing
3420
+ to say. */
3420
3421
  function mpPlainHeadline(zk,mp,todayStr){
3421
3422
  if(!zk) return null;
3422
3423
  if(typeof todayStr!=='string') todayStr=new Date().toISOString().slice(0,10);
3423
- const parts=[RECALL_ZONE_PLAIN[zk]];
3424
3424
  const wd=mp&&typeof mp.window_days==='number'?mp.window_days:30;
3425
3425
  const changes=mp&&Array.isArray(mp.changes)?mp.changes:[];
3426
+ let caveat=null,title='';
3426
3427
  if(changes.length){
3427
3428
  const from=new Date(Date.parse(todayStr)-wd*86400000).toISOString().slice(0,10);
3428
3429
  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+')');
3430
+ if(typeof newest.date==='string'&&newest.date>=from){
3431
+ caveat='window still holds old data';
3432
+ title='the '+wd+'-day window still covers pre-change days ('+newest.date+')';
3433
+ }
3431
3434
  }
3432
3435
  let imp=0,wor=0;
3433
3436
  for(const ch of changes){
@@ -3439,12 +3442,11 @@ function mpPlainHeadline(zk,mp,todayStr){
3439
3442
  }
3440
3443
  }
3441
3444
  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};
3445
+ if(imp>0&&wor===0) dir='improving';
3446
+ else if(wor>0&&imp===0) dir='worsening';
3447
+ else if(imp>0&&wor>0) dir='mixed';
3448
+ const html=[dir,caveat].filter(Boolean).join(' · ');
3449
+ return html?{html,title}:null;
3448
3450
  }
3449
3451
  /* ONE stop table drives the band fill AND the big word's sampled color —
3450
3452
  mirrors the --red/--amber/--green theme tokens (tests pin the lockstep),
@@ -3513,10 +3515,13 @@ function renderRecBand(ups){
3513
3515
  const rgb=recallGradAt(clamp(ups/axis,0,1),z,theme);
3514
3516
  word.style.color='rgb('+rgb+')';
3515
3517
  word.style.textShadow=theme==='dark'?'0 0 12px rgba('+rgb+',.32)':'none';
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:'';
3518
+ /* #593: the verdict tooltip = the zone's plain meaning + the gauge's own
3519
+ metric (the numeric detail stays on the dot's tooltip) */
3520
+ word.title=RECALL_ZONE_PLAIN[zk]+' — uses-per-showing';
3521
+ /* #593: the headline beneath is ONE neutral line — direction word ·
3522
+ window caveat (the trend chips are the card's only colored element) */
3523
+ const pl=el('rec-plain'); const ph=mpPlainHeadline(zk,mp);
3524
+ pl.hidden=!ph; pl.innerHTML=ph?ph.html:''; pl.title=ph?ph.title:'';
3520
3525
  }else{
3521
3526
  dot.hidden=true; dot.title='';
3522
3527
  const pl1=el('rec-plain'); pl1.hidden=true; pl1.innerHTML='';
@@ -3533,28 +3538,24 @@ function renderRecBand(ups){
3533
3538
 
3534
3539
  /* ---------- Memory Precision — Level 1, the pushed index (#476) + the #578
3535
3540
  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
3541
+ presentation pass + the #593 stat-table reshape. The FACE is EXACTLY 4
3542
+ stat rows (MP_NAME labels) + the denominators foot line (.l1vol): ONE
3543
+ stat per row in the fixed value/label/chip grid — the hero value
3544
+ right-aligned and neutral, the trend chip the row's ONLY colored
3545
+ element. ONE chip per metric: the NET move across the window's covered
3546
+ registry entries (oldest before → newest after — successive changes
3547
+ read as one line, never a chip per entry), arrow = sign, color =
3548
+ MP_GOOD valence, no covered entry → the gray no-baseline dash. Row
3549
+ meanings ("fewer is better", attribution coverage, the bar value) live
3550
+ in PER-ROW titles; mean similarity + repeated-known stay card-level
3551
+ TOOLTIP-ONLY (the #578 ruling — high cosine was the noise's camouflage).
3552
+ Absent tier1 (a pre-#578 server) → the stat rows hide and the card
3551
3553
  keeps the #476 shape; absent block entirely → the whole row hides and
3552
3554
  the sub keeps the old label (the capture card's block-absence guard). */
3553
3555
  function renderRecL1(mp){
3554
3556
  const row=el('rec-l1'), sub=el('rec-sub');
3555
3557
  if(!mp||!mp.level1||!mp.level2){
3556
3558
  row.hidden=true;
3557
- const dd0=el('rec-divdet'); if(dd0) dd0.hidden=true;
3558
3559
  if(sub) sub.textContent='uses per showing';
3559
3560
  return;
3560
3561
  }
@@ -3571,40 +3572,36 @@ function renderRecL1(mp){
3571
3572
  (sim!==null?sim.toFixed(2):'—')+
3572
3573
  (floor!==null?' (recall floor '+floor.toFixed(2)+')':'')+
3573
3574
  (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
3575
  const t=mp.tier1;
3576
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. */
3577
+ /* pre-#578 server: no quality rows exist — the stat rows hide (their
3578
+ markup is #578's), the tooltip above still carries the #476 numbers. */
3580
3579
  row.hidden=true;
3581
3580
  return;
3582
3581
  }
3583
3582
  row.hidden=false;
3584
- row.classList.remove('below');
3585
3583
  /* the good-direction word derives off the map — 'fewer is better' for a
3586
3584
  down-good metric — never written inline per row */
3587
3585
  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(', ')+')':'';
3586
+ /* ONE trend chip per row (#593): the window's covered registry entries for
3587
+ the metric aggregate into a single NET move — oldest before → newest
3588
+ after, so successive changes read as one line. The ARROW is the sign of
3589
+ the move (↓ a<b, ↑ a>b); the COLOR says whether that direction is good
3590
+ for the metric (MP_GOOD) — green = improving regardless of sign. pct
3591
+ when the oldest before is nonzero, the raw pair otherwise (a 0→x move
3592
+ has no honest percentage); a flat pair is ±0%; no covered entry → the
3593
+ gray no-baseline dash. */
3594
+ const chip=(k)=>{
3595
+ const es=(Array.isArray(mp.changes)?mp.changes:[])
3596
+ .filter(ch=>ch&&ch.before&&typeof ch.before[k]==='number'&&ch.after&&typeof ch.after[k]==='number')
3597
+ .sort((x,y)=>(x.date<y.date?-1:x.date>y.date?1:0));
3598
+ if(!es.length) return '<span class="l1chip flat">—</span>';
3599
+ const b=es[0].before[k], a=es[es.length-1].after[k];
3600
+ if(a===b) return '<span class="l1chip flat">±0%</span>';
3601
+ const text=b!==0?Math.abs(Math.round((a-b)/b*100))+'%':b+'→'+a;
3602
+ const arrow=a<b?'↓':'↑';
3603
+ const cls=(MP_GOOD[k]==='down'?a<b:a>b)?'good':'bad';
3604
+ return '<span class="l1chip '+cls+'">'+arrow+text+'</span>';
3608
3605
  };
3609
3606
  const bs=(typeof t.block_size==='number'&&isFinite(t.block_size))?t.block_size.toFixed(1):'—';
3610
3607
  const cs=(typeof t.cross_share==='number'&&isFinite(t.cross_share))?Math.round(t.cross_share*100)+'%':'—';
@@ -3612,38 +3609,18 @@ function renderRecL1(mp){
3612
3609
  const sb=(typeof t.sub_bar_share==='number'&&isFinite(t.sub_bar_share))?Math.round(t.sub_bar_share*100)+'%':'—';
3613
3610
  const rc=(typeof t.recycling==='number'&&isFinite(t.recycling))?Math.round(t.recycling).toString():'—';
3614
3611
  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';
3612
+ el('l1-blk').innerHTML='<span class="l1v">'+bs+'</span><span class="l1l">'+MP_NAME.block_size+'</span>'+chip('block_size');
3613
+ el('l1-blk').title='average memories shown per prompt — '+better('block_size');
3614
+ el('l1-cross').innerHTML='<span class="l1v">'+cs+'</span><span class="l1l">'+MP_NAME.cross_share+'</span>'+chip('cross_share');
3615
+ el('l1-cross').title='share of attributable pushed lines from a different project ('+better('cross_share')+') · attribution coverage '+cv;
3616
+ el('l1-sub').innerHTML='<span class="l1v">'+sb+'</span><span class="l1l">'+MP_NAME.sub_bar_share+'</span>'+chip('sub_bar_share');
3617
+ el('l1-sub').title='foreign-project lines below the cross-project bar ('+bar+') — '+better('sub_bar_share');
3618
+ el('l1-recy').innerHTML='<span class="l1v">'+rc+'<i class="l1u">/day</i></span><span class="l1l">'+MP_NAME.recycling+'</span>'+chip('recycling');
3619
+ el('l1-recy').title='average distinct memories shown per day — '+better('recycling');
3620
+ el('l1-vol').innerHTML=fmt(t.pushes)+' prompts · '+fmt(t.lines)+' memories shown';
3624
3621
  el('l1-vol').title='denominators: recall pushes · pushed index lines';
3625
3622
  }
3626
3623
 
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
3624
  /* ---------- corpus &amp; graded drawer (#578): the snapshot-stamped half.
3648
3625
  The corpus-health trio (near-dup clusters, scope-anchor rate, canonical
3649
3626
  label drift) and the graded aggregates are computed by the NIGHTLY
@@ -3677,18 +3654,17 @@ function renderRecSeries(){
3677
3654
  row('graded useful',(typeof g.useful_share==='number'?Math.round(g.useful_share*100)+'%':'—')+' of '+(typeof g.graded==='number'?g.graded:0)+' verdicts');
3678
3655
  }
3679
3656
 
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. */
3657
+ /* ---------- contested drawer (#578 judgment layer). Graded data NEVER
3658
+ rides the memory_precision block (≤ 2 KB discipline); the list comes
3659
+ from the paginated endpoint. #593 makes the row PRESENCE-GATED: hidden
3660
+ in markup, the count loads EAGERLY at band render (one guarded GET) and
3661
+ the row appears only when the opt-in weekly lane ran AND something is
3662
+ contested — a hidden row claims nothing, so the zero-state strings are
3663
+ gone. Thumbs PUT /dashboard/quality/verdict {id, verdict:1|-1}
3664
+ (numeric — the server's strict body), a thumbed item leaves the list
3665
+ (the server clears owner-answered rows), and thumbing away the last row
3666
+ re-hides it. Fail-soft: a fetch error keeps the row hidden — an unknown
3667
+ count never earns a place on the face. */
3692
3668
  function newestGradedCount(){
3693
3669
  if(!D||!Array.isArray(D.series)) return null;
3694
3670
  for(let i=D.series.length-1;i>=0;i--){
@@ -3699,22 +3675,20 @@ function newestGradedCount(){
3699
3675
  }
3700
3676
  let CONTESTED_LOADED=false;
3701
3677
  async function loadContested(force){
3702
- const box=el('rec-contest-rows'), num=el('rec-contest-n');
3678
+ const box=el('rec-contest-rows'), num=el('rec-contest-n'), det=el('rec-contest');
3703
3679
  if(!box) return;
3704
3680
  if(CONTESTED_LOADED&&!force) return;
3705
3681
  try{
3706
3682
  const r=await api('/dashboard/quality/contested?limit=20');
3707
3683
  CONTESTED_LOADED=true;
3684
+ const items=r.items||[];
3685
+ const graded=newestGradedCount();
3686
+ const show=items.length>0&&graded!==0;
3687
+ if(det) det.hidden=!show;
3688
+ if(!show){ box.innerHTML=''; return; }
3708
3689
  if(num) num.textContent=String(r.total);
3709
3690
  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){
3691
+ for(const it of items){
3718
3692
  const row=document.createElement('div');
3719
3693
  row.className='rec-item';
3720
3694
  const line=document.createElement('span');
@@ -3731,8 +3705,12 @@ async function loadContested(force){
3731
3705
  try{
3732
3706
  await api('/dashboard/quality/verdict',{method:'PUT',body:JSON.stringify({id:it.id,verdict:v})});
3733
3707
  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 */ }
3708
+ if(num){
3709
+ const left=Math.max(0,(parseInt(num.textContent,10)||1)-1);
3710
+ num.textContent=String(left);
3711
+ if(left===0&&det) det.hidden=true; /* thumbing away the last row re-hides */
3712
+ }
3713
+ }catch(e){ /* fail-soft: the row stays, the next load retries */ }
3736
3714
  };
3737
3715
  up.addEventListener('click',()=>send(1));
3738
3716
  down.addEventListener('click',()=>send(-1));
@@ -3740,14 +3718,9 @@ async function loadContested(force){
3740
3718
  box.appendChild(row);
3741
3719
  }
3742
3720
  }catch(e){
3743
- box.classList.add('rec-contest-empty');
3744
- box.textContent='contested list unavailable ('+(e&&e.message?e.message:'load failed')+')';
3721
+ if(det) det.hidden=true; /* fail-soft: an unknown count stays off the face */
3745
3722
  }
3746
3723
  }
3747
- (function(){
3748
- const det=el('rec-contest');
3749
- if(det) det.addEventListener('toggle',()=>{ if(det.open) loadContested(); });
3750
- })();
3751
3724
 
3752
3725
  let MODEL_LABEL='';
3753
3726
  /* #409 fix round 5 — owner ruling 2026-09-14 (verbatim): "I do NOT want to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamaze/hicortex",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
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.1",
6
+ "version": "0.26.2",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@gamaze/hicortex",
11
- "version": "0.26.1",
11
+ "version": "0.26.2",
12
12
  "transport": {
13
13
  "type": "stdio",
14
14
  "command": "npx",